Alexandre Julliard : kernel32: Fix handling of %ws format for Unicode.

Alexandre Julliard julliard at winehq.org
Tue Jun 9 10:45:26 CDT 2009


Module: wine
Branch: master
Commit: b4a9c99abcfc267af6caa0d0bd802ac27fcca39e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b4a9c99abcfc267af6caa0d0bd802ac27fcca39e

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Jun  8 18:13:13 2009 +0200

kernel32: Fix handling of %ws format for Unicode.

---

 dlls/kernel32/format_msg.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/format_msg.c b/dlls/kernel32/format_msg.c
index f4baaae..e8f9fbc 100644
--- a/dlls/kernel32/format_msg.c
+++ b/dlls/kernel32/format_msg.c
@@ -485,7 +485,10 @@ DWORD WINAPI FormatMessageW(
 
                         if (fmtstr[strlenW(fmtstr)-1]=='s' && argliststart[0]) {
                             DWORD xarr[3];
+                            WCHAR *fmt_end = fmtstr + strlenW(fmtstr) - 1;
 
+                            /* remap %ws to %ls */
+                            if (fmt_end > fmtstr && (fmt_end[-1] == 'w')) fmt_end[-1] = 'l';
                             xarr[0]=*(argliststart+0);
                             /* possible invalid pointers */
                             xarr[1]=*(argliststart+1);




More information about the wine-cvs mailing list