annotate loader/driver.c @ 3848:f99944f9f427

fix for qnx
author alex
date Fri, 28 Dec 2001 20:21:32 +0000
parents 4dad31e655b6
children 174e2a58b4cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 #include <config.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 #include <stdio.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 #ifdef HAVE_MALLOC_H
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 #include <malloc.h>
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
5 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 #include <stdlib.h>
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
7 #ifdef __FreeBSD__
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
8 #include <sys/time.h>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10
2068
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
11 #include "win32.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
12 #include "wine/driver.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
13 #include "wine/pe_image.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
14 #include "wine/winreg.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
15 #include "wine/vfw.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
16 #include "registry.h"
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
17 #include "ldt_keeper.h"
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
18 #include "driver.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
20
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
21 #if 1
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
22 /*
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
23 * STORE_ALL/REST_ALL seems like an attempt to workaround problems due to
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
24 * WINAPI/no-WINAPI bustage.
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
25 *
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
26 * There should be no need for the STORE_ALL/REST_ALL hack once all
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
27 * function definitions agree with their prototypes (WINAPI-wise) and
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
28 * we make sure, that we do not call these functions without a proper
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
29 * prototype in scope.
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
30 */
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
31 #define STORE_ALL /**/
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
32 #define REST_ALL /**/
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
33 #else
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
34 #define STORE_ALL \
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
35 __asm__( \
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 "push %%ebx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
37 "push %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
38 "push %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
39 "push %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
40 "push %%edi\n\t"::)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
41
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
42 #define REST_ALL \
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
43 __asm__( \
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
44 "pop %%edi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 "pop %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 "pop %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 "pop %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 "pop %%ebx\n\t"::)
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
49 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 static DWORD dwDrvID = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 LRESULT WINAPI SendDriverMessage( HDRVR hDriver, UINT message,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 LPARAM lParam1, LPARAM lParam2 )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 DRVR* module=(DRVR*)hDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 int result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62 #ifdef DETAILED_OUT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 printf("SendDriverMessage: driver %X, message %X, arg1 %X, arg2 %X\n", hDriver, message, lParam1, lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 if(module==0)return -1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 if(module->hDriverModule==0)return -1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 if(module->DriverProc==0)return -1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 result=module->DriverProc(module->dwDriverID,1,message,lParam1,lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 #ifdef DETAILED_OUT
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 printf("\t\tResult: %X\n", result);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 return result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 static NPDRVR DrvAlloc(HDRVR*lpDriver, LPUINT lpDrvResult)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 NPDRVR npDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 /* allocate and lock handle */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 if (lpDriver)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 if ( (*lpDriver = (HDRVR) malloc(sizeof(DRVR))) )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 if ((npDriver = (NPDRVR) *lpDriver))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 *lpDrvResult = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 return (npDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 free((NPDRVR)*lpDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 return (*lpDrvResult = MMSYSERR_NOMEM, (NPDRVR) 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 return (*lpDrvResult = MMSYSERR_INVALPARAM, (NPDRVR) 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 static void DrvFree(HDRVR hDriver)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 int i;
2068
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
101 Setup_FS_Segment();
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 if(hDriver)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 if(((DRVR*)hDriver)->hDriverModule)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 if(((DRVR*)hDriver)->DriverProc)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 (((DRVR*)hDriver)->DriverProc)(((DRVR*)hDriver)->dwDriverID, hDriver, DRV_CLOSE, 0, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 if(hDriver) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 if(((DRVR*)hDriver)->hDriverModule)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 if(((DRVR*)hDriver)->DriverProc)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109 (((DRVR*)hDriver)->DriverProc)(0, hDriver, DRV_FREE, 0, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 FreeLibrary(((DRVR*)hDriver)->hDriverModule);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 free((NPDRVR)hDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 return;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 void DrvClose(HDRVR hdrvr)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 DrvFree(hdrvr);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 char* win32_codec_name=NULL; // must be set before calling DrvOpen() !!!
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 340
diff changeset
124 HDRVR VFWAPI
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 DrvOpen(LPARAM lParam2)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 ICOPEN *icopen=(ICOPEN *) lParam2;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 UINT uDrvResult;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 HDRVR hDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 NPDRVR npDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 char unknown[0x24];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 // char* codec_name=icopen->fccHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133
236
a2c9731b2e01 Setup_FS_Segment() for VoxWare audio
arpi_esp
parents: 185
diff changeset
134 Setup_LDT_Keeper();
a2c9731b2e01 Setup_FS_Segment() for VoxWare audio
arpi_esp
parents: 185
diff changeset
135
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 if (!(npDriver = DrvAlloc(&hDriver, &uDrvResult)))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 return ((HDRVR) 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138
3465
4dad31e655b6 avifile merge. kabi: indent changes really suxxxx
arpi
parents: 2068
diff changeset
139 if (!(npDriver->hDriverModule = LoadLibraryA(win32_codec_name))) {
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 printf("Can't open library %s\n", win32_codec_name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 DrvFree(hDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 return ((HDRVR) 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 #if 0
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 unsigned char *p=((char*)npDriver->hDriverModule);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 double *dp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 int i;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 p+=0x14c0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 for(i=0;i<16;i++)printf(" %02X",p[i]); printf("\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 dp=(double*)p;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 printf("divx bitrate = %f\n",(float)(*dp));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 // *(double*)((char*)npDriver->hDriverModule+0x14c0)=bitrate;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 if (!(npDriver->DriverProc = (DRIVERPROC)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 GetProcAddress(npDriver->hDriverModule, "DriverProc"))) {
185
b2dfe79ffb9f disabled DirectShow loader - use libDS_Filter instead
arpi_esp
parents: 128
diff changeset
160 #if 1
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 printf("Library %s is not a VfW/ACM valid codec\n", win32_codec_name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 #else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 // Try DirectShow...
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 GETCLASS func=(GETCLASS)GetProcAddress(npDriver->hDriverModule,"DllGetClassObject");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 if(!func)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 printf("Library %s is not a valid VfW/ACM/DShow codec\n", win32_codec_name);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 HRESULT result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 struct IClassFactory* factory=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 struct IUnknown* object=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 GUID CLSID_Voxware={0x73f7a062, 0x8829, 0x11d1,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 {0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d}};
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 GUID* id=&CLSID_Voxware;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 result=func(id, &IID_IClassFactory, (void**)&factory);
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 236
diff changeset
176 if(result || (!factory)) printf("No such class object (wrong/missing GUID?)\n");
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 printf("Calling factory->vt->CreateInstance()\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 printf("addr = %X\n",(unsigned int)factory->vt->CreateInstance);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 result=factory->vt->CreateInstance(factory, 0, &IID_IUnknown, (void**)&object);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 printf("Calling factory->vt->Release()\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 factory->vt->Release((struct IUnknown*)factory);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 if(result || (!object)) printf("Class factory failure\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185 printf("DirectShow codecs not yet supported...\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 #endif
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 FreeLibrary(npDriver->hDriverModule);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 DrvFree(hDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 return ((HDRVR) 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 //TRACE("DriverProc == %X\n", npDriver->DriverProc);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 npDriver->dwDriverID = ++dwDrvID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197
2068
3189c317dfc1 using ldt_keeper instead of setup_fs, includes changed
arpi
parents: 1307
diff changeset
198 Setup_FS_Segment();
236
a2c9731b2e01 Setup_FS_Segment() for VoxWare audio
arpi_esp
parents: 185
diff changeset
199
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 (npDriver->DriverProc)(0, hDriver, DRV_LOAD, 0, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 //TRACE("DRV_LOAD Ok!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 (npDriver->DriverProc)(0, hDriver, DRV_ENABLE, 0, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 //TRACE("DRV_ENABLE Ok!\n");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 // open driver
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 npDriver->dwDriverID=(npDriver->DriverProc)(npDriver->dwDriverID, hDriver, DRV_OPEN,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 (LPARAM) (LPSTR) unknown, lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 //TRACE("DRV_OPEN Ok!(%X)\n", npDriver->dwDriverID);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 if (uDrvResult)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 DrvFree(hDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 hDriver = (HDRVR) 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222
340
1f7c824033fb less, and more informal printfs
arpi_esp
parents: 236
diff changeset
223 // printf("Successfully loaded codec %s\n",win32_codec_name);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 return (hDriver);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227