You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-09-12 18:50:20 -07:00
Added patch to avoid crash when INVALID_HANDLE_VALUE is passed to CloseThemeData.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
From ab3d3417ca146b9a72b395b082b4aae628c39d7c Mon Sep 17 00:00:00 2001
|
||||
From: Louis Lenders <xerox_xerox2000@yahoo.co.uk>
|
||||
Date: Wed, 27 Jan 2016 07:29:50 +0100
|
||||
Subject: uxtheme: Do not crash when INVALID_HANDLE_VALUE is passed to
|
||||
CloseThemeData.
|
||||
|
||||
---
|
||||
dlls/uxtheme/system.c | 2 +-
|
||||
dlls/uxtheme/tests/system.c | 2 ++
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/uxtheme/system.c b/dlls/uxtheme/system.c
|
||||
index 8947587..7d07680 100644
|
||||
--- a/dlls/uxtheme/system.c
|
||||
+++ b/dlls/uxtheme/system.c
|
||||
@@ -746,7 +746,7 @@ void WINAPI SetThemeAppProperties(DWORD dwFlags)
|
||||
HRESULT WINAPI CloseThemeData(HTHEME hTheme)
|
||||
{
|
||||
TRACE("(%p)\n", hTheme);
|
||||
- if(!hTheme)
|
||||
+ if(!hTheme || hTheme == INVALID_HANDLE_VALUE)
|
||||
return E_HANDLE;
|
||||
return MSSTYLES_CloseThemeClass(hTheme);
|
||||
}
|
||||
diff --git a/dlls/uxtheme/tests/system.c b/dlls/uxtheme/tests/system.c
|
||||
index 49eba64..4aeedbc 100644
|
||||
--- a/dlls/uxtheme/tests/system.c
|
||||
+++ b/dlls/uxtheme/tests/system.c
|
||||
@@ -541,6 +541,8 @@ static void test_CloseThemeData(void)
|
||||
|
||||
hRes = pCloseThemeData(NULL);
|
||||
ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
||||
+ hRes = pCloseThemeData(INVALID_HANDLE_VALUE);
|
||||
+ ok( hRes == E_HANDLE, "Expected E_HANDLE, got 0x%08x\n", hRes);
|
||||
}
|
||||
|
||||
START_TEST(system)
|
||||
--
|
||||
2.6.4
|
||||
|
1
patches/uxtheme-CloseThemeData/definition
Normal file
1
patches/uxtheme-CloseThemeData/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [29862] Do not crash when INVALID_HANDLE_VALUE is passed to CloseThemeData
|
Reference in New Issue
Block a user