--- driverproc.c 2004/05/26 05:22:38 1.2.2.3 +++ driverproc.c 2010/12/02 06:46:07 1.12 @@ -3,7 +3,7 @@ * XVID MPEG-4 VFW FRONTEND * - driverproc main - * - * Copyright(C) 2001-2003 Peter Ross + * Copyright(C) Peter Ross * * This program is free software ; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,7 @@ * along with this program ; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id: driverproc.c,v 1.2.2.3 2004/05/26 05:22:38 syskin Exp $ + * $Id: driverproc.c,v 1.12 2010/12/02 06:46:07 Isibaar Exp $ * ****************************************************************************/ @@ -35,17 +35,17 @@ static int clean_dll_bindings(CODEC* codec); -BOOL WINAPI DllMain( - HANDLE hModule, - DWORD ul_reason_for_call, - LPVOID lpReserved) +INT_PTR WINAPI DllMain( + HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved) { g_hInst = (HINSTANCE) hModule; return TRUE; } /* __declspec(dllexport) */ LRESULT WINAPI DriverProc( - DWORD dwDriverId, + DWORD_PTR dwDriverId, HDRVR hDriver, UINT uMsg, LPARAM lParam1, @@ -60,7 +60,7 @@ case DRV_LOAD : case DRV_FREE : - return DRV_OK; + return DRVCNF_OK; case DRV_OPEN : DPRINTF("DRV_OPEN"); @@ -70,7 +70,7 @@ if (icopen != NULL && icopen->fccType != ICTYPE_VIDEO) { - return DRV_CANCEL; + return DRVCNF_CANCEL; } codec = malloc(sizeof(CODEC)); @@ -116,26 +116,27 @@ clean_dll_bindings(codec); status_destroy_always(&codec->status); free(codec); - return DRV_OK; + return DRVCNF_OK; case DRV_DISABLE : case DRV_ENABLE : - return DRV_OK; + return DRVCNF_OK; case DRV_INSTALL : case DRV_REMOVE : - return DRV_OK; + return DRVCNF_OK; case DRV_QUERYCONFIGURE : case DRV_CONFIGURE : - return DRV_CANCEL; + return DRVCNF_CANCEL; /* info */ case ICM_GETINFO : DPRINTF("ICM_GETINFO"); - { + + if (lParam1 && lParam2 >= sizeof(ICINFO)) { ICINFO *icinfo = (ICINFO *)lParam1; icinfo->fccType = ICTYPE_VIDEO; @@ -146,6 +147,9 @@ VIDCF_COMPRESSFRAMES; icinfo->dwVersion = 0; +#if !defined(ICVERSION) +#define ICVERSION 0x0104 +#endif icinfo->dwVersionICM = ICVERSION; wcscpy(icinfo->szName, XVID_NAME_L); @@ -153,6 +157,8 @@ return lParam2; /* size of struct */ } + + return 0; /* error */ /* state control */ @@ -302,12 +308,16 @@ void WINAPI Configure(HWND hwnd, HINSTANCE hinst, LPTSTR lpCmdLine, int nCmdShow) { - DWORD dwDriverId; + LRESULT dwDriverId; - dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0); - if (dwDriverId != (DWORD)NULL) + dwDriverId = (LRESULT) DriverProc(0, 0, DRV_OPEN, 0, 0); + if (dwDriverId != (LRESULT)NULL) { - DriverProc(dwDriverId, 0, ICM_CONFIGURE, (LPARAM)GetDesktopWindow(), 0); + if (lstrcmpi(lpCmdLine, "about")==0) { + DriverProc(dwDriverId, 0, ICM_ABOUT, (LPARAM)GetDesktopWindow(), 0); + }else{ + DriverProc(dwDriverId, 0, ICM_CONFIGURE, (LPARAM)GetDesktopWindow(), 0); + } DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); } }