월별 글 목록: 2005년 8월월

NTSTATUS 메시지를 스트링 메시지로..

void DisplayError(DWORD NTStatusMessage)
{
LPVOID lpMessageBuffer;
HMODULE Hand = LoadLibrary(“NTDLL.DLL”);
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_FROM_HMODULE,
Hand,
Err,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMessageBuffer,
0,
NULL );

// Now display the string.
// Free the buffer allocated by the system.
LocalFree( lpMessageBuffer );
FreeLibrary(Hand);
}