Commit 2ef75188 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

wined3d: Add UnregisterClass() on DLL_PROCESS_DETACH.

parent d6c8a003
...@@ -268,7 +268,7 @@ static BOOL WineD3D_CreateFakeGLContext(void) { ...@@ -268,7 +268,7 @@ static BOOL WineD3D_CreateFakeGLContext(void) {
wined3d_fake_gl_context_foreign = FALSE; wined3d_fake_gl_context_foreign = FALSE;
/* We need a fake window as a hdc retrieved using GetDC(0) can't be used for much GL purposes */ /* We need a fake window as a hdc retrieved using GetDC(0) can't be used for much GL purposes */
wined3d_fake_gl_context_hwnd = CreateWindowA("WineD3D_OpenGL", "WineD3D fake window", WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL); wined3d_fake_gl_context_hwnd = CreateWindowA(WINED3D_OPENGL_WINDOW_CLASS_NAME, "WineD3D fake window", WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL);
if(!wined3d_fake_gl_context_hwnd) { if(!wined3d_fake_gl_context_hwnd) {
ERR("HWND creation failed!\n"); ERR("HWND creation failed!\n");
goto fail; goto fail;
......
...@@ -117,9 +117,9 @@ static BOOL wined3d_init(HINSTANCE hInstDLL) ...@@ -117,9 +117,9 @@ static BOOL wined3d_init(HINSTANCE hInstDLL)
wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW); wc.hCursor = LoadCursorA(NULL, (LPCSTR)IDC_ARROW);
wc.hbrBackground = NULL; wc.hbrBackground = NULL;
wc.lpszMenuName = NULL; wc.lpszMenuName = NULL;
wc.lpszClassName = "WineD3D_OpenGL"; wc.lpszClassName = WINED3D_OPENGL_WINDOW_CLASS_NAME;
if (!RegisterClassA(&wc) && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) if (!RegisterClassA(&wc))
{ {
ERR("Failed to register window class 'WineD3D_OpenGL'!\n"); ERR("Failed to register window class 'WineD3D_OpenGL'!\n");
return FALSE; return FALSE;
...@@ -320,9 +320,10 @@ static BOOL wined3d_init(HINSTANCE hInstDLL) ...@@ -320,9 +320,10 @@ static BOOL wined3d_init(HINSTANCE hInstDLL)
return TRUE; return TRUE;
} }
static BOOL wined3d_destroy(void) static BOOL wined3d_destroy(HINSTANCE hInstDLL)
{ {
HeapFree(GetProcessHeap(), 0, wined3d_settings.logo); HeapFree(GetProcessHeap(), 0, wined3d_settings.logo);
UnregisterClassA(WINED3D_OPENGL_WINDOW_CLASS_NAME, hInstDLL);
return TRUE; return TRUE;
} }
...@@ -338,7 +339,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) ...@@ -338,7 +339,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
return wined3d_init(hInstDLL); return wined3d_init(hInstDLL);
case DLL_PROCESS_DETACH: case DLL_PROCESS_DETACH:
return wined3d_destroy(); return wined3d_destroy(hInstDLL);
default: default:
return TRUE; return TRUE;
......
...@@ -2818,4 +2818,8 @@ static inline BOOL use_ps(IWineD3DStateBlockImpl *stateblock) ...@@ -2818,4 +2818,8 @@ static inline BOOL use_ps(IWineD3DStateBlockImpl *stateblock)
void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect, void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface, WINED3DRECT *src_rect,
IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip); IWineD3DSurface *dst_surface, WINED3DRECT *dst_rect, const WINED3DTEXTUREFILTERTYPE filter, BOOL flip);
/* The WNDCLASS-Name for the fake window which we use to retrieve the GL capabilities */
#define WINED3D_OPENGL_WINDOW_CLASS_NAME "WineD3D_OpenGL"
#endif #endif
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