https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c4cb40d8e2f61ff29d7ae7373906afd4d919f46

commit 2c4cb40d8e2f61ff29d7ae7373906afd4d919f46
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Fri Nov 4 19:58:10 2022 +0900
Commit:     Katayama Hirofumi MZ <[email protected]>
CommitDate: Fri Nov 4 19:58:10 2022 +0900

    [SHELL32_APITEST] Workaround on wine_dbgstr_w bugs
    
    Double wine_dbgstr_w calls makes output broken.
    I used two buffers and kept the results of wine_dbgstr_w to do workaround.
    
    CORE-18080
---
 modules/rostests/apitests/shell32/PathResolve.cpp | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/rostests/apitests/shell32/PathResolve.cpp 
b/modules/rostests/apitests/shell32/PathResolve.cpp
index b8d0e560dd9..92c044702de 100644
--- a/modules/rostests/apitests/shell32/PathResolve.cpp
+++ b/modules/rostests/apitests/shell32/PathResolve.cpp
@@ -658,6 +658,9 @@ static void DoEntry(INT SectionNumber, INT LineNumber, 
const TEST_ENTRY *pEntry)
     INT Ret;
     DWORD Error;
 
+    ZeroMemory(Path, sizeof(Path));
+    ZeroMemory(PathExpected, sizeof(PathExpected));
+
     if (pEntry->NameBefore == NULL)
     {
         assert(pEntry->NameExpected == NULL);
@@ -750,8 +753,14 @@ static void DoEntry(INT SectionNumber, INT LineNumber, 
const TEST_ENTRY *pEntry)
 
     if (pEntry->NameExpected && !(pEntry->EF_ & EF_APP_PATH))
     {
+        char expected[MAX_PATH];
+        char path[MAX_PATH];
+
+        lstrcpynA(expected, wine_dbgstr_w(PathExpected), _countof(expected));
+        lstrcpynA(path, wine_dbgstr_w(Path), _countof(path));
+
         ok(lstrcmpW(Path, PathExpected) == 0, "Section %d, Line %d: Path 
expected %s, was %s.\n",
-           SectionNumber, LineNumber, wine_dbgstr_w(PathExpected), 
wine_dbgstr_w(Path));
+           SectionNumber, LineNumber, expected, path);
     }
 }
 

Reply via email to