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
27 /* Need to check these */
28 #define MAX_DEVICES 256
29 #define MAX_DEVICE_NAME_LENGTH 256
30 #define MAX_BUFFER_SIZE 1048576
31 #define MAX_WAVE_BYTES 1048576
33 /* Custom flag set when overlapped I/O is done */
34 #define WHDR_COMPLETE 0x80000000
38 The kinds of devices which MMSYSTEM/WINMM may request from us.
50 #define IsWaveDevice(devicetype) \
51 ( ( devicetype == WaveOutDevice ) || ( devicetype == WaveInDevice ) )
53 #define IsMidiDevice(devicetype) \
54 ( ( devicetype == MidiOutDevice ) || ( devicetype == MidiInDevice ) )
56 #define IsAuxDevice(devicetype) \
57 ( devicetype == AuxDevice )
61 We use these structures to store information regarding open devices. Since
62 the main structure gets destroyed when a device is closed, I call this a
79 SessionThreadTerminate,
84 /* Our own values, used with the session threads */
85 typedef DWORD ThreadFunction
;
86 #define DRVM_TERMINATE 0xFFFFFFFE
87 #define DRVM_INVALID 0xFFFFFFFF
100 PMIDIHDR midi_header
;
110 typedef struct _ThreadInfo
116 /*ThreadFunction function;*/
123 typedef struct _LoopInfo
129 typedef struct _SessionInfo
131 struct _SessionInfo
* next
;
133 DeviceType device_type
;
136 HANDLE kernel_device_handle
;
138 /* These are all the same */
142 HWAVE mme_wave_handle
;
143 HMIDI mme_midi_handle
;
146 /* If playback is paused or not */
149 /* Stuff passed to us from winmm */
150 DWORD_PTR app_user_data
;
155 /* Can only be one or the other */
162 /* Current playback point */
163 //PWAVEHDR next_buffer;
165 /* Where in the current buffer we are */
166 DWORD buffer_position
;
168 // DWORD remaining_bytes;
176 #define ASSERT(condition) \
177 if ( ! (condition) ) \
178 DPRINT("ASSERT FAILED: %s\n", #condition);
186 SessionInfo
* session_info
,
188 DWORD_PTR parameter1
,
189 DWORD_PTR parameter2
);
197 ErrorToMmResult(UINT error_code
);
200 /* Kernel interface */
204 DeviceType device_type
,
206 PWCHAR out_device_name
);
210 DeviceType device_type
,
216 CloseKernelDevice(HANDLE device_handle
);
220 HANDLE device_handle
,
227 HANDLE device_handle
,
233 /* Session management */
237 DeviceType device_type
,
239 SessionInfo
** session_info
);
242 DestroySession(SessionInfo
* session
);
246 DeviceType device_type
,
250 StartSessionThread(SessionInfo
* session_info
);
254 SessionInfo
* session_info
,
255 ThreadFunction function
,
256 PVOID thread_parameter
);
259 HandleBySessionThread(
260 DWORD_PTR private_handle
,
262 DWORD_PTR parameter
);
268 GetDeviceCount(DeviceType device_type
);
271 GetDeviceCapabilities(
272 DeviceType device_type
,
274 DWORD_PTR capabilities
,
275 DWORD capabilities_size
);
279 DeviceType device_type
,
281 PVOID open_descriptor
,
283 DWORD_PTR private_handle
);
287 DWORD_PTR private_handle
);
291 DWORD private_handle
);
295 DWORD private_handle
);
299 DWORD private_handle
);
303 DWORD private_handle
,
308 BreakLoop(DWORD private_handle
);
312 DeviceType device_type
,
317 DWORD_PTR private_handle
,
318 PWAVEHDR wave_header
,
319 DWORD wave_header_size
);
328 WaveThread(LPVOID parameter
);
334 PerformWaveIO(SessionInfo
* session_info
);
337 extern CRITICAL_SECTION critical_section
;