Author: silverblade
Date: Sun Jul 8 21:31:55 2007
New Revision: 27494
URL:
http://svn.reactos.org/svn/reactos?rev=27494&view=rev
Log:
Restructured PORTCLS as requested by Christoph_vW (so PREfast can be
used.) Here is also a very bare-bones implementation of SysAudio
(actually it just creates \Device\sysaudio and a symlink for now...)
Added:
trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniport.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportDMus.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportMidi.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportTopology.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportWaveCyclic.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWavePci.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportWavePci.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPort.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortDMus.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortMidi.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortTopology.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortWaveCyclic.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWavePci.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortWavePci.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/ResourceList.c
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/helper/ResourceList.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp
- copied unchanged from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/factory.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/port.h
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/port.h
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c
- copied, changed from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/factory.c
trunk/reactos/drivers/wdm/audio/sysaudio/main.c
trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild
trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rc
Removed:
trunk/reactos/drivers/multimedia/audio/mpu401/
trunk/reactos/drivers/wdm/audio/backpln/portcls/helper/
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/
Modified:
trunk/reactos/drivers/drivers.rbuild
trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c
trunk/reactos/drivers/wdm/audio/directory.rbuild
Modified: trunk/reactos/drivers/drivers.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/drivers.rbuild?rev…
==============================================================================
--- trunk/reactos/drivers/drivers.rbuild (original)
+++ trunk/reactos/drivers/drivers.rbuild Sun Jul 8 21:31:55 2007
@@ -38,6 +38,9 @@
<directory name="video">
<xi:include href="video/directory.rbuild" />
</directory>
+<directory name="wdm">
+ <xi:include href="wdm/wdm.rbuild" />
+</directory>
<directory name="wmi">
<xi:include href="wmi/wmilib.rbuild" />
</directory>
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniport.cpp)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniport.cpp (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp Sun Jul 8 21:31:55 2007
@@ -10,7 +10,7 @@
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
*/
-#include "../private.h"
+#include "private.h"
#include <portcls.h>
NTSTATUS
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportMidi.cpp)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport/IMiniportMidi.cpp (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp Sun Jul 8 21:31:55
2007
@@ -9,7 +9,7 @@
REFERENCE:
http://www.osronline.com/ddkx/stream/audmp-routines_1fsj.htm
*/
-#include "../private.h"
+#include "private.h"
#include <portcls.h>
NTSTATUS
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortMidi.cpp)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port/IPortMidi.cpp (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp Sun Jul 8 21:31:55 2007
@@ -11,11 +11,13 @@
IPortMidi inherits from IPort. This file contains specific
extensions.
*/
-#include "../private.h"
+#include "private.h"
#include <stdunk.h>
#include <portcls.h>
#include "port.h"
+
+#if 0
/*
IPort Methods
@@ -72,3 +74,5 @@
{
return STATUS_UNSUCCESSFUL;
}
+
+#endif
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/ResourceList.c (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/helper/ResourceList.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/helper/ResourceList.c (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/ResourceList.c Sun Jul 8 21:31:55
2007
@@ -9,7 +9,7 @@
* 27 Jan 07 Created
*/
-#include "../private.h"
+#include "private.h"
#include <portcls.h>
#include <stdunk.h>
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/port.h (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/port.h)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port/port.h (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port.h Sun Jul 8 21:31:55 2007
@@ -17,9 +17,11 @@
#ifndef PORT_PRIVATE_H
#define PORT_PRIVATE_H
+#include "private.h"
#include <stdunk.h>
#include <portcls.h>
+#if 0
typedef struct CPort
{
union
@@ -31,5 +33,6 @@
LONG m_ref_count;
PUNKNOWN m_outer_unknown;
} CPort;
+#endif
#endif
Copied: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c (from r27487,
trunk/reactos/drivers/wdm/audio/backpln/portcls/port/factory.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port/factory.c (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_factory.c Sun Jul 8 21:31:55
2007
@@ -7,7 +7,7 @@
#define INITGUID
-#include "../private.h"
+#include "private.h"
#include <portcls.h>
#include <ks.h>
#include <kcom.h>
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild Sun Jul 8 21:31:55
2007
@@ -1,11 +1,19 @@
<module name="portcls" type="kernelmodedriver"
installbase="system32/drivers" installname="portcls.sys"
allowwarnings="true">
- <linkerflag>-fno-exceptions</linkerflag>
- <linkerflag>-fno-rtti</linkerflag>
- <importlibrary definition="portcls.def" />
+
+ <!-- MinGW32-specific linker options. Worth having but not essential. -->
+ <!--
+ <linkerflag>-fno-exceptions</linkerflag>
+ <linkerflag>-fno-rtti</linkerflag>
+ -->
+
+ <importlibrary definition="portcls.def" />
+
<define name="__USE_W32API" />
<define name="_NTDDK_" />
<define name="DBG" />
+
<include base="portcls">../include</include>
+
<library>ntoskrnl</library>
<library>ks</library>
<library>drmk</library>
@@ -15,13 +23,28 @@
<file>irp.c</file>
<file>drm.c</file>
<file>stubs.c</file>
+ <file>undoc.c</file>
<!-- Probably not the best idea to have this separate -->
<!--<file>../stdunk/stdunk.c</file>-->
- <file>helper/ResourceList.c</file>
+ <file>ResourceList.c</file>
- <file>port/factory.c</file>
+ <file>port_factory.c</file>
+ <file>Port.cpp</file>
+ <file>PortDMus.cpp</file>
+ <file>PortMidi.cpp</file>
+ <file>PortTopology.cpp</file>
+ <file>PortWaveCyclic.cpp</file>
+ <file>PortWavePci.cpp</file>
+
+ <file>miniport_factory.cpp</file>
+ <file>Miniport.cpp</file>
+ <file>MiniportDMus.cpp</file>
+ <file>MiniportMidi.cpp</file>
+ <file>MiniportTopology.cpp</file>
+ <file>MiniportWaveCyclic.cpp</file>
+ <file>MiniportWavePci.cpp</file>
<file>portcls.rc</file>
</module>
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/undoc.c Sun Jul 8 21:31:55 2007
@@ -2,6 +2,7 @@
Undocumented PortCls exports
*/
+#include "private.h"
#include <portcls.h>
PORTCLASSAPI NTSTATUS
Modified: trunk/reactos/drivers/wdm/audio/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/director…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/directory.rbuild (original)
+++ trunk/reactos/drivers/wdm/audio/directory.rbuild Sun Jul 8 21:31:55 2007
@@ -9,4 +9,7 @@
</directory>
<directory name="legacy">
<xi:include href="legacy/directory.rbuild" />
-</directory>
+</directory>
+<directory name="sysaudio">
+ <xi:include href="sysaudio/sysaudio.rbuild" />
+</directory>
Added: trunk/reactos/drivers/wdm/audio/sysaudio/main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/main.c (added)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/main.c Sun Jul 8 21:31:55 2007
@@ -1,0 +1,132 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS Kernel Streaming
+ * FILE: drivers/wdm/audio/sysaudio/main.c
+ * PURPOSE: System Audio graph builder
+ * PROGRAMMER: Andrew Greenwood
+ *
+ * HISTORY:
+ * 8 Jul 07 Started basic implementation
+ */
+
+#include <ntddk.h>
+/* #include <ks.h> */
+#include <debug.h>
+
+NTSTATUS
+NTAPI
+SysAudio_Create(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ DPRINT("SysAudio_Create called\n");
+
+ /* TODO */
+
+ /* Complete the request */
+ Irp->IoStatus.Status = STATUS_SUCCESS;
+ Irp->IoStatus.Information = 0;
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+ return STATUS_SUCCESS;
+}
+
+VOID
+NTAPI
+SysAudio_Unload(IN PDRIVER_OBJECT DriverObject)
+{
+ PDEVICE_OBJECT DeviceObject;
+
+ DPRINT("SysAudio_Unload called\n");
+
+ /* Get DO and DE */
+ DeviceObject = DriverObject->DeviceObject;
+/* DeviceExtension = DeviceObject->DeviceExtension;*/
+
+ /* Delete the object */
+ IoDeleteDevice(DeviceObject);
+}
+
+#if 0
+VOID
+NTAPI
+SysAudio_StartIo(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp)
+{
+ /* TODO */
+
+ DPRINT("SysAudio_StartIo called\n");
+
+ /* Complete the request and start the next packet */
+ Irp->IoStatus.Status = Status;
+ Irp->IoStatus.Information = 0;
+ IoStartNextPacket(DeviceObject, TRUE);
+ IoCompleteRequest(Irp, IO_NO_INCREMENT);
+}
+#endif
+
+NTSTATUS NTAPI
+SysAudio_AddDevice(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PDEVICE_OBJECT PhysicalDeviceObject)
+{
+ NTSTATUS status;
+ UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\sysaudio");
+ UNICODE_STRING SymlinkName =
RTL_CONSTANT_STRING(L"\\DosDevices\\sysaudio");
+ PDEVICE_OBJECT DeviceObject;
+
+ DPRINT("SysAudio_AddDevice called\n");
+
+ status = IoCreateDevice(DriverObject,
+ 0, /* Extension size */
+ &DeviceName,
+ FILE_DEVICE_SOUND, /* is this right? */
+ 0, /* Characteristics */
+ FALSE,
+ &DeviceObject);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ DPRINT("Failed to create \\Device\\sysaudio !\n");
+ return status;
+ }
+
+ status = IoCreateSymbolicLink(&SymlinkName, &DeviceName);
+
+ if ( ! NT_SUCCESS(status) )
+ {
+ IoDeleteDevice(DeviceObject);
+
+ DPRINT("Failed to create \\DosDevices\\sysaudio symlink!\n");
+ return status;
+ }
+
+ DPRINT("Device created successfully\n");
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS NTAPI
+DriverEntry(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PUNICODE_STRING RegistryPath)
+{
+ DPRINT("System audio graph builder (sysaudio) started\n");
+
+ DriverObject->DriverExtension->AddDevice = SysAudio_AddDevice;
+
+ DriverObject->MajorFunction[IRP_MJ_CREATE] = SysAudio_Create;
+
+/* We'd want to handle this but does KS need to know? */
+/* DriverObject->MajorFunction[IRP_MJ_PNP] = KsDefaultDispatchPnp;*/
+
+/* We don't want to handle this though - pass to KS */
+/* DriverObject->MajorFunction[IRP_MJ_POWER] = KsDefaultDispatchPower;*/
+
+ DriverObject->DriverUnload = SysAudio_Unload;
+/* DriverObject->DriverStartIo = SysAudio_StartIo; */
+
+ /* Hmm, shouldn't KS.SYS be involved in some way? */
+
+ return STATUS_SUCCESS;
+}
Added: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild (added)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild Sun Jul 8 21:31:55 2007
@@ -1,0 +1,11 @@
+<module name="sysaudio" type="kernelmodedriver"
installbase="system32/drivers" installname="sysaudio.sys"
allowwarnings="true">
+ <include base="sysaudio">.</include>
+ <library>ntoskrnl</library>
+ <define name="__USE_W32API" />
+ <define name="_NTDDK_" />
+ <define name="_COMDDK_" />
+
+ <file>main.c</file>
+
+ <file>sysaudio.rc</file>
+</module>
Added: trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/sysaudio…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rc (added)
+++ trunk/reactos/drivers/wdm/audio/sysaudio/sysaudio.rc Sun Jul 8 21:31:55 2007
@@ -1,0 +1,5 @@
+#define REACTOS_VERSION_DLL
+#define REACTOS_STR_FILE_DESCRIPTION "System audio graph builder\0"
+#define REACTOS_STR_INTERNAL_NAME "portcls\0"
+#define REACTOS_STR_ORIGINAL_FILENAME "portcls.sys\0"
+#include <reactos/version.rc>