From d00716c055718170ca2fe34f30a70a50db05695a Mon Sep 17 00:00:00 2001 From: Andrew Greenwood Date: Fri, 30 Jan 2004 17:10:23 +0000 Subject: [PATCH] Temporarily named the device "MidiOut0" so mmdrv.dll (when committed!) will use it. This driver can currently play some short MIDI messages when combined with my mmdrv.dll and miditest.exe programs (which I intend to commit eventually, once they're integrated into the ReactOS tree.) svn path=/trunk/; revision=7923 --- reactos/drivers/dd/mpu401/mpu401.c | 21 +++++++++++---------- reactos/drivers/dd/mpu401/mpu401.h | 2 +- reactos/drivers/dd/mpu401/portio.c | 2 +- reactos/drivers/dd/mpu401/sbdebug.h | 2 +- reactos/drivers/dd/mpu401/settings.c | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/reactos/drivers/dd/mpu401/mpu401.c b/reactos/drivers/dd/mpu401/mpu401.c index ed274d4cd6f..705beb47366 100644 --- a/reactos/drivers/dd/mpu401/mpu401.c +++ b/reactos/drivers/dd/mpu401/mpu401.c @@ -13,6 +13,7 @@ /* INCLUDES ****************************************************************/ #include +#include //#include //#define NDEBUG @@ -29,14 +30,14 @@ UINT DeviceCount = 0; /* FUNCTIONS ***************************************************************/ NTSTATUS InitDevice( - IN PWSTR RegistryPath, + IN PUNICODE_STRING RegistryPath, IN PVOID Context) { // PDEVICE_INSTANCE Instance = Context; PDEVICE_OBJECT DeviceObject; // = Context; PDEVICE_EXTENSION Parameters; // = DeviceObject->DeviceExtension; - UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\MPU401_Out_0"); - UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\MPU401_Out_0"); + UNICODE_STRING DeviceName = ROS_STRING_INITIALIZER(L"\\Device\\MidiOut0"); + UNICODE_STRING SymlinkName = ROS_STRING_INITIALIZER(L"\\??\\MidiOut0"); // CONFIG Config; RTL_QUERY_REGISTRY_TABLE Table[2]; NTSTATUS s; @@ -144,17 +145,17 @@ MPU401Create(PDEVICE_OBJECT DeviceObject, { DPRINT("MPU401Create() called!\n"); - // Initialize the MPU-401 + // Initialize the MPU-401? // ... do stuff ... // Play a note to say we're alive: -// WaitToSend(MPU401_PORT); -// MPU401_WRITE_DATA(MPU401_PORT, 0x90); -// WaitToSend(MPU401_PORT); -// MPU401_WRITE_DATA(MPU401_PORT, 0x50); -// WaitToSend(MPU401_PORT); -// MPU401_WRITE_DATA(MPU401_PORT, 0x7f); +/* WaitToSend(MPU401_PORT); + MPU401_WRITE_DATA(MPU401_PORT, 0x90); + WaitToSend(MPU401_PORT); + MPU401_WRITE_DATA(MPU401_PORT, 0x50); + WaitToSend(MPU401_PORT); + MPU401_WRITE_DATA(MPU401_PORT, 0x7f);*/ Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; diff --git a/reactos/drivers/dd/mpu401/mpu401.h b/reactos/drivers/dd/mpu401/mpu401.h index 4b2ce0b5f6e..454750c229e 100644 --- a/reactos/drivers/dd/mpu401/mpu401.h +++ b/reactos/drivers/dd/mpu401/mpu401.h @@ -77,7 +77,7 @@ typedef struct _DEVICE_EXTENSION { - PWSTR RegistryPath; + PUNICODE_STRING RegistryPath; PDRIVER_OBJECT DriverObject; UINT Port; UINT IRQ; diff --git a/reactos/drivers/dd/mpu401/portio.c b/reactos/drivers/dd/mpu401/portio.c index 9e04b8a445f..5d169bbd4da 100644 --- a/reactos/drivers/dd/mpu401/portio.c +++ b/reactos/drivers/dd/mpu401/portio.c @@ -85,7 +85,7 @@ BOOLEAN InitUARTMode(UINT BasePort) { // Check to make sure the reset was acknowledged: for (TimeOut = MPU401_TIMEOUT; - Status = (MPU401_READ_DATA(BasePort) & 0xfe) && TimeOut > 0; + (Status = (MPU401_READ_DATA(BasePort) & 0xfe) && TimeOut > 0); TimeOut --); } diff --git a/reactos/drivers/dd/mpu401/sbdebug.h b/reactos/drivers/dd/mpu401/sbdebug.h index 30e7feec961..1ec5e32ba5d 100644 --- a/reactos/drivers/dd/mpu401/sbdebug.h +++ b/reactos/drivers/dd/mpu401/sbdebug.h @@ -17,7 +17,7 @@ else if (s == STATUS_ACCESS_DENIED) \ DPRINT("NTSTATUS == ACCESS_DENIED\n") \ else \ - DPRINT("NTSTATUS == FAILURE (???)\n"); \ + DPRINT("NTSTATUS == FAILURE (?)\n"); \ } #else #define TEST_STATUS(s) diff --git a/reactos/drivers/dd/mpu401/settings.c b/reactos/drivers/dd/mpu401/settings.c index ef6e31df714..0625489b88a 100644 --- a/reactos/drivers/dd/mpu401/settings.c +++ b/reactos/drivers/dd/mpu401/settings.c @@ -9,7 +9,7 @@ * Sept 27, 2003: Created */ -#include +//#include #include #include "mpu401.h" @@ -296,7 +296,7 @@ NTSTATUS SaveSettings( NT status STATUS_SUCCESS if successful */ { - NTSTATUS s; +// NTSTATUS s; DPRINT("SaveSettings() unimplemented\n");