From de85bfa7d218a6a4a938aefffda709dbec7e7b4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Wed, 2 Mar 2016 22:59:57 +0100
Subject: version: Return ERROR_FILE_NOT_FOUND for Win 9X when a file was not
 found in GetFileVersionInfoSizeEx.

---
 dlls/version/version.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/version/version.c b/dlls/version/version.c
index 43f5c18..71bfc67 100644
--- a/dlls/version/version.c
+++ b/dlls/version/version.c
@@ -694,7 +694,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;
     }
 }
-- 
2.7.1

