MMRESULT WdmAudQueryMixerInfoByMMixer( IN struct _SOUND_DEVICE_INSTANCE* SoundDeviceInstance, IN DWORD MixerId, IN UINT uMsg, IN LPVOID Parameter, IN DWORD Flags) { LPMIXERLINEW MixLine; LPMIXERLINECONTROLSW MixControls; LPMIXERCONTROLDETAILS MixDetails; HANDLE hMixer = NULL; MixLine = (LPMIXERLINEW)Parameter; MixControls = (LPMIXERLINECONTROLSW)Parameter; MixDetails = (LPMIXERCONTROLDETAILS)Parameter; /* FIXME param checks */ if (SoundDeviceInstance) { hMixer = SoundDeviceInstance->Handle; } switch(uMsg) { case MXDM_GETLINEINFO: return WdmAudGetLineInfo(hMixer, MixerId, MixLine, Flags); case MXDM_GETLINECONTROLS: return WdmAudGetLineControls(hMixer, MixerId, MixControls, Flags); case MXDM_SETCONTROLDETAILS: return WdmAudSetControlDetails(hMixer, MixerId, MixDetails, Flags); case MXDM_GETCONTROLDETAILS: return WdmAudGetControlDetails(hMixer, MixerId, MixDetails, Flags); default: DPRINT1("MixerId %lu, uMsg %lu, Parameter %p, Flags %lu\n", MixerId, uMsg, Parameter, Flags); SND_ASSERT(0); return MMSYSERR_NOTSUPPORTED; } }
NTSTATUS NTAPI WdmAudDeviceControl( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { PIO_STACK_LOCATION IoStack; PWDMAUD_DEVICE_INFO DeviceInfo; PWDMAUD_CLIENT ClientInfo; IoStack = IoGetCurrentIrpStackLocation(Irp); DPRINT("WdmAudDeviceControl entered\n"); if (IoStack->Parameters.DeviceIoControl.InputBufferLength < sizeof(WDMAUD_DEVICE_INFO)) { /* invalid parameter */ DPRINT1("Input buffer too small size %u expected %u\n", IoStack->Parameters.DeviceIoControl.InputBufferLength, sizeof(WDMAUD_DEVICE_INFO)); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } DeviceInfo = (PWDMAUD_DEVICE_INFO)Irp->AssociatedIrp.SystemBuffer; if (DeviceInfo->DeviceType < MIN_SOUND_DEVICE_TYPE || DeviceInfo->DeviceType > MAX_SOUND_DEVICE_TYPE) { /* invalid parameter */ DPRINT1("Error: device type not set\n"); return SetIrpIoStatus(Irp, STATUS_INVALID_PARAMETER, 0); } if (!IoStack->FileObject || !IoStack->FileObject->FsContext) { /* file object parameter */ DPRINT1("Error: file object is not attached\n"); return SetIrpIoStatus(Irp, STATUS_UNSUCCESSFUL, 0); } ClientInfo = (PWDMAUD_CLIENT)IoStack->FileObject->FsContext; DPRINT("WdmAudDeviceControl entered\n"); switch(IoStack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_OPEN_WDMAUD: return WdmAudControlOpen(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETNUMDEVS_TYPE: return WdmAudControlDeviceType(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_SETDEVICE_STATE: return WdmAudControlDeviceState(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETCAPABILITIES: return WdmAudCapabilities(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_CLOSE_WDMAUD: return WdmAudIoctlClose(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETFRAMESIZE: return WdmAudFrameSize(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETLINEINFO: return WdmAudGetLineInfo(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETLINECONTROLS: return WdmAudGetLineControls(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_SETCONTROLDETAILS: return WdmAudSetControlDetails(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_GETCONTROLDETAILS: return WdmAudGetControlDetails(DeviceObject, Irp, DeviceInfo, ClientInfo); case IOCTL_QUERYDEVICEINTERFACESTRING: 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: case IOCTL_SETVOLUME: DPRINT1("Unhandeled %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode); break; } return SetIrpIoStatus(Irp, STATUS_NOT_IMPLEMENTED, 0); }