annotate loader/vfl.c @ 6359:25258fe789e8

pncrt.dll used by realplayer8 codecs
author arpi
date Sun, 09 Jun 2002 17:52:30 +0000
parents ce45cce7f7a5
children e2fcdd7608b1
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
1 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
2 * Copyright 1998 Marcus Meissner
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 #include <config.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 #include <stdio.h>
1312
cca0d2481b7e Fix two prototype warnings
jkeil
parents: 1307
diff changeset
7 #include <stdlib.h>
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
8 #include <string.h>
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
10 #include "win32.h"
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
11 #include "loader.h"
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
12
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 #include "wine/winbase.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 #include "wine/windef.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 #include "wine/winuser.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
16 #include "wine/vfw.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
17 #include "wine/winestring.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 #include "wine/driver.h"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19 #include "wine/avifmt.h"
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
20 #include "driver.h"
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
21
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
22
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 #define FIXME_(X) printf
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
24 #define FIXME printf
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
25
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
26 #define OpenDriverA DrvOpen
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
27 #define CloseDriver DrvClose
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
28
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
29 long VFWAPI VideoForWindowsVersion(void);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
30
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
31
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
32 #if 1
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
33 /*
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
34 * 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: 1297
diff changeset
35 * WINAPI/no-WINAPI bustage.
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
36 *
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
37 * 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: 1297
diff changeset
38 * 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: 1297
diff changeset
39 * 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: 1297
diff changeset
40 * prototype in scope.
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
41 */
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
42 #define STORE_ALL /**/
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
43 #define REST_ALL /**/
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
44 #else
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
45 #define STORE_ALL \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 __asm__ ( \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 "push %%ebx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
48 "push %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
49 "push %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 "push %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 "push %%edi\n\t"::)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
52
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
53 #define REST_ALL \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
54 __asm__ ( \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 "pop %%edi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 "pop %%esi\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 "pop %%edx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 "pop %%ecx\n\t" \
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 "pop %%ebx\n\t"::)
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
60 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
62
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
64 * VideoForWindowsVersion [MSVFW.2][MSVIDEO.2]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 * Returns the version in major.minor form.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 * In Windows95 this returns 0x040003b6 (4.950)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
68 long VideoForWindowsVersion(void) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 return 0x040003B6; /* 4.950 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
70 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 /* system.ini: [drivers] */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
73
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
74 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 * ICInfo [MSVFW.33]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 * Get information about an installable compressor. Return TRUE if there
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 * is one.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
78 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
79 int VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 ICInfo(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
81 long fccType, /* [in] type of compressor ('vidc') */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 long fccHandler, /* [in] <n>th compressor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 ICINFO *lpicinfo /* [out] information about compressor */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 char type[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 /* does OpenDriver/CloseDriver */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 lpicinfo->dwSize = sizeof(ICINFO);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 lpicinfo->fccType = fccType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
92 lpicinfo->dwFlags = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 if (GetPrivateProfileStringA("drivers32",NULL,NULL,buf,2000,"system.ini")) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
95 char *s = buf;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 while (*s) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 if (!lstrncmpiA(type,s,4)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 if(!fccHandler--) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99 lpicinfo->fccHandler = mmioStringToFOURCCA(s+5,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 return TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 s=s+lstrlenA(s)+1;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
106 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 return TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
109
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
111 * ICOpen [MSVFW.37]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 * Opens an installable compressor. Return special handle.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
113 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
114 HIC VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
115 ICOpen(long fccType,long fccHandler,unsigned int wMode) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
116 char type[5],handler[5],codecname[20];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 ICOPEN icopen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 HDRVR hdrv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 WINE_HIC *whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122 memcpy(handler,&fccHandler,4);handler[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123
1096
bf973bffe240 some possible buffer overflow places fixed
al3x
parents: 597
diff changeset
124 snprintf(codecname,20,"%s.%s",type,handler);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
126 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 * same layout as ICOPEN
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 icopen.fccType = fccType;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
130 icopen.fccHandler = fccHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 icopen.dwSize = sizeof(ICOPEN);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 icopen.dwFlags = wMode;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 /* FIXME: do we need to fill out the rest too? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 // hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 hdrv=OpenDriverA((long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 /*
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 if (!hdrv) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 if (!strcasecmp(type,"vids")) {
1096
bf973bffe240 some possible buffer overflow places fixed
al3x
parents: 597
diff changeset
139 snprintf(codecname,20,"vidc.%s",handler);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 fccType = mmioFOURCC('v','i','d','c');
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
141 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 // hdrv=OpenDriverA(codecname,"drivers32",(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
143 hdrv=OpenDriverA((long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
144 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
145 if (!hdrv)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 // }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 whic = (WINE_HIC*)my_mreq(sizeof(WINE_HIC), 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 whic->hdrv = hdrv;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 whic->driverproc= ((DRVR*)hdrv)->DriverProc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
151 // whic->private = ICSendMessage((HIC)whic,DRV_OPEN,0,(long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 whic->private = ((DRVR*)hdrv)->dwDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 return (HIC)whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
155
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 * ICOpenFunction [MSVFW.38]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
158 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 HIC VFWAPI ICOpenFunction(long fccType, long fccHandler, unsigned int wMode,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 void* lpfnHandler) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
161 char type[5],handler[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 HIC hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
163 WINE_HIC *whic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 memcpy(type,&fccType,4);type[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166 memcpy(handler,&fccHandler,4);handler[4]=0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 FIXME("(%s,%s,%d,%p), stub!\n",type,handler,wMode,lpfnHandler);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 hic = ICOpen(fccType,fccHandler,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 if (!hic)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 whic->driverproc = (DRIVERPROC)lpfnHandler;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
177 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 * ICGetInfo [MSVFW.30]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
179 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 LRESULT VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 ICGetInfo(HIC hic,ICINFO *picinfo,long cb) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
182 LRESULT ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 ret = ICSendMessage(hic,ICM_GETINFO,(long)picinfo,cb);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 * ICLocate [MSVFW.35]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 HIC VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 ICLocate(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 long fccType, long fccHandler, LPBITMAPINFOHEADER lpbiIn,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195 LPBITMAPINFOHEADER lpbiOut, short wMode
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 char type[5],handler[5];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198 HIC hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 long querymsg;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
201 switch (wMode) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
202 case ICMODE_FASTCOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 case ICMODE_COMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 querymsg = ICM_COMPRESS_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
205 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 case ICMODE_DECOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 case ICMODE_FASTDECOMPRESS:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
208 querymsg = ICM_DECOMPRESS_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
209 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
210 case ICMODE_DRAW:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
211 querymsg = ICM_DRAW_QUERY;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 default:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 FIXME("Unknown mode (%d)\n",wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218 /* Easy case: handler/type match, we just fire a query and return */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
219 hic = ICOpen(fccType,fccHandler,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
220 if (hic) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 if (!ICSendMessage(hic,querymsg,(long)lpbiIn,(long)lpbiOut))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 ICClose(hic);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
224 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 type[4]='\0';memcpy(type,&fccType,4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 handler[4]='\0';memcpy(handler,&fccHandler,4);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 if (fccType==streamtypeVIDEO) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 hic = ICLocate(ICTYPE_VIDEO,fccHandler,lpbiIn,lpbiOut,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
229 if (hic)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 return hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 FIXME("(%s,%s,%p,%p,0x%04x),unhandled!\n",type,handler,lpbiIn,lpbiOut,wMode);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 * ICCompress [MSVFW.23]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
238 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 long VFWAPIV
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 ICCompress(
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241 HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiOutput,void* lpData,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 LPBITMAPINFOHEADER lpbiInput,void* lpBits,long* lpckid,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 long* lpdwFlags,long lFrameNum,long dwFrameSize,long dwQuality,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 LPBITMAPINFOHEADER lpbiPrev,void* lpPrev
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 ) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 ICCOMPRESS iccmp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
248 iccmp.dwFlags = dwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 iccmp.lpbiOutput = lpbiOutput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 iccmp.lpOutput = lpData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
252 iccmp.lpbiInput = lpbiInput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 iccmp.lpInput = lpBits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
255 iccmp.lpckid = lpckid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 iccmp.lpdwFlags = lpdwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
257 iccmp.lFrameNum = lFrameNum;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 iccmp.dwFrameSize = dwFrameSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 iccmp.dwQuality = dwQuality;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260 iccmp.lpbiPrev = lpbiPrev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261 iccmp.lpPrev = lpPrev;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262 return ICSendMessage(hic,ICM_COMPRESS,(long)&iccmp,sizeof(iccmp));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
263 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
264
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
265 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 * ICDecompress [MSVFW.26]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268 long VFWAPIV
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 ICDecompress(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
270 ICDECOMPRESS icd;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 int result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
272 icd.dwFlags = dwFlags;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
273 icd.lpbiInput = lpbiFormat;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 icd.lpInput = lpData;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
275
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 icd.lpbiOutput = lpbi;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277 icd.lpOutput = lpBits;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
278 icd.ckid = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
280 result=ICSendMessage(hic,ICM_DECOMPRESS,(long)&icd,sizeof(icd));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
281 REST_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
282 return result;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
284
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
285 /***********************************************************************
1297
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
286 * ICDecompressEx [MSVFW.26]
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
287 */
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
288 long VFWAPIV
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
289 ICDecompressEx(HIC hic,long dwFlags,LPBITMAPINFOHEADER lpbiFormat,void* lpData,LPBITMAPINFOHEADER lpbi,void* lpBits) {
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
290 ICDECOMPRESSEX icd;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
291 int result;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
292
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
293 icd.dwFlags = dwFlags;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
294
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
295 icd.lpbiSrc = lpbiFormat;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
296 icd.lpSrc = lpData;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
297
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
298 icd.lpbiDst = lpbi;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
299 icd.lpDst = lpBits;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
300
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
301 icd.xSrc=icd.ySrc=0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
302 icd.dxSrc=lpbiFormat->biWidth;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
303 icd.dySrc=abs(lpbiFormat->biHeight);
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
304
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
305 icd.xDst=icd.yDst=0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
306 icd.dxDst=lpbi->biWidth;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
307 icd.dyDst=abs(lpbi->biHeight);
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
308
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
309 //icd.ckid = 0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
310 STORE_ALL;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
311 result=ICSendMessage(hic,ICM_DECOMPRESSEX,(long)&icd,sizeof(icd));
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
312 REST_ALL;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
313 return result;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
314 }
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
315
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
316 long VFWAPIV
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
317 ICUniversalEx(HIC hic,int command,LPBITMAPINFOHEADER lpbiFormat,LPBITMAPINFOHEADER lpbi) {
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
318 ICDECOMPRESSEX icd;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
319 int result;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
320
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
321 icd.dwFlags = 0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
322
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
323 icd.lpbiSrc = lpbiFormat;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
324 icd.lpSrc = 0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
325
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
326 icd.lpbiDst = lpbi;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
327 icd.lpDst = 0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
328
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
329 icd.xSrc=icd.ySrc=0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
330 icd.dxSrc=lpbiFormat->biWidth;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
331 icd.dySrc=abs(lpbiFormat->biHeight);
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
332
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
333 icd.xDst=icd.yDst=0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
334 icd.dxDst=lpbi->biWidth;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
335 icd.dyDst=abs(lpbi->biHeight);
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
336
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
337 //icd.ckid = 0;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
338 STORE_ALL;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
339 result=ICSendMessage(hic,command,(long)&icd,sizeof(icd));
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
340 REST_ALL;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
341 return result;
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
342 }
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
343
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
344
200c03672178 VfwEx support
arpi
parents: 1096
diff changeset
345 /***********************************************************************
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 * ICSendMessage [MSVFW.40]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 LRESULT VFWAPI
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 ICSendMessage(HIC hic,unsigned int msg,long lParam1,long lParam2) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 LRESULT ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351 WINE_HIC *whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 char qw[200];
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353
2069
ce45cce7f7a5 sync with avifile
arpi
parents: 1312
diff changeset
354 // printf("ICSendMessage.whic=%p\n",whic);
ce45cce7f7a5 sync with avifile
arpi
parents: 1312
diff changeset
355
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
356 #if 0
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 __asm__ __volatile__ ("fsave (%0)\n\t": :"r"(&qw));
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
358 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359 STORE_ALL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 /*__asm__
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 (
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 "pushl %eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363 "movl $0xf,%eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364 "movw %ax, %fs\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 "popl %eax\n\t"
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 );*/
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367 ret = whic->driverproc(whic->private,1,msg,lParam1,lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368 REST_ALL;
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
369 #if 0
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 __asm__ __volatile__ ("frstor (%0)\n\t": :"r"(&qw));
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1297
diff changeset
371 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 // } else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 // ret = SendDriverMessage(whic->hdrv,msg,lParam1,lParam2);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 // TRACE(" -> 0x%08lx\n",ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 * ICClose [MSVFW.22]
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
382 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 LRESULT VFWAPI ICClose(HIC hic) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 WINE_HIC *whic = (WINE_HIC*)hic;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385 /* FIXME: correct? */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
386 // CloseDriver(whic->hdrv,0,0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
387 DrvClose(whic->hdrv);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 //#warning FIXME: DrvClose
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389 my_release(whic);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
390 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
391 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392 int VFWAPI ICDoSomething()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 return 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396