svn path=/trunk/; revision=74127
int hasClip = -1;
TRACE("(%p,%p,%p)\n", hwnd, hdc, prc);
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 = GetParent(hwnd);
if(!hParent)
if(prc) {
rt = *prc;
MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
if(prc) {
rt = *prc;
MapWindowPoints(hwnd, hParent, (LPPOINT)&rt, 2);
TRACE("(%p)\n", hTheme);
if(!hTheme || hTheme == INVALID_HANDLE_VALUE)
return E_HANDLE;
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);
}
return MSSTYLES_CloseThemeClass(hTheme);
}