Skip to content
Snippets Groups Projects
Commit c435c293 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard
Browse files

Fix FormatMessage when FORMAT_MESSAGE_FROM_HMODULE is specified and

lpSource is NULL.  Make indenting consistent too.
parent d9b8dfd7
No related branches found
No related tags found
No related merge requests found
......@@ -163,12 +163,14 @@ DWORD WINAPI FormatMessageA(
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
{
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
if (!hmodule)
hmodule = GetModuleHandleW(NULL);
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
}
if ((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) && (!bufsize))
{
hmodule = GetModuleHandleA("kernel32");
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
hmodule = GetModuleHandleA("kernel32");
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
}
if (!bufsize) {
......@@ -388,12 +390,14 @@ DWORD WINAPI FormatMessageW(
if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
{
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
if (!hmodule)
hmodule = GetModuleHandleW(NULL);
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
}
if ((dwFlags & FORMAT_MESSAGE_FROM_SYSTEM) && (!bufsize))
{
hmodule = GetModuleHandleA("kernel32");
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
hmodule = GetModuleHandleA("kernel32");
bufsize=load_messageA(hmodule,dwMessageId,dwLanguageId,NULL,100);
}
if (!bufsize) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment