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
23 /* Need to check these */
24 #define MAX_DEVICES 256
25 #define MAX_DEVICE_NAME_LENGTH 256
26 #define MAX_BUFFER_SIZE 1048576
27 #define MAX_WAVE_BYTES 1048576
29 /* Custom flag set when overlapped I/O is done */
30 #define WHDR_COMPLETE 0x80000000
34 The kinds of devices which MMSYSTEM/WINMM may request from us.
46 #define IsWaveDevice(devicetype) \
47 ( ( devicetype == WaveOutDevice ) || ( devicetype == WaveInDevice ) )
49 #define IsMidiDevice(devicetype) \
50 ( ( devicetype == MidiOutDevice ) || ( devicetype == MidiInDevice ) )
52 #define IsAuxDevice(devicetype) \
53 ( devicetype == AuxDevice )
57 We use these structures to store information regarding open devices. Since
58 the main structure gets destroyed when a device is closed, I call this a
75 SessionThreadTerminate,
80 /* Our own values, used with the session threads */
81 typedef DWORD ThreadFunction
;
82 #define DRVM_TERMINATE 0xFFFFFFFE
83 #define DRVM_INVALID 0xFFFFFFFF
106 typedef struct _ThreadInfo
112 /*ThreadFunction function;*/
119 typedef struct _LoopInfo
125 typedef struct _SessionInfo
127 struct _SessionInfo
* next
;
129 DeviceType device_type
;
132 HANDLE kernel_device_handle
;
134 /* These are all the same */
138 HWAVE mme_wave_handle
;
139 HMIDI mme_midi_handle
;
142 /* If playback is paused or not */
145 /* Stuff passed to us from winmm */
146 DWORD_PTR app_user_data
;
151 /* Can only be one or the other */
158 /* Current playback point */
159 //PWAVEHDR next_buffer;
161 /* Where in the current buffer we are */
162 DWORD buffer_position
;
164 // DWORD remaining_bytes;
172 #define ASSERT(condition) \
173 if ( ! (condition) ) \
174 DPRINT("ASSERT FAILED: %s\n", #condition);
182 SessionInfo
* session_info
,
184 DWORD_PTR parameter1
,
185 DWORD_PTR parameter2
);
193 ErrorToMmResult(UINT error_code
);
196 /* Kernel interface */
200 DeviceType device_type
,
202 PWCHAR out_device_name
);
206 DeviceType device_type
,
212 CloseKernelDevice(HANDLE device_handle
);
216 HANDLE device_handle
,
223 HANDLE device_handle
,
229 /* Session management */
233 DeviceType device_type
,
235 SessionInfo
** session_info
);
238 DestroySession(SessionInfo
* session
);
242 DeviceType device_type
,
246 StartSessionThread(SessionInfo
* session_info
);
250 SessionInfo
* session_info
,
251 ThreadFunction function
,
252 PVOID thread_parameter
);
255 HandleBySessionThread(
256 DWORD_PTR private_handle
,
258 DWORD_PTR parameter
);
264 GetDeviceCount(DeviceType device_type
);
267 GetDeviceCapabilities(
268 DeviceType device_type
,
270 DWORD_PTR capabilities
,
271 DWORD capabilities_size
);
275 DeviceType device_type
,
277 PVOID open_descriptor
,
279 DWORD_PTR private_handle
);
283 DWORD_PTR private_handle
);
287 DWORD private_handle
);
291 DWORD private_handle
);
295 DWORD private_handle
);
299 DWORD private_handle
,
304 BreakLoop(DWORD private_handle
);
308 DeviceType device_type
,
313 DWORD_PTR private_handle
,
314 PWAVEHDR wave_header
,
315 DWORD wave_header_size
);
324 WaveThread(LPVOID parameter
);
330 PerformWaveIO(SessionInfo
* session_info
);
333 extern CRITICAL_SECTION critical_section
;