From: Johannes Anderwald Date: Mon, 17 Oct 2016 19:03:01 +0000 (+0000) Subject: [WDMAUD] X-Git-Tag: ReactOS-0.4.3~76 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=cad3120307f4b978b02b6156270f67a0a245f4f5;hp=39544b234bd1996d53a43fc6175a7b5b46ad9bb5 [WDMAUD] - fix a bug in WdmAudControlDeviceType - clear handle value when opening device interface key fails svn path=/trunk/; revision=72979 --- diff --git a/reactos/drivers/wdm/audio/legacy/wdmaud/control.c b/reactos/drivers/wdm/audio/legacy/wdmaud/control.c index 4fa7c54e2ed..8e80404dc3d 100644 --- a/reactos/drivers/wdm/audio/legacy/wdmaud/control.c +++ b/reactos/drivers/wdm/audio/legacy/wdmaud/control.c @@ -55,11 +55,11 @@ WdmAudControlDeviceType( } else if (DeviceInfo->DeviceType == WAVE_OUT_DEVICE_TYPE) { - Result = WdmAudGetWaveInDeviceCount(); + Result = WdmAudGetWaveOutDeviceCount(); } else if (DeviceInfo->DeviceType == WAVE_IN_DEVICE_TYPE) { - Result = WdmAudGetWaveOutDeviceCount(); + Result = WdmAudGetWaveInDeviceCount(); } else if (DeviceInfo->DeviceType == MIDI_IN_DEVICE_TYPE) { diff --git a/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c b/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c index deafa02aa40..2d8dbd8fb4f 100644 --- a/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c +++ b/reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c @@ -271,6 +271,12 @@ Enum( /* open device interface key */ Status = IoOpenDeviceInterfaceRegistryKey(&KeyName, GENERIC_READ | GENERIC_WRITE, OutKey); + + if (!NT_SUCCESS(Status)) + { + *OutKey = NULL; + } + #if 0 if (!NT_SUCCESS(Status)) {