[WINESYNC] d3dx9: Avoid closing invalid handles.

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>
This commit is contained in:
winesync 2021-01-05 13:16:40 +01:00 committed by Jérôme Gardou
parent 1f6645eb19
commit 93a4e84feb
2 changed files with 5 additions and 3 deletions

View 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());
}

View 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