[WINESYNC] d3dx9: Avoid closing invalid handles.
authorwinesync <ros-dev@reactos.org>
Tue, 5 Jan 2021 12:16:40 +0000 (13:16 +0100)
committerJérôme Gardou <jerome.gardou@reactos.org>
Thu, 4 Feb 2021 15:37:07 +0000 (16:37 +0100)
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50373
Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
wine commit id e27a95e92097a601baa9b0e9dd6fcc5013c863fa by Akihiro Sagawa <sagawa.aki@gmail.com>

dll/directx/wine/d3dx9_36/util.c
sdk/tools/winesync/d3dx9.cfg

index d15444e..762c1e6 100644 (file)
@@ -138,8 +138,10 @@ HRESULT map_view_of_file(const WCHAR *filename, void **buffer, DWORD *length)
     return S_OK;
 
 error:
-    CloseHandle(hmapping);
-    CloseHandle(hfile);
+    if (hmapping)
+        CloseHandle(hmapping);
+    if (hfile != INVALID_HANDLE_VALUE)
+        CloseHandle(hfile);
     return HRESULT_FROM_WIN32(GetLastError());
 }
 
index 9ff89d1..8e6beef 100644 (file)
@@ -34,4 +34,4 @@ files:
   include/d3dx9tex.h: sdk/include/dxsdk/d3dx9tex.h
   include/d3dx9xof.h: sdk/include/dxsdk/d3dx9xof.h
 tags:
-  wine: 34c0055cfcb84e32d13556b7ec841d01acf5fe96
+  wine: e27a95e92097a601baa9b0e9dd6fcc5013c863fa