https://git.reactos.org/?p=reactos.git;a=commitdiff;h=eaa9d0d12c0ecd08a379a…
commit eaa9d0d12c0ecd08a379a8f4289b0a9171bf4bf7
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Wed Apr 11 12:47:12 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Wed Apr 11 12:47:12 2018 +0100
[KERNEL32/STRING] Sync format_msg.c with Wine Staging 3.3. CORE-14434
---
dll/win32/kernel32/winnls/string/format_msg.c | 42 ++++++++++++++++++++++++---
media/doc/README.WINE | 2 +-
2 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/dll/win32/kernel32/winnls/string/format_msg.c
b/dll/win32/kernel32/winnls/string/format_msg.c
index 389cf1fad8..ff6f083703 100644
--- a/dll/win32/kernel32/winnls/string/format_msg.c
+++ b/dll/win32/kernel32/winnls/string/format_msg.c
@@ -19,6 +19,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#ifdef __REACTOS__
+
#include <k32.h>
#define NDEBUG
@@ -27,6 +29,30 @@ DEBUG_CHANNEL(resource);
extern HMODULE kernel32_handle;
+#else /* __REACTOS__ */
+
+#include "config.h"
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#include "windef.h"
+#include "winbase.h"
+#include "winerror.h"
+#include "winternl.h"
+#include "winuser.h"
+#include "winnls.h"
+#include "wine/unicode.h"
+#include "kernel_private.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(resource);
+
+#endif /* __REACTOS__ */
+
struct format_args
{
ULONG_PTR *args;
@@ -61,17 +87,25 @@ struct format_args
*/
static LPWSTR load_message( HMODULE module, UINT id, WORD lang )
{
+#ifdef __REACTOS__
MESSAGE_RESOURCE_ENTRY *mre;
+#else
+ const MESSAGE_RESOURCE_ENTRY *mre;
+#endif
WCHAR *buffer;
- NTSTATUS Status;
+ NTSTATUS status;
TRACE("module = %p, id = %08x\n", module, id );
if (!module) module = GetModuleHandleW( NULL );
- Status = RtlFindMessage(module, (ULONG_PTR)RT_MESSAGETABLE, lang, id, &mre);
- if (!NT_SUCCESS(Status))
+#ifdef __REACTOS__
+ status = RtlFindMessage(module, (ULONG_PTR)RT_MESSAGETABLE, lang, id, &mre);
+ if (!NT_SUCCESS(status))
+#else
+ if ((status = RtlFindMessage( module, RT_MESSAGETABLE, lang, id, &mre )) !=
STATUS_SUCCESS)
+#endif
{
- SetLastError(RtlNtStatusToDosError(Status));
+ SetLastError( RtlNtStatusToDosError(status) );
return NULL;
}
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index c99a0ce3ea..a383f14231 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -280,7 +280,7 @@ kernel32 -
reactos/dll/win32/kernel32/winnls/string/collation.c # Synced to WineStaging-1.7.55
reactos/dll/win32/kernel32/winnls/string/digitmap.c # Synced to WineStaging-3.3
reactos/dll/win32/kernel32/winnls/string/fold.c # Synced to WineStaging-3.3
- reactos/dll/win32/kernel32/winnls/string/format_msg.c # Synced to WineStaging-1.7.55
+ reactos/dll/win32/kernel32/winnls/string/format_msg.c # Synced to WineStaging-3.3
reactos/dll/win32/kernel32/winnls/string/lang.c # Synced in r52754
reactos/dll/win32/kernel32/winnls/string/lcformat.c # Synced to WineStaging-1.7.55
reactos/dll/win32/kernel32/winnls/string/nls.c # Synced in r52754