https://git.reactos.org/?p=reactos.git;a=commitdiff;h=93a4e84febaede9665d29c6779aa833e7f838965

commit 93a4e84febaede9665d29c6779aa833e7f838965
Author:     winesync <[email protected]>
AuthorDate: Tue Jan 5 13:16:40 2021 +0100
Commit:     Jérôme Gardou <[email protected]>
CommitDate: Thu Feb 4 16:37:07 2021 +0100

    [WINESYNC] d3dx9: Avoid closing invalid handles.
    
    Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=50373
    Signed-off-by: Akihiro Sagawa <[email protected]>
    Signed-off-by: Matteo Bruni <[email protected]>
    Signed-off-by: Alexandre Julliard <[email protected]>
    
    wine commit id e27a95e92097a601baa9b0e9dd6fcc5013c863fa by Akihiro Sagawa 
<[email protected]>
---
 dll/directx/wine/d3dx9_36/util.c | 6 ++++--
 sdk/tools/winesync/d3dx9.cfg     | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/dll/directx/wine/d3dx9_36/util.c b/dll/directx/wine/d3dx9_36/util.c
index d15444e5cdc..762c1e6034f 100644
--- a/dll/directx/wine/d3dx9_36/util.c
+++ b/dll/directx/wine/d3dx9_36/util.c
@@ -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());
 }
 
diff --git a/sdk/tools/winesync/d3dx9.cfg b/sdk/tools/winesync/d3dx9.cfg
index 9ff89d183a5..8e6beefe8fc 100644
--- a/sdk/tools/winesync/d3dx9.cfg
+++ b/sdk/tools/winesync/d3dx9.cfg
@@ -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

Reply via email to