Author: janderwald Date: Sat Nov 28 18:06:22 2009 New Revision: 44311
URL: http://svn.reactos.org/svn/reactos?rev=44311&view=rev Log: - Implement IOCTL_RESET_STREAM which is required for waveInReset waveOutReset
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/wd... ============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/control.c [iso-8859-1] Sat Nov 28 18:06:22 2009 @@ -314,6 +314,38 @@ }
return SetIrpIoStatus(Irp, STATUS_INVALID_DEVICE_REQUEST, sizeof(WDMAUD_DEVICE_INFO)); +} + +NTSTATUS +NTAPI +WdmAudResetStream( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp, + IN PWDMAUD_DEVICE_INFO DeviceInfo) +{ + KSRESET ResetStream; + NTSTATUS Status; + ULONG BytesReturned; + PFILE_OBJECT FileObject; + + DPRINT("WdmAudResetStream\n"); + + Status = ObReferenceObjectByHandle(DeviceInfo->hDevice, GENERIC_READ | GENERIC_WRITE, IoFileObjectType, KernelMode, (PVOID*)&FileObject, NULL); + if (!NT_SUCCESS(Status)) + { + DPRINT1("Error: invalid device handle provided %p Type %x\n", DeviceInfo->hDevice, DeviceInfo->DeviceType); + return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); + } + + ResetStream = DeviceInfo->u.ResetStream; + ASSERT(ResetStream == KSRESET_BEGIN || ResetStream == KSRESET_END); + + Status = KsSynchronousIoControlDevice(FileObject, KernelMode, IOCTL_KS_RESET_STATE, (PVOID)&ResetStream, sizeof(KSRESET), NULL, 0, &BytesReturned); + + ObDereferenceObject(FileObject); + + DPRINT("WdmAudResetStream Status %x\n", Status); + return SetIrpIoStatus(Irp, Status, sizeof(WDMAUD_DEVICE_INFO)); }
NTSTATUS @@ -382,6 +414,8 @@ return WdmAudGetDeviceInterface(DeviceObject, Irp, DeviceInfo); case IOCTL_GET_MIXER_EVENT: return WdmAudGetMixerEvent(DeviceObject, Irp, DeviceInfo, ClientInfo); + case IOCTL_RESET_STREAM: + return WdmAudResetStream(DeviceObject, Irp, DeviceInfo); case IOCTL_GETPOS: case IOCTL_GETDEVID: case IOCTL_GETVOLUME:
Modified: trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/legacy/wd... ============================================================================== --- trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/legacy/wdmaud/interface.h [iso-8859-1] Sat Nov 28 18:06:22 2009 @@ -57,6 +57,7 @@ ULONG Value; }MixerEvent; KSSTATE State; + KSRESET ResetStream; ULONG Volume; ULONG FrameSize; HANDLE hNotifyEvent; @@ -346,7 +347,7 @@
/// IOCTL_GET_MIXER_EVENT /// -/// Description: This IOCTL queries for +/// Description: This IOCTL queries for wdmaud driver if there any new kernel streaming events available /// /// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure, /// InputBufferSize is size of WDMAUD_DEVICE_INFO structure @@ -360,5 +361,18 @@ METHOD_BUFFERED, \ FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS)
- +/// IOCTL_RESET_STREAM +/// +/// Description: This IOCTL instructs wdmaud to reset a stream +/// +/// Arguments: InputBuffer is a pointer to a WDMAUD_DEVICE_INFO structure, +/// InputBufferSize is size of WDMAUD_DEVICE_INFO structure +/// Note: The hDevice member must be set and DeviceType +/// ReturnCode: STATUS_SUCCESS indicates success + +#define IOCTL_RESET_STREAM \ + CTL_CODE(FILE_DEVICE_SOUND, \ + 17, \ + METHOD_BUFFERED, \ + FILE_CREATE_TREE_CONNECTION | FILE_ANY_ACCESS) #endif