Author: gadamopoulos
Date: Wed Mar 8 15:08:56 2017
New Revision: 74127
URL:
http://svn.reactos.org/svn/reactos?rev=74127&view=rev
Log:
[UXTHEME] -Fix most new tests for DrawThemeParentBackground. Hackfix CloseThemeData.
Modified:
trunk/reactos/dll/win32/uxtheme/draw.c
trunk/reactos/dll/win32/uxtheme/system.c
Modified: trunk/reactos/dll/win32/uxtheme/draw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/draw.c?r…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/draw.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/draw.c [iso-8859-1] Wed Mar 8 15:08:56 2017
@@ -78,9 +78,17 @@
int hasClip = -1;
TRACE("(%p,%p,%p)\n", hwnd, hdc, prc);
+
+ if (!IsWindow(hwnd) || !hdc)
+ return E_HANDLE;
+
+ if (prc && IsBadReadPtr (prc, sizeof(RECT)))
+ return E_POINTER;
+
hParent = GetParent(hwnd);
if(!hParent)
- hParent = hwnd;
+ return S_OK;
+
if(prc) {
rt = *prc;
MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
Modified: trunk/reactos/dll/win32/uxtheme/system.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/uxtheme/system.c…
==============================================================================
--- trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/uxtheme/system.c [iso-8859-1] Wed Mar 8 15:08:56 2017
@@ -897,6 +897,8 @@
TRACE("(%p)\n", hTheme);
if(!hTheme || hTheme == INVALID_HANDLE_VALUE)
return E_HANDLE;
+ if(IsBadReadPtr (hTheme, sizeof(THEME_CLASS))) /* This check is a hack! */
+ return E_HANDLE;
return MSSTYLES_CloseThemeClass(hTheme);
}