Author: silverblade
Date: Wed Mar 14 23:50:42 2007
New Revision: 26102
URL:
http://svn.reactos.org/svn/reactos?rev=26102&view=rev
Log:
Basic beginnings of an MPU401 driver (forgot to commit with last files)
Added:
trunk/reactos/drivers/multimedia/mpu401_ks/
trunk/reactos/drivers/multimedia/mpu401_ks/adapter.cpp
trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.def
trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rbuild
trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rc
Added: trunk/reactos/drivers/multimedia/mpu401_ks/adapter.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/mpu401_…
==============================================================================
--- trunk/reactos/drivers/multimedia/mpu401_ks/adapter.cpp (added)
+++ trunk/reactos/drivers/multimedia/mpu401_ks/adapter.cpp Wed Mar 14 23:50:42 2007
@@ -1,0 +1,97 @@
+/*
+ ReactOS Operating System
+ MPU401 Example KS Driver
+
+ AUTHORS:
+ Andrew Greenwood
+
+ NOTES:
+ This is an example MPU401 driver. You can use DirectMusic instead with
+ this, by changing the CLSIDs accordingly.
+*/
+
+#define MAX_MINIPORTS 1
+
+#define PUT_GUIDS_HERE
+
+#include <portcls.h>
+
+extern "C"
+NTSTATUS
+StartDevice(
+ IN PDEVICE_OBJECT pDeviceObject,
+ IN PIRP pIrp,
+ IN PRESOURCELIST ResourceList)
+{
+ if ( ! ResourceList )
+ return STATUS_INVALID_PARAMETER;
+
+ if ( ResourceList->NumberOfEntries() == 0 )
+ {
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ PPORT port;
+ PMINIPORT miniport;
+
+ NTSTATUS status;
+
+ status = PcNewPort(&port, CLSID_PortMidi);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ return status;
+ }
+
+ status = PcNewMiniport(&miniport, CLSID_MiniportDriverUart);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ return status;
+ }
+
+ status = port->Init(pDeviceObject, pIrp, miniport, NULL, ResourceList);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ return status;
+ }
+
+ status = PcRegisterSubdevice(pDeviceObject, L"Uart", port);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ /* just print an error here */
+ }
+
+ miniport->Release();
+ port->Release();
+
+ return status;
+}
+
+
+extern "C"
+NTSTATUS
+AddDevice(
+ IN PVOID Context1,
+ IN PVOID Context2)
+{
+ return PcAddAdapterDevice((PDRIVER_OBJECT) Context1,
+ (PDEVICE_OBJECT) Context2,
+ StartDevice,
+ MAX_MINIPORTS,
+ 0);
+}
+
+
+extern "C"
+NTSTATUS
+DriverEntry(
+ IN PVOID Context1,
+ IN PVOID Context2)
+{
+ return PcInitializeAdapterDriver((PDRIVER_OBJECT) Context1,
+ (PUNICODE_STRING) Context2,
+ (PDRIVER_ADD_DEVICE) AddDevice);
+};
Added: trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/mpu401_…
==============================================================================
--- trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.def (added)
+++ trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.def Wed Mar 14 23:50:42 2007
@@ -1,0 +1,6 @@
+;
+; Exports definition file for mpu401_ks.sys
+;
+EXPORTS
+DriverEntry@8
+
Added: trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/mpu401_…
==============================================================================
--- trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rbuild (added)
+++ trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rbuild Wed Mar 14 23:50:42 2007
@@ -1,0 +1,10 @@
+<module name="mpu401_ks" type="exportdriver"
installbase="system32/drivers" installname="mpu401_ks.sys"
allowwarnings="true">
+ <include base="mpu401">.</include>
+ <include base="mpu401">..</include>
+ <importlibrary definition="mpu401.def" />
+ <library>ntoskrnl</library>
+ <library>portcls</library>
+ <define name="__USE_W32API" />
+ <file>mpu401.rc</file>
+ <file>adapter.cpp</file>
+</module>
Added: trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/multimedia/mpu401_…
==============================================================================
--- trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rc (added)
+++ trunk/reactos/drivers/multimedia/mpu401_ks/mpu401.rc Wed Mar 14 23:50:42 2007
@@ -1,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "MPU401 KS Driver\0"
+#define REACTOS_STR_INTERNAL_NAME "mpu401_ks\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "mpu401_ks.sys\0"
+#include <reactos/version.rc>