update for HEAD-2003091401
[reactos.git] / lib / winmm / misc / stubs.c
1 /* 
2  * The stubs here are totaly wrong so please help a brother out 
3  * and fix this shit. sedwards 9-24-02
4  *
5  * Added more stubs for bochs 1.3 once again still mostly wrong
6  * but bochs gets further now. 12-14-02
7  *
8  * [8-18-03] AG: I've added PlaySound/A/W and implemented sndPlaySoundA/W to
9  * call these. I've also tried to match the parameter names and types with the
10  * correct ones.
11  *
12  */
13
14 #include <windows.h>
15 typedef UINT *LPUINT;
16 #include <mmsystem.h>
17 #define NDEBUG
18 #include <debug.h>
19
20 #define NEAR
21 #define FAR
22
23 /* general constants */
24 #define MAXPNAMELEN      32     /* max product name length (including NULL) */
25 #define MAXERRORLENGTH   256    /* max error text length (including NULL) */
26 #define MAX_JOYSTICKOEMVXDNAME 260 /* max oem vxd name length (including NULL) */
27
28
29 // mmsystem.h ends here
30
31 MMRESULT
32 WINAPI 
33 waveOutReset(HWAVEOUT hwo)
34 {
35     // Possible return values:
36     // MMSYSERR_INVALHANDLE, MMSYSERR_NODRIVER, MMSYSERR_NOMEM, MMSYSERR_NOTSUPPORTED
37
38         DbgPrint("waveOutReset stub\n");
39     UNIMPLEMENTED;
40         return 1;
41 }
42
43
44 MMRESULT WINAPI waveOutWrite(HWAVEOUT hwo, LPWAVEHDR pwh,
45                          UINT cbwh)
46 {
47     // Posible return values:
48     // MMSYSERR_INVALHANDLE, MMSYSERR_NODRIVER, MMSYSERR_NOMEM, WAVERR_UNPREPARED
49
50         DbgPrint("waveOutWrite stub\n");
51     UNIMPLEMENTED;
52         return 1;
53 }
54
55 // PlaySound() needs exporting
56 #undef PlaySound
57
58
59 BOOL WINAPI
60 PlaySoundA(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound)
61 {
62     DbgPrint("PlaySoundA stub\n");
63     UNIMPLEMENTED;
64     return TRUE;
65 }
66
67
68 BOOL WINAPI
69 PlaySoundW(LPCWSTR pszSound, HMODULE hmod, DWORD fdwSound)
70 {
71     DbgPrint("PlaySoundW stub\n");
72     UNIMPLEMENTED;
73     return TRUE;
74 }
75
76
77 BOOL WINAPI
78 PlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound)
79 {
80     // ANSI?
81     return PlaySoundA(pszSound, hmod, fdwSound);
82 }
83
84
85 BOOL
86 WINAPI
87 sndPlaySoundA(LPCSTR lpszSound, UINT fuSound)
88 {
89     fuSound &= SND_ASYNC | SND_LOOP | SND_MEMORY | SND_NODEFAULT | SND_NOSTOP | SND_SYNC;
90     return PlaySoundA(lpszSound, NULL, fuSound);
91 }
92
93 BOOL
94 WINAPI
95 sndPlaySoundW(LPCWSTR lpszSound, UINT fuSound)
96 {
97     fuSound &= SND_ASYNC | SND_LOOP | SND_MEMORY | SND_NODEFAULT | SND_NOSTOP | SND_SYNC;
98     return PlaySoundW(lpszSound, NULL, fuSound);
99 }
100
101 MMRESULT 
102 WINAPI
103 midiOutReset(HMIDIOUT hmo)
104 {
105         DbgPrint("midiOutReset stub\n");
106     UNIMPLEMENTED;
107         return 1;
108 }
109
110 MMRESULT 
111 WINAPI
112 waveOutPrepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh,
113                          UINT cbwh)
114 {
115         DbgPrint("waveOutPrepareHeader stub\n");
116     UNIMPLEMENTED;
117     pwh->dwFlags |= WHDR_PREPARED;
118         return 1;
119 }
120
121 MMRESULT
122 WINAPI
123 waveOutGetErrorTextA(MMRESULT mmrError, LPSTR pszText,
124                          UINT cchText)
125 {
126         DbgPrint("waveOutGetErrorTextA stub\n");
127     UNIMPLEMENTED;
128         return 1;
129 }
130
131 MMRESULT
132 WINAPI
133 waveOutOpen(LPHWAVEOUT pwho, UINT uDeviceID,
134                         LPCWAVEFORMATEX pwfx, DWORD dwCallback,
135                         DWORD dwCallbackInstance, DWORD fdwOpen)
136 {
137         DbgPrint("waveOutOpen stub\n");
138     UNIMPLEMENTED;
139         return 1;
140 }
141
142 MMRESULT
143 WINAPI 
144 waveOutClose(HWAVEOUT hwo)
145 {
146         DbgPrint("waveOutClose stub\n");
147         return 1;
148 }
149
150 MMRESULT
151 WINAPI
152 midiOutClose(HMIDIOUT hmo)
153 {
154         DbgPrint("midiOutClose stub\n");
155         return 1;
156 }
157
158 MMRESULT
159 WINAPI
160 midiOutUnprepareHeader(HWAVEOUT hwo, LPMIDIHDR pwh,
161                          UINT cbwh)
162 {
163         DbgPrint("midiOutUnprepareHeader stub\n");
164         return 1;
165 }
166
167 MMRESULT 
168 WINAPI
169 waveOutUnprepareHeader(HWAVEOUT hwo, LPWAVEHDR pwh,
170                          UINT cbwh)
171 {
172         DbgPrint("waveOutUnprepareHeader stub\n");
173     pwh->dwFlags &= ! WHDR_PREPARED;
174         return 1;
175 }
176
177
178 MMRESULT
179 WINAPI
180 midiOutPrepareHeader(HMIDIOUT hmo, LPMIDIHDR lpMidiOutHdr,
181                          UINT cbMidiOutHdr)
182 {
183         DbgPrint("midiOutPrepareHeader stub\n");
184         return 1;
185 }
186
187 MMRESULT 
188 WINAPI
189 midiOutLongMsg(HMIDIOUT hmo, LPMIDIHDR lpMidiOutHdr,
190                          UINT cbMidiOutHdr)
191 {
192         DbgPrint("midiOutLongMsg stub\n");
193         return 1;
194 }
195
196 DWORD
197 WINAPI
198 timeGetTime(VOID)
199 {
200         DbgPrint("timeGetTime stub\n");
201         return 0;
202 }
203
204 MMRESULT WINAPI joyGetDevCapsA(UINT uJoyID, LPJOYCAPSA pjc, UINT cbjc)
205 {
206         DbgPrint("joyGetDevCapsA stub\n");
207         return MMSYSERR_ERROR;
208 }
209
210 UINT WINAPI joyGetNumDevs(void)
211 {
212         DbgPrint("joyGetNumDevs stub\n");
213         return 0;
214 }
215
216 MMRESULT WINAPI joyGetPosEx(UINT uJoyID, LPJOYINFOEX pji)
217 {
218         DbgPrint("joyGetPosEx stub\n");
219         return MMSYSERR_ERROR;
220 }
221
222 MCIERROR WINAPI mciSendCommandA(MCIDEVICEID mciId, UINT uMsg, DWORD dwParam1, DWORD dwParam2)
223 {
224         DbgPrint("mciSendCommandA stub\n");
225         return MMSYSERR_ERROR;
226 }