ReactOS  0.4.14-dev-323-g6fe6a88
mmebuddy.h
Go to the documentation of this file.
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  Some memory allocation helper macros
25 */
26 
27 #define AllocateStruct(thing) \
28  (thing*) AllocateMemory(sizeof(thing))
29 
30 #define StringLengthToBytes(chartype, string_length) \
31  ( ( string_length + 1 ) * sizeof(chartype) )
32 
33 #define AllocateWideString(string_length) \
34  (PWSTR) AllocateMemory(StringLengthToBytes(WCHAR, string_length))
35 
36 #define ZeroWideString(string) \
37  ZeroMemory(string, StringLengthToBytes(WCHAR, wcslen(string)))
38 
39 #define CopyWideString(dest, source) \
40  CopyMemory(dest, source, StringLengthToBytes(WCHAR, wcslen(source)))
41 
42 
43 /*
44  Helps find the minimum/maximum of two values
45 */
46 
47 #define MinimumOf(value_a, value_b) \
48  ( value_a < value_b ? value_a : value_b )
49 
50 #define MaximumOf(value_a, value_b) \
51  ( value_a > value_b ? value_a : value_b )
52 
53 
54 /*
55  Convert a device type into a zero-based array index
56 */
57 
58 #define SOUND_DEVICE_TYPE_TO_INDEX(x) \
59  ( x - MIN_SOUND_DEVICE_TYPE )
60 
61 #define INDEX_TO_SOUND_DEVICE_TYPE(x) \
62  ( x + MIN_SOUND_DEVICE_TYPE )
63 
64 
65 /*
66  Validation
67 */
68 
69 #define IsValidSoundDeviceType IS_VALID_SOUND_DEVICE_TYPE
70 
71 #define VALIDATE_MMSYS_PARAMETER(parameter_condition) \
72  { \
73  if ( ! (parameter_condition) ) \
74  { \
75  SND_ERR(L"FAILED parameter check: %hS at File %S Line %lu\n", #parameter_condition, __FILE__, __LINE__); \
76  return MMSYSERR_INVALPARAM; \
77  } \
78  }
79 
80 #define MMSUCCESS(result) \
81  ( result == MMSYSERR_NOERROR )
82 
83 
84 /*
85  Types and Structures
86 */
87 
89 struct _SOUND_DEVICE;
91 
92 
93 #define DEFINE_GETCAPS_FUNCTYPE(func_typename, caps_type) \
94  typedef MMRESULT (*func_typename)( \
95  IN struct _SOUND_DEVICE* SoundDevice, \
96  IN DWORD DeviceId, \
97  OUT caps_type Capabilities, \
98  IN DWORD CapabilitiesSize);
99 
100 /* This one is for those of us who don't care */
101 DEFINE_GETCAPS_FUNCTYPE(MMGETCAPS_FUNC, PVOID);
102 
103 /* These are for those of us that do */
104 DEFINE_GETCAPS_FUNCTYPE(MMGETWAVEOUTCAPS_FUNC, LPWAVEOUTCAPS);
105 DEFINE_GETCAPS_FUNCTYPE(MMGETWAVEINCAPS_FUNC, LPWAVEINCAPS );
106 DEFINE_GETCAPS_FUNCTYPE(MMGETMIDIOUTCAPS_FUNC, LPMIDIOUTCAPS);
107 DEFINE_GETCAPS_FUNCTYPE(MMGETMIDIINCAPS_FUNC, LPMIDIINCAPS );
108 
109 struct _SOUND_DEVICE;
111 
112 
113 /*
114  By extending the OVERLAPPED structure, it becomes possible to provide the
115  I/O completion routines with additional information.
116 */
117 
118 typedef struct _SOUND_OVERLAPPED
119 {
124 
127 
129 
131  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
132  IN PVOID OffsetPtr,
133  IN DWORD Bytes,
134  IN PSOUND_OVERLAPPED Overlap,
136 
138  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
139  IN DWORD DeviceId,
140  IN UINT uMsg,
142  IN DWORD Flags);
143 
145  IN struct _SOUND_DEVICE* Device,
146  IN PWAVEFORMATEX WaveFormat,
147  IN DWORD WaveFormatSize);
148 
151  IN DWORD DeviceId,
152  IN PWAVEFORMATEX WaveFormat,
153  IN DWORD WaveFormatSize);
154 
156  IN struct _SOUND_DEVICE* SoundDevice,
157  OUT PVOID* Handle);
158 
160  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
161  IN PVOID Handle); /* not sure about this */
162 
164  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
165  IN PWAVEHDR WaveHeader);
166 
168  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
169  IN PVOID Buffer,
170  IN DWORD Length);
171 
173  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
174  IN MMTIME* Time);
175 
176 
178  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
179  IN BOOL bStart);
180 
181 
184  IN DWORD DeviceId,
186  IN DWORD InterfaceLength,
187  OUT DWORD * InterfaceSize);
188 
190  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
192  IN BOOLEAN bStartReset);
193 
194 typedef struct _MMFUNCTION_TABLE
195 {
196  union
197  {
198  MMGETCAPS_FUNC GetCapabilities;
199  MMGETWAVEOUTCAPS_FUNC GetWaveOutCapabilities;
200  MMGETWAVEINCAPS_FUNC GetWaveInCapabilities;
201  MMGETMIDIOUTCAPS_FUNC GetMidiOutCapabilities;
202  MMGETMIDIINCAPS_FUNC GetMidiInCapabilities;
203  };
204 
207 
210 
212 
214 
219 
220  // Redundant
221  //MMWAVEHEADER_FUNC PrepareWaveHeader;
222  //MMWAVEHEADER_FUNC UnprepareWaveHeader;
223  //MMWAVEHEADER_FUNC WriteWaveHeader;
224 
225  //MMWAVEHEADER_FUNC SubmitWaveHeaderToDevice;
226  //MMBUFFER_FUNC CompleteBuffer;
228 
229 
230 
232  IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance,
233  IN PVOID Parameter);
234 
235 typedef struct _SOUND_THREAD
236 {
239 
240  struct
241  {
245  } Events;
246 
247  struct
248  {
253  } Request;
255 
256 typedef struct _SOUND_DEVICE
257 {
262  PVOID Identifier; /* Path for NT4 drivers */
263  /*PWSTR Path;*/
266 
268 {
273 
274  /* Stuff generously donated to us from WinMM */
275  struct
276  {
277  HDRVR Handle;
281  } WinMM;
282 
283  /* DO NOT TOUCH THESE OUTSIDE OF THE SOUND THREAD */
284 
285  union
286  {
288  };
289 
290  union
291  {
293  };
294 
296  //PWAVEHDR CurrentWaveHeader;
308 
309 /* This lives in WAVEHDR.reserved */
310 typedef struct _WAVEHDR_EXTENSION
311 {
315 
316 
317 /*
318  reentrancy.c
319 */
320 
321 MMRESULT
323 
324 VOID
326 
327 VOID
330 
331 VOID
334 
335 
336 /*
337  mme.c
338 */
339 
340 VOID
342  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
343  IN UINT Message,
345 
346 MMRESULT
349  IN DWORD DeviceId,
351  IN DWORD CapabilitiesSize);
352 
353 MMRESULT
356  IN UINT DeviceId,
357  IN LPWAVEOPENDESC OpenParameters,
358  IN DWORD Flags,
359  OUT DWORD_PTR* PrivateHandle);
360 
361 MMRESULT
363  IN DWORD_PTR PrivateHandle);
364 
365 MMRESULT
368  IN DWORD DeviceId,
369  IN DWORD_PTR PrivateHandle,
370  IN MMTIME* Time,
371  IN DWORD Size);
372 
373 MMRESULT
376  IN DWORD DeviceId,
378  IN DWORD InterfaceLength,
379  OUT DWORD * InterfaceSize);
380 
381 
382 MMRESULT
384  IN DWORD_PTR PrivateHandle,
385  IN BOOL bStart);
386 
387 
388 #define MmePrepareWaveHeader(private_handle, header) \
389  PrepareWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
390 
391 #define MmeUnprepareWaveHeader(private_handle, header) \
392  UnprepareWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
393 
394 #define MmeWriteWaveHeader(private_handle, header) \
395  WriteWaveHeader((PSOUND_DEVICE_INSTANCE)private_handle, (PWAVEHDR)header)
396 
397 MMRESULT
399  IN DWORD_PTR PrivateHandle);
400 
401 
402 /*
403  capabilities.c
404 */
405 
406 MMRESULT
408  IN PSOUND_DEVICE SoundDevice,
409  IN DWORD DeviceId,
411  IN DWORD CapabilitiesSize);
412 
413 
414 /*
415  devicelist.c
416 */
417 
418 ULONG
421 
422 BOOLEAN
424  IN PSOUND_DEVICE SoundDevice);
425 
426 MMRESULT
429  IN PVOID Identifier OPTIONAL,
430  OUT PSOUND_DEVICE* SoundDevice OPTIONAL);
431 
432 MMRESULT
435  IN PSOUND_DEVICE SoundDevice);
436 
437 MMRESULT
440 
441 VOID
443 
444 MMRESULT
447  IN DWORD DeviceIndex,
449 
450 MMRESULT
452  IN PSOUND_DEVICE SoundDevice,
453  OUT PVOID* Identifier);
454 
455 MMRESULT
457  IN PSOUND_DEVICE SoundDevice,
459 
460 
461 /*
462  functiontable.c
463 */
464 
465 MMRESULT
467  IN PSOUND_DEVICE SoundDevice,
469 
470 MMRESULT
472  IN PSOUND_DEVICE SoundDevice,
474 
475 
476 /*
477  deviceinstance.c
478 */
479 
480 BOOLEAN
482  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
483 
484 MMRESULT
486  IN PSOUND_DEVICE SoundDevice,
487  OUT PSOUND_DEVICE_INSTANCE* SoundDeviceInstance);
488 
489 MMRESULT
491  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
492 
493 MMRESULT
495  IN PSOUND_DEVICE SoundDevice);
496 
497 MMRESULT
499  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
500  OUT PSOUND_DEVICE* SoundDevice);
501 
502 MMRESULT
504  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
505  OUT PVOID* Handle);
506 
507 MMRESULT
509  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
510  IN HDRVR MmeHandle,
511  IN DWORD_PTR ClientCallback,
512  IN DWORD_PTR ClientCallbackData,
513  IN DWORD Flags);
514 
515 
516 /*
517  thread.c
518 */
519 
520 MMRESULT
523 
524 MMRESULT
527 
528 MMRESULT
530  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
533 
534 
535 /*
536  utility.c
537 */
538 
539 PVOID
541  IN UINT Size);
542 
543 VOID
544 FreeMemory(
545  IN PVOID Pointer);
546 
547 UINT
549 
550 UINT
552  IN UINT Number);
553 
554 MMRESULT
556  IN UINT ErrorCode);
557 
558 MMRESULT
560  IN MMRESULT Result);
561 
562 
563 /*
564  wave/format.c
565 */
566 
567 MMRESULT
569  IN PSOUND_DEVICE SoundDevice,
571  IN DWORD FormatSize);
572 
573 MMRESULT
575  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
576  IN DWORD DeviceId,
578  IN DWORD FormatSize);
579 
580 
581 /*
582  wave/header.c
583 */
584 
585 MMRESULT
587  PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
588  IN PVOID Parameter);
589 
590 VOID
592  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
593  IN PWAVEHDR Header);
594 
595 MMRESULT
597  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
598  IN PWAVEHDR Header);
599 
600 MMRESULT
602  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
603  IN PWAVEHDR Header);
604 
605 MMRESULT
607  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
608  IN PWAVEHDR Header);
609 
610 
611 /*
612  wave/streaming.c
613 */
614 
615 VOID
617  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
618 
620 CompleteIO(
621  IN DWORD dwErrorCode,
622  IN DWORD dwNumberOfBytesTransferred,
624 
625 MMRESULT
627  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
629  IN WAVE_COMMIT_FUNC CommitFunction);
630 
631 MMRESULT
633  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance,
634  IN PVOID OffsetPtr,
635  IN DWORD Length,
636  IN PSOUND_OVERLAPPED Overlap,
638 
639 MMRESULT
641  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
642 
643 VOID
645  IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance);
646 
647 /*
648  kernel.c
649 */
650 
651 MMRESULT
653  IN PWSTR DevicePath,
655  OUT PHANDLE Handle);
656 
657 MMRESULT
659  IN PSOUND_DEVICE SoundDevice,
661  OUT PHANDLE Handle);
662 
663 MMRESULT
665  IN HANDLE Handle);
666 
667 MMRESULT
669  IN HANDLE SoundDeviceInstance,
671  IN LPVOID InBuffer,
673  OUT LPVOID OutBuffer,
675  OUT LPDWORD BytesTransferred OPTIONAL);
676 
677 
678 #endif
MMFUNCTION_TABLE FunctionTable
Definition: mmebuddy.h:264
MMRESULT MmeGetDeviceInterfaceString(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN LPWSTR Interface, IN DWORD InterfaceLength, OUT DWORD *InterfaceSize)
Definition: mmewrap.c:294
#define IN
Definition: typedefs.h:38
MMRESULT ListSoundDevice(IN MMDEVICE_TYPE DeviceType, IN PVOID Identifier OPTIONAL, OUT PSOUND_DEVICE *SoundDevice OPTIONAL)
Definition: devicelist.c:131
BOOL PerformCompletion
Definition: mmebuddy.h:123
MMGETPOS_FUNC GetPos
Definition: mmebuddy.h:215
MMRESULT(* MMQUERYDEVICEINTERFACESTRING_FUNC)(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN LPWSTR Interface, IN DWORD InterfaceLength, OUT DWORD *InterfaceSize)
Definition: mmebuddy.h:182
PVOID CompletionContext
Definition: mmebuddy.h:126
VOID InitiateSoundStreaming(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
Definition: streaming.c:383
_In_ NDIS_ERROR_CODE ErrorCode
Definition: ndis.h:4436
MMRESULT(* SOUND_THREAD_REQUEST_HANDLER)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PVOID Parameter)
Definition: mmebuddy.h:231
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ ULONG IoControlCode
Definition: fltkernel.h:1383
MMGETWAVEINCAPS_FUNC GetWaveInCapabilities
Definition: mmebuddy.h:200
struct _SOUND_DEVICE_INSTANCE * TailInstance
Definition: mmebuddy.h:260
struct _SOUND_DEVICE * Device
Definition: mmebuddy.h:270
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
MMRESULT Win32ErrorToMmResult(IN UINT ErrorCode)
Definition: utility.c:87
MMRESULT SetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, IN PMMFUNCTION_TABLE FunctionTable)
Definition: functiontable.c:21
UCHAR * PMMDEVICE_TYPE
Definition: mmebuddy.h:88
MMRESULT CallSoundThread(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN SOUND_THREAD_REQUEST_HANDLER RequestHandler, IN PVOID Parameter OPTIONAL)
Definition: thread.c:71
UINT GetDigitCount(IN UINT Number)
Definition: utility.c:68
MMRESULT GetSoundDeviceIdentifier(IN PSOUND_DEVICE SoundDevice, OUT PVOID *Identifier)
Definition: devicelist.c:328
uint16_t * PWSTR
Definition: typedefs.h:54
DeviceType
Definition: mmdrv.h:41
Definition: arc.h:80
MMRESULT SetWaveDeviceFormat(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN DWORD DeviceId, IN LPWAVEFORMATEX Format, IN DWORD FormatSize)
Definition: format.c:49
MMRESULT StopStreaming(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
Definition: streaming.c:334
DWORD_PTR ClientCallbackInstanceData
Definition: mmebuddy.h:280
#define CALLBACK
Definition: compat.h:27
MMRESULT WriteFileEx_Committer(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PVOID OffsetPtr, IN DWORD Length, IN PSOUND_OVERLAPPED Overlap, IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine)
Definition: streaming.c:238
DWORD BytesCommitted
Definition: mmebuddy.h:312
_In_ UINT Bytes
Definition: mmcopy.h:9
MMRESETSTREAM_FUNC ResetStream
Definition: mmebuddy.h:218
struct _SOUND_DEVICE SOUND_DEVICE
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG OutBufferSize
Definition: classpnp.h:429
MMRESULT TranslateInternalMmResult(IN MMRESULT Result)
Definition: utility.c:132
MMRESULT(* MMGETPOS_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN MMTIME *Time)
Definition: mmebuddy.h:172
UINT MMRESULT
Definition: mmsystem.h:962
VOID CleanupEntrypointMutexes(VOID)
MMRESULT(* MMRESETSTREAM_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN MMDEVICE_TYPE DeviceType, IN BOOLEAN bStartReset)
Definition: mmebuddy.h:189
PWAVEHDR HeadWaveHeader
Definition: mmebuddy.h:287
MMCLOSE_FUNC Close
Definition: mmebuddy.h:206
_In_ PVOID Parameter
Definition: ldrtypes.h:241
MMRESULT QueryWaveDeviceFormatSupport(IN PSOUND_DEVICE SoundDevice, IN LPWAVEFORMATEX Format, IN DWORD FormatSize)
Definition: format.c:14
MMRESULT GetSoundDevice(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceIndex, OUT PSOUND_DEVICE *Device)
Definition: devicelist.c:289
PVOID Identifier
Definition: mmebuddy.h:262
MMRESULT CreateSoundThread(OUT PSOUND_THREAD *Thread)
Definition: thread.c:209
struct _SOUND_DEVICE_INSTANCE * SoundDeviceInstance
Definition: mmebuddy.h:121
OVERLAPPED Standard
Definition: mmebuddy.h:120
struct _SOUND_THREAD * Thread
Definition: mmebuddy.h:272
#define DEFINE_GETCAPS_FUNCTYPE(func_typename, caps_type)
Definition: mmebuddy.h:93
MMRESULT SetSoundDeviceInstanceMmeData(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN HDRVR MmeHandle, IN DWORD_PTR ClientCallback, IN DWORD_PTR ClientCallbackData, IN DWORD Flags)
MMRESULT MmeGetSoundDeviceCapabilities(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN PVOID Capabilities, IN DWORD CapabilitiesSize)
Definition: mmewrap.c:103
struct _SOUND_DEVICE_INSTANCE * PSOUND_DEVICE_INSTANCE
MMRESULT DestroySoundThread(IN PSOUND_THREAD Thread)
Definition: thread.c:272
VOID NotifyMmeClient(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN UINT Message, IN DWORD_PTR Parameter)
Definition: mmewrap.c:75
WAVE_COMMIT_FUNC CommitWaveBuffer
Definition: mmebuddy.h:213
MMRESULT UnprepareWaveHeader(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PWAVEHDR Header)
Definition: header.c:126
UCHAR MMDEVICE_TYPE
Definition: mmebuddy.h:88
MMRESULT GetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, OUT PMMFUNCTION_TABLE *FunctionTable)
Definition: functiontable.c:47
struct _MMFUNCTION_TABLE MMFUNCTION_TABLE
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
PVOID Parameter
Definition: mmebuddy.h:251
MMWAVEQUERYFORMATSUPPORT_FUNC QueryWaveFormatSupport
Definition: mmebuddy.h:208
SOUND_THREAD_REQUEST_HANDLER Handler
Definition: mmebuddy.h:249
MMRESULT OpenKernelSoundDeviceByName(IN PWSTR DevicePath, IN BOOLEAN ReadOnly, OUT PHANDLE Handle)
Definition: kernel.c:23
Definition: Header.h:8
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
Definition: hidclass.h:103
unsigned int BOOL
Definition: ntddk_ex.h:94
MMRESULT Result
Definition: mmebuddy.h:252
MMGETCAPS_FUNC GetCapabilities
Definition: mmebuddy.h:198
VOID DoWaveStreaming(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
Definition: streaming.c:20
VOID AcquireEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:75
unsigned char BOOLEAN
MMRESULT(* MMOPEN_FUNC)(IN struct _SOUND_DEVICE *SoundDevice, OUT PVOID *Handle)
Definition: mmebuddy.h:155
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:426
MMRESULT CreateSoundDeviceInstance(IN PSOUND_DEVICE SoundDevice, OUT PSOUND_DEVICE_INSTANCE *SoundDeviceInstance)
DWORD BytesCompleted
Definition: mmebuddy.h:313
struct _WAVEHDR_EXTENSION WAVEHDR_EXTENSION
HANDLE Ready
Definition: mmebuddy.h:242
MMRESULT(* MMWAVEQUERYFORMATSUPPORT_FUNC)(IN struct _SOUND_DEVICE *Device, IN PWAVEFORMATEX WaveFormat, IN DWORD WaveFormatSize)
Definition: mmebuddy.h:144
BOOLEAN IsValidSoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
ULONG GetSoundDeviceCount(IN MMDEVICE_TYPE DeviceType)
Definition: devicelist.c:67
MMRESULT PrepareWaveHeader(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PWAVEHDR Header)
Definition: header.c:89
struct _SOUND_THREAD * PSOUND_THREAD
MMRESULT(* MMMIXERQUERY_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags)
Definition: mmebuddy.h:137
struct _SOUND_DEVICE_INSTANCE * HeadInstance
Definition: mmebuddy.h:259
struct _SOUND_OVERLAPPED * PSOUND_OVERLAPPED
_In_ HANDLE Handle
Definition: extypes.h:390
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
MMDEVICE_TYPE Type
Definition: mmebuddy.h:261
MMRESULT EnqueueWaveHeader(PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PVOID Parameter)
Definition: header.c:218
MMRESULT DestroyAllSoundDeviceInstances(IN PSOUND_DEVICE SoundDevice)
struct _SOUND_DEVICE * PSOUND_DEVICE
_In_ PIRP _In_ ULONG _In_ ULONG _In_ ULONG InBufferSize
Definition: classpnp.h:429
MMRESULT SyncOverlappedDeviceIoControl(IN HANDLE SoundDeviceInstance, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
Definition: misc.c:298
MMRESULT MmeGetPosition(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN DWORD_PTR PrivateHandle, IN MMTIME *Time, IN DWORD Size)
Definition: mmewrap.c:327
MMRESULT WriteWaveHeader(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PWAVEHDR Header)
Definition: header.c:159
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
MMSETSTATE_FUNC SetState
Definition: mmebuddy.h:216
struct _WAVEHDR_EXTENSION * PWAVEHDR_EXTENSION
BOOL Running
Definition: mmebuddy.h:238
MMGETWAVEOUTCAPS_FUNC GetWaveOutCapabilities
Definition: mmebuddy.h:199
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
CHAR Message[80]
Definition: alive.c:5
MMRESULT MmeCloseDevice(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:225
UINT GetMemoryAllocationCount(VOID)
unsigned char UCHAR
Definition: xmlstorage.h:181
struct _SOUND_DEVICE * Next
Definition: mmebuddy.h:258
MMRESULT DestroySoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
MMGETMIDIOUTCAPS_FUNC GetMidiOutCapabilities
Definition: mmebuddy.h:201
PWAVEHDR TailWaveHeader
Definition: mmebuddy.h:292
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:414
struct _SOUND_DEVICE_INSTANCE * SoundDeviceInstance
Definition: mmebuddy.h:250
HANDLE Handle
Definition: mmebuddy.h:237
struct _SOUND_THREAD SOUND_THREAD
MMRESULT CommitWaveHeaderToKernelDevice(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PWAVEHDR Header, IN WAVE_COMMIT_FUNC CommitFunction)
VOID CALLBACK CompleteIO(IN DWORD dwErrorCode, IN DWORD dwNumberOfBytesTransferred, IN LPOVERLAPPED lpOverlapped)
Definition: streaming.c:157
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
VOID UnlistAllSoundDevices(VOID)
uint32_t DWORD_PTR
Definition: typedefs.h:63
_In_opt_ PENTER_STATE_SYSTEM_HANDLER _In_opt_ PVOID _In_ LONG _In_opt_ LONG volatile * Number
Definition: ntpoapi.h:204
MMRESULT(* MMWAVESETFORMAT_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *Instance, IN DWORD DeviceId, IN PWAVEFORMATEX WaveFormat, IN DWORD WaveFormatSize)
Definition: mmebuddy.h:149
void(CALLBACK * LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPOVERLAPPED)
Definition: winbase.h:1411
MMMIXERQUERY_FUNC QueryMixerInfo
Definition: mmebuddy.h:211
MMGETMIDIINCAPS_FUNC GetMidiInCapabilities
Definition: mmebuddy.h:202
struct _SOUND_DEVICE_INSTANCE SOUND_DEVICE_INSTANCE
MMRESULT MmeOpenDevice(IN MMDEVICE_TYPE DeviceType, IN UINT DeviceId, IN LPWAVEOPENDESC OpenParameters, IN DWORD Flags, OUT DWORD_PTR *PrivateHandle)
Definition: mmewrap.c:132
LPOVERLAPPED_COMPLETION_ROUTINE OriginalCompletionRoutine
Definition: mmebuddy.h:125
PVOID AllocateMemory(IN UINT Size)
Definition: utility.c:20
MMRESULT MmeSetState(IN DWORD_PTR PrivateHandle, IN BOOL bStart)
Definition: mmewrap.c:19
WAVEFORMATEX WaveFormatEx
Definition: mmebuddy.h:301
MMQUERYDEVICEINTERFACESTRING_FUNC GetDeviceInterfaceString
Definition: mmebuddy.h:217
HANDLE Done
Definition: mmebuddy.h:244
BOOLEAN IsValidSoundDevice(IN PSOUND_DEVICE SoundDevice)
Definition: devicelist.c:87
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
Definition: mswsock.h:90
MMRESULT(* MMBUFFER_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PVOID Buffer, IN DWORD Length)
Definition: mmebuddy.h:167
MMRESULT GetSoundDeviceType(IN PSOUND_DEVICE SoundDevice, OUT PMMDEVICE_TYPE DeviceType)
Definition: devicelist.c:346
HANDLE Request
Definition: mmebuddy.h:243
MMRESULT CloseKernelSoundDevice(IN HANDLE Handle)
Definition: kernel.c:58
MMRESULT UnlistSoundDevices(IN MMDEVICE_TYPE DeviceType)
Definition: devicelist.c:245
MMOPEN_FUNC Open
Definition: mmebuddy.h:205
MMRESULT InitEntrypointMutexes(VOID)
unsigned int UINT
Definition: ndis.h:50
PWAVEHDR WaveLoopStart
Definition: mmebuddy.h:295
VOID FreeMemory(IN PVOID Pointer)
Definition: utility.c:42
MMRESULT UnlistSoundDevice(IN MMDEVICE_TYPE DeviceType, IN PSOUND_DEVICE SoundDevice)
Definition: devicelist.c:188
IN PVOID Instance
Definition: pci.h:359
MMRESULT(* MMSETSTATE_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN BOOL bStart)
Definition: mmebuddy.h:177
MMRESULT(* MMCLOSE_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PVOID Handle)
Definition: mmebuddy.h:159
struct _SOUND_OVERLAPPED SOUND_OVERLAPPED
struct _SOUND_THREAD::@3338 Events
struct _SOUND_DEVICE_INSTANCE * Next
Definition: mmebuddy.h:269
MMRESULT(* MMWAVEHEADER_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PWAVEHDR WaveHeader)
Definition: mmebuddy.h:163
VOID CompleteWaveHeader(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PWAVEHDR Header)
Definition: header.c:274
#define OUT
Definition: typedefs.h:39
VOID ReleaseEntrypointMutex(IN MMDEVICE_TYPE DeviceType)
Definition: reentrancy.c:92
uint32_t * LPDWORD
Definition: typedefs.h:57
MMRESULT OpenKernelSoundDevice(IN PSOUND_DEVICE SoundDevice, IN BOOLEAN ReadOnly, OUT PHANDLE Handle)
_In_ PIRP _In_opt_ PVOID _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
Definition: fsrtlfuncs.h:673
PWAVEHDR Header
Definition: mmebuddy.h:122
unsigned int ULONG
Definition: retypes.h:1
MMRESULT(* WAVE_COMMIT_FUNC)(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PVOID OffsetPtr, IN DWORD Bytes, IN PSOUND_OVERLAPPED Overlap, IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine)
Definition: mmebuddy.h:130
static WLX_DISPATCH_VERSION_1_4 FunctionTable
Definition: wlx.c:736
MMRESULT GetSoundDeviceFromInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PSOUND_DEVICE *SoundDevice)
struct _SOUND_DEVICE_INSTANCE::@3340 WinMM
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct _MMFUNCTION_TABLE * PMMFUNCTION_TABLE
MMRESULT GetSoundDeviceInstanceHandle(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PVOID *Handle)
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
MMRESULT MmeResetWavePlayback(IN DWORD_PTR PrivateHandle)
Definition: mmewrap.c:280
MMWAVESETFORMAT_FUNC SetWaveFormat
Definition: mmebuddy.h:209
static PLARGE_INTEGER Time
Definition: time.c:105
DWORD_PTR ClientCallback
Definition: mmebuddy.h:279
MMRESULT GetSoundDeviceCapabilities(IN PSOUND_DEVICE SoundDevice, IN DWORD DeviceId, OUT PVOID Capabilities, IN DWORD CapabilitiesSize)
Definition: capabilities.c:24
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68