From 3a7d42fd2c72855fdca9b2b8337655152d5179f4 Mon Sep 17 00:00:00 2001 From: Sebastian Lackner Date: Tue, 25 Nov 2014 21:29:26 +0100 Subject: [PATCH] Added patch to ensure wintrust resets data->pWintrustData->u.pFile->hFile after closing handle. --- README.md | 3 +- debian/changelog | 1 + patches/Makefile | 16 ++++++++++ ...ata-pWintrustData-u.pFile-hFile-afte.patch | 29 +++++++++++++++++++ patches/wintrust-Reset_hFile/definition | 1 + 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 patches/wintrust-Reset_hFile/0001-wintrust-Reset-data-pWintrustData-u.pFile-hFile-afte.patch create mode 100644 patches/wintrust-Reset_hFile/definition diff --git a/README.md b/README.md index d53a9225..95375342 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,13 @@ Wine. All those differences are also documented on the Included bug fixes and improvements =================================== -**Bugfixes and features included in the next upcoming release [4]:** +**Bugfixes and features included in the next upcoming release [5]:** * Avoid race-conditions of async WSARecv() operations with write watches. * Fix issues with dragging layers between images in Adobe Photoshop 7.0 ([Wine Bug #12007](https://bugs.winehq.org/show_bug.cgi?id=12007)) * Implement exclusive mode in PulseAudio backend ([Wine Bug #37042](https://bugs.winehq.org/show_bug.cgi?id=37042)) * Take abs() of vertex z coordinate as FFP fog coordinate +* Wintrust doesn't reset data->pWintrustData->u.pFile->hFile after closing handle ([Wine Bug #36257](https://bugs.winehq.org/show_bug.cgi?id=36257)) **Bugs fixed in Wine Staging 1.7.31 [101]:** diff --git a/debian/changelog b/debian/changelog index 06ae1504..dd7a958c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ wine-compholio (1.7.32) UNRELEASED; urgency=low * Added patch to automatically detect if tests are running under Wine. * Added patch to avoid sending unexpected wakeup with uninitialized cookie value. * Added patch to fix issues with dragging layers between images in Adobe Photoshop 7.0. + * Added patch to ensure wintrust resets data->pWintrustData->u.pFile->hFile after closing handle. * Removed patch to close server fd is there is no space in thread inflight fd list (accepted upstream). * Removed patch to fix bugs in StrStr functions (accepted upstream). * Removed patches to avoid sending messages in FindWindowExW (accepted upstream). diff --git a/patches/Makefile b/patches/Makefile index b5fb4b66..8118bc92 100644 --- a/patches/Makefile +++ b/patches/Makefile @@ -118,6 +118,7 @@ PATCHLIST := \ winex11-Window_Groups.ok \ winex11-XEMBED.ok \ winex11-wglShareLists.ok \ + wintrust-Reset_hFile.ok \ wpcap-Dynamic_Linking.ok \ ws2_32-Connect_Time.ok \ ws2_32-TransmitFile.ok \ @@ -1870,6 +1871,21 @@ winex11-wglShareLists.ok: echo '+ { "Michael Müller", "winex11.drv: Only warn about used contexts in wglShareLists.", 1 },'; \ ) > winex11-wglShareLists.ok +# Patchset wintrust-Reset_hFile +# | +# | This patchset fixes the following Wine bugs: +# | * [#36257] Wintrust doesn't reset data->pWintrustData->u.pFile->hFile after closing handle +# | +# | Modified files: +# | * dlls/wintrust/softpub.c +# | +.INTERMEDIATE: wintrust-Reset_hFile.ok +wintrust-Reset_hFile.ok: + $(call APPLY_FILE,wintrust-Reset_hFile/0001-wintrust-Reset-data-pWintrustData-u.pFile-hFile-afte.patch) + @( \ + echo '+ { "Sebastian Lackner", "wintrust: Reset data->pWintrustData->u.pFile->hFile after closing handle.", 1 },'; \ + ) > wintrust-Reset_hFile.ok + # Patchset wpcap-Dynamic_Linking # | # | Modified files: diff --git a/patches/wintrust-Reset_hFile/0001-wintrust-Reset-data-pWintrustData-u.pFile-hFile-afte.patch b/patches/wintrust-Reset_hFile/0001-wintrust-Reset-data-pWintrustData-u.pFile-hFile-afte.patch new file mode 100644 index 00000000..9264d4c1 --- /dev/null +++ b/patches/wintrust-Reset_hFile/0001-wintrust-Reset-data-pWintrustData-u.pFile-hFile-afte.patch @@ -0,0 +1,29 @@ +From 64e1f4ac26867d15c0957c0b0212c9b67a87cb5d Mon Sep 17 00:00:00 2001 +From: Sebastian Lackner +Date: Tue, 25 Nov 2014 21:26:54 +0100 +Subject: wintrust: Reset data->pWintrustData->u.pFile->hFile after closing + handle. + +--- + dlls/wintrust/softpub.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/dlls/wintrust/softpub.c b/dlls/wintrust/softpub.c +index 358ba01..4e8582e 100644 +--- a/dlls/wintrust/softpub.c ++++ b/dlls/wintrust/softpub.c +@@ -1209,7 +1209,11 @@ HRESULT WINAPI SoftpubCleanup(CRYPT_PROVIDER_DATA *data) + if (data->fOpenedFile && + data->pWintrustData->dwUnionChoice == WTD_CHOICE_FILE && + data->pWintrustData->u.pFile) ++ { + CloseHandle(data->pWintrustData->u.pFile->hFile); ++ data->pWintrustData->u.pFile->hFile = INVALID_HANDLE_VALUE; ++ data->fOpenedFile = FALSE; ++ } + + return S_OK; + } +-- +2.1.3 + diff --git a/patches/wintrust-Reset_hFile/definition b/patches/wintrust-Reset_hFile/definition new file mode 100644 index 00000000..3d9b2205 --- /dev/null +++ b/patches/wintrust-Reset_hFile/definition @@ -0,0 +1 @@ +Fixes: [36257] Wintrust doesn't reset data->pWintrustData->u.pFile->hFile after closing handle