Win32: Pass FORMAT_MESSAGE_IGNORE_INSERTS

This should always be passed when retreving messages from third
parties (unless the third party documents format strings)

See https://devblogs.microsoft.com/oldnewthing/20071128-00/?p=24353
This commit is contained in:
Luca Bacci 2025-01-16 14:33:58 +01:00
parent d0ee67a142
commit e10adb1c2b
3 changed files with 3 additions and 0 deletions

View file

@ -43,6 +43,7 @@ _cairo_win32_print_gdi_error (const char *context)
DWORD last_error = GetLastError ();
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
last_error,

View file

@ -110,6 +110,7 @@ _cairo_dwrite_error (HRESULT hr, const char *context)
void *lpMsgBuf;
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
hr,

View file

@ -95,6 +95,7 @@ _cairo_win32_print_gdi_error (const char *context)
DWORD last_error = GetLastError ();
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_IGNORE_INSERTS |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
last_error,