17#define SOUND_KERNEL_BUFFER_COUNT 10
18#define SOUND_KERNEL_BUFFER_SIZE 16384
40 *SoundDeviceInstance = NewInstance;
66 if ( ! SoundDeviceInstance )
70 SoundDevice = SoundDeviceInstance->Device;
75 while ( CurrentInstance )
77 if ( CurrentInstance == SoundDeviceInstance )
80 CurrentInstance = CurrentInstance->
Next;
96 if ( ! SoundDevice->HeadInstance )
99 SoundDevice->HeadInstance = SoundDeviceInstance;
100 SoundDevice->TailInstance = SoundDeviceInstance;
105 SoundDevice->TailInstance->Next = SoundDeviceInstance;
106 SoundDevice->TailInstance = SoundDeviceInstance;
122 SND_TRACE(
L"Unlisting sound device instance\n");
129 PreviousInstance =
NULL;
132 while ( CurrentInstance )
134 if ( CurrentInstance == SoundDeviceInstance )
136 if ( ! PreviousInstance )
144 PreviousInstance->
Next = CurrentInstance->
Next;
147 if ( ! CurrentInstance->
Next )
154 PreviousInstance = CurrentInstance;
155 CurrentInstance = CurrentInstance->
Next;
169 SND_TRACE(
L"Creating a sound device instance\n");
194 (*SoundDeviceInstance)->Next =
NULL;
195 (*SoundDeviceInstance)->Device = SoundDevice;
196 (*SoundDeviceInstance)->Handle =
NULL;
197 (*SoundDeviceInstance)->Thread =
NULL;
200 (*SoundDeviceInstance)->WinMM.ClientCallback = 0;
201 (*SoundDeviceInstance)->WinMM.ClientCallbackInstanceData = 0;
202 (*SoundDeviceInstance)->WinMM.Flags = 0;
205 (*SoundDeviceInstance)->HeadWaveHeader =
NULL;
206 (*SoundDeviceInstance)->TailWaveHeader =
NULL;
208 (*SoundDeviceInstance)->OutstandingBuffers = 0;
210 (*SoundDeviceInstance)->LoopsRemaining = 0;
249 SND_TRACE(
L"Destroying a sound device instance\n");
274 if ( SoundDeviceInstance->Thread )
285 SoundDeviceInstance->Thread =
NULL;
311 SoundDeviceInstance = SoundDevice->HeadInstance;
313 while ( SoundDeviceInstance )
315 NextDeviceInstance = SoundDeviceInstance->
Next;
318 SoundDeviceInstance = NextDeviceInstance;
332 *SoundDevice = SoundDeviceInstance->Device;
345 *
Handle = SoundDeviceInstance->Handle;
360 SND_TRACE(
L"Setting MME data - handle %x, callback %x, instance data %x, flags %x\n",
361 MmeHandle, ClientCallback, ClientCallbackData,
Flags);
363 SoundDeviceInstance->WinMM.Handle = MmeHandle;
364 SoundDeviceInstance->WinMM.ClientCallback = ClientCallback;
365 SoundDeviceInstance->WinMM.ClientCallbackInstanceData = ClientCallbackData;
366 SoundDeviceInstance->WinMM.Flags =
Flags;
static VOID FreeMemory(PCREATE_DATA Data)
MMRESULT DestroyAllSoundDeviceInstances(IN PSOUND_DEVICE SoundDevice)
#define SOUND_KERNEL_BUFFER_COUNT
VOID FreeSoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
MMRESULT SetSoundDeviceInstanceMmeData(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN HDRVR MmeHandle, IN DWORD_PTR ClientCallback, IN DWORD_PTR ClientCallbackData, IN DWORD Flags)
MMRESULT AllocateSoundDeviceInstance(OUT PSOUND_DEVICE_INSTANCE *SoundDeviceInstance)
#define SOUND_KERNEL_BUFFER_SIZE
MMRESULT GetSoundDeviceFromInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PSOUND_DEVICE *SoundDevice)
MMRESULT UnlistSoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
MMRESULT ListSoundDeviceInstance(IN PSOUND_DEVICE SoundDevice, IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
MMRESULT GetSoundDeviceInstanceHandle(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PVOID *Handle)
MMRESULT DestroySoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
BOOLEAN IsValidSoundDeviceInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance)
MMRESULT CreateSoundDeviceInstance(IN PSOUND_DEVICE SoundDevice, OUT PSOUND_DEVICE_INSTANCE *SoundDeviceInstance)
#define INVALID_HANDLE_VALUE
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
BOOLEAN IsValidSoundDevice(IN PSOUND_DEVICE SoundDevice)
MMRESULT CreateSoundThread(OUT PSOUND_THREAD *Thread)
#define VALIDATE_MMSYS_PARAMETER(parameter_condition)
#define AllocateStruct(thing)
MMRESULT GetSoundDeviceFunctionTable(IN PSOUND_DEVICE SoundDevice, OUT PMMFUNCTION_TABLE *FunctionTable)
MMRESULT DestroySoundThread(IN PSOUND_THREAD Thread)
MMRESULT TranslateInternalMmResult(IN MMRESULT Result)
#define MMSUCCESS(result)
#define SND_ASSERT(condition)
#define MMSYSERR_NOTSUPPORTED
struct _SOUND_DEVICE_INSTANCE * Next
struct _SOUND_DEVICE_INSTANCE * HeadInstance
struct _SOUND_DEVICE_INSTANCE * TailInstance
static WLX_DISPATCH_VERSION_1_4 FunctionTable
_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
_Must_inspect_result_ _In_ ULONG Flags