#define WIN32_LEAN_AND_MEAN #include "../master.h" #include "../comfunct/comfunct.h" #include EXPORT ErrorInfoA() { LPVOID lpMsgBuf; FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&lpMsgBuf, 0, NULL ); MessageBoxA(NULL, lpMsgBuf, GetLocalTextA(151), MB_OK | MB_ICONINFORMATION); LocalFree(lpMsgBuf); /* FormatMessage allocated memory for the string, so we must free it */ return; } EXPORT ErrorInfoW() { LPVOID lpMsgBuf; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&lpMsgBuf, 0, NULL ); MessageBoxW(NULL, lpMsgBuf, GetLocalTextW(151), MB_OK | MB_ICONINFORMATION); LocalFree(lpMsgBuf); /* FormatMessage allocated memory for the string, so we must free it */ return; } EXPORT ErrorMessageA(LPCSTR MessageText) { MessageBoxA(NULL, MessageText, GetLocalTextA(151), MB_OK | MB_ICONERROR); return; } EXPORT ErrorMessageW(LPCWSTR MessageText) { MessageBoxW(NULL, MessageText, GetLocalTextW(151), MB_OK | MB_ICONERROR); return; } EXPORT HRErrorInfoA(HRESULT hr) { LPVOID lpMsgBuf; FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&lpMsgBuf, 0, NULL ); MessageBoxA(NULL, lpMsgBuf, GetLocalTextA(151), MB_OK | MB_ICONERROR); LocalFree(lpMsgBuf); /* FormatMessage allocated memory for the string, so we must free it */ } EXPORT HRErrorInfoW(HRESULT hr) { LPVOID lpMsgBuf; FormatMessageW( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&lpMsgBuf, 0, NULL ); MessageBoxW(NULL, lpMsgBuf, GetLocalTextW(151), MB_OK | MB_ICONERROR); LocalFree(lpMsgBuf); /* FormatMessage allocated memory for the string, so we must free it */ } EXPORT DebugPrintA(LPCSTR szFormat, LPCVOID Arg1, LPCVOID Arg2) { char szBuffer[500] = ""; _snprintf(szBuffer, 499, szFormat, Arg1, Arg2); ErrorMessageA(szBuffer); return; } EXPORT DebugPrintW(LPCWSTR szFormat, LPCVOID Arg1, LPCVOID Arg2) { WCHAR szBuffer[500] = L""; _snwprintf(szBuffer, 499, szFormat, Arg1, Arg2); ErrorMessageW(szBuffer); return; }