[UXTHEME] -Fix most new tests for DrawThemeParentBackground. Hackfix CloseThemeData.
[reactos.git] / reactos / dll / win32 / uxtheme / system.c
index 86fbc98..393778f 100644 (file)
@@ -57,7 +57,7 @@ PTHEME_FILE ActiveThemeFile;
 
 static BOOL CALLBACK UXTHEME_broadcast_msg_enumchild (HWND hWnd, LPARAM msg)
 {
-    PostMessageW(hWnd, msg, 0, 0);
+    SendMessageW(hWnd, msg, 0, 0);
     return TRUE;
 }
 
@@ -70,7 +70,7 @@ BOOL CALLBACK UXTHEME_broadcast_msg (HWND hWnd, LPARAM msg)
     }
     else
     {
-       PostMessageW(hWnd, msg, 0, 0);
+       SendMessageW(hWnd, msg, 0, 0);
        EnumChildWindows (hWnd, UXTHEME_broadcast_msg_enumchild, msg);
     }
     return TRUE;
@@ -897,6 +897,8 @@ HRESULT WINAPI CloseThemeData(HTHEME hTheme)
     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);
 }