From af5982356751a0ad8259d7f63cbbb89044fd233b Mon Sep 17 00:00:00 2001 From: Catalin Patulea Date: Mon, 20 Oct 2014 17:55:45 -0400 Subject: [PATCH] kernel32/tests: Add test for FormatMessage with HRESULT. --- dlls/kernel32/tests/format_msg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/kernel32/tests/format_msg.c b/dlls/kernel32/tests/format_msg.c index e98e08372d1..3e8d96d46a1 100644 --- a/dlls/kernel32/tests/format_msg.c +++ b/dlls/kernel32/tests/format_msg.c @@ -1552,6 +1552,12 @@ static void test_message_from_hmodule(void) MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL); ok(ret != 0, "FormatMessageA returned 0\n"); + /* Test HRESULT. It's not documented but in practice _com_error::ErrorMessage relies on this. */ + ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 0x80070005 /* E_ACCESSDENIED */, + MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL); + todo_wine + ok(ret != 0, "FormatMessageA returned 0\n"); + /* Test a message string with an insertion without passing any variadic arguments. */ ret = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_FROM_HMODULE, h, 193 /* ERROR_BAD_EXE_FORMAT */, MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL);