Fixes a crash in Horizon Zero Dawn.
Signed-off-by: Paul Gofman pgofman@codeweavers.com --- dlls/kernel32/tests/format_msg.c | 20 ++++++++++++++++++++ dlls/kernel32/winerror.mc | 7 +++++++ 2 files changed, 27 insertions(+)
diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index 7fd9d55377a..a0b1e4eef03 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -1743,6 +1743,25 @@ static void test_message_from_64bit_number(void) } }
+static void test_message_system_errors(void) +{ + static const DWORD error_codes[] = + { + E_NOTIMPL, + }; + + char buffer[256]; + unsigned int i; + DWORD len; + + for (i = 0; i < ARRAY_SIZE(error_codes); ++i) + { + len = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error_codes[i], + LANG_USER_DEFAULT, buffer, ARRAY_SIZE(buffer), NULL); + ok(len, "Got zero len, code %#x.\n", error_codes[i]); + } +} + START_TEST(format_msg) { DWORD ret; @@ -1771,4 +1790,5 @@ START_TEST(format_msg) test_message_allocate_buffer_wide(); test_message_invalid_flags_wide(); test_message_from_64bit_number(); + test_message_system_errors(); } diff --git a/dlls/kernel32/winerror.mc b/dlls/kernel32/winerror.mc index 258b2d6a31d..3d01db9541f 100644 --- a/dlls/kernel32/winerror.mc +++ b/dlls/kernel32/winerror.mc @@ -3757,3 +3757,10 @@ SymbolicName=TRUST_E_NOSIGNATURE Language=ENU No Signature found in file. . +MessageId=0x4001 +Severity=CoError +Facility=Null +SymbolicName=E_NOTIMPL +Language=ENU +Not implemented. +.