Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void PrintLastError()
- {
- LPWSTR lpMsgBuf;
- DWORD dw = GetLastError();
- FormatMessageW(
- FORMAT_MESSAGE_ALLOCATE_BUFFER |
- FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS,
- NULL,
- dw,
- MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
- (LPWSTR)&lpMsgBuf,
- 0, NULL );
- printf("%S", lpMsgBuf);
- LocalFree(lpMsgBuf);
- }
Add Comment
Please, Sign In to add comment