23 |
* |
* |
24 |
* History: |
* History: |
25 |
* |
* |
26 |
* ... ??? |
* 31.08.2002 Configure() export |
27 |
* 01.12.2001 inital version; (c)2001 peter ross <suxen_drol@hotmail.com> |
* 01.12.2001 inital version; (c)2001 peter ross <pross@xvid.org> |
28 |
* |
* |
29 |
*************************************************************************/ |
*************************************************************************/ |
30 |
|
|
36 |
#include "resource.h" |
#include "resource.h" |
37 |
|
|
38 |
|
|
39 |
BOOL APIENTRY DllMain( |
BOOL WINAPI DllMain( |
40 |
HANDLE hModule, |
HANDLE hModule, |
41 |
DWORD ul_reason_for_call, |
DWORD ul_reason_for_call, |
42 |
LPVOID lpReserved) |
LPVOID lpReserved) |
47 |
|
|
48 |
|
|
49 |
|
|
50 |
__declspec(dllexport) LRESULT WINAPI DriverProc( |
/* __declspec(dllexport) */ LRESULT WINAPI DriverProc( |
51 |
DWORD dwDriverId, |
DWORD dwDriverId, |
52 |
HDRVR hDriver, |
HDRVR hDriver, |
53 |
UINT uMsg, |
UINT uMsg, |
63 |
|
|
64 |
case DRV_LOAD : |
case DRV_LOAD : |
65 |
case DRV_FREE : |
case DRV_FREE : |
66 |
DRV_OK; |
return DRV_OK; |
67 |
|
|
68 |
case DRV_OPEN : |
case DRV_OPEN : |
69 |
DEBUG("DRV_OPEN"); |
DEBUG("DRV_OPEN"); |
74 |
{ |
{ |
75 |
return DRV_CANCEL; |
return DRV_CANCEL; |
76 |
} |
} |
77 |
|
|
78 |
codec = malloc(sizeof(CODEC)); |
codec = malloc(sizeof(CODEC)); |
79 |
|
|
80 |
if (codec == NULL) |
if (codec == NULL) |
81 |
{ |
{ |
82 |
if (icopen != NULL) |
if (icopen != NULL) |
85 |
} |
} |
86 |
return 0; |
return 0; |
87 |
} |
} |
88 |
|
|
89 |
codec->ehandle = codec->dhandle = NULL; |
codec->ehandle = codec->dhandle = NULL; |
90 |
config_reg_get(&codec->config); |
config_reg_get(&codec->config); |
91 |
|
|
92 |
|
/* bad things happen if this is uncommented |
93 |
|
if (lstrcmp(XVID_BUILD, codec->config.build)) |
94 |
|
{ |
95 |
|
config_reg_default(&codec->config); |
96 |
|
} |
97 |
|
*/ |
98 |
|
|
99 |
if (icopen != NULL) |
if (icopen != NULL) |
100 |
{ |
{ |
101 |
icopen->dwError = ICERR_OK; |
icopen->dwError = ICERR_OK; |
146 |
|
|
147 |
return lParam2; /* size of struct */ |
return lParam2; /* size of struct */ |
148 |
} |
} |
|
DEBUG("ICM_GETINFO end"); |
|
|
|
|
149 |
|
|
150 |
/* state control */ |
/* state control */ |
151 |
|
|
274 |
return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); |
return DefDriverProc(dwDriverId, hDriver, uMsg, lParam1, lParam2); |
275 |
} |
} |
276 |
} |
} |
277 |
|
|
278 |
|
|
279 |
|
void WINAPI Configure(HWND hwnd, HINSTANCE hinst, LPTSTR lpCmdLine, int nCmdShow) |
280 |
|
{ |
281 |
|
DWORD dwDriverId; |
282 |
|
|
283 |
|
dwDriverId = DriverProc(0, 0, DRV_OPEN, 0, 0); |
284 |
|
if (dwDriverId != (DWORD)NULL) |
285 |
|
{ |
286 |
|
DriverProc(dwDriverId, 0, ICM_CONFIGURE, 0, 0); |
287 |
|
DriverProc(dwDriverId, 0, DRV_CLOSE, 0, 0); |
288 |
|
} |
289 |
|
} |