kernel32/tests: Add test for FormatMessage with HRESULT.

This commit is contained in:
Catalin Patulea 2014-10-20 17:55:45 -04:00 committed by Alexandre Julliard
parent d74c9e3ec2
commit af59823567
1 changed files with 6 additions and 0 deletions

View File

@ -1552,6 +1552,12 @@ static void test_message_from_hmodule(void)
MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL);
ok(ret != 0, "FormatMessageA returned 0\n"); 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. */ /* 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 */, 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); MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL), out, sizeof(out)/sizeof(CHAR), NULL);