Hello, Changelog: Dmitry Timoshkov <dmitry@xxxxxxxxxxxxxxx> Register window class on mciavi driver loading, and unregister it on driver unloading. diff -u cvs/hq/wine/dlls/winmm/mciavi/mciavi.c wine/dlls/winmm/mciavi/mciavi.c --- cvs/hq/wine/dlls/winmm/mciavi/mciavi.c 2004-01-01 15:33:54.000000000 +0800 +++ wine/dlls/winmm/mciavi/mciavi.c 2004-01-06 20:32:05.000000000 +0800 @@ -140,6 +140,8 @@ static DWORD MCIAVI_drvOpen(LPSTR str, L /* session instance */ if (!modp) return 0xFFFFFFFF; + if (!MCIAVI_RegisterClass()) return 0; + wma = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(WINE_MCIAVI)); if (!wma) return 0; @@ -169,6 +171,8 @@ static DWORD MCIAVI_drvClose(DWORD dwDev wma = (WINE_MCIAVI*)mciGetDriverData(dwDevID); if (wma) { + MCIAVI_UnregisterClass(); + EnterCriticalSection(&wma->cs); mciSetDriverData(dwDevID, 0); diff -u cvs/hq/wine/dlls/winmm/mciavi/private_mciavi.h wine/dlls/winmm/mciavi/private_mciavi.h --- cvs/hq/wine/dlls/winmm/mciavi/private_mciavi.h 2004-01-06 17:42:34.000000000 +0800 +++ wine/dlls/winmm/mciavi/private_mciavi.h 2004-01-06 20:30:10.000000000 +0800 @@ -103,7 +103,9 @@ LRESULT MCIAVI_PaintFrame(WINE_MCIAVI* w WINE_MCIAVI* MCIAVI_mciGetOpenDev(UINT wDevID); DWORD MCIAVI_mciClose(UINT, DWORD, LPMCI_GENERIC_PARMS); -/* window.c */ +/* wnd.c */ +BOOL MCIAVI_RegisterClass(void); +BOOL MCIAVI_UnregisterClass(void); BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms); DWORD MCIAVI_mciPut(UINT wDevID, DWORD dwFlags, LPMCI_DGV_PUT_PARMS lpParms); DWORD MCIAVI_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lpParms); diff -u cvs/hq/wine/dlls/winmm/mciavi/wnd.c wine/dlls/winmm/mciavi/wnd.c --- cvs/hq/wine/dlls/winmm/mciavi/wnd.c 2004-01-01 15:33:54.000000000 +0800 +++ wine/dlls/winmm/mciavi/wnd.c 2004-01-06 20:32:41.000000000 +0800 @@ -86,28 +86,36 @@ static LRESULT WINAPI MCIAVI_WindowProc( return 0; } -BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms) +BOOL MCIAVI_UnregisterClass(void) { - WNDCLASSA wndClass; - HWND hParent = 0; - DWORD dwStyle = WS_OVERLAPPEDWINDOW; - int p = CW_USEDEFAULT; - RECT rc; + return UnregisterClassA("MCIAVI", MCIAVI_hInstance); +} - /* what should be done ? */ - if (wma->hWnd) return TRUE; +BOOL MCIAVI_RegisterClass(void) +{ + WNDCLASSA wndClass; ZeroMemory(&wndClass, sizeof(WNDCLASSA)); wndClass.style = CS_DBLCLKS; wndClass.lpfnWndProc = (WNDPROC)MCIAVI_WindowProc; - wndClass.cbClsExtra = 0; wndClass.cbWndExtra = sizeof(MCIDEVICEID); wndClass.hInstance = MCIAVI_hInstance; wndClass.hCursor = LoadCursorA(0, (LPSTR)IDC_ARROW); wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); wndClass.lpszClassName = "MCIAVI"; - if (!RegisterClassA(&wndClass)) return FALSE; + return RegisterClassA(&wndClass); +} + +BOOL MCIAVI_CreateWindow(WINE_MCIAVI* wma, DWORD dwFlags, LPMCI_DGV_OPEN_PARMSA lpOpenParms) +{ + HWND hParent = 0; + DWORD dwStyle = WS_OVERLAPPEDWINDOW; + int p = CW_USEDEFAULT; + RECT rc; + + /* what should be done ? */ + if (wma->hWnd) return TRUE; if (dwFlags & MCI_DGV_OPEN_PARENT) hParent = lpOpenParms->hWndParent; if (dwFlags & MCI_DGV_OPEN_WS) dwStyle = lpOpenParms->dwStyle;