Skip to content

Commit e10adb1

Browse files
committed
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
1 parent d0ee67a commit e10adb1

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

boilerplate/cairo-boilerplate-win32-printing.c

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ _cairo_win32_print_gdi_error (const char *context)
4343
DWORD last_error = GetLastError ();
4444

4545
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
46+
FORMAT_MESSAGE_IGNORE_INSERTS |
4647
FORMAT_MESSAGE_FROM_SYSTEM,
4748
NULL,
4849
last_error,

src/win32/cairo-dwrite-font.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ _cairo_dwrite_error (HRESULT hr, const char *context)
110110
void *lpMsgBuf;
111111

112112
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
113+
FORMAT_MESSAGE_IGNORE_INSERTS |
113114
FORMAT_MESSAGE_FROM_SYSTEM,
114115
NULL,
115116
hr,

src/win32/cairo-win32-surface.c

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ _cairo_win32_print_gdi_error (const char *context)
9595
DWORD last_error = GetLastError ();
9696

9797
if (!FormatMessageW (FORMAT_MESSAGE_ALLOCATE_BUFFER |
98+
FORMAT_MESSAGE_IGNORE_INSERTS |
9899
FORMAT_MESSAGE_FROM_SYSTEM,
99100
NULL,
100101
last_error,

0 commit comments

Comments
 (0)