James Hawkins : advpack: Set the destination directory to the working directory if key equals SourceDir .

Alexandre Julliard julliard at wine.codeweavers.com
Wed Apr 19 06:03:43 CDT 2006


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

Author: James Hawkins <truiken at gmail.com>
Date:   Tue Apr 18 16:14:34 2006 -0500

advpack: Set the destination directory to the working directory if key equals SourceDir.

---

 dlls/advpack/advpack.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/dlls/advpack/advpack.c b/dlls/advpack/advpack.c
index 3ceb70a..791cb88 100644
--- a/dlls/advpack/advpack.c
+++ b/dlls/advpack/advpack.c
@@ -92,7 +92,7 @@ static void get_dest_dir(HINF hInf, PCWS
 }
 
 /* loads the LDIDs specified in the install section of an INF */
-static void set_ldids(HINF hInf, LPCWSTR pszInstallSection)
+static void set_ldids(HINF hInf, LPCWSTR pszInstallSection, LPCWSTR pszWorkingDir)
 {
     WCHAR field[MAX_FIELD_LENGTH];
     WCHAR line[MAX_FIELD_LENGTH];
@@ -101,6 +101,8 @@ static void set_ldids(HINF hInf, LPCWSTR
     DWORD size;
     int ldid;
 
+    static const WCHAR source_dir[] = {'S','o','u','r','c','e','D','i','r',0};
+
     static const WCHAR custDestW[] = {
         'C','u','s','t','o','m','D','e','s','t','i','n','a','t','i','o','n',0
     };
@@ -145,7 +147,11 @@ static void set_ldids(HINF hInf, LPCWSTR
         if (ptr)
             *ptr = '\0';
 
-        get_dest_dir(hInf, value, dest, MAX_PATH);
+        /* set dest to pszWorkingDir if key is SourceDir */
+        if (pszWorkingDir && !lstrcmpiW(value, source_dir))
+            lstrcpynW(dest, pszWorkingDir, MAX_PATH);
+        else
+            get_dest_dir(hInf, value, dest, MAX_PATH);
 
         /* set all ldids to dest */
         while ((ptr = get_parameter(&key, ',')))
@@ -359,7 +365,7 @@ HRESULT WINAPI OpenINFEngineW(LPCWSTR ps
     if (*phInf == INVALID_HANDLE_VALUE)
         return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
 
-    set_ldids(*phInf, pszInstallSection);
+    set_ldids(*phInf, pszInstallSection, NULL);
     
     return S_OK;
 }
@@ -717,7 +723,7 @@ HRESULT WINAPI TranslateInfStringW(LPCWS
     if (hInf == INVALID_HANDLE_VALUE)
         return HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND);
 
-    set_ldids(hInf, pszInstallSection);
+    set_ldids(hInf, pszInstallSection, NULL);
 
     if (!SetupGetLineTextW(NULL, hInf, pszTranslateSection, pszTranslateKey,
                            pszBuffer, dwBufferSize, pdwRequiredSize))




More information about the wine-cvs mailing list