Commit 997e2046 authored by Louis Lenders's avatar Louis Lenders Committed by Alexandre Julliard

uxtheme: Fix CloseThemeData with invalid handle value.

parent d070c263
......@@ -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);
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment