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));
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(
IN PWDMAUD_CLIENT ClientInfo,
IN ULONG Index);
+VOID
+WdmAudCloseAllMixers(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PWDMAUD_CLIENT ClientInfo,
+ IN ULONG Index);
+
NTSTATUS
WdmAudControlOpenWave(
IN PDEVICE_OBJECT DeviceObject,