Commit d4185bad authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Alexandre Julliard

quartz: Unregister window class after shutdown.

parent 82129d7a
......@@ -37,6 +37,8 @@ static DWORD dll_ref = 0;
/* For the moment, do nothing here. */
BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
{
if (fdwReason == DLL_PROCESS_DETACH)
video_unregister_windowclass();
return QUARTZ_DllMain( hInstDLL, fdwReason, lpv );
}
......
......@@ -67,6 +67,7 @@ HRESULT IEnumRegFiltersImpl_Construct(REGFILTER * pInRegFilters, const ULONG siz
HRESULT IEnumFiltersImpl_Construct(IBaseFilter ** ppFilters, ULONG nFilters, IEnumFilters ** ppEnum);
extern const char * qzdebugstr_guid(const GUID * id);
extern void video_unregister_windowclass(void) DECLSPEC_HIDDEN;
BOOL CompareMediaTypes(const AM_MEDIA_TYPE * pmt1, const AM_MEDIA_TYPE * pmt2, BOOL bWildcards);
void dump_AM_MEDIA_TYPE(const AM_MEDIA_TYPE * pmt);
......
......@@ -164,12 +164,11 @@ static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARA
return 0;
}
static BOOL CreateRenderingWindow(VideoRendererImpl* This)
{
static BOOL video_register_windowclass(void) {
WNDCLASSA winclass;
if (wnd_class_registered)
return 1;
TRACE("(%p)->()\n", This);
winclass.style = 0;
winclass.lpfnWndProc = VideoWndProcA;
winclass.cbClsExtra = 0;
......@@ -180,17 +179,26 @@ static BOOL CreateRenderingWindow(VideoRendererImpl* This)
winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
winclass.lpszMenuName = NULL;
winclass.lpszClassName = "Wine ActiveMovie Class";
if (!wnd_class_registered)
if (!RegisterClassA(&winclass))
{
if (!RegisterClassA(&winclass))
{
ERR("Unable to register window %u\n", GetLastError());
return FALSE;
}
wnd_class_registered = TRUE;
ERR("Unable to register window class: %u\n", GetLastError());
return FALSE;
}
wnd_class_registered = 1;
return 1;
}
void video_unregister_windowclass(void) {
if (!wnd_class_registered)
return;
UnregisterClassA("Wine ActiveMovie Class", NULL);
}
static BOOL CreateRenderingWindow(VideoRendererImpl* This)
{
TRACE("(%p)->()\n", This);
if (!video_register_windowclass())
return FALSE;
This->hWnd = CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,
NULL, NULL, NULL);
......
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