https://git.reactos.org/?p=reactos.git;a=commitdiff;h=28928748f106b17693c6eb2c8049ec02b805c6b8

commit 28928748f106b17693c6eb2c8049ec02b805c6b8
Author:     Amine Khaldi <[email protected]>
AuthorDate: Sat Mar 24 13:10:33 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sat Mar 24 13:10:33 2018 +0100

    [VERSION] Sync with Wine Staging 3.3. CORE-14434
---
 dll/win32/version/version.c | 45 +++++++++++++++++++++++++++++----------------
 media/doc/README.WINE       |  2 +-
 2 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/dll/win32/version/version.c b/dll/win32/version/version.c
index 13436cad16..78f8837364 100644
--- a/dll/win32/version/version.c
+++ b/dll/win32/version/version.c
@@ -705,7 +705,12 @@ DWORD WINAPI GetFileVersionInfoSizeExW( DWORD flags, 
LPCWSTR filename, LPDWORD h
         return (len * 2) + 4;
 
     default:
-        SetLastError( lzfd == HFILE_ERROR ? ofs.nErrCode : 
ERROR_RESOURCE_DATA_NOT_FOUND );
+        if (lzfd == HFILE_ERROR)
+            SetLastError(ofs.nErrCode);
+        else if (GetVersion() & 0x80000000)
+            SetLastError(ERROR_FILE_NOT_FOUND);
+        else
+            SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
         return 0;
     }
 }
@@ -1124,16 +1129,22 @@ static int testFileExistenceA( char const * path, char 
const * file, BOOL excl )
 
     fileinfo.cBytes = sizeof(OFSTRUCT);
 
-    strcpy(filename, path);
-    filenamelen = strlen(filename);
+    if (path)
+    {
+        strcpy(filename, path);
+        filenamelen = strlen(filename);
 
-    /* Add a trailing \ if necessary */
-    if(filenamelen) {
-       if(filename[filenamelen - 1] != '\\')
-           strcat(filename, "\\");
+        /* Add a trailing \ if necessary */
+        if(filenamelen)
+        {
+            if(filename[filenamelen - 1] != '\\')
+                strcat(filename, "\\");
+        }
+        else /* specify the current directory */
+            strcpy(filename, ".\\");
     }
-    else /* specify the current directory */
-       strcpy(filename, ".\\");
+    else
+        filename[0] = 0;
 
     /* Create the full pathname */
     strcat(filename, file);
@@ -1223,10 +1234,10 @@ DWORD WINAPI VerFindFileA(
         {
             if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = 
destDir;
             else if(lpszAppDir && testFileExistenceA(lpszAppDir, lpszFilename, 
FALSE))
-            {
                 curDir = lpszAppDir;
+
+            if(!testFileExistenceA(systemDir, lpszFilename, FALSE))
                 retval |= VFF_CURNEDEST;
-            }
         }
     }
     else /* not a shared file */
@@ -1237,15 +1248,17 @@ DWORD WINAPI VerFindFileA(
             GetWindowsDirectoryA( winDir, MAX_PATH );
             if(testFileExistenceA(destDir, lpszFilename, FALSE)) curDir = 
destDir;
             else if(testFileExistenceA(winDir, lpszFilename, FALSE))
-            {
                 curDir = winDir;
-                retval |= VFF_CURNEDEST;
-            }
             else if(testFileExistenceA(systemDir, lpszFilename, FALSE))
-            {
                 curDir = systemDir;
-                retval |= VFF_CURNEDEST;
+
+            if (lpszAppDir && lpszAppDir[0])
+            {
+                if(!testFileExistenceA(lpszAppDir, lpszFilename, FALSE))
+                    retval |= VFF_CURNEDEST;
             }
+            else if(testFileExistenceA(NULL, lpszFilename, FALSE))
+                retval |= VFF_CURNEDEST;
         }
     }
 
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 343cc070cf..45607118d9 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -192,7 +192,7 @@ reactos/dll/win32/urlmon              # Synced to 
WineStaging-3.3
 reactos/dll/win32/usp10               # Synced to WineStaging-3.3
 reactos/dll/win32/uxtheme             # Forked
 reactos/dll/win32/vbscript            # Synced to WineStaging-3.3
-reactos/dll/win32/version             # Synced to Wine-3.0
+reactos/dll/win32/version             # Synced to WineStaging-3.3
 reactos/dll/win32/vssapi              # Synced to WineStaging-2.9
 reactos/dll/win32/wbemdisp            # Synced to Wine-3.0
 reactos/dll/win32/wbemprox            # Synced to Wine-3.0

Reply via email to