Author: janderwald
Date: Thu Dec 4 12:43:42 2008
New Revision: 37855
URL:
http://svn.reactos.org/svn/reactos?rev=37855&view=rev
Log:
- Implement PcGetDeviceProperty, PcGetTimeInterval
- Stub interfaces of IDmaChannel, IDmaChannelSlave
- Stub IMiniport adapters IMiniportDMus
- Stub IPort drivers (IPortDMus, IPortMidi, IPortTopology, IPortWaveCyclic, IPortWavePci)
- Implement IRegistryKey interface
- Enhance IResource interface
Added:
trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c (with props)
trunk/reactos/drivers/wdm/audio/backpln/portcls/resource.c (with props)
Removed:
trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp
trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/Miniport.cpp (removed)
@@ -1,33 +1,0 @@
-/*
- ReactOS Operating System
-
- Port Class API
- IMiniPortMidi Implementation
-
- by Andrew Greenwood
-
- REFERENCE:
-
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
-*/
-
-#include "private.h"
-#include <portcls.h>
-
-NTSTATUS
-IMiniport::GetDescription(
- OUT PPCFILTER_DESCRIPTOR* Description)
-{
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IMiniport::DataRangeIntersection(
- IN ULONG PinId,
- IN PKSDATARANGE DataRange,
- IN PKSDATARANGE MatchingDataRange,
- IN ULONG OutputBufferLength,
- OUT PVOID ResultantFormat OPTIONAL,
- OUT PULONG ResultantFormatLength)
-{
- return STATUS_UNSUCCESSFUL;
-}
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportDMus.cpp (removed)
@@ -1,1 +1,0 @@
-
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportMidi.cpp (removed)
@@ -1,43 +1,0 @@
-/*
- ReactOS Operating System
-
- Port Class API
- IMiniPortMidi Implementation
-
- by Andrew Greenwood
-
- REFERENCE:
-
http://www.osronline.com/ddkx/stream/audmp-routines_1fsj.htm
-*/
-#include "private.h"
-#include <portcls.h>
-
-NTSTATUS
-IMiniportMidi::Init(
- IN PUNKNOWN UnknownAdapter,
- IN PRESOURCELIST ResourceList,
- IN PPORTMIDI Port,
- OUT PSERVICEGROUP* ServiceGroup)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_6jsj.htm */
-
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IMiniportMidi::NewStream(
- OUT PMINIPORTMIDISTREAM Stream,
- IN PUNKNOWN OuterUnknown OPTIONAL,
- IN POOL_TYPE PoolType,
- IN ULONG Pin,
- IN BOOLEAN Capture,
- IN PKSDATAFORMAT DataFormat,
- OUT PSERVICEGROUP* ServiceGroup)
-{
- return STATUS_UNSUCCESSFUL;
-}
-
-void
-IMiniportMidi::Service(void)
-{
-}
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportTopology.cpp (removed)
@@ -1,1 +1,0 @@
-
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/MiniportWaveCyclic.cpp (removed)
@@ -1,1 +1,0 @@
-
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/Port.cpp (removed)
@@ -1,55 +1,0 @@
-/*
- ReactOS Operating System
- Port Class API / IPort Implementation
-
- by Andrew Greenwood
-
- REFERENCE:
-
http://www.osronline.com/ddkx/stream/audmp-routines_0tgz.htm
-
- NOTE: I'm not sure if this file is even needed...
-*/
-
-#if 0
-#include "../private.h"
-#include <stdunk.h>
-#include <portcls.h>
-
-NTSTATUS
-IPort::GetDeviceProperty(
- IN DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
- IN ULONG BufferLength,
- OUT PVOID PropertyBuffer,
- OUT PULONG ReturnLength)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_93xv.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPort::Init(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- IN PUNKNOWN UnknownMiniport,
- IN PUNKNOWN UnknownAdapter OPTIONAL,
- IN PRESOURCELIST ResourceList)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_7qcz.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPort::NewRegistryKey(
- OUT PREGISTRYKEY* OutRegistryKey,
- IN PUNKNOWN OuterUnknown OPTIONAL,
- IN ULONG RegistryKeyType,
- IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
- IN ULONG CreateOptions OPTIONAL,
- OUT PULONG Disposition OPTIONAL)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_2jhv.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-#endif
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/PortDMus.cpp (removed)
@@ -1,1 +1,0 @@
-
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/PortMidi.cpp (removed)
@@ -1,78 +1,0 @@
-/*
- ReactOS Operating System
- Port Class API / IPortMidi Implementation
-
- by Andrew Greenwood
-
- REFERENCE:
-
http://www.osronline.com/ddkx/stream/audmp-routines_49pv.htm
-
- NOTES:
- IPortMidi inherits from IPort. This file contains specific
- extensions.
-*/
-#include "private.h"
-#include <stdunk.h>
-#include <portcls.h>
-#include "port.h"
-
-
-#if 0
-
-/*
- IPort Methods
-*/
-
-NTSTATUS
-CPortMidi::GetDeviceProperty(
- IN DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
- IN ULONG BufferLength,
- OUT PVOID PropertyBuffer,
- OUT PULONG ReturnLength)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_93xv.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-CPortMidi::Init(
- IN PDEVICE_OBJECT DeviceObject,
- IN PIRP Irp,
- IN PUNKNOWN UnknownMiniport,
- IN PUNKNOWN UnknownAdapter OPTIONAL,
- IN PRESOURCELIST ResourceList)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_7qcz.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-CPortMidi::NewRegistryKey(
- OUT PREGISTRYKEY* OutRegistryKey,
- IN PUNKNOWN OuterUnknown OPTIONAL,
- IN ULONG RegistryKeyType,
- IN ACCESS_MASK DesiredAccess,
- IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
- IN ULONG CreateOptions OPTIONAL,
- OUT PULONG Disposition OPTIONAL)
-{
- /*
http://www.osronline.com/ddkx/stream/audmp-routines_2jhv.htm */
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- IPortMidi Methods
-*/
-
-VOID
-CPortMidi::Notify(IN PSERVICEGROUP ServiceGroup OPTIONAL)
-{
-}
-
-NTSTATUS
-CPortMidi::RegisterServiceGroup(IN PSERVICEGROUP ServiceGroup)
-{
- return STATUS_UNSUCCESSFUL;
-}
-
-#endif
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/PortTopology.cpp (removed)
@@ -1,3 +1,0 @@
-/*
- Inherits from IPort only
-*/
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/PortWaveCyclic.cpp (removed)
@@ -1,41 +1,0 @@
-/*
- ReactOS Operating System
- Port Class API / IPort Implementation
-
- by Andrew Greenwood
-*/
-
-#include "private.h"
-
-NTSTATUS
-IPortWaveCyclic::NewMasterDmaChannel(
- OUT PDMACHANNEL* DmaChannel,
- IN PUNKNOWN OuterUnknown,
- IN PRESOURCELIST ResourceList OPTIONAL,
- IN ULONG MaximumLength,
- IN BOOL Dma32BitAddresses,
- IN BOOL Dma64BitAddresses,
- IN DMA_WIDTH DmaWidth,
- IN DMA_SPEED DmaSpeed)
-{
- return STATUS_UNSUCCESSFUL;
-}
-
-NTSTATUS
-IPortWaveCyclic::NewSlaveDmaChannel(
- OUT PDMACHANNELSLAVE* DmaChannel,
- IN PUNKNOWN OuterUnknown,
- IN PRESOURCELIST ResourceList OPTIONAL,
- IN ULONG DmaIndex,
- IN ULONG MaximumLength,
- IN BOOL DemandMode,
- IN DMA_SPEED DmaSpeed)
-{
- return STATUS_UNSUCCESSFUL;
-}
-
-VOID
-IPortWaveCyclic::Notify(
- IN PSERVICEGROUP ServiceGroup)
-{
-}
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -10,7 +10,7 @@
*/
#include "private.h"
-
+#include <initguid.h>
/*
This is called from DriverEntry so that PortCls can take care of some
IRPs and map some others to the main KS driver. In most cases this will
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c [iso-8859-1] Thu Dec 4 12:43:42
2008
@@ -1,0 +1,32 @@
+#include "private.h"
+
+/*
+ * @implemented
+ */
+NTSTATUS
+NTAPI
+PcGetDeviceProperty(
+ IN PVOID DeviceObject,
+ IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
+ IN ULONG BufferLength,
+ OUT PVOID PropertyBuffer,
+ OUT PULONG ResultLength)
+{
+ return IoGetDeviceProperty(DeviceObject, DeviceProperty, BufferLength,
PropertyBuffer, ResultLength);
+}
+
+/*
+ * @implemented
+ */
+ULONGLONG
+NTAPI
+PcGetTimeInterval(
+ IN ULONGLONG Since)
+{
+ LARGE_INTEGER CurrentTime;
+
+ KeQuerySystemTime(&CurrentTime);
+
+ return (CurrentTime.QuadPart - Since);
+}
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,198 @@
+#include "private.h"
+
+
+typedef struct
+{
+ IDmaChannelSlaveVtbl *lpVtbl;
+
+ LONG ref;
+ ULONG BufferSize;
+ PHYSICAL_ADDRESS Address;
+
+}IDmaChannelImpl;
+
+
+/*
+ Basic IUnknown methods
+*/
+
+ NTSTATUS
+ STDMETHODCALLTYPE
+ IDmaChannel_fnQueryInterface(
+ IDmaChannel* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+ {
+ /* TODO */
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannel_fnAddRef(
+ IDmaChannel* iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_AddRef: This %p\n", This);
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannel_fnRelease(
+ IDmaChannel* iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ DPRINT("IDmaChannel_Release: This %p new ref %u\n", This, This->ref);
+
+ if (This->ref == 0)
+ {
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+
+
+NTSTATUS
+NTAPI
+IDmaChannel_fnAllocateBuffer(
+ IN IDmaChannel * iface,
+ IN ULONG BufferSize,
+ IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_AllocateBuffer: This %p BufferSize %u\n", This,
BufferSize);
+
+ /* Did the caller already allocate a buffer ?*/
+ if (This->BufferSize) return STATUS_UNSUCCESSFUL;
+
+ /* FIXME */
+ //This->BufferSize = BufferSize;
+
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnAllocatedBufferSize(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_AllocatedBufferSize: This %p BufferSize %u\n", This,
This->BufferSize);
+ return This->BufferSize;
+}
+
+VOID
+NTAPI
+IDmaChannel_fnCopyFrom(
+ IN IDmaChannel * iface,
+ IN PVOID Destination,
+ IN PVOID Source,
+ IN ULONG ByteCount
+ )
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_CopyFrom: This %p Destination %p Source %p ByteCount
%u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannel_fnCopyTo(
+ IN IDmaChannel * iface,
+ IN PVOID Destination,
+ IN PVOID Source,
+ IN ULONG ByteCount
+ )
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_CopyTo: This %p Destination %p Source %p ByteCount
%u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannel_fnFreeBuffer(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_FreeBuffer: This %p\n", This);
+}
+
+PADAPTER_OBJECT
+NTAPI
+IDmaChannel_fnGetAdapterObject(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_GetAdapterObject: This %p\n", This);
+ return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnMaximumBufferSize(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_MaximumBufferSize: This %p\n", This);
+ return 0;
+}
+
+PHYSICAL_ADDRESS
+NTAPI
+IDmaChannel_fnPhysicalAdress(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_PhysicalAdress: This %p\n", This);
+ return This->Address;
+}
+
+VOID
+NTAPI
+IDmaChannel_fnSetBufferSize(
+ IN IDmaChannel * iface,
+ IN ULONG BufferSize)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_SetBufferSize: This %p\n", This);
+
+}
+
+PVOID
+NTAPI
+IDmaChannel_fnSystemAddress(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_SystemAddress: This %p\n", This);
+ return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannel_fnTransferCount(
+ IN IDmaChannel * iface)
+{
+ IDmaChannelImpl * This = (IDmaChannelImpl*)iface;
+
+ DPRINT("IDmaChannel_TransferCount: This %p\n", This);
+ return 0;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_master.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,287 @@
+#include "private.h"
+
+
+typedef struct
+{
+ IDmaChannelSlaveVtbl *lpVtbl;
+
+ LONG ref;
+
+ ULONG BufferSize;
+ PHYSICAL_ADDRESS Address;
+
+}IDmaChannelSlaveImpl;
+
+
+//---------------------------------------------------------------
+// IUnknown methods
+//
+
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnQueryInterface(
+ IDmaChannelSlave * iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ /* TODO */
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannelSlave_fnAddRef(
+ IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_AddRef: This %p\n", This);
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IDmaChannelSlave_fnRelease(
+ IDmaChannelSlave* iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ DPRINT("IDmaChannelSlave_Release: This %p new ref %u\n", This,
This->ref);
+
+ if (This->ref == 0)
+ {
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+//---------------------------------------------------------------
+// IDmaChannel methods
+//
+
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnAllocateBuffer(
+ IN IDmaChannelSlave * iface,
+ IN ULONG BufferSize,
+ IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_AllocateBuffer: This %p BufferSize %u\n", This,
BufferSize);
+
+ /* Did the caller already allocate a buffer ?*/
+ if (This->BufferSize) return STATUS_UNSUCCESSFUL;
+
+ /* FIXME */
+ //This->BufferSize = BufferSize;
+
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnAllocatedBufferSize(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_AllocatedBufferSize: This %p BufferSize %u\n",
This, This->BufferSize);
+ return This->BufferSize;
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnCopyFrom(
+ IN IDmaChannelSlave * iface,
+ IN PVOID Destination,
+ IN PVOID Source,
+ IN ULONG ByteCount
+ )
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_CopyFrom: This %p Destination %p Source %p ByteCount
%u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnCopyTo(
+ IN IDmaChannelSlave * iface,
+ IN PVOID Destination,
+ IN PVOID Source,
+ IN ULONG ByteCount
+ )
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_CopyTo: This %p Destination %p Source %p ByteCount
%u\n", This, Destination, Source, ByteCount);
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnFreeBuffer(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_FreeBuffer: This %p\n", This);
+}
+
+PADAPTER_OBJECT
+NTAPI
+IDmaChannelSlave_fnGetAdapterObject(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_GetAdapterObject: This %p\n", This);
+ return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnMaximumBufferSize(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_MaximumBufferSize: This %p\n", This);
+ return 0;
+}
+
+PHYSICAL_ADDRESS
+NTAPI
+IDmaChannelSlave_fnPhysicalAdress(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_PhysicalAdress: This %p\n", This);
+ return This->Address;
+}
+
+VOID
+NTAPI
+IDmaChannelSlave_fnSetBufferSize(
+ IN IDmaChannelSlave * iface,
+ IN ULONG BufferSize)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_SetBufferSize: This %p\n", This);
+
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnBufferSize(
+ IN IDmaChannelSlave * iface)
+{
+ return 0;
+}
+
+
+PVOID
+NTAPI
+IDmaChannelSlave_fnSystemAddress(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_SystemAddress: This %p\n", This);
+ return NULL;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnTransferCount(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_TransferCount: This %p\n", This);
+ return 0;
+}
+
+ULONG
+NTAPI
+IDmaChannelSlave_fnReadCounter(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_ReadCounter: This %p\n", This);
+ return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnStart(
+ IN IDmaChannelSlave * iface,
+ ULONG MapSize,
+ BOOLEAN WriteToDevice)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_Start: This %p\n", This);
+ return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnStop(
+ IN IDmaChannelSlave * iface)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_fnStop: This %p\n", This);
+ return 0;
+}
+
+NTSTATUS
+NTAPI
+IDmaChannelSlave_fnWaitForTC(
+ IN IDmaChannelSlave * iface,
+ ULONG Timeout)
+{
+ IDmaChannelSlaveImpl * This = (IDmaChannelSlaveImpl*)iface;
+
+ DPRINT("IDmaChannelSlave_WaitForTC: This %p\n", This);
+ return 0;
+
+}
+
+static IDmaChannelSlaveVtbl vt_IDmaChannelSlaveVtbl =
+{
+ /* IUnknown methods */
+ IDmaChannelSlave_fnQueryInterface,
+ IDmaChannelSlave_fnAddRef,
+ IDmaChannelSlave_fnRelease,
+ /* IDmaChannel methods */
+ IDmaChannelSlave_fnAllocateBuffer,
+ IDmaChannelSlave_fnFreeBuffer,
+ IDmaChannelSlave_fnTransferCount,
+ IDmaChannelSlave_fnMaximumBufferSize,
+ IDmaChannelSlave_fnAllocatedBufferSize,
+ IDmaChannelSlave_fnBufferSize,
+ IDmaChannelSlave_fnSetBufferSize,
+ IDmaChannelSlave_fnSystemAddress,
+ IDmaChannelSlave_fnPhysicalAdress,
+ IDmaChannelSlave_fnGetAdapterObject,
+ IDmaChannelSlave_fnCopyFrom,
+ IDmaChannelSlave_fnCopyTo,
+ /* IDmaChannelSlave methods */
+ IDmaChannelSlave_fnStart,
+ IDmaChannelSlave_fnStop,
+ IDmaChannelSlave_fnReadCounter,
+ IDmaChannelSlave_fnWaitForTC
+};
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/dma_slave.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,56 @@
+/*
+ ReactOS Operating System
+
+ Port Class API
+ IMiniPortMidi Implementation
+
+ by Andrew Greenwood
+
+ REFERENCE:
+
http://www.osronline.com/ddkx/stream/audmp-routines_64vn.htm
+*/
+
+#include "private.h"
+
+const GUID CLSID_MiniportDriverDMusUART;
+const GUID CLSID_MiniportDriverUart;
+const GUID CLSID_MiniportDriverDMusUARTCapture;
+const GUID CLSID_MiniportDriverFmSynth;
+const GUID CLSID_MiniportDriverFmSynthWithVol;
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcNewMiniport(
+ OUT PMINIPORT* OutMiniport,
+ IN REFCLSID ClassId)
+{
+ NTSTATUS Status = STATUS_INVALID_PARAMETER;
+
+ if (!OutMiniport)
+ {
+ DPRINT("PcNewMiniport was supplied a NULL OutPort parameter\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverDMusUART) ||
+ IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverUart) ||
+ IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverDMusUARTCapture))
+ {
+ Status = NewMiniportDMusUART(OutMiniport, ClassId);
+ }
+ else if (IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverFmSynth) ||
+ IsEqualGUIDAligned(ClassId, &CLSID_MiniportDriverFmSynthWithVol))
+ {
+ Status = NewMiniportFmSynth(OutMiniport, ClassId);
+ }
+ else
+ {
+ Status = STATUS_INVALID_PARAMETER;
+ }
+
+ DPRINT("PcNewMiniport Status %x\n", Status);
+ return Status;
+}
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c [iso-8859-1] Thu Dec
4 12:43:42 2008
@@ -1,0 +1,164 @@
+#include "private.h"
+
+typedef struct
+{
+ IMiniportDMusVtbl *lpVtbl;
+ LONG ref;
+ CLSID ClassId;
+
+}IMiniportDMusImpl;
+
+const GUID IID_IMiniportDMus;
+
+/* IUnknown methods */
+
+NTSTATUS
+STDMETHODCALLTYPE
+IMiniportDMus_fnQueryInterface(
+ IMiniportDMus* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+ if (IsEqualGUIDAligned(refiid, &IID_IMiniportDMus))
+ {
+ *Output = &This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IMiniportDMus_fnAddRef(
+ IMiniportDMus* iface)
+{
+ IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IMiniportDMust_fnRelease(
+ IMiniportDMus* iface)
+{
+ IMiniportDMusImpl * This = (IMiniportDMusImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+/* IMiniport methods */
+
+NTSTATUS
+NTAPI
+IMiniportDMus_fnDataRangeIntersection(
+ IN IMiniportDMus * iface,
+ IN ULONG PinId,
+ IN PKSDATARANGE DataRange,
+ IN PKSDATARANGE MatchingDataRange,
+ IN ULONG OutputBufferLength,
+ OUT PVOID ResultantFormat OPTIONAL,
+ OUT PULONG ResultantFormatLength)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+NTAPI
+IMiniportDMus_fnGetDescription(
+ IN IMiniportDMus * iface,
+ OUT PPCFILTER_DESCRIPTOR *Description
+ )
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+/* IMinIMiniportDMus methods */
+
+HRESULT
+NTAPI
+IMiniportDMus_fnInit(
+ IN IMiniportDMus * iface,
+ IN PUNKNOWN pUnknownAdapter,
+ IN PRESOURCELIST pResourceList,
+ IN PPORTDMUS pPort,
+ OUT PSERVICEGROUP *ppServiceGroup
+ )
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+HRESULT
+NTAPI
+IMiniportDMus_fnNewStream(
+ IN IMiniportDMus * iface,
+ OUT PMXF *ppMXF,
+ IN PUNKNOWN pOuterUnknown OPTIONAL,
+ IN POOL_TYPE PoolType,
+ IN ULONG uPinId,
+ IN DMUS_STREAM_TYPE StreamType,
+ IN PKSDATAFORMAT pDataFormat,
+ OUT PSERVICEGROUP *ppServiceGroup,
+ IN PAllocatorMXF pAllocatorMXF,
+ IN PMASTERCLOCK pMasterClock,
+ OUT PULONGLONG puuSchedulePreFetch
+ )
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+NTAPI
+IMiniportDMus_fnService(
+ IN IMiniportDMus * iface)
+{
+
+}
+
+static IMiniportDMusVtbl vt_PortDMusVtbl =
+{
+ /* IUnknown */
+ IMiniportDMus_fnQueryInterface,
+ IMiniportDMus_fnAddRef,
+ IMiniportDMust_fnRelease,
+ /* IMiniport */
+ IMiniportDMus_fnGetDescription,
+ IMiniportDMus_fnDataRangeIntersection,
+ /* IMiniportDMus */
+ IMiniportDMus_fnInit,
+ IMiniportDMus_fnService,
+ IMiniportDMus_fnNewStream
+};
+
+NTSTATUS
+NewMiniportDMusUART(
+ OUT PMINIPORT* OutMiniport,
+ IN REFCLSID ClassId)
+{
+ IMiniportDMusImpl * This;
+
+ This = ExAllocatePoolWithTag(NonPagedPool, sizeof(IMiniportDMusImpl),
TAG_PORTCLASS);
+ if (!This)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ /* Initialize IMiniportDMus */
+ RtlCopyMemory(&This->ClassId, ClassId, sizeof(CLSID));
+ This->ref = 1;
+ This->lpVtbl = &vt_PortDMusVtbl;
+ *OutMiniport = (PMINIPORT)&This->lpVtbl;
+
+ return STATUS_SUCCESS;
+}
+
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_dmus.c
------------------------------------------------------------------------------
svn:eol-style = native
Removed: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_factory.cpp (removed)
@@ -1,1 +1,0 @@
-
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c [iso-8859-1] Thu
Dec 4 12:43:42 2008
@@ -1,0 +1,9 @@
+#include "private.h"
+
+
+NTSTATUS NewMiniportFmSynth(
+ OUT PMINIPORT* OutMiniport,
+ IN REFCLSID ClassId)
+{
+ return STATUS_UNSUCCESSFUL;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/miniport_fmsynth.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,41 @@
+#include "private.h"
+
+
+const GUID CLSID_PortTopology;
+const GUID CLSID_PortMidi;
+const GUID CLSID_PortWaveCyclic;
+const GUID CLSID_PortWavePci;
+const GUID CLSID_PortDMus;
+
+PORTCLASSAPI
+NTSTATUS
+NTAPI
+PcNewPort(
+ OUT PPORT* OutPort,
+ IN REFCLSID ClassId)
+{
+ NTSTATUS Status;
+
+ if (!OutPort)
+ {
+ DPRINT("PcNewPort was supplied a NULL OutPort parameter\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ if (IsEqualGUIDAligned(ClassId, &CLSID_PortMidi))
+ Status = NewPortMidi(OutPort);
+ else if (IsEqualGUIDAligned(ClassId, &CLSID_PortDMus))
+ Status = NewPortDMus(OutPort);
+ else if (IsEqualGUIDAligned(ClassId, &CLSID_PortTopology))
+ Status = NewPortTopology(OutPort);
+ else if (IsEqualGUIDAligned(ClassId, &CLSID_PortWaveCyclic))
+ Status = NewPortWaveCyclic(OutPort);
+ else if (IsEqualGUIDAligned(ClassId, &CLSID_PortWavePci))
+ Status = NewPortWavePci(OutPort);
+ else
+ Status = STATUS_NOT_SUPPORTED;
+
+ DPRINT("PcNewPort Status %lx\n", Status);
+
+ return Status;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,177 @@
+#include "private.h"
+
+typedef struct
+{
+ IPortDMusVtbl *lpVtbl;
+
+ LONG ref;
+ BOOL bInitialized;
+ IMiniportDMus *pMiniport;
+ DEVICE_OBJECT *pDeviceObject;
+ PSERVICEGROUP ServiceGroup;
+
+}IPortDMusImpl;
+
+const GUID IID_IPortDMus;
+
+//---------------------------------------------------------------
+// IUnknown interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortDMus_fnQueryInterface(
+ IPortDMus* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+ if (IsEqualGUIDAligned(refiid, &IID_IPortDMus) ||
+ IsEqualGUIDAligned(refiid, &IID_IUnknown))
+ {
+ *Output = &This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IPortDMus_fnAddRef(
+ IPortDMus* iface)
+{
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+NTAPI
+IPortDMus_fnRelease(
+ IPortDMus* iface)
+{
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ if (This->bInitialized)
+ {
+ This->pMiniport->lpVtbl->Release(This->pMiniport);
+ }
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+
+//---------------------------------------------------------------
+// IPort interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortDMus_fnGetDeviceProperty(
+ IN IPortDMus * iface,
+ IN DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
+ IN ULONG BufferLength,
+ OUT PVOID PropertyBuffer,
+ OUT PULONG ReturnLength)
+{
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortDMus_fnNewRegistryKey called w/o initiazed\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ return IoGetDeviceProperty(This->pDeviceObject, DeviceRegistryProperty,
BufferLength, PropertyBuffer, ReturnLength);
+}
+
+NTSTATUS
+NTAPI
+IPortDMus_fnInit(
+ IN IPortDMus * iface,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ IN PUNKNOWN UnknownMiniport,
+ IN PUNKNOWN UnknownAdapter OPTIONAL,
+ IN PRESOURCELIST ResourceList)
+{
+ IMiniportDMus * Miniport;
+ NTSTATUS Status;
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+ if (This->bInitialized)
+ {
+ DPRINT("IPortDMus_Init called again\n");
+ return STATUS_SUCCESS;
+ }
+
+ Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport,
&IID_IMiniportDMus, (PVOID*)&Miniport);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("IPortDMus_Init called with invalid IMiniport adapter\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ Status = Miniport->lpVtbl->Init(Miniport, UnknownAdapter, ResourceList, iface,
&This->ServiceGroup);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("IMinIPortDMus_Init failed with %x\n", Status);
+ return Status;
+ }
+
+ /* Initialize port object */
+ This->pMiniport = Miniport;
+ This->pDeviceObject = DeviceObject;
+ This->bInitialized = TRUE;
+
+ /* increment reference on miniport adapter */
+ Miniport->lpVtbl->AddRef(Miniport);
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+IPortDMus_fnNewRegistryKey(
+ IN IPortDMus * iface,
+ OUT PREGISTRYKEY *OutRegistryKey,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN ULONG RegistryKeyType,
+ IN ACCESS_MASK DesiredAccess,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+ IN ULONG CreateOptions OPTIONAL,
+ OUT PULONG Disposition OPTIONAL)
+{
+ IPortDMusImpl * This = (IPortDMusImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortDMus_fnNewRegistryKey called w/o initialized\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+
+
+
+
+
+
+
+NTSTATUS
+NewPortDMus(
+ OUT PPORT* OutPort)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_dmus.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,8 @@
+#include "private.h"
+
+NTSTATUS
+NewPortMidi(
+ OUT PPORT* OutPort)
+{
+ return STATUS_UNSUCCESSFUL;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_midi.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Thu Dec
4 12:43:42 2008
@@ -1,0 +1,11 @@
+#include "private.h"
+
+
+
+
+NTSTATUS
+NewPortTopology(
+ OUT PPORT* OutPort)
+{
+ return STATUS_UNSUCCESSFUL;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] Thu Dec
4 12:43:42 2008
@@ -1,0 +1,249 @@
+#include "private.h"
+
+typedef struct
+{
+ IPortWaveCyclicVtbl *lpVtbl;
+ IPortClsVersion *lpVtblPortClsVersion;
+#if 0
+ IUnregisterSubdevice *lpVtblUnregisterSubDevice;
+#endif
+
+ LONG ref;
+
+ BOOL bInitialized;
+ PDEVICE_OBJECT pDeviceObject;
+ PMINIPORTWAVECYCLIC pMiniport;
+
+}IPortWaveCyclicImpl;
+
+const GUID IID_IMiniportWaveCyclic;
+const GUID IID_IPortWaveCyclic;
+const GUID IID_IUnknown;
+
+//---------------------------------------------------------------
+// IUnknown interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnQueryInterface(
+ IPortWaveCyclic* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+ if (IsEqualGUIDAligned(refiid, &IID_IPortWaveCyclic) ||
+ IsEqualGUIDAligned(refiid, &IID_IUnknown))
+ {
+ *Output = &This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+NTAPI
+IPortWaveCyclic_fnAddRef(
+ IPortWaveCyclic* iface)
+{
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+NTAPI
+IPortWaveCyclic_fnRelease(
+ IPortWaveCyclic* iface)
+{
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ if (This->bInitialized)
+ {
+ This->pMiniport->lpVtbl->Release(This->pMiniport);
+ }
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+
+//---------------------------------------------------------------
+// IPort interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnGetDeviceProperty(
+ IN IPortWaveCyclic * iface,
+ IN DEVICE_REGISTRY_PROPERTY DeviceRegistryProperty,
+ IN ULONG BufferLength,
+ OUT PVOID PropertyBuffer,
+ OUT PULONG ReturnLength)
+{
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initiazed\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ return IoGetDeviceProperty(This->pDeviceObject, DeviceRegistryProperty,
BufferLength, PropertyBuffer, ReturnLength);
+}
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnInit(
+ IN IPortWaveCyclic * iface,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PIRP Irp,
+ IN PUNKNOWN UnknownMiniport,
+ IN PUNKNOWN UnknownAdapter OPTIONAL,
+ IN PRESOURCELIST ResourceList)
+{
+ IMiniportWaveCyclic * Miniport;
+ NTSTATUS Status;
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ if (This->bInitialized)
+ {
+ DPRINT("IPortWaveCyclic_Init called again\n");
+ return STATUS_SUCCESS;
+ }
+
+ Status = UnknownMiniport->lpVtbl->QueryInterface(UnknownMiniport,
&IID_IMiniportWaveCyclic, (PVOID*)&Miniport);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("IPortWaveCyclic_Init called with invalid IMiniport
adapter\n");
+ return STATUS_INVALID_PARAMETER;
+ }
+
+ Status = Miniport->lpVtbl->Init(Miniport, UnknownAdapter, ResourceList,
iface);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT("IMiniportWaveCyclic_Init failed with %x\n", Status);
+ return Status;
+ }
+
+ /* Initialize port object */
+ This->pMiniport = Miniport;
+ This->pDeviceObject = DeviceObject;
+ This->bInitialized = TRUE;
+
+ /* increment reference on miniport adapter */
+ Miniport->lpVtbl->AddRef(Miniport);
+
+ return STATUS_SUCCESS;
+}
+
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewRegistryKey(
+ IN IPortWaveCyclic * iface,
+ OUT PREGISTRYKEY *OutRegistryKey,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN ULONG RegistryKeyType,
+ IN ACCESS_MASK DesiredAccess,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+ IN ULONG CreateOptions OPTIONAL,
+ OUT PULONG Disposition OPTIONAL)
+{
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+
+//---------------------------------------------------------------
+// IPortWaveCyclic interface functions
+//
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewMasterDmaChannel(
+ IN IPortWaveCyclic * iface,
+ OUT PDMACHANNEL* DmaChannel,
+ IN PUNKNOWN OuterUnknown,
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN ULONG MaximumLength,
+ IN BOOL Dma32BitAddresses,
+ IN BOOL Dma64BitAddresses,
+ IN DMA_WIDTH DmaWidth,
+ IN DMA_SPEED DmaSpeed)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+NTAPI
+IPortWaveCyclic_fnNewSlaveDmaChannel(
+ IN IPortWaveCyclic * iface,
+ OUT PDMACHANNELSLAVE* DmaChannel,
+ IN PUNKNOWN OuterUnknown,
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN ULONG DmaIndex,
+ IN ULONG MaximumLength,
+ IN BOOL DemandMode,
+ IN DMA_SPEED DmaSpeed)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+NTAPI
+IPortWaveCyclic_fnNotify(
+ IN IPortWaveCyclic * iface,
+ IN PSERVICEGROUP ServiceGroup)
+{
+}
+
+
+static const IPortWaveCyclicVtbl vt_IPortWaveCyclicVtbl =
+{
+ IPortWaveCyclic_fnQueryInterface,
+ IPortWaveCyclic_fnAddRef,
+ IPortWaveCyclic_fnRelease,
+ IPortWaveCyclic_fnInit,
+ IPortWaveCyclic_fnGetDeviceProperty,
+ IPortWaveCyclic_fnNewRegistryKey,
+ IPortWaveCyclic_fnNotify,
+ IPortWaveCyclic_fnNewMasterDmaChannel,
+ IPortWaveCyclic_fnNewSlaveDmaChannel,
+};
+
+//---------------------------------------------------------------
+// IPortWaveCyclic constructor
+//
+
+NTSTATUS
+NewPortWaveCyclic(
+ OUT PPORT* OutPort)
+{
+ IPortWaveCyclicImpl * This;
+
+ This = ExAllocatePoolWithTag(NonPagedPool, sizeof(IPortWaveCyclicImpl),
TAG_PORTCLASS);
+ if (!This)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ This->lpVtbl = (IPortWaveCyclicVtbl*)&vt_IPortWaveCyclicVtbl;
+ This->ref = 1;
+ This->bInitialized = FALSE;
+ *OutPort = (PPORT)(&This->lpVtbl);
+
+ return STATUS_SUCCESS;
+}
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,47 @@
+#include "private.h"
+
+typedef struct
+{
+ IPortWavePciVtbl *lpVtbl;
+ IPortClsVersion *lpVtblPortClsVersion;
+#if 0
+ IUnregisterSubdevice *lpVtblUnregisterSubDevice;
+#endif
+ LONG ref;
+
+
+}IPortWavePciImpl;
+
+
+NTSTATUS
+NTAPI
+IPortWavePci_fnNewMasterDmaChannel(
+ IN IPortWavePci * iface,
+ OUT PDMACHANNEL* DmaChannel,
+ IN PUNKNOWN OuterUnknown,
+ IN POOL_TYPE PoolType,
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN BOOL ScatterGather,
+ IN BOOL Dma32BitAddresses,
+ IN BOOL Dma64BitAddresses,
+ IN DMA_WIDTH DmaWidth,
+ IN DMA_SPEED DmaSpeed,
+ IN ULONG MaximumLength,
+ IN ULONG DmaPort)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+VOID
+IPortWavePci_fnNotify(
+ IN IPortWavePci * iface,
+ IN PSERVICEGROUP ServiceGroup)
+{
+}
+
+NTSTATUS
+NewPortWavePci(
+ OUT PPORT* OutPort)
+{
+ return STATUS_UNSUCCESSFUL;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
------------------------------------------------------------------------------
svn:eol-style = native
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 [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,50 +1,33 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../../tools/rbuild/project.dtd">
<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-rtti</linkerflag>
- -->
<importlibrary definition="portcls.spec" />
-
<define name="_NTDDK_" />
<define name="PC_NO_IMPORTS" />
-
<include base="portcls">../include</include>
-
<library>ntoskrnl</library>
<library>ks</library>
<library>drmk</library>
-
+ <library>rtl</library>
+ <file>api.c</file>
<file>dll.c</file>
+ <file>dma_master.c</file>
+ <file>dma_slave.c</file>
<file>adapter.c</file>
<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>ResourceList.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>resource.c</file>
+ <file>registry.c</file>
+ <file>port.c</file>
+ <file>port_dmus.c</file>
+ <file>port_midi.c</file>
+ <file>port_topology.c</file>
+ <file>port_wavepci.c</file>
+ <file>port_wavecyclic.c</file>
+ <file>miniport.c</file>
+ <file>miniport_dmus.c</file>
+ <file>miniport_fmsynth.c</file>
<file>portcls.rc</file>
</module>
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -10,6 +10,9 @@
#include <ntddk.h>
#include <portcls.h>
#include <debug.h>
+
+#include <portcls.h>
+#include <dmusicks.h>
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#define TAG_PORTCLASS TAG('P', 'C', 'L', 'S')
@@ -43,6 +46,28 @@
IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp);
+NTSTATUS NewMiniportDMusUART(
+ OUT PMINIPORT* OutMiniport,
+ IN REFCLSID ClassId);
+
+NTSTATUS NewMiniportFmSynth(
+ OUT PMINIPORT* OutMiniport,
+ IN REFCLSID ClassId);
+
+NTSTATUS NewPortMidi(
+ OUT PPORT* OutPort);
+
+NTSTATUS NewPortDMus(
+ OUT PPORT* OutPort);
+
+NTSTATUS NewPortTopology(
+ OUT PPORT* OutPort);
+
+NTSTATUS NewPortWaveCyclic(
+ OUT PPORT* OutPort);
+
+NTSTATUS NewPortWavePci(
+ OUT PPORT* OutPort);
typedef struct
{
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,222 @@
+#include "private.h"
+
+typedef struct
+{
+ IRegistryKeyVtbl * lpVtbl;
+
+ LONG ref;
+ HANDLE hKey;
+
+}IRegistryKeyImpl;
+
+const GUID IID_IRegistryKey;
+
+/*
+ Basic IUnknown methods
+*/
+
+static IRegistryKeyVtbl vt_IRegistryKeyVtbl;
+
+
+ULONG
+STDMETHODCALLTYPE
+IRegistryKey_fnAddRef(
+ IN IRegistryKey* iface)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+ DPRINT("IRegistryKey_AddRef: This %p\n", This);
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IRegistryKey_fnRelease(
+ IN IRegistryKey* iface)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ if (This->hKey)
+ {
+ ZwClose(This->hKey);
+ }
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryInterface(
+ IN IRegistryKey* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+
+ if (IsEqualGUIDAligned(refiid, &IID_IRegistryKey))
+ {
+ *Output = (PVOID)&This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+
+ DPRINT("IRegistryKey_QueryInterface: This %p unknown iid\n", This,
This->ref);
+ return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnDeleteKey(
+ IN IRegistryKey* iface)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwDeleteKey(This->hKey);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnEnumerateKey(
+ IN IRegistryKey* iface,
+ IN ULONG Index,
+ IN KEY_INFORMATION_CLASS KeyInformationClass,
+ OUT PVOID KeyInformation,
+ IN ULONG Length,
+ OUT PULONG ResultLength)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwEnumerateKey(This->hKey, Index, KeyInformationClass, KeyInformation,
Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnEnumerateKeyValue(
+ IN IRegistryKey* iface,
+ IN ULONG Index,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ OUT PVOID KeyValueInformation,
+ IN ULONG Length,
+ OUT PULONG ResultLength)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwEnumerateValueKey(This->hKey, Index, KeyValueInformationClass,
KeyValueInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnNewSubKey(
+ IN IRegistryKey* iface,
+ OUT PREGISTRYKEY *RegistrySubKey,
+ IN PUNKNOWN OuterUnknown,
+ IN ACCESS_MASK DesiredAccess,
+ IN PUNICODE_STRING SubKeyName,
+ IN ULONG CreateOptions,
+ OUT PULONG Disposition OPTIONAL)
+{
+ OBJECT_ATTRIBUTES Attributes;
+ NTSTATUS Status;
+ HANDLE hKey;
+ IRegistryKeyImpl * NewThis, *This = (IRegistryKeyImpl*)iface;
+
+ InitializeObjectAttributes(&Attributes, SubKeyName, 0, This->hKey, NULL);
+ Status = ZwCreateKey(&hKey, KEY_READ | KEY_WRITE, &Attributes, 0, NULL, 0,
Disposition);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+
+ NewThis = ExAllocatePoolWithTag(NonPagedPool, sizeof(IRegistryKeyImpl),
TAG_PORTCLASS);
+ if (!NewThis)
+ {
+ ZwClose(hKey);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ NewThis->hKey = hKey;
+ NewThis->ref = 1;
+ NewThis->lpVtbl = &vt_IRegistryKeyVtbl;
+ *RegistrySubKey = (PREGISTRYKEY)&This->lpVtbl;
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryKey(
+ IN IRegistryKey* iface,
+ IN KEY_INFORMATION_CLASS KeyInformationClass,
+ OUT PVOID KeyInformation,
+ IN ULONG Length,
+ OUT PULONG ResultLength)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwQueryKey(This->hKey, KeyInformationClass, KeyInformation, Length,
ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryRegistryValues(
+ IN IRegistryKey* iface,
+ IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
+ IN PVOID Context OPTIONAL)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ DPRINT("IRegistryKey_QueryRegistryValues: This %p\n", This);
+ return STATUS_UNSUCCESSFUL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnQueryValueKey(
+ IN IRegistryKey* iface,
+ IN PUNICODE_STRING ValueName,
+ IN KEY_VALUE_INFORMATION_CLASS KeyValueInformationClass,
+ OUT PVOID KeyValueInformation,
+ IN ULONG Length,
+ OUT PULONG ResultLength)
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwQueryValueKey(This->hKey, ValueName, KeyValueInformationClass,
KeyValueInformation, Length, ResultLength);
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IRegistryKey_fnSetValueKey(
+ IN IRegistryKey* iface,
+ IN PUNICODE_STRING ValueName OPTIONAL,
+ IN ULONG Type,
+ IN PVOID Data,
+ IN ULONG DataSize
+ )
+{
+ IRegistryKeyImpl * This = (IRegistryKeyImpl*)iface;
+ return ZwSetValueKey(This->hKey, ValueName, 0, Type, Data, DataSize);
+}
+
+
+/*
+ * @unimplemented
+ */
+NTSTATUS NTAPI
+PcNewRegistryKey(
+ OUT PREGISTRYKEY* OutRegistryKey,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN ULONG RegistryKeyType,
+ IN ACCESS_MASK DesiredAccess,
+ IN PVOID DeviceObject OPTIONAL,
+ IN PVOID SubDevice OPTIONAL,
+ IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
+ IN ULONG CreateOptions OPTIONAL,
+ OUT PULONG Disposition OPTIONAL)
+{
+ UNIMPLEMENTED;
+ //IoGetDeviceProperty
+
+ return STATUS_UNSUCCESSFUL;
+}
+
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/registry.c
------------------------------------------------------------------------------
svn:eol-style = native
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/resource.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/resource.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/resource.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -1,0 +1,321 @@
+/*
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS
+ * FILE: drivers/multimedia/portcls/helpers/ResourceList.c
+ * PURPOSE: Port Class driver / ResourceList implementation
+ * PROGRAMMER: Andrew Greenwood
+ *
+ * HISTORY:
+ * 27 Jan 07 Created
+ */
+
+#include "private.h"
+#include <portcls.h>
+#include <stdunk.h>
+#include <intrin.h>
+
+typedef struct CResourceList
+{
+ IResourceListVtbl *lpVtbl;
+ LONG ref;
+ PUNKNOWN OuterUnknown;
+ POOL_TYPE PoolType;
+ PCM_RESOURCE_LIST TranslatedResourceList;
+ PCM_RESOURCE_LIST UntranslatedResourceList;
+} IResourceListImpl;
+
+const GUID IID_IResourceList;
+
+/*
+ Basic IUnknown methods
+*/
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnQueryInterface(
+ IResourceList* iface,
+ IN REFIID refiid,
+ OUT PVOID* Output)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+ if (IsEqualGUIDAligned(refiid, &IID_IResourceList))
+ {
+ *Output = &This->lpVtbl;
+ _InterlockedIncrement(&This->ref);
+ return STATUS_SUCCESS;
+ }
+ return STATUS_UNSUCCESSFUL;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnAddRef(
+ IResourceList* iface)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ return _InterlockedIncrement(&This->ref);
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnRelease(
+ IResourceList* iface)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ _InterlockedDecrement(&This->ref);
+
+ if (This->ref == 0)
+ {
+ ExFreePool(This->TranslatedResourceList);
+ ExFreePool(This->UntranslatedResourceList);
+ ExFreePoolWithTag(This, TAG_PORTCLASS);
+ return 0;
+ }
+ /* Return new reference count */
+ return This->ref;
+}
+
+
+/*
+ IResourceList methods
+*/
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnNumberOfEntries(IResourceList* iface)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ return This->TranslatedResourceList->List[0].PartialResourceList.Count;
+}
+
+ULONG
+STDMETHODCALLTYPE
+IResourceList_fnNumberOfEntriesOfType(
+ IResourceList* iface,
+ IN CM_RESOURCE_TYPE Type)
+{
+ /* I guess the translated and untranslated lists will be same length? */
+
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+ ULONG Index, Count = 0;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+ for (Index = 0; Index <
This->TranslatedResourceList->List[0].PartialResourceList.Count; Index ++ )
+ {
+ PartialDescriptor =
&This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[Index];
+
+ if (PartialDescriptor->Type == Type)
+ {
+ /* Yay! Finally found one that matches! */
+ Count++;
+ }
+ }
+
+ DPRINT("Found %d\n", Count);
+ return Count;
+}
+
+PCM_PARTIAL_RESOURCE_DESCRIPTOR
+STDMETHODCALLTYPE
+IResourceList_fnFindTranslatedEntry(
+ IResourceList* iface,
+ IN CM_RESOURCE_TYPE Type,
+ IN ULONG Index)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+ ULONG DescIndex, Count = 0;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+ for (DescIndex = 0; DescIndex <
This->TranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
+ {
+ PartialDescriptor =
&This->TranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
+
+ if (PartialDescriptor->Type == Type)
+ {
+ /* Yay! Finally found one that matches! */
+ if (Index == Count)
+ {
+ return PartialDescriptor;
+ }
+ Count++;
+ }
+ }
+
+ return NULL;
+}
+
+PCM_PARTIAL_RESOURCE_DESCRIPTOR
+STDMETHODCALLTYPE
+IResourceList_fnFindUntranslatedEntry(
+ IResourceList* iface,
+ IN CM_RESOURCE_TYPE Type,
+ IN ULONG Index)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+ ULONG DescIndex, Count = 0;
+ PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
+
+ for (DescIndex = 0; DescIndex <
This->UntranslatedResourceList->List[0].PartialResourceList.Count; DescIndex ++ )
+ {
+ PartialDescriptor =
&This->UntranslatedResourceList->List[0].PartialResourceList.PartialDescriptors[DescIndex];
+
+ if (PartialDescriptor->Type == Type)
+ {
+ /* Yay! Finally found one that matches! */
+ if (Index == Count)
+ {
+ return PartialDescriptor;
+ }
+ Count++;
+ }
+ }
+ return NULL;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnAddEntry(
+ IResourceList* iface,
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Translated,
+ IN PCM_PARTIAL_RESOURCE_DESCRIPTOR Untranslated)
+{
+ PCM_RESOURCE_LIST NewUntranslatedResources, NewTranslatedResources;
+ ULONG NewTranslatedSize, NewUntranslatedSize;
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ NewTranslatedSize = sizeof(CM_RESOURCE_LIST) +
This->TranslatedResourceList[0].List->PartialResourceList.Count *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ NewTranslatedResources = ExAllocatePoolWithTag(This->PoolType, NewTranslatedSize,
TAG_PORTCLASS);
+ if (!NewTranslatedResources)
+ return STATUS_INSUFFICIENT_RESOURCES;
+
+ NewUntranslatedSize = sizeof(CM_RESOURCE_LIST) +
This->UntranslatedResourceList[0].List->PartialResourceList.Count *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
+ NewUntranslatedResources = ExAllocatePoolWithTag(This->PoolType,
NewUntranslatedSize, TAG_PORTCLASS);
+ if (!NewUntranslatedResources)
+ {
+ ExFreePoolWithTag(NewTranslatedResources, TAG_PORTCLASS);
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ RtlCopyMemory(NewTranslatedResources, This->TranslatedResourceList,
sizeof(CM_RESOURCE_LIST) +
(This->TranslatedResourceList[0].List->PartialResourceList.Count-1) *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
RtlCopyMemory(&NewTranslatedResources->List[0].PartialResourceList.PartialDescriptors[This->TranslatedResourceList[0].List->PartialResourceList.Count],
Translated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
+ RtlCopyMemory(NewUntranslatedResources, This->UntranslatedResourceList,
sizeof(CM_RESOURCE_LIST) +
(This->UntranslatedResourceList[0].List->PartialResourceList.Count-1) *
sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
RtlCopyMemory(&NewUntranslatedResources->List[0].PartialResourceList.PartialDescriptors[This->UntranslatedResourceList[0].List->PartialResourceList.Count],
Untranslated, sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR));
+
+ ExFreePoolWithTag(This->TranslatedResourceList, TAG_PORTCLASS);
+ ExFreePoolWithTag(This->UntranslatedResourceList, TAG_PORTCLASS);
+
+ This->UntranslatedResourceList = NewUntranslatedResources;
+ This->TranslatedResourceList = NewTranslatedResources;
+
+ NewUntranslatedResources->List[0].PartialResourceList.Count++;
+ NewTranslatedResources->List[0].PartialResourceList.Count++;
+
+ return STATUS_SUCCESS;
+}
+
+NTSTATUS
+STDMETHODCALLTYPE
+IResourceList_fnAddEntryFromParent(
+ IResourceList* iface,
+ IN IResourceList* Parent,
+ IN CM_RESOURCE_TYPE Type,
+ IN ULONG Index)
+{
+ return STATUS_SUCCESS;
+}
+
+PCM_RESOURCE_LIST
+STDMETHODCALLTYPE
+IResourceList_fnTranslatedList(
+ IResourceList* iface)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ return This->TranslatedResourceList;
+}
+
+PCM_RESOURCE_LIST
+STDMETHODCALLTYPE
+IResourceList_fnUntranslatedList(
+ IResourceList* iface)
+{
+ IResourceListImpl * This = (IResourceListImpl*)iface;
+
+ return This->UntranslatedResourceList;
+}
+
+
+/*
+ ResourceList V-Table
+*/
+static const IResourceListVtbl vt_ResourceListVtbl =
+{
+ /* IUnknown */
+ IResourceList_fnQueryInterface,
+ IResourceList_fnAddRef,
+ IResourceList_fnRelease,
+ /* IResourceList */
+ IResourceList_fnNumberOfEntries,
+ IResourceList_fnNumberOfEntriesOfType,
+ IResourceList_fnFindTranslatedEntry,
+ IResourceList_fnFindUntranslatedEntry,
+ IResourceList_fnAddEntry,
+ IResourceList_fnAddEntryFromParent,
+ IResourceList_fnTranslatedList,
+ IResourceList_fnUntranslatedList
+};
+
+
+/*
+ Factory for creating a resource list
+*/
+PORTCLASSAPI NTSTATUS NTAPI
+PcNewResourceList(
+ OUT PRESOURCELIST* OutResourceList,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN POOL_TYPE PoolType,
+ IN PCM_RESOURCE_LIST TranslatedResources,
+ IN PCM_RESOURCE_LIST UntranslatedResources)
+{
+ IResourceListImpl* NewList = NULL;
+
+ /* TODO: Validate parameters */
+
+ DPRINT("PcNewResourceList\n");
+
+ NewList = ExAllocatePoolWithTag(PoolType, sizeof(IResourceListImpl), TAG_PORTCLASS);
+
+ if (!NewList)
+ {
+ DPRINT("ExAllocatePoolWithTag failed\n");
+ return STATUS_INSUFFICIENT_RESOURCES;
+ }
+
+ /* Initialize */
+ NewList->lpVtbl = (IResourceListVtbl*)&vt_ResourceListVtbl;
+ NewList->ref = 1;
+ NewList->OuterUnknown = OuterUnknown;
+ NewList->TranslatedResourceList= TranslatedResources;
+ NewList->UntranslatedResourceList = UntranslatedResources;
+ NewList->PoolType = PoolType;
+
+ /* Increment our usage count and set the pointer to this object */
+ *OutResourceList = (IResourceList*)&NewList->lpVtbl;
+
+ return STATUS_SUCCESS;
+}
+
+PORTCLASSAPI NTSTATUS NTAPI
+PcNewResourceSublist(
+ OUT PRESOURCELIST* OutResourceList,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN POOL_TYPE PoolType,
+ IN PRESOURCELIST ParentList,
+ IN ULONG MaximumEntries)
+{
+ return STATUS_UNSUCCESSFUL;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/resource.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c [iso-8859-1] Thu Dec 4
12:43:42 2008
@@ -16,9 +16,6 @@
Factory Stubs
*/
-/*
- * @unimplemented
- */
NTSTATUS NTAPI
PcNewDmaChannel(
OUT PDMACHANNEL* OutDmaChannel,
@@ -50,37 +47,6 @@
* @unimplemented
*/
NTSTATUS NTAPI
-PcNewMiniport(
- OUT PMINIPORT* OutMiniport,
- IN REFCLSID ClassId)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcNewRegistryKey(
- OUT PREGISTRYKEY* OutRegistryKey,
- IN PUNKNOWN OuterUnknown OPTIONAL,
- IN ULONG RegistryKeyType,
- IN ACCESS_MASK DesiredAccess,
- IN PVOID DeviceObject OPTIONAL,
- IN PVOID SubDevice OPTIONAL,
- IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL,
- IN ULONG CreateOptions OPTIONAL,
- OUT PULONG Disposition OPTIONAL)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
PcNewServiceGroup(
OUT PSERVICEGROUP* OutServiceGroup,
IN PUNKNOWN OuterUnknown OPTIONAL)
@@ -122,21 +88,6 @@
/* ===============================================================
Properties
*/
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcGetDeviceProperty(
- IN PVOID DeviceObject,
- IN DEVICE_REGISTRY_PROPERTY DeviceProperty,
- IN ULONG BufferLength,
- OUT PVOID PropertyBuffer,
- OUT PULONG ResultLength)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
/*
* @unimplemented
@@ -239,13 +190,7 @@
/*
* @unimplemented
*/
-ULONGLONG NTAPI
-PcGetTimeInterval(
- IN ULONGLONG Since)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
+
/*
* @unimplemented