mirror of
https://github.com/reactos/reactos.git
synced 2024-09-08 03:40:17 +00:00
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:
parent
8d3e4b4e77
commit
330b16d830
|
@ -38,6 +38,9 @@
|
||||||
<directory name="video">
|
<directory name="video">
|
||||||
<xi:include href="video/directory.rbuild" />
|
<xi:include href="video/directory.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
<directory name="wdm">
|
||||||
|
<xi:include href="wdm/wdm.rbuild" />
|
||||||
|
</directory>
|
||||||
<directory name="wmi">
|
<directory name="wmi">
|
||||||
<xi:include href="wmi/wmilib.rbuild" />
|
<xi:include href="wmi/wmilib.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
|
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../private.h"
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
|
@ -9,7 +9,7 @@
|
||||||
REFERENCE:
|
REFERENCE:
|
||||||
http://www.osronline.com/ddkx/stream/audmp-routines_1fsj.htm
|
http://www.osronline.com/ddkx/stream/audmp-routines_1fsj.htm
|
||||||
*/
|
*/
|
||||||
#include "../private.h"
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
|
|
||||||
NTSTATUS
|
NTSTATUS
|
|
@ -11,12 +11,14 @@
|
||||||
IPortMidi inherits from IPort. This file contains specific
|
IPortMidi inherits from IPort. This file contains specific
|
||||||
extensions.
|
extensions.
|
||||||
*/
|
*/
|
||||||
#include "../private.h"
|
#include "private.h"
|
||||||
#include <stdunk.h>
|
#include <stdunk.h>
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
#include "port.h"
|
#include "port.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
|
||||||
/*
|
/*
|
||||||
IPort Methods
|
IPort Methods
|
||||||
*/
|
*/
|
||||||
|
@ -72,3 +74,5 @@ CPortMidi::RegisterServiceGroup(IN PSERVICEGROUP ServiceGroup)
|
||||||
{
|
{
|
||||||
return STATUS_UNSUCCESSFUL;
|
return STATUS_UNSUCCESSFUL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
|
@ -9,7 +9,7 @@
|
||||||
* 27 Jan 07 Created
|
* 27 Jan 07 Created
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../private.h"
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
#include <stdunk.h>
|
#include <stdunk.h>
|
||||||
|
|
|
@ -17,9 +17,11 @@
|
||||||
#ifndef PORT_PRIVATE_H
|
#ifndef PORT_PRIVATE_H
|
||||||
#define PORT_PRIVATE_H
|
#define PORT_PRIVATE_H
|
||||||
|
|
||||||
|
#include "private.h"
|
||||||
#include <stdunk.h>
|
#include <stdunk.h>
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
|
|
||||||
|
#if 0
|
||||||
typedef struct CPort
|
typedef struct CPort
|
||||||
{
|
{
|
||||||
union
|
union
|
||||||
|
@ -31,5 +33,6 @@ typedef struct CPort
|
||||||
LONG m_ref_count;
|
LONG m_ref_count;
|
||||||
PUNKNOWN m_outer_unknown;
|
PUNKNOWN m_outer_unknown;
|
||||||
} CPort;
|
} CPort;
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#define INITGUID
|
#define INITGUID
|
||||||
|
|
||||||
#include "../private.h"
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
#include <ks.h>
|
#include <ks.h>
|
||||||
#include <kcom.h>
|
#include <kcom.h>
|
|
@ -1,11 +1,19 @@
|
||||||
<module name="portcls" type="kernelmodedriver" installbase="system32/drivers" installname="portcls.sys" allowwarnings="true">
|
<module name="portcls" type="kernelmodedriver" installbase="system32/drivers" installname="portcls.sys" allowwarnings="true">
|
||||||
|
|
||||||
|
<!-- MinGW32-specific linker options. Worth having but not essential. -->
|
||||||
|
<!--
|
||||||
<linkerflag>-fno-exceptions</linkerflag>
|
<linkerflag>-fno-exceptions</linkerflag>
|
||||||
<linkerflag>-fno-rtti</linkerflag>
|
<linkerflag>-fno-rtti</linkerflag>
|
||||||
|
-->
|
||||||
|
|
||||||
<importlibrary definition="portcls.def" />
|
<importlibrary definition="portcls.def" />
|
||||||
|
|
||||||
<define name="__USE_W32API" />
|
<define name="__USE_W32API" />
|
||||||
<define name="_NTDDK_" />
|
<define name="_NTDDK_" />
|
||||||
<define name="DBG" />
|
<define name="DBG" />
|
||||||
|
|
||||||
<include base="portcls">../include</include>
|
<include base="portcls">../include</include>
|
||||||
|
|
||||||
<library>ntoskrnl</library>
|
<library>ntoskrnl</library>
|
||||||
<library>ks</library>
|
<library>ks</library>
|
||||||
<library>drmk</library>
|
<library>drmk</library>
|
||||||
|
@ -15,13 +23,28 @@
|
||||||
<file>irp.c</file>
|
<file>irp.c</file>
|
||||||
<file>drm.c</file>
|
<file>drm.c</file>
|
||||||
<file>stubs.c</file>
|
<file>stubs.c</file>
|
||||||
|
<file>undoc.c</file>
|
||||||
|
|
||||||
<!-- Probably not the best idea to have this separate -->
|
<!-- Probably not the best idea to have this separate -->
|
||||||
<!--<file>../stdunk/stdunk.c</file>-->
|
<!--<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>
|
<file>portcls.rc</file>
|
||||||
</module>
|
</module>
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
Undocumented PortCls exports
|
Undocumented PortCls exports
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "private.h"
|
||||||
#include <portcls.h>
|
#include <portcls.h>
|
||||||
|
|
||||||
PORTCLASSAPI NTSTATUS
|
PORTCLASSAPI NTSTATUS
|
||||||
|
|
|
@ -10,3 +10,6 @@
|
||||||
<directory name="legacy">
|
<directory name="legacy">
|
||||||
<xi:include href="legacy/directory.rbuild" />
|
<xi:include href="legacy/directory.rbuild" />
|
||||||
</directory>
|
</directory>
|
||||||
|
<directory name="sysaudio">
|
||||||
|
<xi:include href="sysaudio/sysaudio.rbuild" />
|
||||||
|
</directory>
|
||||||
|
|
132
reactos/drivers/wdm/audio/sysaudio/main.c
Normal file
132
reactos/drivers/wdm/audio/sysaudio/main.c
Normal 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;
|
||||||
|
}
|
11
reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild
Normal file
11
reactos/drivers/wdm/audio/sysaudio/sysaudio.rbuild
Normal 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>
|
5
reactos/drivers/wdm/audio/sysaudio/sysaudio.rc
Normal file
5
reactos/drivers/wdm/audio/sysaudio/sysaudio.rc
Normal 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>
|
Loading…
Reference in a new issue