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...)


svn path=/trunk/; revision=27494
This commit is contained in:
Andrew Greenwood 2007-07-08 17:31:55 +00:00
parent 8d3e4b4e77
commit 330b16d830
23 changed files with 196 additions and 11 deletions

View file

@ -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>

View file

@ -10,7 +10,7 @@
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
*/
#include "../private.h"
#include "private.h"
#include <portcls.h>
NTSTATUS

View file

@ -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

View file

@ -11,12 +11,14 @@
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 @@ CPortMidi::RegisterServiceGroup(IN PSERVICEGROUP ServiceGroup)
{
return STATUS_UNSUCCESSFUL;
}
#endif

View file

@ -9,7 +9,7 @@
* 27 Jan 07 Created
*/
#include "../private.h"
#include "private.h"
#include <portcls.h>
#include <stdunk.h>

View file

@ -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 @@ typedef struct CPort
LONG m_ref_count;
PUNKNOWN m_outer_unknown;
} CPort;
#endif
#endif

View file

@ -7,7 +7,7 @@
#define INITGUID
#include "../private.h"
#include "private.h"
#include <portcls.h>
#include <ks.h>
#include <kcom.h>

View file

@ -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>

View file

@ -2,6 +2,7 @@
Undocumented PortCls exports
*/
#include "private.h"
#include <portcls.h>
PORTCLASSAPI NTSTATUS

View file

@ -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>

View file

@ -0,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;
}

View file

@ -0,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>

View file

@ -0,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>