22#define KERNEL_DEVICE_NAME L"\\\\.\\wdmaud"
39 WaitObjects[0] =
Instance->hNotifyEvent;
40 WaitObjects[1] =
Instance->hStopEvent;
74 Instance->WinMM.ClientCallbackInstanceData,
122 SND_ERR(
L"Call to IOCTL_GETNUMDEVS_TYPE failed\n");
152 SND_TRACE(
L"WDMAUD - GetWdmDeviceCapabilities DeviceType %u DeviceId %u\n",
DeviceType, DeviceId);
282 if (!DeviceInterfaceDetailData)
351 DeviceInfo.hDevice = SoundDeviceInstance->Handle;
396 SetEvent(SoundDeviceInstance->hStopEvent);
509 DeviceInfo.u.WaveFormatEx.cbSize = WaveFormat->cbSize;
510 DeviceInfo.u.WaveFormatEx.wFormatTag = WaveFormat->wFormatTag;
513 DeviceInfo.u.WaveFormatEx.nSamplesPerSec = 44100;
515 DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = 176400;
516 DeviceInfo.u.WaveFormatEx.wBitsPerSample = 16;
518 DeviceInfo.u.WaveFormatEx.nChannels = WaveFormat->nChannels;
519 DeviceInfo.u.WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec;
520 DeviceInfo.u.WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign;
521 DeviceInfo.u.WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec;
541 Instance->WaveFormatEx.wFormatTag = WaveFormat->wFormatTag;
542 Instance->WaveFormatEx.nChannels = WaveFormat->nChannels;
543 Instance->WaveFormatEx.nSamplesPerSec = WaveFormat->nSamplesPerSec;
544 Instance->WaveFormatEx.nBlockAlign = WaveFormat->nBlockAlign;
545 Instance->WaveFormatEx.nAvgBytesPerSec = WaveFormat->nAvgBytesPerSec;
549 Instance->WaveFormatEx.cbSize = WaveFormat->cbSize;
599 IN DWORD dwNumberOfBytesTransferred,
661 DeviceInfo->Header.PresentationTime.Numerator = 1;
662 DeviceInfo->Header.PresentationTime.Denominator = 1;
669 if (Overlap->Standard.hEvent ==
NULL)
776 *InterfaceSize =
DeviceInfo.u.Interface.DeviceInterfaceStringSize;
780 if (InterfaceLength <
DeviceInfo.u.Interface.DeviceInterfaceStringSize)
786 DeviceInfo.u.Interface.DeviceInterfaceStringSize = InterfaceLength;
DWORD SyncOverlappedDeviceIoControl(IN HANDLE Handle, IN DWORD IoControlCode, IN LPVOID InBuffer, IN DWORD InBufferSize, OUT LPVOID OutBuffer, IN DWORD OutBufferSize, OUT LPDWORD BytesTransferred OPTIONAL)
#define INVALID_HANDLE_VALUE
#define HeapFree(x, y, z)
BOOL WINAPI ReadFileEx(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead OPTIONAL, IN LPOVERLAPPED lpOverlapped, IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
BOOL WINAPI WriteFileEx(IN HANDLE hFile, IN LPCVOID lpBuffer, IN DWORD nNumberOfBytesToWrite OPTIONAL, IN LPOVERLAPPED lpOverlapped, IN LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
#define MXDM_GETCONTROLDETAILS
#define MXDM_GETLINECONTROLS
#define MXDM_SETCONTROLDETAILS
BOOL WINAPI DriverCallback(DWORD dwCallBack, UINT uFlags, HDRVR hDev, UINT wMsg, DWORD dwUser, DWORD dwParam1, DWORD dwParam2)
BOOL WINAPI SetupDiEnumDeviceInterfaces(HDEVINFO DeviceInfoSet, PSP_DEVINFO_DATA DeviceInfoData, CONST GUID *InterfaceClassGuid, DWORD MemberIndex, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData)
HDEVINFO WINAPI SetupDiGetClassDevsW(CONST GUID *class, LPCWSTR enumstr, HWND parent, DWORD flags)
BOOL WINAPI SetupDiGetDeviceInterfaceDetailW(HDEVINFO DeviceInfoSet, PSP_DEVICE_INTERFACE_DATA DeviceInterfaceData, PSP_DEVICE_INTERFACE_DETAIL_DATA_W DeviceInterfaceDetailData, DWORD DeviceInterfaceDetailDataSize, PDWORD RequiredSize, PSP_DEVINFO_DATA DeviceInfoData)
BOOL WINAPI SetupDiDestroyDeviceInfoList(HDEVINFO devinfo)
MMRESULT WdmAudSetMixerDeviceFormatByLegacy(IN PSOUND_DEVICE_INSTANCE Instance, IN DWORD DeviceId, IN PWAVEFORMATEX WaveFormat, IN DWORD WaveFormatSize)
MMRESULT WdmAudQueryMixerInfoByLegacy(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN DWORD DeviceId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags)
MMRESULT WdmAudOpenSoundDeviceByLegacy(IN PSOUND_DEVICE SoundDevice, OUT PVOID *Handle)
MMRESULT WdmAudGetWavePositionByLegacy(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN MMTIME *Time)
MMRESULT WdmAudSetVolumeByLegacy(_In_ PSOUND_DEVICE_INSTANCE SoundDeviceInstance, _In_ DWORD DeviceId, _In_ DWORD dwVolume)
MMRESULT WdmAudSetWaveStateByLegacy(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN BOOL bStart)
MMRESULT WdmAudGetDeviceInterfaceStringByLegacy(IN MMDEVICE_TYPE DeviceType, IN DWORD DeviceId, IN LPWSTR Interface, IN DWORD InterfaceLength, OUT DWORD *InterfaceSize)
MMRESULT WdmAudCloseSoundDeviceByLegacy(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN PVOID Handle)
MMRESULT WdmAudCommitWaveBufferByLegacy(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, IN PVOID OffsetPtr, IN DWORD Length, IN PSOUND_OVERLAPPED Overlap, IN LPOVERLAPPED_COMPLETION_ROUTINE CompletionRoutine)
MMRESULT WdmAudGetCapabilitiesByLegacy(IN PSOUND_DEVICE SoundDevice, IN DWORD DeviceId, OUT PVOID Capabilities, IN DWORD CapabilitiesSize)
MMRESULT WdmAudResetStreamByLegacy(IN struct _SOUND_DEVICE_INSTANCE *SoundDeviceInstance, IN MMDEVICE_TYPE DeviceType, IN BOOLEAN bStartReset)
MMRESULT WdmAudCleanupByLegacy()
MMRESULT WdmAudSetWaveDeviceFormatByLegacy(IN PSOUND_DEVICE_INSTANCE Instance, IN DWORD DeviceId, IN PWAVEFORMATEX WaveFormat, IN DWORD WaveFormatSize)
MMRESULT WdmAudGetVolumeByLegacy(_In_ PSOUND_DEVICE_INSTANCE SoundDeviceInstance, _In_ DWORD DeviceId, _Out_ PDWORD pdwVolume)
DWORD WINAPI MixerEventThreadRoutine(LPVOID Parameter)
MMRESULT WdmAudGetNumWdmDevsByLegacy(IN MMDEVICE_TYPE DeviceType, OUT DWORD *DeviceCount)
VOID CALLBACK LegacyCompletionRoutine(IN DWORD dwErrorCode, IN DWORD dwNumberOfBytesTransferred, IN LPOVERLAPPED lpOverlapped)
_Must_inspect_result_ typedef _Out_ PHIDP_CAPS Capabilities
struct _SOUND_DEVICE_INSTANCE * PSOUND_DEVICE_INSTANCE
struct _SOUND_OVERLAPPED * PSOUND_OVERLAPPED
#define VALIDATE_MMSYS_PARAMETER(parameter_condition)
MMRESULT GetSoundDeviceFromInstance(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PSOUND_DEVICE *SoundDevice)
#define CopyWideString(dest, source)
MMRESULT TranslateInternalMmResult(IN MMRESULT Result)
MMRESULT GetSoundDeviceInstanceHandle(IN PSOUND_DEVICE_INSTANCE SoundDeviceInstance, OUT PVOID *Handle)
MMRESULT GetSoundDeviceIdentifier(IN PSOUND_DEVICE SoundDevice, OUT PVOID *Identifier)
MMRESULT GetSoundDeviceType(IN PSOUND_DEVICE SoundDevice, OUT PMMDEVICE_TYPE DeviceType)
#define MMSUCCESS(result)
#define SND_ASSERT(condition)
struct tagMIXERLINECONTROLSW * LPMIXERLINECONTROLSW
#define MMSYSERR_MOREDATA
#define MMSYSERR_NOTSUPPORTED
struct tagMIXERCAPSW * LPMIXERCAPSW
struct tagWAVEINCAPSW * LPWAVEINCAPSW
struct tagMIDIOUTCAPSW * LPMIDIOUTCAPSW
struct tagMIDIINCAPSW * LPMIDIINCAPSW
struct tagMIXERLINEW * LPMIXERLINEW
struct tMIXERCONTROLDETAILS * LPMIXERCONTROLDETAILS
struct tagWAVEOUTCAPSW * LPWAVEOUTCAPSW
#define FILE_FLAG_OVERLAPPED
static PLARGE_INTEGER Time
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED lpOverlapped
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define DIGCF_DEVICEINTERFACE
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W SP_DEVICE_INTERFACE_DETAIL_DATA_W
struct _SP_DEVICE_INTERFACE_DETAIL_DATA_W * PSP_DEVICE_INTERFACE_DETAIL_DATA_W
struct _SP_DEVICE_INTERFACE_DATA SP_DEVICE_INTERFACE_DATA
#define IS_VALID_SOUND_DEVICE_TYPE(x)
WCHAR Data[ANYSIZE_ARRAY]
LPOVERLAPPED_COMPLETION_ROUTINE OriginalCompletionRoutine
WCHAR DevicePath[ANYSIZE_ARRAY]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
WCHAR szPname[MAXPNAMELEN]
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
DWORD WINAPI WaitForSingleObjectEx(IN HANDLE hHandle, IN DWORD dwMilliseconds, IN BOOL bAlertable)
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
#define RtlCopyMemory(Destination, Source, Length)
struct _LARGE_INTEGER::@2304 u
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_In_ WDFREQUEST _In_opt_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
#define IOCTL_GETFRAMESIZE
#define IOCTL_CLOSE_WDMAUD
#define IOCTL_GETCONTROLDETAILS
#define IOCTL_OPEN_WDMAUD
#define IOCTL_RESET_STREAM
#define IOCTL_GETCAPABILITIES
#define IOCTL_SETCONTROLDETAILS
#define IOCTL_GETLINEINFO
#define IOCTL_SETDEVICE_STATE
#define IOCTL_QUERYDEVICEINTERFACESTRING
#define IOCTL_GETNUMDEVS_TYPE
#define IOCTL_GETLINECONTROLS
#define IOCTL_GET_MIXER_EVENT
struct WDMAUD_DEVICE_INFO * PWDMAUD_DEVICE_INFO
void(CALLBACK * LPOVERLAPPED_COMPLETION_ROUTINE)(DWORD, DWORD, LPOVERLAPPED)
_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
_Inout_opt_ PVOID Parameter