mirror of
https://github.com/reactos/reactos.git
synced 2025-01-07 06:45:24 +00:00
c2d0d784c7
- Create a branch to do a proper merge of USB work from a trunk base instead of from cmake-bringup - In the future, DO NOT under any circumstances branch another branch. This leads to merge problems! svn path=/branches/usb-bringup-trunk/; revision=55018
14 lines
535 B
C
14 lines
535 B
C
#include <regedit.h>
|
|
void ErrorMessageBox(HWND hWnd, LPCTSTR title, DWORD code)
|
|
{
|
|
LPTSTR lpMsgBuf;
|
|
DWORD status;
|
|
static const TCHAR fallback[] = TEXT("Error displaying error message.\n");
|
|
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
|
NULL, code, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
|
|
if (!status)
|
|
lpMsgBuf = (LPTSTR)fallback;
|
|
MessageBox(hWnd, lpMsgBuf, title, MB_OK | MB_ICONERROR);
|
|
if (lpMsgBuf != fallback)
|
|
LocalFree(lpMsgBuf);
|
|
}
|