mirror of
https://github.com/reactos/reactos.git
synced 2025-02-24 17:34:57 +00:00
- Set the stream state to run when opening the device
- Set the stream state to stop when closing the device svn path=/trunk/; revision=42459
This commit is contained in:
parent
7b78af8b30
commit
7121ab4d0e
1 changed files with 19 additions and 0 deletions
|
@ -205,6 +205,16 @@ CloseWdmSoundDevice(
|
||||||
DeviceInfo.DeviceType = DeviceType;
|
DeviceInfo.DeviceType = DeviceType;
|
||||||
DeviceInfo.hDevice = SoundDeviceInstance->Handle;
|
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,
|
SyncOverlappedDeviceIoControl(KernelHandle,
|
||||||
IOCTL_CLOSE_WDMAUD,
|
IOCTL_CLOSE_WDMAUD,
|
||||||
(LPVOID) &DeviceInfo,
|
(LPVOID) &DeviceInfo,
|
||||||
|
@ -318,6 +328,15 @@ SetWdmWaveDeviceFormat(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 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;
|
return MMSYSERR_NOERROR;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue