https://git.reactos.org/?p=reactos.git;a=commitdiff;h=97b990849f01d01f62934edfaf77d20be01e7a67

commit 97b990849f01d01f62934edfaf77d20be01e7a67
Author:     winesync <[email protected]>
AuthorDate: Fri Sep 11 19:53:58 2020 +0200
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Wed Sep 16 10:36:02 2020 +0200

    [WINESYNC] dbghelp: Replace another usage of GetEnvironmentVariable() with 
the target process's environment.
    
    Signed-off-by: Zebediah Figura <[email protected]>
    Signed-off-by: Jacek Caban <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id 70b2d181b1547dbe3c2a62e57c6afb0ee903f358 by Zebediah Figura 
<[email protected]>
---
 dll/win32/dbghelp/path.c       | 9 +++------
 sdk/tools/winesync/dbghelp.cfg | 2 +-
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/dll/win32/dbghelp/path.c b/dll/win32/dbghelp/path.c
index 2681c405aa1..6639375d444 100644
--- a/dll/win32/dbghelp/path.c
+++ b/dll/win32/dbghelp/path.c
@@ -756,12 +756,9 @@ BOOL search_dll_path(const struct process *process, const 
WCHAR *name, BOOL (*ma
         WCHAR env_name[64];
         swprintf(env_name, ARRAY_SIZE(env_name), L"WINEDLLDIR%u", i);
         if (!(env = process_getenv(process, env_name))) return FALSE;
-        len = lstrlenW(env);
-        if (!(buf = heap_alloc((len + lstrlenW(name) + 2) * sizeof(WCHAR)))) 
return FALSE;
-
-        len = GetEnvironmentVariableW(env_name, buf, len);
-        buf[len++] = '\\';
-        lstrcpyW(buf + len, name);
+        len = wcslen(env) + wcslen(name) + 2;
+        if (!(buf = heap_alloc(len * sizeof(WCHAR)))) return FALSE;
+        swprintf(buf, len, L"%s\\%s", env, name);
         file = CreateFileW(buf, GENERIC_READ, FILE_SHARE_READ, NULL, 
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
         if (file != INVALID_HANDLE_VALUE)
         {
diff --git a/sdk/tools/winesync/dbghelp.cfg b/sdk/tools/winesync/dbghelp.cfg
index cdf2499dfdf..2fecd3ea9c7 100644
--- a/sdk/tools/winesync/dbghelp.cfg
+++ b/sdk/tools/winesync/dbghelp.cfg
@@ -4,4 +4,4 @@ files:
   include/dbghelp.h: sdk/include/psdk/dbghelp.h
   include/wine/mscvpdb.h: sdk/include/reactos/wine/mscvpdb.h
 tags:
-  wine: 774ee4734a7d6c02f648fdf1747df837c964583d
+  wine: 70b2d181b1547dbe3c2a62e57c6afb0ee903f358

Reply via email to