Author: janderwald
Date: Fri Aug 7 12:11:24 2009
New Revision: 42459
URL:
http://svn.reactos.org/svn/reactos?rev=42459&view=rev
Log:
- Set the stream state to run when opening the device
- Set the stream state to stop when closing the device
Modified:
trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c
Modified: trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/wdmaud.drv/wdmau…
==============================================================================
--- trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/wdmaud.drv/wdmaud.c [iso-8859-1] Fri Aug 7 12:11:24 2009
@@ -205,6 +205,16 @@
DeviceInfo.DeviceType = DeviceType;
DeviceInfo.hDevice = SoundDeviceInstance->Handle;
+ /* First stop the stream */
+ DeviceInfo.u.State = KSSTATE_STOP;
+ SyncOverlappedDeviceIoControl(KernelHandle,
+ IOCTL_SETDEVICE_STATE,
+ (LPVOID) &DeviceInfo,
+ sizeof(WDMAUD_DEVICE_INFO),
+ (LPVOID) &DeviceInfo,
+ sizeof(WDMAUD_DEVICE_INFO),
+ NULL);
+
SyncOverlappedDeviceIoControl(KernelHandle,
IOCTL_CLOSE_WDMAUD,
(LPVOID) &DeviceInfo,
@@ -318,6 +328,15 @@
}
}
+ /* 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);
return MMSYSERR_NOERROR;
}