Module: wine Branch: master Commit: af5982356751a0ad8259d7f63cbbb89044fd233b URL: http://source.winehq.org/git/wine.git/?a=commit;h=af5982356751a0ad8259d7f63c...
Author: Catalin Patulea catalinp@google.com Date: Mon Oct 20 17:55:45 2014 -0400
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 e98e083..3e8d96d 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);