Commit 420d7a82 authored by Frank Richter's avatar Frank Richter Committed by Alexandre Julliard

Opening some theme class data now also increases the reference count

of the theme file, so as long as theme class data is still opened somewhere, the theme file won't get freed. Otherwise, it could happen that invalid class data was used, which could lead to problems.
parent 204f32ea
......@@ -810,6 +810,8 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
}
if(cls) {
TRACE("Opened app %s, class %s from list %s\n", debugstr_w(cls->szAppName), debugstr_w(cls->szClassName), debugstr_w(pszClassList));
cls->tf = tfActiveTheme;
cls->tf->dwRefCount++;
}
return cls;
}
......@@ -823,11 +825,12 @@ PTHEME_CLASS MSSTYLES_OpenThemeClass(LPCWSTR pszAppName, LPCWSTR pszClassList)
* tc Theme class to close
*
* NOTES
* There is currently no need clean anything up for theme classes,
* so do nothing for now
* The MSSTYLES_CloseThemeFile decreases the refcount of the owning
* theme file and cleans it up, if needed.
*/
HRESULT MSSTYLES_CloseThemeClass(PTHEME_CLASS tc)
{
MSSTYLES_CloseThemeFile (tc->tf);
return S_OK;
}
......
......@@ -46,8 +46,11 @@ typedef struct _THEME_PARTSTATE {
struct _THEME_PARTSTATE *next;
} THEME_PARTSTATE, *PTHEME_PARTSTATE;
struct _THEME_FILE;
typedef struct _THEME_CLASS {
HMODULE hTheme;
struct _THEME_FILE* tf;
WCHAR szAppName[MAX_THEME_APP_NAME];
WCHAR szClassName[MAX_THEME_CLASS_NAME];
PTHEME_PARTSTATE partstate;
......
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