--- trunk/vfw/src/driverproc.c 2002/03/16 11:40:48 30 +++ trunk/vfw/src/driverproc.c 2002/08/31 09:54:36 385 @@ -23,7 +23,7 @@ * * History: * - * ... ??? + * 31.08.2002 Configure() export * 01.12.2001 inital version; (c)2001 peter ross * *************************************************************************/ @@ -36,7 +36,7 @@ #include "resource.h" -BOOL APIENTRY DllMain( +BOOL WINAPI DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) @@ -47,7 +47,7 @@ -__declspec(dllexport) LRESULT WINAPI DriverProc( +/* __declspec(dllexport) */ LRESULT WINAPI DriverProc( DWORD dwDriverId, HDRVR hDriver, UINT uMsg, @@ -63,7 +63,7 @@ case DRV_LOAD : case DRV_FREE : - DRV_OK; + return DRV_OK; case DRV_OPEN : DEBUG("DRV_OPEN"); @@ -74,7 +74,9 @@ { return DRV_CANCEL; } + codec = malloc(sizeof(CODEC)); + if (codec == NULL) { if (icopen != NULL) @@ -83,9 +85,17 @@ } return 0; } + codec->ehandle = codec->dhandle = NULL; config_reg_get(&codec->config); + /* bad things happen if this is uncommented + if (lstrcmp(XVID_BUILD, codec->config.build)) + { + config_reg_default(&codec->config); + } + */ + if (icopen != NULL) { icopen->dwError = ICERR_OK; @@ -136,8 +146,6 @@ return lParam2; /* size of struct */ } - DEBUG("ICM_GETINFO end"); - /* state control */ @@ -266,3 +274,16 @@ return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); } } + + +void WINAPI Configure(HWND hwnd, HINSTANCE hinst, LPTSTR lpCmdLine, int nCmdShow) +{ + DWORD dwDriverId; + + dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0); + if (dwDriverId != (DWORD)NULL) + { + DriverProc(dwDriverId, 0, ICM_CONFIGURE, 0, 0); + DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); + } +}