uxtheme: Fix CloseThemeData with invalid handle value.

Signed-off-by: Louis Lenders <xerox.xerox2000x@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Louis Lenders 2016-02-12 10:51:42 +01:00 committed by Alexandre Julliard
parent d070c263ad
commit 997e2046df
2 changed files with 3 additions and 1 deletions

View File

@ -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);
}

View File

@ -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)