Author: akhaldi
Date: Fri Nov 27 20:09:44 2015
New Revision: 70159
URL:
http://svn.reactos.org/svn/reactos?rev=70159&view=rev
Log:
[KERNEL32] Sync format_msg.c with Wine Staging 1.7.55. CORE-10536
Modified:
trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c
trunk/reactos/media/doc/README.WINE
Modified: trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/winnls/…
==============================================================================
--- trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/winnls/string/format_msg.c [iso-8859-1] Fri Nov 27
20:09:44 2015
@@ -56,8 +56,6 @@
* Yes, ANSI strings in win32 resources. Go figure.
*/
-static const WCHAR FMTWSTR[] = { '%','s',0 };
-
/**********************************************************************
* load_message (internal)
*/
@@ -90,6 +88,24 @@
}
TRACE("returning %s\n", wine_dbgstr_w(buffer));
return buffer;
+}
+
+static LPWSTR search_message( DWORD flags, HMODULE module, UINT id, WORD lang )
+{
+ LPWSTR from = NULL;
+ if (flags & FORMAT_MESSAGE_FROM_HMODULE)
+ from = load_message( module, id, lang );
+ if (!from && (flags & FORMAT_MESSAGE_FROM_SYSTEM))
+ {
+ /* Fold win32 hresult to its embedded error code. */
+ if (HRESULT_SEVERITY(id) == SEVERITY_ERROR &&
+ HRESULT_FACILITY(id) == FACILITY_WIN32)
+ {
+ id = HRESULT_CODE(id);
+ }
+ from = load_message( kernel32_handle, id, lang );
+ }
+ return from;
}
/**********************************************************************
@@ -480,10 +496,7 @@
}
else if (dwFlags & (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM))
{
- if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
- from = load_message( (HMODULE)lpSource, dwMessageId, dwLanguageId );
- if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
- from = load_message( kernel32_handle, dwMessageId, dwLanguageId );
+ from = search_message( dwFlags, (HMODULE)lpSource, dwMessageId, dwLanguageId );
if (!from) return 0;
}
else
@@ -580,10 +593,7 @@
}
else if (dwFlags & (FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_FROM_SYSTEM))
{
- if (dwFlags & FORMAT_MESSAGE_FROM_HMODULE)
- from = load_message( (HMODULE)lpSource, dwMessageId, dwLanguageId );
- if (!from && (dwFlags & FORMAT_MESSAGE_FROM_SYSTEM))
- from = load_message( kernel32_handle, dwMessageId, dwLanguageId );
+ from = search_message( dwFlags, (HMODULE)lpSource, dwMessageId, dwLanguageId );
if (!from) return 0;
}
else
Modified: trunk/reactos/media/doc/README.WINE
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/media/doc/README.WINE?rev=…
==============================================================================
--- trunk/reactos/media/doc/README.WINE [iso-8859-1] (original)
+++ trunk/reactos/media/doc/README.WINE [iso-8859-1] Fri Nov 27 20:09:44 2015
@@ -274,7 +274,7 @@
reactos/dll/win32/kernel32/winnls/string/casemap.c # Synced to WineStaging-1.7.55
reactos/dll/win32/kernel32/winnls/string/chartype.c # Synced in r52754
reactos/dll/win32/kernel32/winnls/string/collation.c # Synced to WineStaging-1.7.55
- reactos/dll/win32/kernel32/winnls/string/format_msg.c # Synced to Wine-1.7.27
+ reactos/dll/win32/kernel32/winnls/string/format_msg.c # Synced to WineStaging-1.7.55
reactos/dll/win32/kernel32/winnls/string/lang.c # Synced in r52754
reactos/dll/win32/kernel32/winnls/string/lcformat.c # Synced in r52754
reactos/dll/win32/kernel32/winnls/string/nls.c # Synced in r52754