Set last error values compatible with Win9x implementation of GetFileVersionInfoSize

Dmitry Timoshkov dmitry at baikal.ru
Tue Aug 31 08:30:29 CDT 2004


Hello,

installer of Quicken depends on last error values set by
GetFileVersionInfoSize and expects them to be set to something
different than ERROR_RESOURCE_DATA_NOT_FOUND set on NT platforms.

I hope that there is no need to introduce several code paths
depending on the GetVersion return value.

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    Set last error values compatible with Win9x implementation
    of GetFileVersionInfoSize, Quicken installer depends on it.

--- cvs/hq/wine/dlls/version/info.c	2004-08-27 18:18:54.000000000 +0900
+++ wine/dlls/version/info.c	2004-08-31 17:44:14.000000000 +0900
@@ -512,6 +512,17 @@ DWORD WINAPI GetFileVersionInfoSizeW( LP
 
     if (handle) *handle = 0;
 
+    if (!filename)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return 0;
+    }
+    if (!*filename)
+    {
+        SetLastError(ERROR_BAD_PATHNAME);
+        return 0;
+    }
+
     len = VERSION_GetFileVersionInfo_PE(filename, 0, NULL);
     /* 0xFFFFFFFF means: file is a PE module, but VERSION_INFO not found */
     if(len == 0xFFFFFFFF)
@@ -531,7 +542,12 @@ DWORD WINAPI GetFileVersionInfoSizeW( LP
         len = VERSION_GetFileVersionInfo_16(filenameA, 0, NULL);
         HeapFree( GetProcessHeap(), 0, filenameA );
         /* 0xFFFFFFFF means: file exists, but VERSION_INFO not found */
-        if (!len || len == 0xFFFFFFFF)
+        if (!len)
+        {
+            SetLastError(ERROR_FILE_NOT_FOUND);
+            return 0;
+        }
+        if (len == 0xFFFFFFFF)
         {
             SetLastError(ERROR_RESOURCE_DATA_NOT_FOUND);
             return 0;






More information about the wine-patches mailing list