[WDMAUD.DRV]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 24 Feb 2011 14:38:16 +0000 (14:38 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Thu, 24 Feb 2011 14:38:16 +0000 (14:38 +0000)
- Set wave in pins into run state
- Fixes hang of ReactOS sndrec32, though it crashes then instantly. Needs more investigation

svn path=/trunk/; revision=50894

reactos/dll/win32/wdmaud.drv/legacy.c

index 0c05fab..f1d01e7 100644 (file)
@@ -528,18 +528,18 @@ WdmAudSetWaveDeviceFormatByLegacy(
         Instance->BufferCount = 100;
     }
 
-    if (DeviceType == WAVE_OUT_DEVICE_TYPE)
-    {
-        /* Now start the stream */
-        DeviceInfo.u.State = KSSTATE_RUN;
-        SyncOverlappedDeviceIoControl(KernelHandle,
-                                      IOCTL_SETDEVICE_STATE,
-                                      (LPVOID) &DeviceInfo,
-                                      sizeof(WDMAUD_DEVICE_INFO),
-                                      (LPVOID) &DeviceInfo,
-                                      sizeof(WDMAUD_DEVICE_INFO),
-                                      NULL);
-    }
+    /* Now acquire resources */
+    DeviceInfo.u.State = KSSTATE_ACQUIRE;
+    SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL);
+
+    /* pause the pin */
+    DeviceInfo.u.State = KSSTATE_PAUSE;
+    SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL);
+
+    /* start the pin */
+    DeviceInfo.u.State = KSSTATE_RUN;
+    SyncOverlappedDeviceIoControl(KernelHandle, IOCTL_SETDEVICE_STATE, (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), (LPVOID) &DeviceInfo, sizeof(WDMAUD_DEVICE_INFO), NULL);
+
 
     return MMSYSERR_NOERROR;
 }