3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS Multimedia
5 * FILE: dll/win32/mmdrv/mmdrv.h
6 * PURPOSE: Multimedia User Mode Driver (header)
7 * PROGRAMMER: Andrew Greenwood
10 * Jan 30, 2004: Imported into ReactOS tree
11 * Jan 10, 2007: Rewritten and tidied up
19 #define WIN32_NO_STATUS
28 /* Need to check these */
29 #define MAX_DEVICES 256
30 #define MAX_DEVICE_NAME_LENGTH 256
31 #define MAX_BUFFER_SIZE 1048576
32 #define MAX_WAVE_BYTES 1048576
34 /* Custom flag set when overlapped I/O is done */
35 #define WHDR_COMPLETE 0x80000000
39 The kinds of devices which MMSYSTEM/WINMM may request from us.
51 #define IsWaveDevice(devicetype) \
52 ( ( devicetype == WaveOutDevice ) || ( devicetype == WaveInDevice ) )
54 #define IsMidiDevice(devicetype) \
55 ( ( devicetype == MidiOutDevice ) || ( devicetype == MidiInDevice ) )
57 #define IsAuxDevice(devicetype) \
58 ( devicetype == AuxDevice )
62 We use these structures to store information regarding open devices. Since
63 the main structure gets destroyed when a device is closed, I call this a
80 SessionThreadTerminate,
85 /* Our own values, used with the session threads */
86 typedef DWORD ThreadFunction
;
87 #define DRVM_TERMINATE 0xFFFFFFFE
88 #define DRVM_INVALID 0xFFFFFFFF
100 PWAVEHDR wave_header
;
101 PMIDIHDR midi_header
;
111 typedef struct _ThreadInfo
117 /*ThreadFunction function;*/
124 typedef struct _LoopInfo
130 typedef struct _SessionInfo
132 struct _SessionInfo
* next
;
134 DeviceType device_type
;
137 HANDLE kernel_device_handle
;
139 /* These are all the same */
143 HWAVE mme_wave_handle
;
144 HMIDI mme_midi_handle
;
147 /* If playback is paused or not */
150 /* Stuff passed to us from winmm */
151 DWORD_PTR app_user_data
;
156 /* Can only be one or the other */
163 /* Current playback point */
164 //PWAVEHDR next_buffer;
166 /* Where in the current buffer we are */
167 DWORD buffer_position
;
169 // DWORD remaining_bytes;
177 #define ASSERT(condition) \
178 if ( ! (condition) ) \
179 DPRINT("ASSERT FAILED: %s\n", #condition);
187 SessionInfo
* session_info
,
189 DWORD_PTR parameter1
,
190 DWORD_PTR parameter2
);
198 ErrorToMmResult(UINT error_code
);
201 /* Kernel interface */
205 DeviceType device_type
,
207 PWCHAR out_device_name
);
211 DeviceType device_type
,
217 CloseKernelDevice(HANDLE device_handle
);
221 HANDLE device_handle
,
228 HANDLE device_handle
,
234 /* Session management */
238 DeviceType device_type
,
240 SessionInfo
** session_info
);
243 DestroySession(SessionInfo
* session
);
247 DeviceType device_type
,
251 StartSessionThread(SessionInfo
* session_info
);
255 SessionInfo
* session_info
,
256 ThreadFunction function
,
257 PVOID thread_parameter
);
260 HandleBySessionThread(
261 DWORD_PTR private_handle
,
263 DWORD_PTR parameter
);
269 GetDeviceCount(DeviceType device_type
);
272 GetDeviceCapabilities(
273 DeviceType device_type
,
275 DWORD_PTR capabilities
,
276 DWORD capabilities_size
);
280 DeviceType device_type
,
282 PVOID open_descriptor
,
284 DWORD_PTR private_handle
);
288 DWORD_PTR private_handle
);
292 DWORD private_handle
);
296 DWORD private_handle
);
300 DWORD private_handle
);
304 DWORD private_handle
,
309 BreakLoop(DWORD private_handle
);
313 DeviceType device_type
,
318 DWORD_PTR private_handle
,
319 PWAVEHDR wave_header
,
320 DWORD wave_header_size
);
329 WaveThread(LPVOID parameter
);
335 PerformWaveIO(SessionInfo
* session_info
);
338 extern CRITICAL_SECTION critical_section
;