annotate loader/afl.c @ 34115:3d7ee643b110

Port to Wine. This makes MPlayer and the GUI compile and run as a Wine executable, which is mainly to allow Windows code checking in a Linux environment. In Makefile: Generalize the windres call by specifying option "-o" for the output file. In gui/win32/interface.c: Use the same function to create a thread as Cygwin, and convert Windows style file names so that they are accessible in the Linux environment. In osdep/priority.c: Include windows.h. In configure: Add system "Wine" which shall be considered (mostly) a win32 system. Since winegcc by default compiles all files with the "-fpic" flag, remove it, and remove all MinGW compatibility WIN32 defines, because we're not compiling for real Windows. Define to not use Windows sockets (Wine uses different ones) and replace Windows' stricmp by strcasecmp. Ensure that yasm's object format isn't win32 and that HAVE_LINUX_DVD_STRUCT will be defined. In stream/tvi_dshow.c: Define MP_DEFINE_LOCAL_GUID, because Wine's DEFINE_GUID macro isn't compatible using "static" with it. In loader/com.h: Rename the IIDs to become local ones, because Wine's unknwn.h not only declares but defines them. In mplayer.c: Don't define a SIGSEGV signal handler, or the Wine executable will crash.
author ib
date Sat, 15 Oct 2011 13:20:52 +0000
parents 8fa2f43cb760
children
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
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
3
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
4 This file will contain an interface to ACM drivers.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
5 Its content will be based mainly on wine/dlls/msacm32
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
6 actually, for audio decompression only the following functions
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
7 are needed:
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
8
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
9 acmStreamOpen ( takes formats of src and dest, returns stream handle )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
10 acmStreamPrepareHeader ( takes stream handler and info on data )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
11 acmStreamConvert ( the same as PrepareHeader )
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
12 acmStreamUnprepareHeader
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
13 acmStreamClose
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
14 acmStreamSize
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
15 maybe acmStreamReset
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
16
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
17 In future I'll also add functions for format enumeration,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
18 but not right now.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
19
18783
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
20 Modified for use with MPlayer, detailed changelog at
0783dd397f74 CVS --> Subversion in copyright notices
diego
parents: 15166
diff changeset
21 http://svn.mplayerhq.hu/mplayer/trunk/
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
22
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
23 ***************************************************************************/
2069
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
24 #include "config.h"
21261
a2e02e6b6379 Rename config.h --> debug.h and include config.h explicitly.
diego
parents: 18878
diff changeset
25 #include "debug.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
26
2069
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
27 #include "wine/winbase.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
28 #include "wine/windef.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
29 #include "wine/winuser.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
30 #include "wine/vfw.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
31 #include "wine/winestring.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
32 #include "wine/driver.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
33 #include "wine/winerror.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
34 #include "wine/msacm.h"
ce45cce7f7a5 sync with avifile
arpi
parents: 1307
diff changeset
35 #include "wine/msacmdrv.h"
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
36 #include "wineacm.h"
9978
11cee15b1a8f last mingw32 support patch by Sascha Sommer
alex
parents: 9961
diff changeset
37 #ifndef __MINGW32__
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1
diff changeset
38 #include "ext.h"
9978
11cee15b1a8f last mingw32 support patch by Sascha Sommer
alex
parents: 9961
diff changeset
39 #endif
26999
0b21ffa03b9c Rename loader/driver.[ch] to loader/drv.[ch], otherwise loader/driver.h can
diego
parents: 25849
diff changeset
40 #include "drv.h"
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1
diff changeset
41
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
42 #include <stdio.h>
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
43 #include <stdlib.h>
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
44 #include <string.h>
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
45 #pragma pack(1)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
46 #define OpenDriverA DrvOpen
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
47 #define CloseDriver DrvClose
1307
d8c1b0b38edc Add prototypes to wine/loader stuff, so that we can catch __stdcall function
jkeil
parents: 1
diff changeset
48
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
49 static inline PWINE_ACMSTREAM ACM_GetStream(HACMSTREAM has)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
50 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
51 return (PWINE_ACMSTREAM)has;
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 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
55 * acmDriverAddA (MSACM32.2)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
56 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
57 MMRESULT WINAPI acmDriverAddA(PHACMDRIVERID phadid, HINSTANCE hinstModule,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
58 LPARAM lParam, DWORD dwPriority, DWORD fdwAdd)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
59 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
60 if (!phadid)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
61 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
62
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
63 /* Check if any unknown flags */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
64 if (fdwAdd &
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
65 ~(ACM_DRIVERADDF_FUNCTION|ACM_DRIVERADDF_NOTIFYHWND|
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
66 ACM_DRIVERADDF_GLOBAL))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
67 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
68
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
69 /* Check if any incompatible flags */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
70 if ((fdwAdd & ACM_DRIVERADDF_FUNCTION) &&
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
71 (fdwAdd & ACM_DRIVERADDF_NOTIFYHWND))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
72 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
73
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
74 /* FIXME: in fact, should GetModuleFileName(hinstModule) and do a
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
75 * LoadDriver on it, to be sure we can call SendDriverMessage on the
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
76 * hDrvr handle.
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
77 */
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
78 *phadid = (HACMDRIVERID) MSACM_RegisterDriver(NULL, 0, hinstModule);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
79
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
80 /* FIXME: lParam, dwPriority and fdwAdd ignored */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
81
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
82 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
83 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
84
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
85 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
86 * acmDriverClose (MSACM32.4)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
87 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
88 MMRESULT WINAPI acmDriverClose(HACMDRIVER had, DWORD fdwClose)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
89 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
90 PWINE_ACMDRIVER p;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
91 PWINE_ACMDRIVER* tp;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
92
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
93 if (fdwClose)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
94 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
95
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
96 p = MSACM_GetDriver(had);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
97 if (!p)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
98 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
99
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
100 for (tp = &(p->obj.pACMDriverID->pACMDriverList); *tp; *tp = (*tp)->pNextACMDriver) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
101 if (*tp == p) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
102 *tp = (*tp)->pNextACMDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
103 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
104 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
105 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
106
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
107 if (p->hDrvr && !p->obj.pACMDriverID->pACMDriverList)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
108 CloseDriver(p->hDrvr);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
109
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
110 HeapFree(MSACM_hHeap, 0, p);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
111
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
112 return MMSYSERR_NOERROR;
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 * acmDriverEnum (MSACM32.7)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
117 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
118 MMRESULT WINAPI acmDriverEnum(ACMDRIVERENUMCB fnCallback, DWORD dwInstance, DWORD fdwEnum)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
119 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
120 PWINE_ACMDRIVERID p;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
121 DWORD fdwSupport;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
122
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
123 if (!fnCallback) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
124 return MMSYSERR_INVALPARAM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
125 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
126
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
127 if (fdwEnum && ~(ACM_DRIVERENUMF_NOLOCAL|ACM_DRIVERENUMF_DISABLED)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
128 return MMSYSERR_INVALFLAG;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
129 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
130
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
131 for (p = MSACM_pFirstACMDriverID; p; p = p->pNextACMDriverID) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
132 fdwSupport = ACMDRIVERDETAILS_SUPPORTF_CODEC;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
133 if (!p->bEnabled) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
134 if (fdwEnum & ACM_DRIVERENUMF_DISABLED)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
135 fdwSupport |= ACMDRIVERDETAILS_SUPPORTF_DISABLED;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
136 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
137 continue;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
138 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
139 (*fnCallback)((HACMDRIVERID) p, dwInstance, fdwSupport);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
140 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
141
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
142 return MMSYSERR_NOERROR;
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 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
146 * acmDriverID (MSACM32.8)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
147 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
148 MMRESULT WINAPI acmDriverID(HACMOBJ hao, PHACMDRIVERID phadid, DWORD fdwDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
149 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
150 PWINE_ACMOBJ pao;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
151
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
152 pao = MSACM_GetObj(hao);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
153 if (!pao)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
154 return MMSYSERR_INVALHANDLE;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
155
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
156 if (!phadid)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
157 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
158
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
159 if (fdwDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
160 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
161
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
162 *phadid = (HACMDRIVERID) pao->pACMDriverID;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
163
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
164 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
165 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
166
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
167 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
168 * acmDriverMessage (MSACM32.9)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
169 * FIXME
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
170 * Not implemented
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
171 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
172 LRESULT WINAPI acmDriverMessage(HACMDRIVER had, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
173 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
174 PWINE_ACMDRIVER pad = MSACM_GetDriver(had);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
175 if (!pad)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
176 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
177
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
178 /* FIXME: Check if uMsg legal */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
179
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
180 if (!SendDriverMessage(pad->hDrvr, uMsg, lParam1, lParam2))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
181 return MMSYSERR_NOTSUPPORTED;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
182
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
183 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
184 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
185
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
186
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
187 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
188 * acmDriverOpen (MSACM32.10)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
189 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
190 MMRESULT WINAPI acmDriverOpen(PHACMDRIVER phad, HACMDRIVERID hadid, DWORD fdwOpen)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
191 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
192 PWINE_ACMDRIVERID padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
193 PWINE_ACMDRIVER pad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
194 ICOPEN icopen;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
195
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
196
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
197 TRACE("(%p, %x, %08lu)\n", phad, hadid, fdwOpen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
198
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
199 if (!phad)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
200 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
201
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
202 padid = MSACM_GetDriverID(hadid);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
203 if (!padid)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
204 return MMSYSERR_INVALHANDLE;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
205
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
206 if (fdwOpen)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
207 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
208
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
209 pad = (PWINE_ACMDRIVER) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVER));
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
210 if (!pad)
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
211 return MMSYSERR_NOMEM;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
212
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
213 pad->obj.pACMDriverID = padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
214 icopen.fccType = mmioFOURCC('a', 'u', 'd', 'c');
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
215 icopen.fccHandler = (long)padid->pszFileName;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
216 icopen.dwSize = sizeof(ICOPEN);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
217 icopen.dwFlags = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
218
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
219 icopen.pV1Reserved = padid->pszFileName;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
220 if (!padid->hInstModule)
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
221 pad->hDrvr = OpenDriverA((long)&icopen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
222 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
223 pad->hDrvr = padid->hInstModule;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
224
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
225 if (!pad->hDrvr) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
226 HeapFree(MSACM_hHeap, 0, pad);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
227 return MMSYSERR_ERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
228 }
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
229
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
230 pad->pfnDriverProc = GetProcAddress(pad->hDrvr, "DriverProc");
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
231
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
232 /* insert new pad at beg of list */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
233 pad->pNextACMDriver = padid->pACMDriverList;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
234 padid->pACMDriverList = pad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
235
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
236 /* FIXME: Create a WINE_ACMDRIVER32 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
237 *phad = (HACMDRIVER)pad;
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
238
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
239 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
240 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
241
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
242 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
243 * acmDriverRemove (MSACM32.12)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
244 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
245 MMRESULT WINAPI acmDriverRemove(HACMDRIVERID hadid, DWORD fdwRemove)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
246 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
247 PWINE_ACMDRIVERID padid;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
248
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
249 padid = MSACM_GetDriverID(hadid);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
250 if (!padid)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
251 return MMSYSERR_INVALHANDLE;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
252
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
253 if (fdwRemove)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
254 return MMSYSERR_INVALFLAG;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
255
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
256 MSACM_UnregisterDriver(padid);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
257
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
258 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
259 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
260
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
261
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
262
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 HANDLE MSACM_hHeap = (HANDLE) NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
266 PWINE_ACMDRIVERID MSACM_pFirstACMDriverID = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
267 PWINE_ACMDRIVERID MSACM_pLastACMDriverID = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
268
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
269 /***********************************************************************
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
270 * MSACM_RegisterDriver32()
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
271 */
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
272 PWINE_ACMDRIVERID MSACM_RegisterDriver(const char* pszFileName,
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
273 WORD wFormatTag,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
274 HINSTANCE hinstModule)
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
275 {
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
276 PWINE_ACMDRIVERID padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
277
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
278 TRACE("('%s', '%x', 0x%08x)\n", pszFileName, wFormatTag, hinstModule);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
279
9961
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
280 #ifndef WIN32_LOADER
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
281 MSACM_hHeap = GetProcessHeap();
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
282 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
283 padid = (PWINE_ACMDRIVERID) HeapAlloc(MSACM_hHeap, 0, sizeof(WINE_ACMDRIVERID));
18878
3bf0d70b4c7f rm unnecesary casts from void* - part 2
reynaldo
parents: 18783
diff changeset
284 padid->pszFileName = malloc(strlen(pszFileName)+1);
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
285 strcpy(padid->pszFileName, pszFileName);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
286 // 1~strdup(pszDriverAlias);
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
287 padid->wFormatTag = wFormatTag;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
288 padid->hInstModule = hinstModule;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
289 padid->bEnabled = TRUE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
290 padid->pACMDriverList = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
291 padid->pNextACMDriverID = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
292 padid->pPrevACMDriverID = MSACM_pLastACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
293 if (MSACM_pLastACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
294 MSACM_pLastACMDriverID->pNextACMDriverID = padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
295 MSACM_pLastACMDriverID = padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
296 if (!MSACM_pFirstACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
297 MSACM_pFirstACMDriverID = padid;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
298
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
299 return padid;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
300 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
301
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
302
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
303 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
304 * MSACM_UnregisterDriver32()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
305 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
306 PWINE_ACMDRIVERID MSACM_UnregisterDriver(PWINE_ACMDRIVERID p)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
307 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
308 PWINE_ACMDRIVERID pNextACMDriverID;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
309
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
310 while (p->pACMDriverList)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
311 acmDriverClose((HACMDRIVER) p->pACMDriverList, 0);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
312
32537
8fa2f43cb760 Remove most of the NULL pointer check before free all over the code
cboesch
parents: 32116
diff changeset
313 free(p->pszFileName);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
314
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
315 if (p == MSACM_pFirstACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
316 MSACM_pFirstACMDriverID = p->pNextACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
317 if (p == MSACM_pLastACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
318 MSACM_pLastACMDriverID = p->pPrevACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
319
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
320 if (p->pPrevACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
321 p->pPrevACMDriverID->pNextACMDriverID = p->pNextACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
322 if (p->pNextACMDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
323 p->pNextACMDriverID->pPrevACMDriverID = p->pPrevACMDriverID;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
324
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
325 pNextACMDriverID = p->pNextACMDriverID;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
326
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
327 HeapFree(MSACM_hHeap, 0, p);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
328
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
329 return pNextACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
330 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
331
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
332 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
333 * MSACM_UnregisterAllDrivers32()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
334 * FIXME
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
335 * Where should this function be called?
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
336 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
337 void MSACM_UnregisterAllDrivers(void)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
338 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
339 PWINE_ACMDRIVERID p;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
340
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
341 for (p = MSACM_pFirstACMDriverID; p; p = MSACM_UnregisterDriver(p));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
342 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
343
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
344 /***********************************************************************
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
345 * MSACM_GetDriverID32()
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
346 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
347 PWINE_ACMDRIVERID MSACM_GetDriverID(HACMDRIVERID hDriverID)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
348 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
349 return (PWINE_ACMDRIVERID)hDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
350 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
351
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
352 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
353 * MSACM_GetDriver32()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
354 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
355 PWINE_ACMDRIVER MSACM_GetDriver(HACMDRIVER hDriver)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
356 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
357 return (PWINE_ACMDRIVER)hDriver;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
358 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
359
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
360 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
361 * MSACM_GetObj32()
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
362 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
363 PWINE_ACMOBJ MSACM_GetObj(HACMOBJ hObj)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
364 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
365 return (PWINE_ACMOBJ)hObj;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
366 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
367
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
368
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
369
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
370 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
371 * acmStreamOpen (MSACM32.40)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
372 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
373 MMRESULT WINAPI acmStreamOpen(PHACMSTREAM phas, HACMDRIVER had, PWAVEFORMATEX pwfxSrc,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
374 PWAVEFORMATEX pwfxDst, PWAVEFILTER pwfltr, DWORD dwCallback,
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
375 DWORD dwInstance, DWORD fdwOpen)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
376 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
377 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
378 PWINE_ACMDRIVER wad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
379 MMRESULT ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
380 int wfxSrcSize;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
381 int wfxDstSize;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
382
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
383 TRACE("(%p, 0x%08x, %p, %p, %p, %ld, %ld, %ld)\n",
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
384 phas, had, pwfxSrc, pwfxDst, pwfltr, dwCallback, dwInstance, fdwOpen);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
385
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
386 TRACE("src [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
387 pwfxSrc->wFormatTag, pwfxSrc->nChannels, pwfxSrc->nSamplesPerSec, pwfxSrc->nAvgBytesPerSec,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
388 pwfxSrc->nBlockAlign, pwfxSrc->wBitsPerSample, pwfxSrc->cbSize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
389
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
390 TRACE("dst [wFormatTag=%u, nChannels=%u, nSamplesPerSec=%lu, nAvgBytesPerSec=%lu, nBlockAlign=%u, wBitsPerSample=%u, cbSize=%u]\n",
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
391 pwfxDst->wFormatTag, pwfxDst->nChannels, pwfxDst->nSamplesPerSec, pwfxDst->nAvgBytesPerSec,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
392 pwfxDst->nBlockAlign, pwfxDst->wBitsPerSample, pwfxDst->cbSize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
393
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
394 #define SIZEOF_WFX(wfx) (sizeof(WAVEFORMATEX) + ((wfx->wFormatTag == WAVE_FORMAT_PCM) ? 0 : wfx->cbSize))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
395 wfxSrcSize = SIZEOF_WFX(pwfxSrc);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
396 wfxDstSize = SIZEOF_WFX(pwfxDst);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
397 #undef SIZEOF_WFX
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
398
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
399 was = (PWINE_ACMSTREAM) HeapAlloc(MSACM_hHeap, 0, sizeof(*was) + wfxSrcSize + wfxDstSize + ((pwfltr) ? sizeof(WAVEFILTER) : 0));
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
400 if (was == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
401 return MMSYSERR_NOMEM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
402 was->drvInst.cbStruct = sizeof(was->drvInst);
32116
601319a3523e Avoid some pointless uses of sizeof() and one related cast.
reimar
parents: 29263
diff changeset
403 was->drvInst.pwfxSrc = (PWAVEFORMATEX)(was + 1);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
404 memcpy(was->drvInst.pwfxSrc, pwfxSrc, wfxSrcSize);
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
405 // LHACM is checking for 0x1
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
406 // but if this will not help
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
407 // was->drvInst.pwfxSrc->wFormatTag = 1;
32116
601319a3523e Avoid some pointless uses of sizeof() and one related cast.
reimar
parents: 29263
diff changeset
408 was->drvInst.pwfxDst = (PWAVEFORMATEX)((LPSTR)(was + 1) + wfxSrcSize);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
409 memcpy(was->drvInst.pwfxDst, pwfxDst, wfxDstSize);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
410 if (pwfltr) {
32116
601319a3523e Avoid some pointless uses of sizeof() and one related cast.
reimar
parents: 29263
diff changeset
411 was->drvInst.pwfltr = (PWAVEFILTER)((LPSTR)(was + 1) + wfxSrcSize + wfxDstSize);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
412 memcpy(was->drvInst.pwfltr, pwfltr, sizeof(WAVEFILTER));
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
413 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
414 was->drvInst.pwfltr = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
415 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
416 was->drvInst.dwCallback = dwCallback;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
417 was->drvInst.dwInstance = dwInstance;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
418 was->drvInst.fdwOpen = fdwOpen;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
419 was->drvInst.fdwDriver = 0L;
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
420 was->drvInst.dwDriver = 0L;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
421 was->drvInst.has = (HACMSTREAM)was;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
422
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
423 if (had) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
424 if (!(wad = MSACM_GetDriver(had))) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
425 ret = MMSYSERR_INVALPARAM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
426 goto errCleanUp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
427 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
428
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
429 was->obj.pACMDriverID = wad->obj.pACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
430 was->pDrv = wad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
431 was->hAcmDriver = 0; /* not to close it in acmStreamClose */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
432
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
433 ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
434 if (ret != MMSYSERR_NOERROR)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
435 goto errCleanUp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
436 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
437 PWINE_ACMDRIVERID wadi;
24380
542822a1cc57 warning fixes:
diego
parents: 21261
diff changeset
438 //short drv_tag;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
439 ret = ACMERR_NOTPOSSIBLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
440 /* if(pwfxSrc->wFormatTag==1)//compression
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
441 drv_tag=pwfxDst->wFormatTag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
442 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
443 if(pwfxDst->wFormatTag==1)//decompression
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
444 drv_tag=pwfxSrc->wFormatTag;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
445 else
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
446 goto errCleanUp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
447
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
448 ret=acmDriverOpen2(drv_tag);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
449 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
450 if ((wad = MSACM_GetDriver(had)) != 0) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
451 was->obj.pACMDriverID = wad->obj.pACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
452 was->pDrv = wad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
453 was->hAcmDriver = had;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
454
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
455 ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
456 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
457 if (fdwOpen & ACM_STREAMOPENF_QUERY) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
458 acmDriverClose(had, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
459 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
460 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
461 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
462 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
463 acmDriverClose(had, 0L);*/
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
464 //if(MSACM_pFirstACMDriverID==NULL)
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
465 // MSACM_RegisterAllDrivers();
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
466
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
467 for (wadi = MSACM_pFirstACMDriverID; wadi; wadi = wadi->pNextACMDriverID)
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
468 {
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
469 /* Check Format */
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
470 if ((int)wadi->wFormatTag != (int)pwfxSrc->wFormatTag) continue;
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
471
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
472 ret = acmDriverOpen(&had, (HACMDRIVERID)wadi, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
473 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
474 if ((wad = MSACM_GetDriver(had)) != 0) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
475 was->obj.pACMDriverID = wad->obj.pACMDriverID;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
476 was->pDrv = wad;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
477 was->hAcmDriver = had;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
478
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
479 ret = SendDriverMessage(wad->hDrvr, ACMDM_STREAM_OPEN, (DWORD)&was->drvInst, 0L);
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
480 //lhacm - crash printf("RETOPEN %d\n", ret);
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
481 //ret = 0;
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
482 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
483 if (fdwOpen & ACM_STREAMOPENF_QUERY) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
484 acmDriverClose(had, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
485 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
486 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
487 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
488 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
489 // no match, close this acm driver and try next one
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
490 acmDriverClose(had, 0L);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
491 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
492 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
493 if (ret != MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
494 ret = ACMERR_NOTPOSSIBLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
495 goto errCleanUp;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
496 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
497 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
498 ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
499 if (!(fdwOpen & ACM_STREAMOPENF_QUERY)) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
500 if (phas)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
501 *phas = (HACMSTREAM)was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
502 TRACE("=> (%d)\n", ret);
9961
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
503 #ifdef WIN32_LOADER
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
504 CodecAlloc();
9961
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
505 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
506 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
507 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
508 errCleanUp:
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
509 if (phas)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
510 *phas = (HACMSTREAM)0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
511 HeapFree(MSACM_hHeap, 0, was);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
512 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
513 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
514 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
515
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
516
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
517 MMRESULT WINAPI acmStreamClose(HACMSTREAM has, DWORD fdwClose)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
518 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
519 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
520 MMRESULT ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
521
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
522 TRACE("(0x%08x, %ld)\n", has, fdwClose);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
523
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
524 if ((was = ACM_GetStream(has)) == NULL) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
525 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
526 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
527 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CLOSE, (DWORD)&was->drvInst, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
528 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
529 if (was->hAcmDriver)
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
530 acmDriverClose(was->hAcmDriver, 0L);
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
531 HeapFree(MSACM_hHeap, 0, was);
9961
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
532 #ifdef WIN32_LOADER
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
533 CodecRelease();
9961
1a6057610a61 cygwin support by Sascha Sommer
alex
parents: 7386
diff changeset
534 #endif
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
535 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
536 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
537 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
538 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
539
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
540 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
541 * acmStreamConvert (MSACM32.38)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
542 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
543 MMRESULT WINAPI acmStreamConvert(HACMSTREAM has, PACMSTREAMHEADER pash,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
544 DWORD fdwConvert)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
545 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
546 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
547 MMRESULT ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
548 PACMDRVSTREAMHEADER padsh;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
549
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
550 TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwConvert);
7386
174e2a58b4cd avifile sync - 95% cosmetics 5% bug
arpi
parents: 2069
diff changeset
551
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
552 if ((was = ACM_GetStream(has)) == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
553 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
554 if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
555 return MMSYSERR_INVALPARAM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
556
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
557 if (!(pash->fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
558 return ACMERR_UNPREPARED;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
559
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
560 /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
561 * size. some fields are private to msacm internals, and are exposed
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
562 * in ACMSTREAMHEADER in the dwReservedDriver array
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
563 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
564 padsh = (PACMDRVSTREAMHEADER)pash;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
565
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
566 /* check that pointers have not been modified */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
567 if (padsh->pbPreparedSrc != padsh->pbSrc ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
568 padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
569 padsh->pbPreparedDst != padsh->pbDst ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
570 padsh->cbPreparedDstLength < padsh->cbDstLength) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
571 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
572 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
573
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
574 padsh->fdwConvert = fdwConvert;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
575
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
576 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_CONVERT, (DWORD)&was->drvInst, (DWORD)padsh);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
577 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
578 padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_DONE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
579 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
580 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
581 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
582 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
583
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
584
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
585 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
586 * acmStreamPrepareHeader (MSACM32.41)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
587 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
588 MMRESULT WINAPI acmStreamPrepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
589 DWORD fdwPrepare)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
590 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
591 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
592 MMRESULT ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
593 PACMDRVSTREAMHEADER padsh;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
594
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
595 TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwPrepare);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
596
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
597 if ((was = ACM_GetStream(has)) == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
598 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
599 if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
600 return MMSYSERR_INVALPARAM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
601 if (fdwPrepare)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
602 ret = MMSYSERR_INVALFLAG;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
603
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
604 if (pash->fdwStatus & ACMSTREAMHEADER_STATUSF_DONE)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
605 return MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
606
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
607 /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
608 * size. some fields are private to msacm internals, and are exposed
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
609 * in ACMSTREAMHEADER in the dwReservedDriver array
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
610 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
611 padsh = (PACMDRVSTREAMHEADER)pash;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
612
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
613 padsh->fdwConvert = fdwPrepare;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
614 padsh->padshNext = NULL;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
615 padsh->fdwDriver = padsh->dwDriver = 0L;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
616
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
617 padsh->fdwPrepared = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
618 padsh->dwPrepared = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
619 padsh->pbPreparedSrc = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
620 padsh->cbPreparedSrcLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
621 padsh->pbPreparedDst = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
622 padsh->cbPreparedDstLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
623
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
624 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_PREPARE, (DWORD)&was->drvInst, (DWORD)padsh);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
625 if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
626 ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
627 padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
628 padsh->fdwStatus |= ACMSTREAMHEADER_STATUSF_PREPARED;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
629 padsh->fdwPrepared = padsh->fdwStatus;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
630 padsh->dwPrepared = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
631 padsh->pbPreparedSrc = padsh->pbSrc;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
632 padsh->cbPreparedSrcLength = padsh->cbSrcLength;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
633 padsh->pbPreparedDst = padsh->pbDst;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
634 padsh->cbPreparedDstLength = padsh->cbDstLength;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
635 } else {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
636 padsh->fdwPrepared = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
637 padsh->dwPrepared = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
638 padsh->pbPreparedSrc = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
639 padsh->cbPreparedSrcLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
640 padsh->pbPreparedDst = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
641 padsh->cbPreparedDstLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
642 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
643 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
644 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
645 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
646
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
647 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
648 * acmStreamReset (MSACM32.42)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
649 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
650 MMRESULT WINAPI acmStreamReset(HACMSTREAM has, DWORD fdwReset)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
651 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
652 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
653 MMRESULT ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
654
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
655 TRACE("(0x%08x, %ld)\n", has, fdwReset);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
656
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
657 if (fdwReset) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
658 ret = MMSYSERR_INVALFLAG;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
659 } else if ((was = ACM_GetStream(has)) == NULL) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
660 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
661 } else if (was->drvInst.fdwOpen & ACM_STREAMOPENF_ASYNC) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
662 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_RESET, (DWORD)&was->drvInst, 0);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
663 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
664 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
665 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
666 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
667
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
668 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
669 * acmStreamSize (MSACM32.43)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
670 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
671 MMRESULT WINAPI acmStreamSize(HACMSTREAM has, DWORD cbInput,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
672 LPDWORD pdwOutputBytes, DWORD fdwSize)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
673 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
674 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
675 ACMDRVSTREAMSIZE adss;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
676 MMRESULT ret;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
677
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
678 TRACE("(0x%08x, %ld, %p, %ld)\n", has, cbInput, pdwOutputBytes, fdwSize);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
679
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
680 if ((was = ACM_GetStream(has)) == NULL) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
681 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
682 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
683 if ((fdwSize & ~ACM_STREAMSIZEF_QUERYMASK) != 0) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
684 return MMSYSERR_INVALFLAG;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
685 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
686
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
687 *pdwOutputBytes = 0L;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
688
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
689 switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
690 case ACM_STREAMSIZEF_DESTINATION:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
691 adss.cbDstLength = cbInput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
692 adss.cbSrcLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
693 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
694 case ACM_STREAMSIZEF_SOURCE:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
695 adss.cbSrcLength = cbInput;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
696 adss.cbDstLength = 0;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
697 break;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
698 default:
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
699 return MMSYSERR_INVALFLAG;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
700 }
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
701
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
702 adss.cbStruct = sizeof(adss);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
703 adss.fdwSize = fdwSize;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
704 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_SIZE,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
705 (DWORD)&was->drvInst, (DWORD)&adss);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
706 if (ret == MMSYSERR_NOERROR) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
707 switch (fdwSize & ACM_STREAMSIZEF_QUERYMASK) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
708 case ACM_STREAMSIZEF_DESTINATION:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
709 *pdwOutputBytes = adss.cbSrcLength;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
710 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
711 case ACM_STREAMSIZEF_SOURCE:
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
712 *pdwOutputBytes = adss.cbDstLength;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
713 break;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
714 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
715 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
716 TRACE("=> (%d) [%lu]\n", ret, *pdwOutputBytes);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
717 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
718 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
719
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
720 /***********************************************************************
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
721 * acmStreamUnprepareHeader (MSACM32.44)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
722 */
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
723 MMRESULT WINAPI acmStreamUnprepareHeader(HACMSTREAM has, PACMSTREAMHEADER pash,
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
724 DWORD fdwUnprepare)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
725 {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
726 PWINE_ACMSTREAM was;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
727 MMRESULT ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
728 PACMDRVSTREAMHEADER padsh;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
729
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
730 TRACE("(0x%08x, %p, %ld)\n", has, pash, fdwUnprepare);
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
731
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
732 if ((was = ACM_GetStream(has)) == NULL)
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
733 return MMSYSERR_INVALHANDLE;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
734 if (!pash || pash->cbStruct < sizeof(ACMSTREAMHEADER))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
735 return MMSYSERR_INVALPARAM;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
736
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
737 if (!(pash->fdwStatus & ACMSTREAMHEADER_STATUSF_PREPARED))
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
738 return ACMERR_UNPREPARED;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
739
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
740 /* Note: the ACMSTREAMHEADER and ACMDRVSTREAMHEADER structs are of same
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
741 * size. some fields are private to msacm internals, and are exposed
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
742 * in ACMSTREAMHEADER in the dwReservedDriver array
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
743 */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
744 padsh = (PACMDRVSTREAMHEADER)pash;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
745
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
746 /* check that pointers have not been modified */
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
747 if (padsh->pbPreparedSrc != padsh->pbSrc ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
748 padsh->cbPreparedSrcLength < padsh->cbSrcLength ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
749 padsh->pbPreparedDst != padsh->pbDst ||
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
750 padsh->cbPreparedDstLength < padsh->cbDstLength) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
751 return MMSYSERR_INVALPARAM;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26999
diff changeset
752 }
1
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
753
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
754 padsh->fdwConvert = fdwUnprepare;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
755
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
756 ret = SendDriverMessage(was->pDrv->hDrvr, ACMDM_STREAM_UNPREPARE, (DWORD)&was->drvInst, (DWORD)padsh);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
757 if (ret == MMSYSERR_NOERROR || ret == MMSYSERR_NOTSUPPORTED) {
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
758 ret = MMSYSERR_NOERROR;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
759 padsh->fdwStatus &= ~(ACMSTREAMHEADER_STATUSF_DONE|ACMSTREAMHEADER_STATUSF_INQUEUE|ACMSTREAMHEADER_STATUSF_PREPARED);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
760 }
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
761 TRACE("=> (%d)\n", ret);
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
762 return ret;
3b5f5d1c5041 Initial revision
arpi_esp
parents:
diff changeset
763 }