Added case for GCW_ATOM int GetClassLong32A.
[wine.git] / multimedia / msvideo.c
blob177803d91c257b1b48be0f93428693ed6686b752
1 /*
2 * Copyright 1998 Marcus Meissner
3 */
4 #include <stdio.h>
6 #include "windows.h"
7 #include "driver.h"
8 #include "mmsystem.h"
9 #include "ole2.h"
10 #include "vfw.h"
11 #include "debug.h"
13 /****************************************************************************
14 * VideoForWindowsVersion [MSVFW32.2][MSVIDEO.2]
15 * Returns the version in major.minor form.
16 * In Windows95 this returns 0x040003b6 (4.950)
18 DWORD WINAPI
19 VideoForWindowsVersion(void) {
20 return 0x040003B6; /* 4.950 */
23 /* system.ini: [drivers32] */
25 /**************************************************************************
26 * ICInfo [MSVFW32.33]
27 * Get information about an installable compressor. Return TRUE if there
28 * is one.
30 BOOL32 WINAPI
31 ICInfo32(
32 DWORD fccType, /* [in] type of compressor ('vidc') */
33 DWORD fccHandler, /* [in] <n>th compressor */
34 ICINFO32 *lpicinfo /* [out] information about compressor */
35 ) {
36 char type[5],buf[2000];
38 memcpy(type,&fccType,4);type[4]=0;
39 TRACE(mmsys,"(%s,%ld,%p).\n",type,fccHandler,lpicinfo);
40 /* does OpenDriver/CloseDriver */
41 lpicinfo->dwSize = sizeof(ICINFO32);
42 lpicinfo->fccType = fccType;
43 lpicinfo->dwFlags = 0;
44 if (GetPrivateProfileString32A("drivers32",NULL,NULL,buf,2000,"system.ini")) {
45 char *s = buf;
46 while (*s) {
47 if (!lstrncmpi32A(type,s,4)) {
48 if(!fccHandler--) {
49 lpicinfo->fccHandler = mmioStringToFOURCC32A(s+5,0);
50 return TRUE;
53 s=s+lstrlen32A(s)+1; /* either next char or \0 */
56 return FALSE;
59 /**************************************************************************
60 * ICOpen [MSVFW32.37]
61 * Opens an installable compressor. Return special handle.
63 HIC32 WINAPI
64 ICOpen32(DWORD fccType,DWORD fccHandler,UINT32 wMode) {
65 char type[5],handler[5],codecname[20];
66 ICOPEN icopen;
67 HDRVR32 hdrv;
68 WINE_HIC *whic;
70 memcpy(type,&fccType,4);type[4]=0;
71 memcpy(handler,&fccHandler,4);handler[4]=0;
72 TRACE(mmsys,"(%s,%s,0x%08lx)\n",type,handler,(DWORD)wMode);
73 sprintf(codecname,"%s.%s",type,handler);
74 hdrv=OpenDriver32A(codecname,"drivers32",0);
75 if (!hdrv)
76 return 0;
77 whic = HeapAlloc(GetProcessHeap(),0,sizeof(WINE_HIC));
78 whic->hdrv = hdrv;
79 whic->driverproc= GetProcAddress32(GetDriverModuleHandle32(hdrv),"DriverProc");
80 /* Well, lParam2 is in fact a LPVIDEO_OPEN_PARMS, but it has the
81 * same layout as ICOPEN
83 icopen.fccType = fccType;
84 icopen.fccHandler = fccHandler;
85 icopen.dwSize = sizeof(ICOPEN);
86 /* FIXME: fill out rest too... */
87 whic->private = whic->driverproc(0,hdrv,DRV_OPEN,0,&icopen);
88 return (HIC32)whic;
91 LRESULT WINAPI
92 ICGetInfo32(HIC32 hic,ICINFO32 *picinfo,DWORD cb) {
93 LRESULT ret;
94 WINE_HIC *whic = (WINE_HIC*)hic;
96 TRACE(mmsys,"(0x%08lx,%p,%ld)\n",(DWORD)hic,picinfo,cb);
97 ret = ICSendMessage32(whic,ICM_GETINFO,(DWORD)picinfo,cb);
98 TRACE(mmsys," -> 0x%08lx\n",ret);
99 return ret;
103 HIC32 WINAPI
104 ICLocate(DWORD fccType, DWORD fccHandler, LPBITMAPINFOHEADER lpbiIn,
105 LPBITMAPINFOHEADER lpbiOut, WORD wFlags
107 FIXME(mmsys,"stub!\n");
108 return 0;
111 LRESULT VFWAPI
112 ICSendMessage32(HIC32 hic,UINT32 msg,DWORD lParam1,DWORD lParam2) {
113 LRESULT ret;
114 WINE_HIC *whic = (WINE_HIC*)hic;
116 switch (msg) {
117 case ICM_GETINFO:
118 FIXME(mmsys,"(0x%08lx,ICM_GETINFO,0x%08lx,0x%08lx)\n",(DWORD)hic,lParam1,lParam2);
119 break;
120 default:
121 FIXME(mmsys,"(0x%08lx,0x%08lx,0x%08lx,0x%08lx)\n",(DWORD)hic,(DWORD)msg,lParam1,lParam2);
123 ret = whic->driverproc(whic->private,whic->hdrv,msg,lParam1,lParam2);
124 FIXME(mmsys," -> 0x%08lx\n",ret);
125 return ret;
129 DWORD VFWAPIV ICDrawBegin32(
130 HIC32 hic,
131 DWORD dwFlags,/* flags */
132 HPALETTE32 hpal, /* palette to draw with */
133 HWND32 hwnd, /* window to draw to */
134 HDC32 hdc, /* HDC to draw to */
135 INT32 xDst, /* destination rectangle */
136 INT32 yDst,
137 INT32 dxDst,
138 INT32 dyDst,
139 LPBITMAPINFOHEADER lpbi, /* format of frame to draw */
140 INT32 xSrc, /* source rectangle */
141 INT32 ySrc,
142 INT32 dxSrc,
143 INT32 dySrc,
144 DWORD dwRate, /* frames/second = (dwRate/dwScale) */
145 DWORD dwScale) {
146 return 0;
149 HANDLE32 /* HDRAWDIB */ WINAPI
150 DrawDibOpen32( void ) {
151 FIXME(mmsys,"stub!\n");
152 return 0;
154 HWND32 VFWAPIV MCIWndCreate32 (HWND32 hwndParent, HINSTANCE32 hInstance,
155 DWORD dwStyle,LPVOID szFile)
156 { FIXME(mmsys,"%x %x %lx %p\n",hwndParent, hInstance, dwStyle, szFile);
157 return 0;
159 HWND32 VFWAPIV MCIWndCreate32A(HWND32 hwndParent, HINSTANCE32 hInstance,
160 DWORD dwStyle,LPCSTR szFile)
161 { FIXME(mmsys,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, szFile);
162 return 0;
164 HWND32 VFWAPIV MCIWndCreate32W(HWND32 hwndParent, HINSTANCE32 hInstance,
165 DWORD dwStyle,LPCWSTR szFile)
166 { FIXME(mmsys,"%x %x %lx %s\n",hwndParent, hInstance, dwStyle, debugstr_w(szFile));
167 return 0;