[WDMAUD]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 17 Oct 2016 19:03:01 +0000 (19:03 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Mon, 17 Oct 2016 19:03:01 +0000 (19:03 +0000)
- fix a bug in WdmAudControlDeviceType
- clear handle value when opening device interface key fails

svn path=/trunk/; revision=72979

reactos/drivers/wdm/audio/legacy/wdmaud/control.c
reactos/drivers/wdm/audio/legacy/wdmaud/mmixer.c

index 4fa7c54..8e80404 100644 (file)
@@ -55,11 +55,11 @@ WdmAudControlDeviceType(
     }
     else if (DeviceInfo->DeviceType == WAVE_OUT_DEVICE_TYPE)
     {
     }
     else if (DeviceInfo->DeviceType == WAVE_OUT_DEVICE_TYPE)
     {
-        Result = WdmAudGetWaveInDeviceCount();
+        Result = WdmAudGetWaveOutDeviceCount();
     }
     else if (DeviceInfo->DeviceType == WAVE_IN_DEVICE_TYPE)
     {
     }
     else if (DeviceInfo->DeviceType == WAVE_IN_DEVICE_TYPE)
     {
-        Result = WdmAudGetWaveOutDeviceCount();
+        Result = WdmAudGetWaveInDeviceCount();
     }
     else if (DeviceInfo->DeviceType == MIDI_IN_DEVICE_TYPE)
     {
     }
     else if (DeviceInfo->DeviceType == MIDI_IN_DEVICE_TYPE)
     {
index deafa02..2d8dbd8 100644 (file)
@@ -271,6 +271,12 @@ Enum(
 
     /* open device interface key */
     Status = IoOpenDeviceInterfaceRegistryKey(&KeyName, GENERIC_READ | GENERIC_WRITE, OutKey);
 
     /* open device interface key */
     Status = IoOpenDeviceInterfaceRegistryKey(&KeyName, GENERIC_READ | GENERIC_WRITE, OutKey);
+
+    if (!NT_SUCCESS(Status))
+    {
+        *OutKey = NULL;
+    }
+
 #if 0
     if (!NT_SUCCESS(Status))
     {
 #if 0
     if (!NT_SUCCESS(Status))
     {