Home | Info | Community | Development | myReactOS | Contact Us
[static]
Definition at line 231 of file mpu401.c.
Referenced by DriverEntry().
{ PIO_STACK_LOCATION Stack; PDEVICE_EXTENSION DeviceExtension; ULONG ByteCount; PUCHAR Data; DPRINT("MPU401DeviceControl() called!\n"); DeviceExtension = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); DPRINT("Control code %d [0x%x]\n", Stack->Parameters.DeviceIoControl.IoControlCode, Stack->Parameters.DeviceIoControl.IoControlCode); switch(Stack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_MIDI_PLAY : { DPRINT("Received IOCTL_MIDI_PLAY\n"); Data = (PUCHAR) Irp->AssociatedIrp.SystemBuffer; DPRINT("Sending %d bytes of MIDI data to 0x%d:\n", Stack->Parameters.DeviceIoControl.InputBufferLength, DeviceExtension->Port); for (ByteCount = 0; ByteCount < Stack->Parameters.DeviceIoControl.InputBufferLength; ByteCount ++) { DPRINT("0x%x ", Data[ByteCount]); MPU401_WRITE_BYTE(DeviceExtension->Port, Data[ByteCount]); // if (WaitToSend(MPU401_PORT)) // MPU401_WRITE_DATA(MPU401_PORT, Data[ByteCount]); } Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return(STATUS_SUCCESS); } } return(STATUS_SUCCESS); /* DeviceExtension = DeviceObject->DeviceExtension; Stack = IoGetCurrentIrpStackLocation(Irp); BeepParam = (PBEEP_SET_PARAMETERS)Irp->AssociatedIrp.SystemBuffer; Irp->IoStatus.Information = 0; if (Stack->Parameters.DeviceIoControl.IoControlCode != IOCTL_BEEP_SET) { Irp->IoStatus.Status = STATUS_NOT_IMPLEMENTED; IoCompleteRequest(Irp, IO_NO_INCREMENT); return(STATUS_NOT_IMPLEMENTED); } if ((Stack->Parameters.DeviceIoControl.InputBufferLength != sizeof(BEEP_SET_PARAMETERS)) || (BeepParam->Frequency < BEEP_FREQUENCY_MINIMUM) || (BeepParam->Frequency > BEEP_FREQUENCY_MAXIMUM)) { Irp->IoStatus.Status = STATUS_INVALID_PARAMETER; IoCompleteRequest(Irp, IO_NO_INCREMENT); return(STATUS_INVALID_PARAMETER); } DueTime.QuadPart = 0; */ /* do the beep!! */ /* DPRINT("Beep:\n Freq: %lu Hz\n Dur: %lu ms\n", pbsp->Frequency, pbsp->Duration); if (BeepParam->Duration >= 0) { DueTime.QuadPart = (LONGLONG)BeepParam->Duration * -10000; KeSetTimer(&DeviceExtension->Timer, DueTime, &DeviceExtension->Dpc); HalMakeBeep(BeepParam->Frequency); DeviceExtension->BeepOn = TRUE; KeWaitForSingleObject(&DeviceExtension->Event, Executive, KernelMode, FALSE, NULL); } else if (BeepParam->Duration == (DWORD)-1) { if (DeviceExtension->BeepOn == TRUE) { HalMakeBeep(0); DeviceExtension->BeepOn = FALSE; } else { HalMakeBeep(BeepParam->Frequency); DeviceExtension->BeepOn = TRUE; } } DPRINT("Did the beep!\n"); Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return(STATUS_SUCCESS); */ }