X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=drivers%2Fwdm%2Faudio%2Flegacy%2Fwdmaud%2Fmmixer.c;h=3016d24c67350f8ad6b95cdb83247d9c36a1ec8d;hp=9887d0974a2d08f77940a180b8728ef30d3560ba;hb=c51df789e869379a515d94c66da152c5b26660ff;hpb=d788a52c79f5822cc8a21920de421b77519ebd94 diff --git a/drivers/wdm/audio/legacy/wdmaud/mmixer.c b/drivers/wdm/audio/legacy/wdmaud/mmixer.c index 9887d0974a2..3016d24c673 100644 --- a/drivers/wdm/audio/legacy/wdmaud/mmixer.c +++ b/drivers/wdm/audio/legacy/wdmaud/mmixer.c @@ -480,7 +480,7 @@ WdmAudControlCloseMixer( IN ULONG Index) { /* Remove event associated to this client */ - if (MMixerClose(&MixerContext, DeviceInfo->DeviceIndex, ClientInfo, EventCallback)) + if (MMixerClose(&MixerContext, DeviceInfo->DeviceIndex, ClientInfo, EventCallback) != MM_STATUS_SUCCESS) { DPRINT1("Failed to close mixer\n"); return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, sizeof(WDMAUD_DEVICE_INFO)); @@ -497,6 +497,34 @@ WdmAudControlCloseMixer( return SetIrpIoStatus(Irp, STATUS_SUCCESS, sizeof(WDMAUD_DEVICE_INFO)); } +VOID +WdmAudCloseAllMixers( + IN PDEVICE_OBJECT DeviceObject, + IN PWDMAUD_CLIENT ClientInfo, + IN ULONG Index) +{ + ULONG DeviceCount, DeviceIndex; + + /* Get all mixers */ + DeviceCount = GetSysAudioDeviceCount(DeviceObject); + + /* Close every mixer attached to the device */ + for (DeviceIndex = 0; DeviceIndex < DeviceCount; DeviceIndex++) + { + if (MMixerClose(&MixerContext, DeviceIndex, ClientInfo, EventCallback) != MM_STATUS_SUCCESS) + { + DPRINT1("Failed to close mixer for device %lu\n", DeviceIndex); + } + } + + /* Dereference event */ + if (ClientInfo->hPins[Index].NotifyEvent) + { + ObDereferenceObject(ClientInfo->hPins[Index].NotifyEvent); + ClientInfo->hPins[Index].NotifyEvent = NULL; + } +} + NTSTATUS NTAPI WdmAudGetControlDetails(