[AUDIO-BRINGUP]
[reactos.git] / include / reactos / libs / sound / mmebuddy.h
1 /*
2 * PROJECT: ReactOS Sound System "MME Buddy" Library
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: include/reactos/libs/sound/mmebuddy.h
5 *
6 * PURPOSE: Header for the "MME Buddy" helper library (located in
7 * lib/drivers/sound/mmebuddy)
8 *
9 * PROGRAMMERS: Andrew Greenwood (silverblade@reactos.org)
10 *
11 * HISTORY: 4 July 2008 - Created
12 * 31 Dec 2008 - Split off NT4-specific code into a separate library
13 *
14 * NOTES: MME Buddy was the best name I could come up with...
15 * The structures etc. here should be treated as internal to the
16 * library so should not be directly accessed elsewhere. Perhaps they
17 * can be moved to an internal header?
18 */
19
20 #ifndef ROS_AUDIO_MMEBUDDY_H
21 #define ROS_AUDIO_MMEBUDDY_H
22
23 /*
24 Hacky debug macro
25 */
26
27 #define POPUP(...) \
28 { \
29 WCHAR dbg_popup_msg[1024], dbg_popup_title[256]; \
30 wsprintf(dbg_popup_title, L"%hS(%d)", __FILE__, __LINE__); \
31 wsprintf(dbg_popup_msg, __VA_ARGS__); \
32 MessageBox(0, dbg_popup_msg, dbg_popup_title, MB_OK | MB_TASKMODAL); \
33 }
34
35 #ifndef NDEBUG
36 #define SND_ERR(...) \
37 { \
38 WCHAR dbg_popup_msg[1024]; \
39 wsprintf(dbg_popup_msg, __VA_ARGS__); \
40 OutputDebugString(dbg_popup_msg); \
41 }
42 #define SND_WARN(...) \
43 { \
44 WCHAR dbg_popup_msg[1024]; \
45 wsprintf(dbg_popup_msg, __VA_ARGS__); \
46 OutputDebugString(dbg_popup_msg); \
47 }
48 #define SND_TRACE(...) \
49 { \
50 WCHAR dbg_popup_msg[1024]; \
51 wsprintf(dbg_popup_msg, __VA_ARGS__); \
52 OutputDebugString(dbg_popup_msg); \
53 }
54
55 #define SND_ASSERT(condition) \
56 { \
57 if ( ! ( condition ) ) \
58 { \
59 SND_ERR(L"ASSERT FAILED: %hS File %hS Line %u\n", #condition, __FILE__, __LINE__); \
60 POPUP(L"ASSERT FAILED: %hS\n", #condition); \
61 ExitProcess(1); \
62 } \
63 }
64
65 #define DUMP_WAVEHDR_QUEUE(sound_device_instance) \
66 { \
67 PWAVEHDR CurrDumpHdr = sound_device_instance->HeadWaveHeader; \
68 SND_TRACE(L"-- Current wave header list --\n"); \
69 while ( CurrDumpHdr ) \
70 { \
71 SND_TRACE(L"%x | %d bytes | flags: %x\n", CurrDumpHdr, \
72 CurrDumpHdr->dwBufferLength, \
73 CurrDumpHdr->dwFlags); \
74 CurrDumpHdr = CurrDumpHdr->lpNext; \
75 } \
76 }
77
78 #else
79 #define SND_ERR(...) do {} while ( 0 )
80 #define SND_WARN(...) do {} while ( 0 )
81 #define SND_TRACE(...) do {} while ( 0 )
82 #define SND_ASSERT(condition) do {} while ( 0 )
83 #define DUMP_WAVEHDR_QUEUE(condition) do {} while ( 0 )
84 #endif
85
86 /*
87 Some memory allocation helper macros
88 */
89
90 #define AllocateStruct(thing) \
91 (thing*) AllocateMemory(sizeof(thing))
92
93 #define StringLengthToBytes(chartype, string_length) \
94 ( ( string_length + 1 ) * sizeof(chartype) )
95
96 #define AllocateWideString(string_length) \
97 (PWSTR) AllocateMemory(StringLengthToBytes(WCHAR, string_length))
98
99 #define ZeroWideString(string) \
100 ZeroMemory(string, StringLengthToBytes(WCHAR, wcslen(string)))
101
102 #define CopyWideString(dest, source) \
103 CopyMemory(dest, source, StringLengthToBytes(WCHAR, wcslen(source)))
104
105
106 /*
107 Helps find the minimum/maximum of two values
108 */
109
110 #define MinimumOf(value_a, value_b) \
111 ( value_a < value_b ? value_a : value_b )
112
113 #define MaximumOf(value_a, value_b) \
114 ( value_a > value_b ? value_a : value_b )
115
116
117 /*
118 Convert a device type into a zero-based array index
119 */
120
121 #define SOUND_DEVICE_TYPE_TO_INDEX(x) \
122 ( x - MIN_SOUND_DEVICE_TYPE )
123
124 #define INDEX_TO_SOUND_DEVICE_TYPE(x) \
125 ( x + MIN_SOUND_DEVICE_TYPE )
126
127
128 /*
129 Validation
130 */
131
132 #define IsValidSoundDeviceType IS_VALID_SOUND_DEVICE_TYPE
133
134 #define VALIDATE_MMSYS_PARAMETER(parameter_condition) \
135 { \
136 if ( ! (parameter_condition) ) \
137 { \
138 SND_ERR(L"FAILED parameter check: %hS at File %S Line %lu\n", #parameter_condition, __FILE__, __LINE__); \
139 return MMSYSERR_INVALPARAM; \
140 } \
141 }
142
143 #define MMSUCCESS(result) \
144 ( result == MMSYSERR_NOERROR )
145
146
147 /*
148 Types and Structures
149 */
150
151 typedef UCHAR MMDEVICE_TYPE, *PMMDEVICE_TYPE;
152 struct _SOUND_DEVICE;
153 struct _SOUND_DEVICE_INSTANCE;
154
155
156 #define DEFINE_GETCAPS_FUNCTYPE(func_typename, caps_type) \
157 typedef MMRESULT (*func_typename)( \
158 IN struct _SOUND_DEVICE* SoundDevice, \
159 IN DWORD DeviceId, \
160 OUT caps_type Capabilities, \
161 IN DWORD CapabilitiesSize);
162
163 /* This one is for those of us who don't care */
164 DEFINE_GETCAPS_FUNCTYPE(MMGETCAPS_FUNC, PVOID);
165
166 /* These are for those of us that do */
167 DEFINE_GETCAPS_FUNCTYPE(MMGETWAVEOUTCAPS_FUNC, LPWAVEOUTCAPS);
168 DEFINE_GETCAPS_FUNCTYPE(MMGETWAVEINCAPS_FUNC, LPWAVEINCAPS );
169 DEFINE_GETCAPS_FUNCTYPE(MMGETMIDIOUTCAPS_FUNC, LPMIDIOUTCAPS);
170 DEFINE_GETCAPS_FUNCTYPE(MMGETMIDIINCAPS_FUNC, LPMIDIINCAPS );
171
172 struct _SOUND_DEVICE;
173 struct _SOUND_DEVICE_INSTANCE;
174
175
176 /*
177 By extending the OVERLAPPED structure, it becomes possible to provide the
178 I/O completion routines with additional information.
179 */
180
181 typedef struct _SOUND_OVERLAPPED
182 {
183 OVERLAPPED Standard;
184 struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance;
185 PWAVEHDR Header;
186 BOOL PerformCompletion;
187
188 DWORD OriginalBufferSize;
189 LPOVERLAPPED_COMPLETION_ROUTINE OriginalCompletionRoutine;
190
191 } SOUND_OVERLAPPED, *PSOUND_OVERLAPPED;
192
193 typedef MMRESULT (*WAVE_COMMIT_FUNC)(
194 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
195 IN PVOID OffsetPtr,
196 IN DWORD Bytes,
197 IN PSOUND_OVERLAPPED Overlap,
198 IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
199
200 typedef MMRESULT (*MMMIXERQUERY_FUNC) (
201 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
202 IN DWORD DeviceId,
203 IN UINT uMsg,
204 IN LPVOID Parameter,
205 IN DWORD Flags);
206
207 typedef MMRESULT (*MMWAVEQUERYFORMATSUPPORT_FUNC)(
208 IN struct _SOUND_DEVICE* Device,
209 IN PWAVEFORMATEX WaveFormat,
210 IN DWORD WaveFormatSize);
211
212 typedef MMRESULT (*MMWAVESETFORMAT_FUNC)(
213 IN struct _SOUND_DEVICE_INSTANCE* Instance,
214 IN DWORD DeviceId,
215 IN PWAVEFORMATEX WaveFormat,
216 IN DWORD WaveFormatSize);
217
218 typedef MMRESULT (*MMOPEN_FUNC)(
219 IN struct _SOUND_DEVICE* SoundDevice,
220 OUT PVOID* Handle);
221
222 typedef MMRESULT (*MMCLOSE_FUNC)(
223 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
224 IN PVOID Handle); /* not sure about this */
225
226 typedef MMRESULT (*MMWAVEHEADER_FUNC)(
227 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
228 IN PWAVEHDR WaveHeader);
229
230 typedef MMRESULT (*MMBUFFER_FUNC)(
231 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
232 IN PVOID Buffer,
233 IN DWORD Length);
234
235 typedef MMRESULT(*MMGETPOS_FUNC)(
236 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
237 IN MMTIME* Time);
238
239
240 typedef MMRESULT(*MMSETSTATE_FUNC)(
241 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
242 IN BOOL bStart);
243
244
245 typedef MMRESULT(*MMQUERYDEVICEINTERFACESTRING_FUNC)(
246 IN MMDEVICE_TYPE DeviceType,
247 IN DWORD DeviceId,
248 IN LPWSTR Interface,
249 IN DWORD InterfaceLength,
250 OUT DWORD * InterfaceSize);
251
252 typedef MMRESULT(*MMRESETSTREAM_FUNC)(
253 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
254 IN MMDEVICE_TYPE DeviceType,
255 IN BOOLEAN bStartReset);
256
257 typedef struct _MMFUNCTION_TABLE
258 {
259 union
260 {
261 MMGETCAPS_FUNC GetCapabilities;
262 MMGETWAVEOUTCAPS_FUNC GetWaveOutCapabilities;
263 MMGETWAVEINCAPS_FUNC GetWaveInCapabilities;
264 MMGETMIDIOUTCAPS_FUNC GetMidiOutCapabilities;
265 MMGETMIDIINCAPS_FUNC GetMidiInCapabilities;
266 };
267
268 MMOPEN_FUNC Open;
269 MMCLOSE_FUNC Close;
270
271 MMWAVEQUERYFORMATSUPPORT_FUNC QueryWaveFormatSupport;
272 MMWAVESETFORMAT_FUNC SetWaveFormat;
273
274 MMMIXERQUERY_FUNC QueryMixerInfo;
275
276 WAVE_COMMIT_FUNC CommitWaveBuffer;
277
278 MMGETPOS_FUNC GetPos;
279 MMSETSTATE_FUNC SetState;
280 MMQUERYDEVICEINTERFACESTRING_FUNC GetDeviceInterfaceString;
281 MMRESETSTREAM_FUNC ResetStream;
282
283 // Redundant
284 //MMWAVEHEADER_FUNC PrepareWaveHeader;
285 //MMWAVEHEADER_FUNC UnprepareWaveHeader;
286 //MMWAVEHEADER_FUNC WriteWaveHeader;
287
288 //MMWAVEHEADER_FUNC SubmitWaveHeaderToDevice;
289 //MMBUFFER_FUNC CompleteBuffer;
290 } MMFUNCTION_TABLE, *PMMFUNCTION_TABLE;
291
292
293
294 typedef MMRESULT (*SOUND_THREAD_REQUEST_HANDLER)(
295 IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
296 IN PVOID Parameter);
297
298 typedef struct _SOUND_THREAD
299 {
300 HANDLE Handle;
301 BOOL Running;
302
303 struct
304 {
305 HANDLE Ready;
306 HANDLE Request;
307 HANDLE Done;
308 } Events;
309
310 struct
311 {
312 SOUND_THREAD_REQUEST_HANDLER Handler;
313 struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance;
314 PVOID Parameter;
315 MMRESULT Result;
316 } Request;
317 } SOUND_THREAD, *PSOUND_THREAD;
318
319 typedef struct _SOUND_DEVICE
320 {
321 struct _SOUND_DEVICE* Next;
322 struct _SOUND_DEVICE_INSTANCE* HeadInstance;
323 struct _SOUND_DEVICE_INSTANCE* TailInstance;
324 MMDEVICE_TYPE Type;
325 PVOID Identifier; /* Path for NT4 drivers */
326 /*PWSTR Path;*/
327 MMFUNCTION_TABLE FunctionTable;
328 } SOUND_DEVICE, *PSOUND_DEVICE;
329
330 typedef struct _SOUND_DEVICE_INSTANCE
331 {
332 struct _SOUND_DEVICE_INSTANCE* Next;
333 struct _SOUND_DEVICE* Device;
334 PVOID Handle;
335 struct _SOUND_THREAD* Thread;
336
337 /* Stuff generously donated to us from WinMM */
338 struct
339 {
340 HDRVR Handle;
341 DWORD Flags;
342 DWORD_PTR ClientCallback;
343 DWORD_PTR ClientCallbackInstanceData;
344 } WinMM;
345
346 /* DO NOT TOUCH THESE OUTSIDE OF THE SOUND THREAD */
347
348 union
349 {
350 PWAVEHDR HeadWaveHeader;
351 };
352
353 union
354 {
355 PWAVEHDR TailWaveHeader;
356 };
357
358 PWAVEHDR WaveLoopStart;
359 //PWAVEHDR CurrentWaveHeader;
360 DWORD OutstandingBuffers;
361 DWORD LoopsRemaining;
362 DWORD FrameSize;
363 DWORD BufferCount;
364 WAVEFORMATEX WaveFormatEx;
365 HANDLE hNotifyEvent;
366 HANDLE hStopEvent;
367 HANDLE hResetEvent;
368 BOOL ResetInProgress;
369 } SOUND_DEVICE_INSTANCE, *PSOUND_DEVICE_INSTANCE;
370
371 /* This lives in WAVEHDR.reserved */
372 typedef struct _WAVEHDR_EXTENSION
373 {
374 DWORD BytesCommitted;
375 DWORD BytesCompleted;
376 } WAVEHDR_EXTENSION, *PWAVEHDR_EXTENSION;
377
378
379 /*
380 reentrancy.c
381 */
382
383 MMRESULT
384 InitEntrypointMutexes();
385
386 VOID
387 CleanupEntrypointMutexes();
388
389 VOID
390 AcquireEntrypointMutex(
391 IN MMDEVICE_TYPE DeviceType);
392
393 VOID
394 ReleaseEntrypointMutex(
395 IN MMDEVICE_TYPE DeviceType);
396
397
398 /*
399 mme.c
400 */
401
402 VOID
403 NotifyMmeClient(
404 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
405 IN UINT Message,
406 IN DWORD_PTR Parameter);
407
408 MMRESULT
409 MmeGetSoundDeviceCapabilities(
410 IN MMDEVICE_TYPE DeviceType,
411 IN DWORD DeviceId,
412 IN PVOID Capabilities,
413 IN DWORD CapabilitiesSize);
414
415 MMRESULT
416 MmeOpenDevice(
417 IN MMDEVICE_TYPE DeviceType,
418 IN UINT DeviceId,
419 IN LPWAVEOPENDESC OpenParameters,
420 IN DWORD Flags,
421 OUT DWORD_PTR* PrivateHandle);
422
423 MMRESULT
424 MmeCloseDevice(
425 IN DWORD_PTR PrivateHandle);
426
427 MMRESULT
428 MmeGetPosition(
429 IN MMDEVICE_TYPE DeviceType,
430 IN DWORD DeviceId,
431 IN DWORD_PTR PrivateHandle,
432 IN MMTIME* Time,
433 IN DWORD Size);
434
435 MMRESULT
436 MmeGetDeviceInterfaceString(
437 IN MMDEVICE_TYPE DeviceType,
438 IN DWORD DeviceId,
439 IN LPWSTR Interface,
440 IN DWORD InterfaceLength,
441 OUT DWORD * InterfaceSize);
442
443
444 MMRESULT
445 MmeSetState(
446 IN DWORD_PTR PrivateHandle,
447 IN BOOL bStart);
448
449
450 #define MmePrepareWaveHeader(private_handle, header) \
451 PrepareWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
452
453 #define MmeUnprepareWaveHeader(private_handle, header) \
454 UnprepareWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
455
456 #define MmeWriteWaveHeader(private_handle, header) \
457 WriteWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
458
459 MMRESULT
460 MmeResetWavePlayback(
461 IN DWORD_PTR PrivateHandle);
462
463
464 /*
465 capabilities.c
466 */
467
468 MMRESULT
469 GetSoundDeviceCapabilities(
470 IN PSOUND_DEVICE SoundDevice,
471 IN DWORD DeviceId,
472 OUT PVOID Capabilities,
473 IN DWORD CapabilitiesSize);
474
475
476 /*
477 devicelist.c
478 */
479
480 ULONG
481 GetSoundDeviceCount(
482 IN MMDEVICE_TYPE DeviceType);
483
484 BOOLEAN
485 IsValidSoundDevice(
486 IN PSOUND_DEVICE SoundDevice);
487
488 MMRESULT
489 ListSoundDevice(
490 IN MMDEVICE_TYPE DeviceType,
491 IN PVOID Identifier OPTIONAL,
492 OUT PSOUND_DEVICE* SoundDevice OPTIONAL);
493
494 MMRESULT
495 UnlistSoundDevice(
496 IN MMDEVICE_TYPE DeviceType,
497 IN PSOUND_DEVICE SoundDevice);
498
499 MMRESULT
500 UnlistSoundDevices(
501 IN MMDEVICE_TYPE DeviceType);
502
503 VOID
504 UnlistAllSoundDevices();
505
506 MMRESULT
507 GetSoundDevice(
508 IN MMDEVICE_TYPE DeviceType,
509 IN DWORD DeviceIndex,
510 OUT PSOUND_DEVICE* Device);
511
512 MMRESULT
513 GetSoundDeviceIdentifier(
514 IN PSOUND_DEVICE SoundDevice,
515 OUT PVOID* Identifier);
516
517 MMRESULT
518 GetSoundDeviceType(
519 IN PSOUND_DEVICE SoundDevice,
520 OUT PMMDEVICE_TYPE DeviceType);
521
522
523 /*
524 functiontable.c
525 */
526
527 MMRESULT
528 SetSoundDeviceFunctionTable(
529 IN PSOUND_DEVICE SoundDevice,
530 IN PMMFUNCTION_TABLE FunctionTable);
531
532 MMRESULT
533 GetSoundDeviceFunctionTable(
534 IN PSOUND_DEVICE SoundDevice,
535 OUT PMMFUNCTION_TABLE* FunctionTable);
536
537
538 /*
539 deviceinstance.c
540 */
541
542 BOOLEAN
543 IsValidSoundDeviceInstance(
544 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
545
546 MMRESULT
547 CreateSoundDeviceInstance(
548 IN PSOUND_DEVICE SoundDevice,
549 OUT PSOUND_DEVICE_INSTANCE* SoundDeviceInstance);
550
551 MMRESULT
552 DestroySoundDeviceInstance(
553 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
554
555 MMRESULT
556 DestroyAllSoundDeviceInstances(
557 IN PSOUND_DEVICE SoundDevice);
558
559 MMRESULT
560 GetSoundDeviceFromInstance(
561 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
562 OUT PSOUND_DEVICE* SoundDevice);
563
564 MMRESULT
565 GetSoundDeviceInstanceHandle(
566 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
567 OUT PVOID* Handle);
568
569 MMRESULT
570 SetSoundDeviceInstanceMmeData(
571 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
572 IN HDRVR MmeHandle,
573 IN DWORD_PTR ClientCallback,
574 IN DWORD_PTR ClientCallbackData,
575 IN DWORD Flags);
576
577
578 /*
579 thread.c
580 */
581
582 MMRESULT
583 CreateSoundThread(
584 OUT PSOUND_THREAD* Thread);
585
586 MMRESULT
587 DestroySoundThread(
588 IN PSOUND_THREAD Thread);
589
590 MMRESULT
591 CallSoundThread(
592 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
593 IN SOUND_THREAD_REQUEST_HANDLER RequestHandler,
594 IN PVOID Parameter OPTIONAL);
595
596
597 /*
598 utility.c
599 */
600
601 PVOID
602 AllocateMemory(
603 IN UINT Size);
604
605 VOID
606 FreeMemory(
607 IN PVOID Pointer);
608
609 UINT
610 GetMemoryAllocationCount();
611
612 UINT
613 GetDigitCount(
614 IN UINT Number);
615
616 MMRESULT
617 Win32ErrorToMmResult(
618 IN UINT ErrorCode);
619
620 MMRESULT
621 TranslateInternalMmResult(
622 IN MMRESULT Result);
623
624
625 /*
626 wave/format.c
627 */
628
629 MMRESULT
630 QueryWaveDeviceFormatSupport(
631 IN PSOUND_DEVICE SoundDevice,
632 IN LPWAVEFORMATEX Format,
633 IN DWORD FormatSize);
634
635 MMRESULT
636 SetWaveDeviceFormat(
637 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
638 IN DWORD DeviceId,
639 IN LPWAVEFORMATEX Format,
640 IN DWORD FormatSize);
641
642
643 /*
644 wave/header.c
645 */
646
647 MMRESULT
648 EnqueueWaveHeader(
649 PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
650 IN PVOID Parameter);
651
652 VOID
653 CompleteWaveHeader(
654 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
655 IN PWAVEHDR Header);
656
657 MMRESULT
658 PrepareWaveHeader(
659 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
660 IN PWAVEHDR Header);
661
662 MMRESULT
663 UnprepareWaveHeader(
664 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
665 IN PWAVEHDR Header);
666
667 MMRESULT
668 WriteWaveHeader(
669 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
670 IN PWAVEHDR Header);
671
672
673 /*
674 wave/streaming.c
675 */
676
677 VOID
678 DoWaveStreaming(
679 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
680
681 VOID CALLBACK
682 CompleteIO(
683 IN DWORD dwErrorCode,
684 IN DWORD dwNumberOfBytesTransferred,
685 IN LPOVERLAPPED lpOverlapped);
686
687 MMRESULT
688 CommitWaveHeaderToKernelDevice(
689 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
690 IN PWAVEHDR Header,
691 IN WAVE_COMMIT_FUNC CommitFunction);
692
693 MMRESULT
694 WriteFileEx_Committer(
695 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
696 IN PVOID OffsetPtr,
697 IN DWORD Length,
698 IN PSOUND_OVERLAPPED Overlap,
699 IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine);
700
701 MMRESULT
702 StopStreaming(
703 IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
704
705
706 /*
707 kernel.c
708 */
709
710 MMRESULT
711 OpenKernelSoundDeviceByName(
712 IN PWSTR DevicePath,
713 IN BOOLEAN ReadOnly,
714 OUT PHANDLE Handle);
715
716 MMRESULT
717 OpenKernelSoundDevice(
718 IN PSOUND_DEVICE SoundDevice,
719 IN BOOLEAN ReadOnly,
720 OUT PHANDLE Handle);
721
722 MMRESULT
723 CloseKernelSoundDevice(
724 IN HANDLE Handle);
725
726 MMRESULT
727 SyncOverlappedDeviceIoControl(
728 IN HANDLE SoundDeviceInstance,
729 IN DWORD IoControlCode,
730 IN LPVOID InBuffer,
731 IN DWORD InBufferSize,
732 OUT LPVOID OutBuffer,
733 IN DWORD OutBufferSize,
734 OUT LPDWORD BytesTransferred OPTIONAL);
735
736
737 #endif