#include <ntddk.h>
#include <debug.h>
#include "mpu401.h"
Go to the source code of this file.
◆ DriverEntry()
Definition at line 361 of file mpu401.c.
377 DPRINT(
"MPU401 Device Driver 0.0.1\n");
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
static NTSTATUS NTAPI MPU401Cleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static VOID NTAPI MPU401Unload(PDRIVER_OBJECT DriverObject)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
static NTSTATUS NTAPI MPU401Close(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI MPU401DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI MPU401Create(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS InitDevice(IN PUNICODE_STRING RegistryPath, IN PVOID Context)
#define IRP_MJ_DEVICE_CONTROL
◆ InitDevice()
Definition at line 31 of file mpu401.c.
48 DPRINT(
"Sorry - only 1 device supported by MPU401 driver at present :(\n");
52 DPRINT(
"Creating IO device\n");
68 DPRINT(
"Creating DOS link\n");
74 DPRINT(
"Initializing device\n");
92 DPRINT(
"Setting reg path\n");
96 DPRINT(
"Zeroing table memory and setting query routine\n");
100 DPRINT(
"Setting port and IRQ defaults\n");
122 DPRINT(
"UART mode initialization FAILED!\n");
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_In_ PDEVICE_OBJECT DeviceObject
return STATUS_NOT_IMPLEMENTED
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
#define NT_SUCCESS(StatCode)
#define FILE_DEVICE_SOUND
BOOLEAN InitUARTMode(ULONG BasePort)
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
#define RtlZeroMemory(Destination, Length)
#define RTL_CONSTANT_STRING(s)
Referenced by DriverEntry().
◆ MPU401Cleanup()
Definition at line 198 of file mpu401.c.
209 DPRINT(
"MPU401Cleanup() called!\n");
212 for (Channel = 0; Channel <= 15; Channel ++)
222 Irp->IoStatus.Information = 0;
#define IoCompleteRequest
Referenced by DriverEntry().
◆ MPU401Close()
Definition at line 169 of file mpu401.c.
182 DPRINT(
"MPU401Close() called!\n");
189 Irp->IoStatus.Information = 0;
_In_ PDEVICE_OBJECT DeviceObject
#define IoCompleteRequest
Referenced by DriverEntry().
◆ MPU401Create()
Definition at line 135 of file mpu401.c.
145 DPRINT(
"MPU401Create() called!\n");
160 Irp->IoStatus.Information = 0;
BOOLEAN WaitToSend(ULONG BasePort)
#define IoCompleteRequest
#define MPU401_WRITE_DATA(bp, x)
Referenced by DriverEntry().
◆ MPU401DeviceControl()
Definition at line 231 of file mpu401.c.
246 DPRINT(
"MPU401DeviceControl() called!\n");
251 DPRINT(
"Control code %d [0x%x]\n",
Stack->Parameters.DeviceIoControl.IoControlCode,
252 Stack->Parameters.DeviceIoControl.IoControlCode);
254 switch(
Stack->Parameters.DeviceIoControl.IoControlCode)
258 DPRINT(
"Received IOCTL_MIDI_PLAY\n");
261 DPRINT(
"Sending %d bytes of MIDI data to 0x%x:\n",
Stack->Parameters.DeviceIoControl.InputBufferLength, DeviceExtension->Port);
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
#define MPU401_WRITE_BYTE(bp, x)
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_In_ PDEVICE_OBJECT DeviceObject
#define IoCompleteRequest
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Referenced by DriverEntry().
◆ MPU401Unload()
◆ DeviceCount
Definition at line 26 of file mpu401.c.
Referenced by BlockIoEfiGetChildHandle(), BlockIoFirmwareOpen(), CreateFlopDeviceObject(), DiskCreateFdo(), DriverEntry(), Enum(), FDO_DeviceRelations(), FindWinMMDeviceIndex(), HDA_FDOQueryBusRelations(), InitDevice(), PopulateWdmDeviceList(), USBSTOR_FdoHandleDeviceRelations(), ViCreateDriveLetter(), WdmAudCloseAllMixers(), WdmAudGetNumWdmDevsByLegacy(), WdmAudGetNumWdmDevsByMMixer(), and WdmAudInitWorkerRoutine().