But, if I know all kinds of error messages then I can put a map. How do I get those messages?
MSXML6 uses a resource only dll (MSXML6r.dll) for messages. I used the following console application on Win 10 22H2 to print the message table.
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <stdio.h>
#include <tchar.h>
int _tmain()
{
auto hModule = LoadLibraryEx(_T("C:\\Windows\\System32\\msxml6r.dll"), NULL, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE);
if (hModule)
{
HRSRC hrsrc = FindResource(hModule, MAKEINTRESOURCE(1), RT_MESSAGETABLE );
if (hrsrc)
{
HGLOBAL hglobal = LoadResource(hModule, hrsrc);
if (hglobal)
{
PVOID pv = LockResource(hglobal);
if (pv)
{
PMESSAGE_RESOURCE_DATA pmrd = (PMESSAGE_RESOURCE_DATA)pv;
_tprintf_s(_T("Message resource data contains %u blocks\n"), pmrd->NumberOfBlocks);
for (DWORD i = 0; i < pmrd->NumberOfBlocks; i++)
{
PMESSAGE_RESOURCE_BLOCK pmrb = &pmrd->Blocks[i];
_tprintf_s(_T("\n--------- Block %u -----------\n"), i);
_tprintf_s(_T("LowId: %u, HighId: %u, OffsetToEntries: %u\n"), pmrb->LowId, pmrb->HighId, pmrb->OffsetToEntries);
for (DWORD x = pmrb->LowId, y = 0; x <= pmrb->HighId; x++)
{
LPTSTR pszText{};
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_IGNORE_INSERTS,
hModule, x, 0, (LPTSTR)&pszText, 0, nullptr);
_tprintf_s(_T("Message id: %u (0x%08X), Text: %s\n"), x, x, pszText);
LocalFree(pszText);
}
}
UnlockResource(hglobal);
}
}
}
FreeLibrary(hModule);
}
return 0;
}