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
17 #define WIN32_NO_STATUS
18 #define WIN32_LEAN_AND_MEAN
26 /* Need to check these */
27 #define MAX_DEVICES 256
28 #define MAX_DEVICE_NAME_LENGTH 256
29 #define MAX_BUFFER_SIZE 1048576
30 #define MAX_WAVE_BYTES 1048576
32 /* Custom flag set when overlapped I/O is done */
33 #define WHDR_COMPLETE 0x80000000
37 The kinds of devices which MMSYSTEM/WINMM may request from us.
49 #define IsWaveDevice(devicetype) \
50 ( ( devicetype == WaveOutDevice ) || ( devicetype == WaveInDevice ) )
52 #define IsMidiDevice(devicetype) \
53 ( ( devicetype == MidiOutDevice ) || ( devicetype == MidiInDevice ) )
55 #define IsAuxDevice(devicetype) \
56 ( devicetype == AuxDevice )
60 We use these structures to store information regarding open devices. Since
61 the main structure gets destroyed when a device is closed, I call this a
78 SessionThreadTerminate,
83 /* Our own values, used with the session threads */
84 typedef DWORD ThreadFunction
;
85 #define DRVM_TERMINATE 0xFFFFFFFE
86 #define DRVM_INVALID 0xFFFFFFFF
109 typedef struct _ThreadInfo
115 /*ThreadFunction function;*/
122 typedef struct _LoopInfo
128 typedef struct _SessionInfo
130 struct _SessionInfo
* next
;
132 DeviceType device_type
;
135 HANDLE kernel_device_handle
;
137 /* These are all the same */
141 HWAVE mme_wave_handle
;
142 HMIDI mme_midi_handle
;
145 /* If playback is paused or not */
148 /* Stuff passed to us from winmm */
149 DWORD_PTR app_user_data
;
154 /* Can only be one or the other */
161 /* Current playback point */
162 //PWAVEHDR next_buffer;
164 /* Where in the current buffer we are */
165 DWORD buffer_position
;
167 // DWORD remaining_bytes;
175 #define ASSERT(condition) \
176 if ( ! (condition) ) \
177 DPRINT("ASSERT FAILED: %s\n", #condition);
185 SessionInfo
* session_info
,
187 DWORD_PTR parameter1
,
188 DWORD_PTR parameter2
);
196 ErrorToMmResult(UINT error_code
);
199 /* Kernel interface */
203 DeviceType device_type
,
205 PWCHAR out_device_name
);
209 DeviceType device_type
,
215 CloseKernelDevice(HANDLE device_handle
);
219 HANDLE device_handle
,
226 HANDLE device_handle
,
232 /* Session management */
236 DeviceType device_type
,
238 SessionInfo
** session_info
);
241 DestroySession(SessionInfo
* session
);
245 DeviceType device_type
,
249 StartSessionThread(SessionInfo
* session_info
);
253 SessionInfo
* session_info
,
254 ThreadFunction function
,
255 PVOID thread_parameter
);
258 HandleBySessionThread(
259 DWORD_PTR private_handle
,
261 DWORD_PTR parameter
);
267 GetDeviceCount(DeviceType device_type
);
270 GetDeviceCapabilities(
271 DeviceType device_type
,
273 DWORD_PTR capabilities
,
274 DWORD capabilities_size
);
278 DeviceType device_type
,
280 PVOID open_descriptor
,
282 DWORD_PTR private_handle
);
286 DWORD_PTR private_handle
);
290 DWORD private_handle
);
294 DWORD private_handle
);
298 DWORD private_handle
);
302 DWORD private_handle
,
307 BreakLoop(DWORD private_handle
);
311 DeviceType device_type
,
316 DWORD_PTR private_handle
,
317 PWAVEHDR wave_header
,
318 DWORD wave_header_size
);
327 WaveThread(LPVOID parameter
);
333 PerformWaveIO(SessionInfo
* session_info
);
336 extern CRITICAL_SECTION critical_section
;