Author: silverblade
Date: Sat Mar 17 16:21:33 2007
New Revision: 26120
URL:
http://svn.reactos.org/svn/reactos?rev=26120&view=rev
Log:
A few header files I forgot to commit last time. Sorry!
Added:
trunk/reactos/include/ddk/kcom.h
trunk/reactos/include/ddk/stdunk.h
trunk/reactos/include/ddk/wdm.h
Modified:
trunk/reactos/include/ddk/ks.h
trunk/reactos/include/ddk/portcls.h
trunk/reactos/include/ddk/punknown.h
Added: trunk/reactos/include/ddk/kcom.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/kcom.h?rev=261…
==============================================================================
--- trunk/reactos/include/ddk/kcom.h (added)
+++ trunk/reactos/include/ddk/kcom.h Sat Mar 17 16:21:33 2007
@@ -1,0 +1,43 @@
+/*
+ ReactOS
+ Kernel-Mode COM for Kernel Streaming
+
+ Author:
+ Andrew Greenwood
+
+ Notes:
+ This is untested, and is for internal use by Kernel Streaming. The
+ functions here are documented on MSDN. Does this even compile??
+ Implementation should be in KS.SYS
+*/
+
+#ifndef KCOM_H
+#define KCOM_H
+
+#include <ntddk.h>
+
+COMDDKAPI NTSTATUS NTAPI
+KoCreateInstance(
+ IN REFCLSID ClassId,
+ IN IUnknown* UnkOuter OPTIONAL,
+ IN ULONG ClsContext,
+ IN REFIID InterfaceId,
+ OUT PVOID* Interface);
+
+/* Add a kernel COM Create-item entry to a device object */
+COMDDKAPI NTSTATUS NTAPI
+KoDeviceInitialize(
+ IN PDEVICE_OBJECT DeviceObject);
+
+COMDDKAPI NTSTATUS NTAPI
+KoDriverInitialize(
+ IN PDRIVER_OBJECT DriverObject,
+ IN PUNICODE_STRING RegistryPathName,
+ IN KoCreateObjectHandler CreateObjectHandler);
+
+/* Decrements refcount for calling interface on an object */
+COMDDKAPI NTSTATUS NTAPI
+KoRelease(
+ IN REFCLSID ClassId);
+
+#endif
Modified: trunk/reactos/include/ddk/ks.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/ks.h?rev=26120…
==============================================================================
--- trunk/reactos/include/ddk/ks.h (original)
+++ trunk/reactos/include/ddk/ks.h Sat Mar 17 16:21:33 2007
@@ -913,10 +913,23 @@
} KSPRIORITY, *PKSPRIORITY;
-/* =============================================================== */
-
-typedef struct
-{
+/* ===============================================================
+ Dispatch Table
+
http://www.osronline.com/DDKx/stream/ks-struct_494j.htm
+*/
+
+typedef struct
+{
+ PDRIVER_DISPATCH DeviceIoControl;
+ PDRIVER_DISPATCH Read;
+ PDRIVER_DISPATCH Write;
+ PDRIVER_DISPATCH Flush;
+ PDRIVER_DISPATCH Close;
+ PDRIVER_DISPATCH QuerySecurity;
+ PDRIVER_DISPATCH SetSecurity;
+ PFAST_IO_DEVICE_CONTROL FastDeviceIoControl;
+ PFAST_IO_READ FastRead;
+ PFAST_IO_WRITE FastWrite;
} KSDISPATCH_TABLE, *PKSDISPATCH_TABLE;
typedef struct
@@ -2012,7 +2025,7 @@
KSDDKAPI VOID NTAPI
KsFreeDeviceHeader(
- IN PVOID Header);
+ IN KSDEVICE_HEADER Header);
KSDDKAPI VOID NTAPI
KsFreeObjectHeader(
Modified: trunk/reactos/include/ddk/portcls.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/portcls.h?rev=…
==============================================================================
--- trunk/reactos/include/ddk/portcls.h (original)
+++ trunk/reactos/include/ddk/portcls.h Sat Mar 17 16:21:33 2007
@@ -123,6 +123,8 @@
#ifndef PORTCLS_H
#define PORTCLS_H
+#include <wdm.h>
+
/*#include <windef.h>*/
#include <ks.h>
#include <drmk.h>
@@ -133,13 +135,14 @@
#define PCFILTER_NODE ((ULONG) -1)
/* HACK */
-typedef PVOID CM_RESOURCE_TYPE;
-
-#define PORT_CLASS_DEVICE_EXTENSION_SIZE (64 * sizeof(ULONG_PTR))
-
-/* ===============================================================
- Class IDs - TODO
-*/
+/* typedef PVOID CM_RESOURCE_TYPE; */
+
+#define PORT_CLASS_DEVICE_EXTENSION_SIZE ( 64 * sizeof(ULONG_PTR) )
+
+/* ===============================================================
+ Class IDs - TODO (put these elsewhere!!!)
+*/
+#if 0
//#define CLSID_PortDMus /* dmusicks.h */
DEFINE_GUID(CLSID_PortMidi,0xb4c90a43L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9,
0x11, 0xb5, 0x44);
#define CLSID_PortTopology
@@ -152,6 +155,7 @@
#define CLSID_MiniportDriverFmSynth
#define CLSID_MiniportDriverFmSynthWithVol
DEFINE_GUID(CLSID_MiniportDriverUart,0xb4c90ae1L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0,
0xc9, 0x11, 0xb5, 0x44);
+#endif
/* ===============================================================
@@ -370,6 +374,9 @@
IResourceList Interface
*/
+#undef INTERFACE
+#define INTERFACE IResourceList
+
DECLARE_INTERFACE_(IResourceList, IUnknown)
{
DEFINE_ABSTRACT_UNKNOWN()
@@ -440,7 +447,103 @@
#define AddPortFromParent(p, n) \
AddEntryFromParent((p), CmResourceTypePort, (n))
-/* TODO ... */
+#define NumberOfInterrupts() \
+ NumberOfEntriesOfType(CmResourceTypeInterrupt)
+
+#define FindTranslatedInterrupt(n) \
+ FindTranslatedEntry(CmResourceTypeInterrupt, (n))
+
+#define FindUntranslatedInterrupt(n) \
+ FindUntranslatedEntry(CmResourceTypeInterrupt, (n))
+
+#define AddInterruptFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeInterrupt, (n))
+
+#define NumberOfMemories() \
+ NumberOfEntriesOfType(CmResourceTypeMemory)
+
+#define FindTranslatedMemory(n) \
+ FindTranslatedEntry(CmResourceTypeMemory, (n))
+
+#define FindUntranslatedMemory(n) \
+ FindUntranslatedEntry(CmResourceTypeMemory, (n))
+
+#define AddMemoryFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeMemory, (n))
+
+#define NumberOfDmas() \
+ NumberOfEntriesOfType(CmResourceTypeDma)
+
+#define FindTranslatedDma(n) \
+ FindTranslatedEntry(CmResourceTypeDma, (n))
+
+#define FindUntranslatedDma(n) \
+ FindUntranslatedEntry(CmResourceTypeDma, (n))
+
+#define AddDmaFromParent(p, n) \
+ AddEntryFromParent(p), CmResourceTypeInterrupt, (n))
+
+#define NumberOfDeviceSpecifics() \
+ NumberOfEntriesOfType(CmResourceTypeDeviceSpecific)
+
+#define FindTranslatedDeviceSpecific(n) \
+ FindTranslatedEntry(CmResourceTypeDeviceSpecific, (n))
+
+#define FindUntranslatedDeviceSpecific(n) \
+ FindUntranslatedEntry(CmResourceTypeDeviceSpecific, (n))
+
+#define AddDeviceSpecificFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeDeviceSpecific, (n))
+
+#define NumberOfBusNumbers() \
+ NumberOfEntriesOfType(CmResourceTypeBusNumber)
+
+#define FindTranslatedBusNumber(n) \
+ FindTranslatedEntry(CmResourceTypeBusNumber, (n))
+
+#define FindUntranslatedBusNumber(n) \
+ FindUntranslatedEntry(CmResourceTypeBusNumber, (n))
+
+#define AddBusNumberFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeBusNumber, (n))
+
+#define NumberOfDevicePrivates() \
+ NumberOfEntriesOfType(CmResourceTypeDevicePrivate)
+
+#define FindTranslatedDevicePrivate(n) \
+ FindTranslatedEntry(CmResourceTypeDevicePrivate, (n))
+
+#define FindUntranslatedDevicePrivate(n) \
+ FindUntranslatedEntry(CmResourceTypeDevicePrivate, (n))
+
+#define AddDevicePrivateFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeDevicePrivate, (n))
+
+#define NumberOfAssignedResources() \
+ NumberOfEntriesOfType(CmResourceTypeAssignedResource)
+
+#define FindTranslatedAssignedResource(n) \
+ FindTranslatedEntry(CmResourceTypeAssignedResource, (n))
+
+#define FindUntranslatedAssignedResource(n) \
+ FindUntranslatedEntry(CmResourceTypeAssignedResource, (n))
+
+#define AddAssignedResourceFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeAssignedResource, (n))
+
+#define NumberOfSubAllocateFroms() \
+ NumberOfEntriesOfType(CmResourceTypeSubAllocateFrom)
+
+#define FindTranslatedSubAllocateFrom(n) \
+ FindTranslatedEntry(CmResourceTypeSubAllocateFrom, (n))
+
+#define FindUntranslatedSubAllocateFrom(n) \
+ FindUntranslatedEntry(CmResourceTypeSubAllocateFrom, (n))
+
+#define AddSubAllocateFromFromParent(p, n) \
+ AddEntryFromParent((p), CmResourceTypeSubAllocateFrom, (n))
+
+#undef INTERFACE
/* ===============================================================
@@ -500,6 +603,163 @@
STDMETHODIMP_(void) CancelDelayedService(void);
typedef IServiceGroup *PSERVICEGROUP;
+
+
+/* ===============================================================
+ IDmaChannel Interface
+*/
+
+#define DEFINE_ABSTRACT_DMACHANNEL() \
+ STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
+ IN ULONG BufferSize, \
+ IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
+\
+ STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
+ STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
+ STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
+ STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
+ STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
+\
+ STDMETHOD_(void, SetBufferSize)( THIS_ \
+ IN ULONG BufferSize) PURE; \
+\
+ STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
+ STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS ) PURE; \
+ STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
+\
+ STDMETHOD_(void, CopyTo)( THIS_ \
+ IN PVOID Destination, \
+ IN PVOID Source, \
+ IN ULONG ByteCount) PURE; \
+\
+ STDMETHOD_(void, CopyFrom)( THIS_ \
+ IN PVOID Destination, \
+ IN PVOID Source, \
+ IN ULONG ByteCount) PURE;
+
+#define IMP_IDmaChannel() \
+ STDMETHODIMP_(NTSTATUS) AllocateBuffer( \
+ IN ULONG BufferSize, \
+ IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
+\
+ STDMETHODIMP_(void) FreeBuffer(void); \
+ STDMETHODIMP_(ULONG) TransferCount(void); \
+ STDMETHODIMP_(ULONG) MaximumBufferSize(void); \
+ STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \
+ STDMETHODIMP_(ULONG) BufferSize(void); \
+\
+ STDMETHODIMP_(void) SetBufferSize)( \
+ IN ULONG BufferSize); \
+\
+ STDMETHODIMP_(PVOID) SystemAddress(void); \
+ STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(void); \
+ STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void); \
+\
+ STDMETHODIMP_(void) CopyTo( \
+ IN PVOID Destination, \
+ IN PVOID Source, \
+ IN ULONG ByteCount); \
+\
+ STDMETHODIMP_(void) CopyFrom( \
+ IN PVOID Destination, \
+ IN PVOID Source, \
+ IN ULONG ByteCount);
+
+DECLARE_INTERFACE_(IDmaChannel, IUnknown)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_DMACHANNEL()
+};
+
+typedef IDmaChannel *PDMACHANNEL;
+
+
+/* ===============================================================
+ IDmaChannelSlave Interface
+*/
+
+#define DEFINE_ABSTRACT_DMACHANNELSLAVE() \
+ STDMETHOD_(NTSTATUS, Start)( THIS_ \
+ IN ULONG MapSize, \
+ IN BOOLEAN WriteToDevice) PURE; \
+\
+ STDMETHOD_(NTSTATUS, Stop)( THIS ) PURE; \
+ STDMETHOD_(NTSTATUS, ReadCounter)( THIS ) PURE; \
+\
+ STDMETHOD_(NTSTATUS, WaitForTC)( THIS_ \
+ ULONG Timeout) PURE;
+
+#define IMP_IDmaChannelSlave \
+ STDMETHODIMP_(NTSTATUS) Start( \
+ IN ULONG MapSize, \
+ IN BOOLEAN WriteToDevice); \
+\
+ STDMETHODIMP_(NTSTATUS) Stop(void); \
+ STDMETHODIMP_(NTSTATUS) ReadCounter)(void); \
+\
+ STDMETHODIMP_(NTSTATUS, WaitForTC)( \
+ ULONG Timeout);
+
+DECLARE_INTERFACE_(IDmaChannelSlave, IDmaChannel)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_DMACHANNEL()
+ DEFINE_ABSTRACT_DMACHANNELSLAVE()
+};
+
+typedef IDmaChannelSlave *PDMACHANNELSLAVE;
+
+
+/* ===============================================================
+ IInterruptSync Interface
+*/
+
+typedef enum
+{
+ InterruptSyncModeNormal = 1,
+ InterruptSyncModeAll,
+ InterruptSyncModeRepeat
+} INTERRUPTSYNCMODE;
+
+struct IInterruptSync;
+
+typedef NTSTATUS (*PINTERRUPTSYNCROUTINE)(
+ IN struct IInterruptSync* InterruptSync,
+ IN PVOID DynamicContext);
+
+DECLARE_INTERFACE_(IInterruptSync, IUnknown)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+
+ STDMETHOD_(NTSTATUS, CallSynchronizedRoutine)( THIS_
+ IN PINTERRUPTSYNCROUTINE Routine,
+ IN PVOID DynamicContext) PURE;
+
+ STDMETHOD_(PKINTERRUPT, GetKInterrupt)( THIS ) PURE;
+ STDMETHOD_(NTSTATUS, Connect)( THIS ) PURE;
+ STDMETHOD_(void, Disconnect)( THIS ) PURE;
+
+ STDMETHOD_(NTSTATUS, RegisterServiceRoutine)( THIS_
+ IN PINTERRUPTSYNCROUTINE Routine,
+ IN PVOID DynamicContext,
+ IN BOOLEAN First) PURE;
+};
+
+#define IMP_IInterruptSync \
+ STDMETHODIMP_(NTSTATUS, CallSynchronizedRoutine)( \
+ IN PINTERRUPTSYNCROUTINE Routine, \
+ IN PVOID DynamicContext); \
+\
+ STDMETHODIMP_(PKINTERRUPT, GetKInterrupt)(void); \
+ STDMETHODIMP_(NTSTATUS, Connect)(void); \
+ STDMETHODIMP_(void, Disconnect)(void); \
+\
+ STDMETHODIMP_(NTSTATUS, RegisterServiceRoutine)( \
+ IN PINTERRUPTSYNCROUTINE Routine, \
+ IN PVOID DynamicContext, \
+ IN BOOLEAN First);
+
+typedef IInterruptSync *PINTERRUPTSYNC;
/* ===============================================================
@@ -631,6 +891,9 @@
/* ===============================================================
IPort Interface
*/
+
+DEFINE_GUID(IID_IPort,
+ 0xb4c90a25L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
#define DEFINE_ABSTRACT_PORT() \
STDMETHOD_(NTSTATUS, Init)( THIS_ \
@@ -669,7 +932,7 @@
OUT PVOID PropertyBuffer, \
OUT PULONG ResultLength); \
\
- STDMETHOD_(NTSTATUS) NewRegistryKey( \
+ STDMETHODIMP_(NTSTATUS) NewRegistryKey( \
OUT PREGISTRYKEY* OutRegistryKey, \
IN PUNKNOWN OuterUnknown OPTIONAL, \
IN ULONG RegistryKeyType, \
@@ -688,8 +951,110 @@
/* ===============================================================
+ IPortMidi Interface
+*/
+
+DEFINE_GUID(CLSID_PortMidi,
+ 0xb4c90a43L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
+
+DECLARE_INTERFACE_(IPortMidi, IPort)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_PORT()
+
+ STDMETHOD_(VOID, Notify)(THIS_
+ IN PSERVICEGROUP ServiceGroup OPTIONAL) PURE;
+
+ STDMETHOD_(NTSTATUS, RegisterServiceGroup)(THIS_
+ IN PSERVICEGROUP ServiceGroup) PURE;
+};
+
+typedef IPortMidi *PPORTMIDI;
+
+#define IMP_IPortMidi() \
+ STDMETHODIMP_(VOID) Notify( \
+ IN PSERVICEGROUP ServiceGroup OPTIONAL); \
+\
+ STDMETHODIMP_(NTSTATUS) RegisterServiceGroup( \
+ IN PSERVICEGROUP ServiceGroup);
+
+
+
+/* ===============================================================
+ IPortWaveCyclic Interface
+*/
+
+DECLARE_INTERFACE_(IPortWaveCyclic, IPort)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_PORT()
+
+ STDMETHOD_(NTSTATUS, NewMasterDmaChannel)(THIS_
+ 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) PURE;
+
+ STDMETHOD_(NTSTATUS, NewSlaveDmaChannel)(THIS_
+ OUT PDMACHANNELSLAVE* DmaChannel,
+ IN PUNKNOWN OuterUnknown,
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN ULONG DmaIndex,
+ IN ULONG MaximumLength,
+ IN BOOL DemandMode,
+ IN DMA_SPEED DmaSpeed) PURE;
+
+ STDMETHOD_(VOID, Notify)(THIS_
+ IN PSERVICEGROUP ServiceGroup) PURE;
+};
+
+/* TODO ... */
+
+
+/* ===============================================================
+ IPortWavePci Interface
+*/
+
+DECLARE_INTERFACE_(IPortWavePci, IPort)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_PORT()
+
+ STDMETHOD_(NTSTATUS, NewMasterDmaChannel)(THIS_
+ 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) PURE;
+
+ STDMETHOD_(VOID, Notify)(THIS_
+ IN PSERVICEGROUP ServiceGroup) PURE;
+};
+
+/* TODO ... */
+
+
+/* ===============================================================
+ IPortWavePciStream Interface
+*/
+
+
+/* ===============================================================
IMiniPort Interface
*/
+
+DEFINE_GUID(IID_IMiniPort,
+ 0xb4c90a24L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
#define DEFINE_ABSTRACT_MINIPORT() \
STDMETHOD_(NTSTATUS, GetDescription)( THIS_ \
@@ -725,230 +1090,134 @@
/* ===============================================================
- IDmaChannel Interface
-*/
-
-#define DEFINE_ABSTRACT_DMACHANNEL() \
- STDMETHOD_(NTSTATUS, AllocateBuffer)( THIS_ \
- IN ULONG BufferSize, \
- IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL) PURE; \
-\
- STDMETHOD_(void, FreeBuffer)( THIS ) PURE; \
- STDMETHOD_(ULONG, TransferCount)( THIS ) PURE; \
- STDMETHOD_(ULONG, MaximumBufferSize)( THIS ) PURE; \
- STDMETHOD_(ULONG, AllocatedBufferSize)( THIS ) PURE; \
- STDMETHOD_(ULONG, BufferSize)( THIS ) PURE; \
-\
- STDMETHOD_(void, SetBufferSize)( THIS_ \
- IN ULONG BufferSize) PURE; \
-\
- STDMETHOD_(PVOID, SystemAddress)( THIS ) PURE; \
- STDMETHOD_(PHYSICAL_ADDRESS, PhysicalAddress)( THIS ) PURE; \
- STDMETHOD_(PADAPTER_OBJECT, GetAdapterObject)( THIS ) PURE; \
-\
- STDMETHOD_(void, CopyTo)( THIS_ \
- IN PVOID Destination, \
- IN PVOID Source, \
- IN ULONG ByteCount) PURE; \
-\
- STDMETHOD_(void, CopyFrom)( THIS_ \
- IN PVOID Destination, \
- IN PVOID Source, \
- IN ULONG ByteCount) PURE;
-
-#define IMP_IDmaChannel() \
- STDMETHODIMP_(NTSTATUS) AllocateBuffer( \
- IN ULONG BufferSize, \
- IN PPHYSICAL_ADDRESS PhysicalAddressConstraint OPTIONAL); \
-\
- STDMETHODIMP_(void) FreeBuffer(void); \
- STDMETHODIMP_(ULONG) TransferCount(void); \
- STDMETHODIMP_(ULONG) MaximumBufferSize(void); \
- STDMETHODIMP_(ULONG) AllocatedBufferSize(void); \
- STDMETHODIMP_(ULONG) BufferSize(void); \
-\
- STDMETHODIMP_(void) SetBufferSize)( \
- IN ULONG BufferSize); \
-\
- STDMETHODIMP_(PVOID) SystemAddress(void); \
- STDMETHODIMP_(PHYSICAL_ADDRESS) PhysicalAddress(void); \
- STDMETHODIMP_(PADAPTER_OBJECT) GetAdapterObject(void); \
-\
- STDMETHODIMP_(void) CopyTo( \
- IN PVOID Destination, \
- IN PVOID Source, \
- IN ULONG ByteCount); \
-\
- STDMETHODIMP_(void) CopyFrom( \
- IN PVOID Destination, \
- IN PVOID Source, \
- IN ULONG ByteCount);
-
-DECLARE_INTERFACE_(IDmaChannel, IUnknown)
+ IMiniportMidiStream Interface
+*/
+
+DECLARE_INTERFACE_(IMiniportMidiStream, IUnknown)
+{
+ /* TODO - Read, SetFormat, SetState, Write */
+};
+
+typedef IMiniportMidiStream* PMINIPORTMIDISTREAM;
+
+
+/* ===============================================================
+ IMiniportMidi Interface
+*/
+
+DECLARE_INTERFACE_(IMiniportMidi, IMiniport)
+{
+ STDMETHOD_(NTSTATUS, Init)(THIS_
+ IN PUNKNOWN UnknownAdapter,
+ IN PRESOURCELIST ResourceList,
+ IN PPORTMIDI Port,
+ OUT PSERVICEGROUP* ServiceGroup) PURE;
+
+ STDMETHOD_(NTSTATUS, NewStream)(THIS_
+ OUT PMINIPORTMIDISTREAM Stream,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN POOL_TYPE PoolType,
+ IN ULONG Pin,
+ IN BOOLEAN Capture,
+ IN PKSDATAFORMAT DataFormat,
+ OUT PSERVICEGROUP* ServiceGroup) PURE;
+
+ STDMETHOD_(void, Service)(THIS) PURE;
+};
+
+/* TODO ... */
+
+
+/* ===============================================================
+ IMiniportDriverUart Interface
+*/
+
+DEFINE_GUID(CLSID_MiniportDriverUart,
+ 0xb4c90ae1L, 0x5791, 0x11d0, 0x86, 0xf9, 0x00, 0xa0, 0xc9, 0x11, 0xb5, 0x44);
+
+/* ===============================================================
+ IPortTopology Interface
+*/
+
+DECLARE_INTERFACE_(IPortTopology, IPort)
{
DEFINE_ABSTRACT_UNKNOWN()
- DEFINE_ABSTRACT_DMACHANNEL()
-};
-
-typedef IDmaChannel *PDMACHANNEL;
-
-
-/* ===============================================================
- IDmaChannelSlave Interface
-*/
-
-#define DEFINE_ABSTRACT_DMACHANNELSLAVE() \
- STDMETHOD_(NTSTATUS, Start)( THIS_ \
- IN ULONG MapSize, \
- IN BOOLEAN WriteToDevice) PURE; \
-\
- STDMETHOD_(NTSTATUS, Stop)( THIS ) PURE; \
- STDMETHOD_(NTSTATUS, ReadCounter)( THIS ) PURE; \
-\
- STDMETHOD_(NTSTATUS, WaitForTC)( THIS_ \
- ULONG Timeout) PURE;
-
-#define IMP_IDmaChannelSlave \
- STDMETHODIMP_(NTSTATUS) Start( \
- IN ULONG MapSize, \
- IN BOOLEAN WriteToDevice); \
-\
- STDMETHODIMP_(NTSTATUS) Stop(void); \
- STDMETHODIMP_(NTSTATUS) ReadCounter)(void); \
-\
- STDMETHODIMP_(NTSTATUS, WaitForTC)( \
- ULONG Timeout);
-
-DECLARE_INTERFACE_(IDmaChannelSlave, IDmaChannel)
+ DEFINE_ABSTRACT_PORT()
+};
+
+typedef IPortTopology *PPORTTOPOLOGY;
+
+#define IMP_IPortTopology IMP_IPort
+
+/* ===============================================================
+ IMiniportTopology Interface
+*/
+
+/* ===============================================================
+ IMiniportWaveCyclicStream Interface
+*/
+
+/* ===============================================================
+ IMiniportWaveCyclic Interface
+*/
+
+/* ===============================================================
+ IMiniportWavePciStream Interface
+*/
+
+/* ===============================================================
+ IMiniportWavePci Interface
+*/
+
+/* ===============================================================
+ IAdapterPowerManagement Interface
+*/
+
+DECLARE_INTERFACE_(IAdapterPowerManagement, IUnknown)
+{
+};
+
+#define IMP_IAdapterPowerManagement
+
+/* ===============================================================
+ IPowerNotify Interface
+*/
+
+/* ===============================================================
+ IPinCount Interface
+*/
+
+/* ===============================================================
+ IPortEvents Interface
+*/
+
+DECLARE_INTERFACE_(IPortEvents, IUnknown)
{
DEFINE_ABSTRACT_UNKNOWN()
- DEFINE_ABSTRACT_DMACHANNEL()
- DEFINE_ABSTRACT_DMACHANNELSLAVE()
-};
-
-typedef IDmaChannelSlave *PDMACHANNELSLAVE;
-
-
-/* ===============================================================
- IInterruptSync Interface
-*/
-
-typedef enum
-{
- InterruptSyncModeNormal = 1,
- InterruptSyncModeAll,
- InterruptSyncModeRepeat
-} INTERRUPTSYNCMODE;
-
-struct IInterruptSync;
-
-typedef NTSTATUS (*PINTERRUPTSYNCROUTINE)(
- IN struct IInterruptSync* InterruptSync,
- IN PVOID DynamicContext);
-
-DECLARE_INTERFACE_(IInterruptSync, IUnknown)
-{
- DEFINE_ABSTRACT_UNKNOWN()
-
- STDMETHOD_(NTSTATUS, CallSynchronizedRoutine)( THIS_
- IN PINTERRUPTSYNCROUTINE Routine,
- IN PVOID DynamicContext) PURE;
-
- STDMETHOD_(PKINTERRUPT, GetKInterrupt)( THIS ) PURE;
- STDMETHOD_(NTSTATUS, Connect)( THIS ) PURE;
- STDMETHOD_(void, Disconnect)( THIS ) PURE;
-
- STDMETHOD_(NTSTATUS, RegisterServiceRoutine)( THIS_
- IN PINTERRUPTSYNCROUTINE Routine,
- IN PVOID DynamicContext,
- IN BOOLEAN First) PURE;
-};
-
-#define IMP_IInterruptSync \
- STDMETHODIMP_(NTSTATUS) CallSynchronizedRoutine)( \
- IN PINTERRUPTSYNCROUTINE Routine, \
- IN PVOID DynamicContext); \
-\
- STDMETHODIMP_(PKINTERRUPT, GetKInterrupt)(void); \
- STDMETHODIMP_(NTSTATUS, Connect)(void); \
- STDMETHODIMP_(void, Disconnect)(void); \
-\
- STDMETHODIMP_(NTSTATUS, RegisterServiceRoutine)( \
- IN PINTERRUPTSYNCROUTINE Routine, \
- IN PVOID DynamicContext, \
- IN BOOLEAN First);
-
-typedef IInterruptSync *PINTERRUPTSYNC;
-
-
-/* ===============================================================
- IPortMidi Interface
-*/
-
-/* ===============================================================
- IMiniportMidiStream Interface
-*/
-
-/* ===============================================================
- IMiniportMidi Interface
-*/
-
-/* ===============================================================
- IPortTopology Interface
-*/
-
-/* ===============================================================
- IMiniportTopology Interface
-*/
-
-/* ===============================================================
- IPortWaveCyclic Interface
-*/
-
-/* ===============================================================
- IMiniportWaveCyclicStream Interface
-*/
-
-/* ===============================================================
- IMiniportWaveCyclic Interface
-*/
-
-/* ===============================================================
- IPortWavePci Interface
-*/
-
-/* ===============================================================
- IPortWavePciStream Interface
-*/
-
-/* ===============================================================
- IMiniportWavePciStream Interface
-*/
-
-/* ===============================================================
- IMiniportWavePci Interface
-*/
-
-/* ===============================================================
- IAdapterPowerManagement Interface
-*/
-
-/* ===============================================================
- IPowerNotify Interface
-*/
-
-/* ===============================================================
- IPinCount Interface
-*/
-
-/* ===============================================================
- IPortEvents Interface
-*/
+ /* TODO */
+};
+
+typedef IPortEvents *PPORTEVENTS;
+
/* ===============================================================
IDrmPort / IDrmPort2 Interfaces
These are almost identical, except for the addition of two extra methods.
*/
+
+#define DEFINE_ABSTRACT_DRMPORT()
+/* TODO */
+
+DECLARE_INTERFACE_(IDrmPort, IUnknown)
+{
+ DEFINE_ABSTRACT_UNKNOWN()
+ DEFINE_ABSTRACT_DRMPORT()
+};
+
+typedef IDrmPort *PDRMPORT;
+
+/* TODO */
+
/* ===============================================================
IPortClsVersion Interface
Modified: trunk/reactos/include/ddk/punknown.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/punknown.h?rev…
==============================================================================
--- trunk/reactos/include/ddk/punknown.h (original)
+++ trunk/reactos/include/ddk/punknown.h Sat Mar 17 16:21:33 2007
@@ -8,16 +8,13 @@
#ifndef _UNKNOWN_H_
#define _UNKNOWN_H_
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <windef.h>
+//#include <windef.h>
+#include <ntddk.h>
#define COM_NO_WINDOWS_H
#include <basetyps.h>
-#ifdef __cplusplus
-}
+#ifdef PUT_GUIDS_HERE
+ #include <initguid.h>
#endif
Added: trunk/reactos/include/ddk/stdunk.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/stdunk.h?rev=2…
==============================================================================
--- trunk/reactos/include/ddk/stdunk.h (added)
+++ trunk/reactos/include/ddk/stdunk.h Sat Mar 17 16:21:33 2007
@@ -1,0 +1,216 @@
+/*
+ ReactOS Kernel-Mode COM
+ IUnknown implementations
+
+ LICENSE
+ Please see COPYING in the top-level directory for license information.
+
+ AUTHORS
+ Andrew Greenwood
+*/
+
+#ifndef STDUNK_H
+#define STDUNK_H
+
+#include <punknown.h>
+
+/* ===============================================================
+ INonDelegatingUnknown interface
+*/
+
+DECLARE_INTERFACE(INonDelegatingUnknown)
+{
+ STDMETHOD_(NTSTATUS, NonDelegatingQueryInterface)( THIS_
+ IN REFIID,
+ OUT PVOID*) PURE;
+
+ STDMETHOD_(ULONG, NonDelegatingAddRef)( THIS ) PURE;
+ STDMETHOD_(ULONG, NonDelegatingRelease)( THIS ) PURE;
+};
+
+typedef INonDelegatingUnknown *PNONDELEGATINGUNKNOWN;
+
+
+/* ===============================================================
+ CUnknown declaration / definition
+
+ There are 2 variants for this, and I'm not sure if the C
+ version is correct.
+*/
+
+#ifdef __cplusplus
+
+class CUnknown : public INonDelegatingUnknown
+{
+ private :
+ LONG m_ref_count;
+ PUNKNOWN m_outer_unknown;
+
+ public :
+ /* CUnknown */
+ CUnknown(PUNKNOWN pUnknownOuter);
+ virtual ~CUnknown();
+
+ PUNKNOWN GetOuterUnknown()
+ { return m_outer_unknown; }
+
+ /* INonDelegatingUnknown */
+ STDMETHODIMP_(ULONG) NonDelegatingAddRef();
+ STDMETHODIMP_(ULONG) NonDelegatingRelease();
+
+ STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface(
+ REFIID rIID,
+ PVOID* ppVoid);
+};
+
+#define DECLARE_STD_UNKNOWN() \
+ STDMETHODIMP_(NTSTATUS) NonDelegatingQueryInterface( \
+ REFIID iid, \
+ PVOID* ppvObject); \
+\
+ STDMETHODIMP_(NTSTATUS) QueryInterface( \
+ REFIID riid, \
+ void** ppv) \
+ { \
+ return GetOuterUnknown()->QueryInterface(riid, ppv); \
+ } \
+\
+ STDMETHODIMP_(ULONG) AddRef() \
+ { \
+ return GetOuterUnknown()->AddRef(); \
+ } \
+\
+ STDMETHODIMP_(ULONG) Release() \
+ { \
+ return GetOuterUnknown()->Release(); \
+ }
+
+#define DEFINE_STD_CONSTRUCTOR(classname) \
+ classname(PUNKNOWN outer_unknown) \
+ : CUnknown(outer_unknown) \
+ { }
+
+#else /* Not C++ */
+
+STDMETHODCALLTYPE
+NTSTATUS
+Unknown_QueryInterface(
+ IUnknown* this,
+ IN REFIID refiid,
+ OUT PVOID* output);
+
+STDMETHODCALLTYPE
+ULONG
+Unknown_AddRef(
+ IUnknown* unknown_this);
+
+STDMETHODCALLTYPE
+ULONG
+Unknown_Release(
+ IUnknown* unknown_this);
+
+typedef struct CUnknown
+{
+ union
+ {
+ IUnknown IUnknown;
+ INonDelegatingUnknown INonDelegatingUnknown;
+ };
+
+ LONG m_ref_count;
+ PUNKNOWN m_outer_unknown;
+} CUnknown;
+
+#endif /* __cplusplus */
+
+
+
+#ifdef __cplusplus
+
+
+/* ===============================================================
+ Construction helpers
+*/
+
+#define QICAST(typename) \
+ PVOID( (typename) (this) )
+
+#define QICASTUNKNOWN(typename) \
+ PVOID( PUNKNOWN( (typename) (this) ) )
+
+#define STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag,
base) \
+ classname *new_ptr = new(pool_type, tag) classname(outer_unknown); \
+\
+ if ( ! new_ptr ) \
+ return STATUS_INSUFFICIENT_RESOURCES; \
+\
+ *unknown = PUNKNOWN((base)(new_ptr)); \
+ (*unknown)->AddRef(); \
+ return STATUS_SUCCESS
+
+#define STD_CREATE_BODY_WITH_TAG(classname, unknown, outer_unknown, pool_type, tag, base)
\
+ STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type, tag,
PUNKNOWN)
+
+#define STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, base) \
+ STD_CREATE_BODY_WITH_TAG_(classname, unknown, outer_unknown, pool_type,
'rCcP', base)
+
+#define STD_CREATE_BODY(classname, unknown, outer_unknown, pool_type) \
+ STD_CREATE_BODY_(classname, unknown, outer_unknown, pool_type, PUNKNOWN)
+
+
+/* ===============================================================
+ Custom "new" and "delete" C++ operators
+*/
+
+#ifndef ALLOCATION_OPERATORS_DEFINED
+#define ALLOCATION_OPERATORS_DEFINED
+
+inline PVOID
+KCOM_New(
+ size_t size,
+ POOL_TYPE pool_type,
+ ULONG tag)
+{
+ PVOID result;
+
+ result = ExAllocatePoolWithTag(pool_type, size, tag);
+
+ if ( result )
+ RtlZeroMemory(result, size);
+
+ return result;
+}
+
+inline PVOID
+operator new (
+ size_t size,
+ POOL_TYPE pool_type)
+{
+ return KCOM_New(size, pool_type, 'wNcP');
+}
+
+inline PVOID
+operator new (
+ size_t size,
+ POOL_TYPE pool_type,
+ ULONG tag)
+{
+ return KCOM_New(size, pool_type, tag);
+}
+
+inline void __cdecl
+operator delete(
+ PVOID ptr)
+{
+ ExFreePool(ptr);
+}
+
+#endif /* ALLOCATION_OPERATORS_DEFINED */
+
+
+#else /* Being compiled with C */
+
+
+#endif /* __cplusplus */
+
+#endif /* include guard */
Added: trunk/reactos/include/ddk/wdm.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/ddk/wdm.h?rev=2612…
==============================================================================
--- trunk/reactos/include/ddk/wdm.h (added)
+++ trunk/reactos/include/ddk/wdm.h Sat Mar 17 16:21:33 2007
@@ -1,0 +1,24 @@
+/*
+ WDM (far from finished!)
+*/
+
+#ifndef WDM_H
+#define WDM_H
+
+typedef int CM_RESOURCE_TYPE;
+
+#define CmResourceTypeNull 0
+#define CmResourceTypePort 1
+#define CmResourceTypeInterrupt 2
+#define CmResourceTypeMemory 3
+#define CmResourceTypeDma 4
+#define CmResourceTypeDeviceSpecific 5
+#define CmResourceTypeBusNumber 6
+#define CmResourceTypeNonArbitrated 128
+#define CmResourceTypeConfigData 128
+#define CmResourceTypeDevicePrivate 129
+#define CmResourceTypePcCardConfig 130
+#define CmResourceTypeMfCardConfig 131
+
+#endif
+