Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 135 of file shutdown.c.
{ int errorCode = GetLastError(); LPTSTR lpMsgBuf = NULL; DWORD errLength; // error message length LPTSTR resMsg; // for error message in OEM symbols // Display the error message to the user errLength = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, errorCode, LANG_USER_DEFAULT, (LPTSTR) &lpMsgBuf, 0, NULL) + 1; resMsg = (LPTSTR)LocalAlloc(LPTR, errLength * sizeof(TCHAR)); CharToOemBuff(lpMsgBuf, resMsg, errLength); _ftprintf(stderr, resMsg); _ftprintf(stderr, _T("Error code: %d\n"), errorCode); LocalFree(lpMsgBuf); LocalFree(resMsg); }