Fix FormatMessage when FORMAT_MESSAGE_FROM_HMODULE is specified and
lpSource is NULL. Make indenting consistent too.
This commit is contained in:
parent
d9b8dfd7da
commit
c435c29339
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue