#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.
370{
371
372
373
374
376
377 DPRINT(
"MPU401 Device Driver 0.0.1\n");
378
379
380
381
382
383
384
391
392
394
395
396
397
398
399
400
401
402
403
404
406}
static NTSTATUS NTAPI MPU401Create(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI MPU401Cleanup(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static NTSTATUS NTAPI MPU401Close(PDEVICE_OBJECT DeviceObject, PIRP Irp)
static VOID NTAPI MPU401Unload(PDRIVER_OBJECT DriverObject)
static NTSTATUS InitDevice(IN PUNICODE_STRING RegistryPath, IN PVOID Context)
static NTSTATUS NTAPI MPU401DeviceControl(PDEVICE_OBJECT DeviceObject, PIRP Irp)
#define IRP_MJ_DEVICE_CONTROL
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
◆ InitDevice()
Definition at line 31 of file mpu401.c.
34{
35
40
43
44
45
47 {
48 DPRINT(
"Sorry - only 1 device supported by MPU401 driver at present :(\n");
50 }
51
52 DPRINT(
"Creating IO device\n");
53
58 0,
61
64
67
68 DPRINT(
"Creating DOS link\n");
69
70
73
74 DPRINT(
"Initializing device\n");
75
76
77
78
79
80
81
83
85 {
88 }
89
90
91
92 DPRINT(
"Setting reg path\n");
94
95
96 DPRINT(
"Zeroing table memory and setting query routine\n");
99
100 DPRINT(
"Setting port and IRQ defaults\n");
103
104
105
106
107
108
109
110
111
114
116
117
118
119
121 {
122 DPRINT(
"UART mode initialization FAILED!\n");
123
124
125
126 }
127
129
131}
#define STATUS_NOT_IMPLEMENTED
#define NT_SUCCESS(StatCode)
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)
NTSTATUS NTAPI IoCreateSymbolicLink(IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
#define FILE_DEVICE_SOUND
#define RTL_CONSTANT_STRING(s)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_Must_inspect_result_ _In_ WDFQUEUE _In_opt_ WDFREQUEST _In_opt_ WDFFILEOBJECT _Inout_opt_ PWDF_REQUEST_PARAMETERS Parameters
Referenced by DriverEntry().
◆ MPU401Cleanup()
Definition at line 198 of file mpu401.c.
207{
209 DPRINT(
"MPU401Cleanup() called!\n");
210
211
212 for (Channel = 0; Channel <= 15; Channel ++)
213 {
214
215
216
217
218 }
219
220
222 Irp->IoStatus.Information = 0;
225
227}
#define IoCompleteRequest
Referenced by DriverEntry().
◆ MPU401Close()
Definition at line 169 of file mpu401.c.
178{
181
182 DPRINT(
"MPU401Close() called!\n");
183
185
187
189 Irp->IoStatus.Information = 0;
192
194}
Referenced by DriverEntry().
◆ MPU401Create()
Definition at line 135 of file mpu401.c.
144{
145 DPRINT(
"MPU401Create() called!\n");
146
147
148
149
150
151
158
160 Irp->IoStatus.Information = 0;
163
165}
#define MPU401_WRITE_DATA(bp, x)
BOOLEAN WaitToSend(ULONG BasePort)
Referenced by DriverEntry().
◆ MPU401DeviceControl()
Definition at line 231 of file mpu401.c.
240{
245
246 DPRINT(
"MPU401DeviceControl() called!\n");
247
250
251 DPRINT(
"Control code %d [0x%x]\n",
Stack->Parameters.DeviceIoControl.IoControlCode,
252 Stack->Parameters.DeviceIoControl.IoControlCode);
253
254 switch(
Stack->Parameters.DeviceIoControl.IoControlCode)
255 {
257 {
258 DPRINT(
"Received IOCTL_MIDI_PLAY\n");
260
261 DPRINT(
"Sending %d bytes of MIDI data to 0x%x:\n",
Stack->Parameters.DeviceIoControl.InputBufferLength, DeviceExtension->Port);
262
264 {
266
268
269
270 }
271
274
276 }
277 }
278
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define MPU401_WRITE_BYTE(bp, x)
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _In_ LARGE_INTEGER ByteCount
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().