mirror of
https://github.com/reactos/reactos.git
synced 2024-08-07 19:58:21 +00:00
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
This commit is contained in:
parent
392b65e4a7
commit
d00716c055
|
@ -13,6 +13,7 @@
|
||||||
/* INCLUDES ****************************************************************/
|
/* INCLUDES ****************************************************************/
|
||||||
|
|
||||||
#include <ddk/ntddk.h>
|
#include <ddk/ntddk.h>
|
||||||
|
#include <rosrtl/string.h>
|
||||||
//#include <ddk/ntddbeep.h>
|
//#include <ddk/ntddbeep.h>
|
||||||
|
|
||||||
//#define NDEBUG
|
//#define NDEBUG
|
||||||
|
@ -29,14 +30,14 @@ UINT DeviceCount = 0;
|
||||||
/* FUNCTIONS ***************************************************************/
|
/* FUNCTIONS ***************************************************************/
|
||||||
|
|
||||||
NTSTATUS InitDevice(
|
NTSTATUS InitDevice(
|
||||||
IN PWSTR RegistryPath,
|
IN PUNICODE_STRING RegistryPath,
|
||||||
IN PVOID Context)
|
IN PVOID Context)
|
||||||
{
|
{
|
||||||
// PDEVICE_INSTANCE Instance = Context;
|
// PDEVICE_INSTANCE Instance = Context;
|
||||||
PDEVICE_OBJECT DeviceObject; // = Context;
|
PDEVICE_OBJECT DeviceObject; // = Context;
|
||||||
PDEVICE_EXTENSION Parameters; // = DeviceObject->DeviceExtension;
|
PDEVICE_EXTENSION Parameters; // = DeviceObject->DeviceExtension;
|
||||||
UNICODE_STRING DeviceName = UNICODE_STRING_INITIALIZER(L"\\Device\\MPU401_Out_0");
|
UNICODE_STRING DeviceName = ROS_STRING_INITIALIZER(L"\\Device\\MidiOut0");
|
||||||
UNICODE_STRING SymlinkName = UNICODE_STRING_INITIALIZER(L"\\??\\MPU401_Out_0");
|
UNICODE_STRING SymlinkName = ROS_STRING_INITIALIZER(L"\\??\\MidiOut0");
|
||||||
// CONFIG Config;
|
// CONFIG Config;
|
||||||
RTL_QUERY_REGISTRY_TABLE Table[2];
|
RTL_QUERY_REGISTRY_TABLE Table[2];
|
||||||
NTSTATUS s;
|
NTSTATUS s;
|
||||||
|
@ -144,17 +145,17 @@ MPU401Create(PDEVICE_OBJECT DeviceObject,
|
||||||
{
|
{
|
||||||
DPRINT("MPU401Create() called!\n");
|
DPRINT("MPU401Create() called!\n");
|
||||||
|
|
||||||
// Initialize the MPU-401
|
// Initialize the MPU-401?
|
||||||
// ... do stuff ...
|
// ... do stuff ...
|
||||||
|
|
||||||
|
|
||||||
// Play a note to say we're alive:
|
// Play a note to say we're alive:
|
||||||
// WaitToSend(MPU401_PORT);
|
/* WaitToSend(MPU401_PORT);
|
||||||
// MPU401_WRITE_DATA(MPU401_PORT, 0x90);
|
MPU401_WRITE_DATA(MPU401_PORT, 0x90);
|
||||||
// WaitToSend(MPU401_PORT);
|
WaitToSend(MPU401_PORT);
|
||||||
// MPU401_WRITE_DATA(MPU401_PORT, 0x50);
|
MPU401_WRITE_DATA(MPU401_PORT, 0x50);
|
||||||
// WaitToSend(MPU401_PORT);
|
WaitToSend(MPU401_PORT);
|
||||||
// MPU401_WRITE_DATA(MPU401_PORT, 0x7f);
|
MPU401_WRITE_DATA(MPU401_PORT, 0x7f);*/
|
||||||
|
|
||||||
Irp->IoStatus.Status = STATUS_SUCCESS;
|
Irp->IoStatus.Status = STATUS_SUCCESS;
|
||||||
Irp->IoStatus.Information = 0;
|
Irp->IoStatus.Information = 0;
|
||||||
|
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
typedef struct _DEVICE_EXTENSION
|
typedef struct _DEVICE_EXTENSION
|
||||||
{
|
{
|
||||||
PWSTR RegistryPath;
|
PUNICODE_STRING RegistryPath;
|
||||||
PDRIVER_OBJECT DriverObject;
|
PDRIVER_OBJECT DriverObject;
|
||||||
UINT Port;
|
UINT Port;
|
||||||
UINT IRQ;
|
UINT IRQ;
|
||||||
|
|
|
@ -85,7 +85,7 @@ BOOLEAN InitUARTMode(UINT BasePort)
|
||||||
{
|
{
|
||||||
// Check to make sure the reset was acknowledged:
|
// Check to make sure the reset was acknowledged:
|
||||||
for (TimeOut = MPU401_TIMEOUT;
|
for (TimeOut = MPU401_TIMEOUT;
|
||||||
Status = (MPU401_READ_DATA(BasePort) & 0xfe) && TimeOut > 0;
|
(Status = (MPU401_READ_DATA(BasePort) & 0xfe) && TimeOut > 0);
|
||||||
TimeOut --);
|
TimeOut --);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
else if (s == STATUS_ACCESS_DENIED) \
|
else if (s == STATUS_ACCESS_DENIED) \
|
||||||
DPRINT("NTSTATUS == ACCESS_DENIED\n") \
|
DPRINT("NTSTATUS == ACCESS_DENIED\n") \
|
||||||
else \
|
else \
|
||||||
DPRINT("NTSTATUS == FAILURE (???)\n"); \
|
DPRINT("NTSTATUS == FAILURE (?)\n"); \
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define TEST_STATUS(s)
|
#define TEST_STATUS(s)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
* Sept 27, 2003: Created
|
* Sept 27, 2003: Created
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <ntddk.h>
|
//#include <ntddk.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "mpu401.h"
|
#include "mpu401.h"
|
||||||
|
@ -296,7 +296,7 @@ NTSTATUS SaveSettings(
|
||||||
NT status STATUS_SUCCESS if successful
|
NT status STATUS_SUCCESS if successful
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
NTSTATUS s;
|
// NTSTATUS s;
|
||||||
|
|
||||||
DPRINT("SaveSettings() unimplemented\n");
|
DPRINT("SaveSettings() unimplemented\n");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue