49 _Null_terminated_ WCHAR buffer[MAX_PATH] = { 0 };
51 HMODULE module =
NULL;
54 count = FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM,
59 sizeof(buffer) /
sizeof(WCHAR),
65 count = GetSystemDirectory( buffer,
66 sizeof(buffer) /
sizeof( WCHAR ) );
68 if (count==0 || count >
sizeof(buffer) /
sizeof( WCHAR )) {
75 printf(
" Could not translate error: %u\n", Code);
80 status = StringCchCat( buffer,
81 sizeof(buffer) /
sizeof( WCHAR ),
86 printf(
" Could not translate error: %u\n", Code);
90 module = LoadLibraryExW( buffer,
NULL, LOAD_LIBRARY_AS_DATAFILE );
96 count = FormatMessage (FORMAT_MESSAGE_FROM_HMODULE,
101 sizeof(buffer) /
sizeof(WCHAR),
104 if (module !=
NULL) {
106 FreeLibrary( module );
115 printf(
" Could not translate error: %u\n", Code);
124 printf(
" %ws\n", buffer);
NcLoadRegistryStringRetry NULL
VOID DisplayError(_In_ DWORD Code)