2009-06-26 15:51:14 +00:00
|
|
|
#ifndef _STREAM_H
|
|
|
|
#define _STREAM_H
|
|
|
|
|
2009-06-26 16:30:44 +00:00
|
|
|
#include <ntddk.h>
|
2009-08-03 13:46:37 +00:00
|
|
|
#include <windef.h>
|
2009-06-26 15:51:14 +00:00
|
|
|
#include <ks.h>
|
|
|
|
|
|
|
|
#define STREAMAPI __stdcall
|
|
|
|
#define STREAM_SYSTEM_TIME_MASK ((STREAM_SYSTEM_TIME)0x00000001FFFFFFFF)
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef enum {
|
|
|
|
DebugLevelFatal = 0,
|
|
|
|
DebugLevelError,
|
|
|
|
DebugLevelWarning,
|
|
|
|
DebugLevelInfo,
|
|
|
|
DebugLevelTrace,
|
|
|
|
DebugLevelVerbose,
|
|
|
|
DebugLevelMaximum
|
|
|
|
} STREAM_DEBUG_LEVEL;
|
2009-06-26 16:30:44 +00:00
|
|
|
|
2009-06-26 15:51:14 +00:00
|
|
|
#if DBG
|
|
|
|
|
|
|
|
#define DebugPrint(x) StreamClassDebugPrint x
|
|
|
|
#define DEBUG_BREAKPOINT() DbgBreakPoint()
|
|
|
|
#define DEBUG_ASSERT(exp) \
|
2010-08-10 20:50:55 +00:00
|
|
|
if ( !(exp) ) { \
|
|
|
|
StreamClassDebugAssert( __FILE__, __LINE__, #exp, exp); \
|
|
|
|
}
|
2009-06-26 15:51:14 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
#define DebugPrint(x)
|
|
|
|
#define DEBUG_BREAKPOINT()
|
|
|
|
#define DEBUG_ASSERT(exp)
|
|
|
|
|
|
|
|
#endif
|
2009-06-26 16:30:44 +00:00
|
|
|
|
2009-06-26 15:51:14 +00:00
|
|
|
typedef PHYSICAL_ADDRESS STREAM_PHYSICAL_ADDRESS, *PSTREAM_PHYSICAL_ADDRESS;
|
2010-02-27 14:01:48 +00:00
|
|
|
__GNU_EXTENSION typedef unsigned __int64 STREAM_SYSTEM_TIME, *PSTREAM_SYSTEM_TIME;
|
|
|
|
__GNU_EXTENSION typedef unsigned __int64 STREAM_TIMESTAMP, *PSTREAM_TIMESTAMP;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef enum {
|
|
|
|
TIME_GET_STREAM_TIME,
|
|
|
|
TIME_READ_ONBOARD_CLOCK,
|
|
|
|
TIME_SET_ONBOARD_CLOCK
|
|
|
|
} TIME_FUNCTION;
|
|
|
|
|
|
|
|
typedef struct _HW_TIME_CONTEXT {
|
|
|
|
struct _HW_DEVICE_EXTENSION *HwDeviceExtension;
|
|
|
|
struct _HW_STREAM_OBJECT *HwStreamObject;
|
|
|
|
TIME_FUNCTION Function;
|
|
|
|
ULONGLONG Time;
|
|
|
|
ULONGLONG SystemTime;
|
|
|
|
} HW_TIME_CONTEXT, *PHW_TIME_CONTEXT;
|
|
|
|
|
|
|
|
typedef struct _HW_EVENT_DESCRIPTOR {
|
|
|
|
BOOLEAN Enable;
|
|
|
|
PKSEVENT_ENTRY EventEntry;
|
|
|
|
PKSEVENTDATA EventData;
|
|
|
|
__GNU_EXTENSION union {
|
|
|
|
struct _HW_STREAM_OBJECT * StreamObject;
|
|
|
|
struct _HW_DEVICE_EXTENSION *DeviceExtension;
|
|
|
|
};
|
|
|
|
ULONG EnableEventSetIndex;
|
|
|
|
PVOID HwInstanceExtension;
|
|
|
|
ULONG Reserved;
|
2009-06-26 15:51:14 +00:00
|
|
|
} HW_EVENT_DESCRIPTOR, *PHW_EVENT_DESCRIPTOR;
|
|
|
|
|
2009-06-26 16:30:44 +00:00
|
|
|
struct _HW_STREAM_REQUEST_BLOCK;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef VOID (STREAMAPI *PHW_RECEIVE_STREAM_DATA_SRB) (IN struct _HW_STREAM_REQUEST_BLOCK *SRB);
|
|
|
|
typedef VOID (STREAMAPI *PHW_RECEIVE_STREAM_CONTROL_SRB) (IN struct _HW_STREAM_REQUEST_BLOCK *SRB);
|
|
|
|
typedef NTSTATUS (STREAMAPI *PHW_EVENT_ROUTINE) (IN PHW_EVENT_DESCRIPTOR EventDescriptor);
|
|
|
|
typedef VOID (STREAMAPI *PHW_CLOCK_FUNCTION) (IN PHW_TIME_CONTEXT HwTimeContext);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _HW_CLOCK_OBJECT {
|
|
|
|
PHW_CLOCK_FUNCTION HwClockFunction;
|
|
|
|
ULONG ClockSupportFlags;
|
|
|
|
ULONG Reserved[2];
|
2009-06-26 15:51:14 +00:00
|
|
|
} HW_CLOCK_OBJECT, *PHW_CLOCK_OBJECT;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
#define CLOCK_SUPPORT_CAN_SET_ONBOARD_CLOCK 0x1
|
2009-06-26 15:51:14 +00:00
|
|
|
#define CLOCK_SUPPORT_CAN_READ_ONBOARD_CLOCK 0x2
|
|
|
|
#define CLOCK_SUPPORT_CAN_RETURN_STREAM_TIME 0x4
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _HW_STREAM_OBJECT {
|
|
|
|
ULONG SizeOfThisPacket;
|
|
|
|
ULONG StreamNumber;
|
|
|
|
PVOID HwStreamExtension;
|
|
|
|
PHW_RECEIVE_STREAM_DATA_SRB ReceiveDataPacket;
|
|
|
|
PHW_RECEIVE_STREAM_CONTROL_SRB ReceiveControlPacket;
|
|
|
|
HW_CLOCK_OBJECT HwClockObject;
|
|
|
|
BOOLEAN Dma;
|
|
|
|
BOOLEAN Pio;
|
|
|
|
PVOID HwDeviceExtension;
|
|
|
|
ULONG StreamHeaderMediaSpecific;
|
|
|
|
ULONG StreamHeaderWorkspace;
|
|
|
|
BOOLEAN Allocator;
|
|
|
|
PHW_EVENT_ROUTINE HwEventRoutine;
|
|
|
|
ULONG Reserved[2];
|
2009-06-26 15:51:14 +00:00
|
|
|
} HW_STREAM_OBJECT, *PHW_STREAM_OBJECT;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _HW_STREAM_HEADER {
|
|
|
|
ULONG NumberOfStreams;
|
|
|
|
ULONG SizeOfHwStreamInformation;
|
|
|
|
ULONG NumDevPropArrayEntries;
|
|
|
|
PKSPROPERTY_SET DevicePropertiesArray;
|
|
|
|
ULONG NumDevEventArrayEntries;
|
|
|
|
PKSEVENT_SET DeviceEventsArray;
|
|
|
|
PKSTOPOLOGY Topology;
|
|
|
|
PHW_EVENT_ROUTINE DeviceEventRoutine;
|
|
|
|
LONG NumDevMethodArrayEntries;
|
|
|
|
PKSMETHOD_SET DeviceMethodsArray;
|
|
|
|
} HW_STREAM_HEADER, *PHW_STREAM_HEADER;
|
|
|
|
|
|
|
|
typedef struct _HW_STREAM_INFORMATION {
|
|
|
|
ULONG NumberOfPossibleInstances;
|
|
|
|
KSPIN_DATAFLOW DataFlow;
|
|
|
|
BOOLEAN DataAccessible;
|
|
|
|
ULONG NumberOfFormatArrayEntries;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumberOfFormatArrayEntries) PKSDATAFORMAT* StreamFormatsArray;
|
2010-08-10 20:50:55 +00:00
|
|
|
PVOID ClassReserved[4];
|
|
|
|
ULONG NumStreamPropArrayEntries;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumStreamPropArrayEntries) PKSPROPERTY_SET StreamPropertiesArray;
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG NumStreamEventArrayEntries;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumStreamEventArrayEntries) PKSEVENT_SET StreamEventsArray;
|
2010-08-10 20:50:55 +00:00
|
|
|
GUID* Category;
|
|
|
|
GUID* Name;
|
|
|
|
ULONG MediumsCount;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(MediumsCount) const KSPIN_MEDIUM* Mediums;
|
2010-08-10 20:50:55 +00:00
|
|
|
BOOLEAN BridgeStream;
|
|
|
|
ULONG Reserved[2];
|
|
|
|
} HW_STREAM_INFORMATION, *PHW_STREAM_INFORMATION;
|
|
|
|
|
|
|
|
typedef struct _HW_STREAM_DESCRIPTOR {
|
|
|
|
HW_STREAM_HEADER StreamHeader;
|
|
|
|
HW_STREAM_INFORMATION StreamInfo;
|
2009-06-26 15:51:14 +00:00
|
|
|
} HW_STREAM_DESCRIPTOR, *PHW_STREAM_DESCRIPTOR;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _STREAM_TIME_REFERENCE {
|
|
|
|
STREAM_TIMESTAMP CurrentOnboardClockValue;
|
|
|
|
LARGE_INTEGER OnboardClockFrequency;
|
|
|
|
LARGE_INTEGER CurrentSystemTime;
|
|
|
|
ULONG Reserved[2];
|
|
|
|
} STREAM_TIME_REFERENCE, *PSTREAM_TIME_REFERENCE;
|
|
|
|
|
|
|
|
typedef struct _STREAM_DATA_INTERSECT_INFO {
|
|
|
|
ULONG StreamNumber;
|
|
|
|
PKSDATARANGE DataRange;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_bytes_(SizeOfDataFormatBuffer) PVOID DataFormatBuffer;
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG SizeOfDataFormatBuffer;
|
|
|
|
} STREAM_DATA_INTERSECT_INFO, *PSTREAM_DATA_INTERSECT_INFO;
|
|
|
|
|
|
|
|
typedef struct _STREAM_PROPERTY_DESCRIPTOR {
|
|
|
|
PKSPROPERTY Property;
|
|
|
|
ULONG PropertySetID;
|
|
|
|
PVOID PropertyInfo;
|
|
|
|
ULONG PropertyInputSize;
|
|
|
|
ULONG PropertyOutputSize;
|
|
|
|
} STREAM_PROPERTY_DESCRIPTOR, *PSTREAM_PROPERTY_DESCRIPTOR;
|
|
|
|
|
|
|
|
typedef struct _STREAM_METHOD_DESCRIPTOR {
|
|
|
|
ULONG MethodSetID;
|
|
|
|
PKSMETHOD Method;
|
|
|
|
PVOID MethodInfo;
|
|
|
|
LONG MethodInputSize;
|
|
|
|
LONG MethodOutputSize;
|
2009-06-26 15:51:14 +00:00
|
|
|
} STREAM_METHOD_DESCRIPTOR, *PSTREAM_METHOD_DESCRIPTOR;
|
|
|
|
|
|
|
|
#define STREAM_REQUEST_BLOCK_SIZE sizeof(STREAM_REQUEST_BLOCK)
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef enum _SRB_COMMAND {
|
|
|
|
SRB_READ_DATA,
|
|
|
|
SRB_WRITE_DATA,
|
|
|
|
SRB_GET_STREAM_STATE,
|
|
|
|
SRB_SET_STREAM_STATE,
|
|
|
|
SRB_SET_STREAM_PROPERTY,
|
|
|
|
SRB_GET_STREAM_PROPERTY,
|
|
|
|
SRB_OPEN_MASTER_CLOCK,
|
|
|
|
|
|
|
|
SRB_INDICATE_MASTER_CLOCK,
|
|
|
|
SRB_UNKNOWN_STREAM_COMMAND,
|
|
|
|
SRB_SET_STREAM_RATE,
|
|
|
|
SRB_PROPOSE_DATA_FORMAT,
|
|
|
|
SRB_CLOSE_MASTER_CLOCK,
|
|
|
|
SRB_PROPOSE_STREAM_RATE,
|
|
|
|
SRB_SET_DATA_FORMAT,
|
|
|
|
SRB_GET_DATA_FORMAT,
|
|
|
|
SRB_BEGIN_FLUSH,
|
|
|
|
SRB_END_FLUSH,
|
|
|
|
|
|
|
|
SRB_GET_STREAM_INFO = 0x100,
|
|
|
|
SRB_OPEN_STREAM,
|
|
|
|
SRB_CLOSE_STREAM,
|
|
|
|
SRB_OPEN_DEVICE_INSTANCE,
|
|
|
|
SRB_CLOSE_DEVICE_INSTANCE,
|
|
|
|
SRB_GET_DEVICE_PROPERTY,
|
|
|
|
SRB_SET_DEVICE_PROPERTY,
|
|
|
|
SRB_INITIALIZE_DEVICE,
|
|
|
|
SRB_CHANGE_POWER_STATE,
|
|
|
|
SRB_UNINITIALIZE_DEVICE,
|
|
|
|
SRB_UNKNOWN_DEVICE_COMMAND,
|
|
|
|
SRB_PAGING_OUT_DRIVER,
|
|
|
|
SRB_GET_DATA_INTERSECTION,
|
|
|
|
SRB_INITIALIZATION_COMPLETE,
|
|
|
|
SRB_SURPRISE_REMOVAL
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-08-10 20:50:55 +00:00
|
|
|
,SRB_DEVICE_METHOD
|
|
|
|
,SRB_STREAM_METHOD
|
2009-06-26 15:51:14 +00:00
|
|
|
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
|
2010-08-10 20:50:55 +00:00
|
|
|
,SRB_NOTIFY_IDLE_STATE
|
2009-06-26 15:51:14 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2010-08-10 20:50:55 +00:00
|
|
|
} SRB_COMMAND;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct {
|
|
|
|
PHYSICAL_ADDRESS PhysicalAddress;
|
|
|
|
ULONG Length;
|
2009-06-26 15:51:14 +00:00
|
|
|
} KSSCATTER_GATHER, *PKSSCATTER_GATHER;
|
|
|
|
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _HW_STREAM_REQUEST_BLOCK {
|
|
|
|
ULONG SizeOfThisPacket;
|
|
|
|
SRB_COMMAND Command;
|
|
|
|
NTSTATUS Status;
|
|
|
|
PHW_STREAM_OBJECT StreamObject;
|
|
|
|
PVOID HwDeviceExtension;
|
|
|
|
PVOID SRBExtension;
|
|
|
|
|
|
|
|
union _CommandData {
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(_Inexpressible_(NumberOfBuffers)) PKSSTREAM_HEADER DataBufferArray;
|
2010-08-10 20:50:55 +00:00
|
|
|
PHW_STREAM_DESCRIPTOR StreamBuffer;
|
|
|
|
KSSTATE StreamState;
|
|
|
|
PSTREAM_TIME_REFERENCE TimeReference;
|
|
|
|
PSTREAM_PROPERTY_DESCRIPTOR PropertyInfo;
|
|
|
|
PKSDATAFORMAT OpenFormat;
|
|
|
|
struct _PORT_CONFIGURATION_INFORMATION *ConfigInfo;
|
|
|
|
HANDLE MasterClockHandle;
|
|
|
|
DEVICE_POWER_STATE DeviceState;
|
|
|
|
PSTREAM_DATA_INTERSECT_INFO IntersectInfo;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-08-10 20:50:55 +00:00
|
|
|
PVOID MethodInfo;
|
|
|
|
LONG FilterTypeIndex;
|
2009-06-26 15:51:14 +00:00
|
|
|
#if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
|
2010-08-10 20:50:55 +00:00
|
|
|
BOOLEAN Idle;
|
2009-06-26 15:51:14 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2010-08-10 20:50:55 +00:00
|
|
|
} CommandData;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG NumberOfBuffers;
|
|
|
|
ULONG TimeoutCounter;
|
|
|
|
ULONG TimeoutOriginal;
|
|
|
|
struct _HW_STREAM_REQUEST_BLOCK *NextSRB;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
PIRP Irp;
|
|
|
|
ULONG Flags;
|
|
|
|
PVOID HwInstanceExtension;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
__GNU_EXTENSION union {
|
|
|
|
ULONG NumberOfBytesToTransfer;
|
|
|
|
ULONG ActualBytesTransferred;
|
|
|
|
};
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumberOfScatterGatherElements) PKSSCATTER_GATHER ScatterGatherBuffer;
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG NumberOfPhysicalPages;
|
|
|
|
ULONG NumberOfScatterGatherElements;
|
|
|
|
ULONG Reserved[1];
|
|
|
|
} HW_STREAM_REQUEST_BLOCK, *PHW_STREAM_REQUEST_BLOCK;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
#define SRB_HW_FLAGS_DATA_TRANSFER 0x01
|
|
|
|
#define SRB_HW_FLAGS_STREAM_REQUEST 0x2
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef enum {
|
|
|
|
PerRequestExtension,
|
|
|
|
DmaBuffer,
|
|
|
|
SRBDataBuffer
|
|
|
|
} STREAM_BUFFER_TYPE;
|
|
|
|
|
|
|
|
typedef struct _ACCESS_RANGE {
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_bytes_(RangeLength) STREAM_PHYSICAL_ADDRESS RangeStart;
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG RangeLength;
|
|
|
|
BOOLEAN RangeInMemory;
|
|
|
|
ULONG Reserved;
|
|
|
|
} ACCESS_RANGE, *PACCESS_RANGE;
|
|
|
|
|
|
|
|
typedef struct _PORT_CONFIGURATION_INFORMATION {
|
|
|
|
ULONG SizeOfThisPacket;
|
|
|
|
PVOID HwDeviceExtension;
|
|
|
|
PDEVICE_OBJECT ClassDeviceObject;
|
|
|
|
PDEVICE_OBJECT PhysicalDeviceObject;
|
|
|
|
ULONG SystemIoBusNumber;
|
|
|
|
INTERFACE_TYPE AdapterInterfaceType;
|
|
|
|
ULONG BusInterruptLevel;
|
|
|
|
ULONG BusInterruptVector;
|
|
|
|
KINTERRUPT_MODE InterruptMode;
|
|
|
|
ULONG DmaChannel;
|
|
|
|
ULONG NumberOfAccessRanges;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumberOfAccessRanges) PACCESS_RANGE AccessRanges;
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG StreamDescriptorSize;
|
|
|
|
PIRP Irp;
|
|
|
|
PKINTERRUPT InterruptObject;
|
|
|
|
PADAPTER_OBJECT DmaAdapterObject;
|
|
|
|
PDEVICE_OBJECT RealPhysicalDeviceObject;
|
|
|
|
ULONG Reserved[1];
|
|
|
|
} PORT_CONFIGURATION_INFORMATION, *PPORT_CONFIGURATION_INFORMATION;
|
|
|
|
|
|
|
|
typedef VOID (STREAMAPI *PHW_RECEIVE_DEVICE_SRB) (IN PHW_STREAM_REQUEST_BLOCK SRB);
|
|
|
|
typedef VOID (STREAMAPI *PHW_CANCEL_SRB) (IN PHW_STREAM_REQUEST_BLOCK SRB);
|
|
|
|
typedef VOID (STREAMAPI *PHW_REQUEST_TIMEOUT_HANDLER) (IN PHW_STREAM_REQUEST_BLOCK SRB);
|
|
|
|
typedef BOOLEAN (STREAMAPI *PHW_INTERRUPT) (IN PVOID DeviceExtension);
|
|
|
|
typedef VOID (STREAMAPI *PHW_TIMER_ROUTINE) (IN PVOID Context);
|
|
|
|
typedef VOID (STREAMAPI *PHW_PRIORITY_ROUTINE) (IN PVOID Context);
|
|
|
|
typedef VOID (STREAMAPI *PHW_QUERY_CLOCK_ROUTINE) (IN PHW_TIME_CONTEXT TimeContext);
|
|
|
|
typedef BOOLEAN (STREAMAPI *PHW_RESET_ADAPTER) (IN PVOID DeviceExtension);
|
|
|
|
|
|
|
|
typedef enum _STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE {
|
|
|
|
ReadyForNextStreamDataRequest,
|
|
|
|
ReadyForNextStreamControlRequest,
|
|
|
|
HardwareStarved,
|
|
|
|
StreamRequestComplete,
|
|
|
|
SignalMultipleStreamEvents,
|
|
|
|
SignalStreamEvent,
|
|
|
|
DeleteStreamEvent,
|
|
|
|
StreamNotificationMaximum
|
|
|
|
} STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE, *PSTREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE;
|
|
|
|
|
|
|
|
typedef enum _STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE {
|
|
|
|
ReadyForNextDeviceRequest,
|
|
|
|
DeviceRequestComplete,
|
|
|
|
SignalMultipleDeviceEvents,
|
|
|
|
SignalDeviceEvent,
|
|
|
|
DeleteDeviceEvent,
|
2009-06-26 15:51:14 +00:00
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-08-10 20:50:55 +00:00
|
|
|
SignalMultipleDeviceInstanceEvents,
|
2009-06-26 15:51:14 +00:00
|
|
|
#endif
|
2010-08-10 20:50:55 +00:00
|
|
|
DeviceNotificationMaximum
|
2009-06-26 15:51:14 +00:00
|
|
|
} STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE, *PSTREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE;
|
|
|
|
|
|
|
|
#define STREAM_CLASS_VERSION_20 0x0200
|
|
|
|
|
|
|
|
typedef struct _HW_INITIALIZATION_DATA {
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-08-10 20:50:55 +00:00
|
|
|
__GNU_EXTENSION union {
|
|
|
|
ULONG HwInitializationDataSize;
|
|
|
|
__GNU_EXTENSION struct {
|
|
|
|
USHORT SizeOfThisPacket;
|
|
|
|
USHORT StreamClassVersion;
|
2009-06-26 15:51:14 +00:00
|
|
|
};
|
2010-08-10 20:50:55 +00:00
|
|
|
};
|
2009-06-26 15:51:14 +00:00
|
|
|
#else
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG HwInitializationDataSize;
|
|
|
|
#endif /* NTDDI_VERSION >= NTDDI_WINXP */
|
|
|
|
|
|
|
|
PHW_INTERRUPT HwInterrupt;
|
|
|
|
PHW_RECEIVE_DEVICE_SRB HwReceivePacket;
|
|
|
|
PHW_CANCEL_SRB HwCancelPacket;
|
|
|
|
PHW_REQUEST_TIMEOUT_HANDLER HwRequestTimeoutHandler;
|
|
|
|
ULONG DeviceExtensionSize;
|
|
|
|
ULONG PerRequestExtensionSize;
|
|
|
|
ULONG PerStreamExtensionSize;
|
|
|
|
ULONG FilterInstanceExtensionSize;
|
|
|
|
BOOLEAN BusMasterDMA;
|
|
|
|
BOOLEAN Dma24BitAddresses;
|
|
|
|
ULONG BufferAlignment;
|
|
|
|
BOOLEAN TurnOffSynchronization;
|
|
|
|
ULONG DmaBufferSize;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
#if (NTDDI_VERSION >= NTDDI_WINXP)
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG NumNameExtensions;
|
2013-08-02 23:39:54 +00:00
|
|
|
_Field_size_(NumNameExtensions) PWCHAR *NameExtensionArray;
|
2009-06-26 15:51:14 +00:00
|
|
|
#else
|
2010-08-10 20:50:55 +00:00
|
|
|
ULONG Reserved[2];
|
2009-06-26 15:51:14 +00:00
|
|
|
#endif
|
|
|
|
} HW_INITIALIZATION_DATA, *PHW_INITIALIZATION_DATA;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef enum _STREAM_PRIORITY {
|
|
|
|
High,
|
|
|
|
Dispatch,
|
|
|
|
Low,
|
|
|
|
LowToHigh
|
|
|
|
} STREAM_PRIORITY, *PSTREAM_PRIORITY;
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
VOID
|
|
|
|
StreamClassAbortOutstandingRequests(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_opt_ PHW_STREAM_OBJECT HwStreamObject,
|
|
|
|
_In_ NTSTATUS Status);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
2013-08-02 23:39:54 +00:00
|
|
|
STREAMAPI
|
2009-06-26 15:51:14 +00:00
|
|
|
StreamClassCallAtNewPriority(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_opt_ PHW_STREAM_OBJECT StreamObject,
|
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_ STREAM_PRIORITY Priority,
|
|
|
|
_In_ PHW_PRIORITY_ROUTINE PriorityRoutine,
|
|
|
|
_In_ PVOID Context);
|
2010-08-10 20:50:55 +00:00
|
|
|
|
2009-06-26 15:51:14 +00:00
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassCompleteRequestAndMarkQueueReady(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PHW_STREAM_REQUEST_BLOCK Srb);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
__analysis_noreturn
|
2009-06-26 15:51:14 +00:00
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassDebugAssert(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PCHAR File,
|
|
|
|
_In_ ULONG Line,
|
|
|
|
_In_ PCHAR AssertText,
|
|
|
|
_In_ ULONG AssertValue);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2009-06-28 14:12:58 +00:00
|
|
|
VOID
|
2009-06-26 15:51:14 +00:00
|
|
|
__cdecl
|
|
|
|
StreamClassDebugPrint(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ STREAM_DEBUG_LEVEL DebugPrintLevel,
|
|
|
|
_In_ PCCHAR DebugMessage,
|
2010-08-10 20:50:55 +00:00
|
|
|
...);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
__cdecl
|
|
|
|
StreamClassDeviceNotification(
|
2010-08-10 20:50:55 +00:00
|
|
|
IN STREAM_MINIDRIVER_DEVICE_NOTIFICATION_TYPE NotificationType,
|
|
|
|
IN PVOID HwDeviceExtension,
|
|
|
|
IN PHW_STREAM_REQUEST_BLOCK pSrb,
|
|
|
|
IN PKSEVENT_ENTRY EventEntry,
|
|
|
|
IN GUID *EventSet,
|
|
|
|
IN ULONG EventId);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassFilterReenumerateStreams(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwInstanceExtension,
|
|
|
|
_In_ ULONG StreamDescriptorSize);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
PVOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassGetDmaBuffer(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwDeviceExtension);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
PKSEVENT_ENTRY
|
|
|
|
StreamClassGetNextEvent(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_opt_ PVOID HwInstanceExtension_OR_HwDeviceExtension,
|
|
|
|
_In_opt_ PHW_STREAM_OBJECT HwStreamObject,
|
|
|
|
_In_opt_ GUID *EventGuid,
|
|
|
|
_In_ ULONG EventItem,
|
|
|
|
_In_opt_ PKSEVENT_ENTRY CurrentEvent);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
STREAM_PHYSICAL_ADDRESS
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassGetPhysicalAddress(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_opt_ PHW_STREAM_REQUEST_BLOCK HwSRB,
|
|
|
|
_In_ PVOID VirtualAddress,
|
|
|
|
_In_ STREAM_BUFFER_TYPE Type,
|
|
|
|
_Out_ ULONG *Length);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
StreamClassQueryMasterClock(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PHW_STREAM_OBJECT HwStreamObject,
|
|
|
|
_In_ HANDLE MasterClockHandle,
|
|
|
|
_In_ TIME_FUNCTION TimeFunction,
|
|
|
|
_In_ PHW_QUERY_CLOCK_ROUTINE ClockCallbackRoutine);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
_IRQL_requires_max_(DISPATCH_LEVEL)
|
2009-06-26 15:51:14 +00:00
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassQueryMasterClockSync(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ HANDLE MasterClockHandle,
|
|
|
|
_Inout_ PHW_TIME_CONTEXT TimeContext);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2009-06-26 15:51:14 +00:00
|
|
|
BOOLEAN
|
|
|
|
STREAMAPI
|
2010-08-10 20:50:55 +00:00
|
|
|
StreamClassReadWriteConfig(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_ BOOLEAN Read,
|
|
|
|
_Inout_updates_bytes_(Length) PVOID Buffer,
|
|
|
|
_In_ ULONG Offset,
|
|
|
|
_In_ ULONG Length);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassReenumerateStreams(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_ ULONG StreamDescriptorSize);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2009-06-26 15:51:14 +00:00
|
|
|
NTSTATUS
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassRegisterAdapter(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PVOID Argument1,
|
|
|
|
_In_ PVOID Argument2,
|
|
|
|
_In_ PHW_INITIALIZATION_DATA HwInitializationData);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
#define StreamClassRegisterMinidriver StreamClassRegisterAdapter
|
|
|
|
|
2013-08-02 23:39:54 +00:00
|
|
|
_IRQL_requires_max_(APC_LEVEL)
|
2009-06-26 16:30:44 +00:00
|
|
|
NTSTATUS
|
2010-08-10 20:50:55 +00:00
|
|
|
StreamClassRegisterFilterWithNoKSPins(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ PDEVICE_OBJECT DeviceObject,
|
|
|
|
_In_ const GUID *InterfaceClassGUID,
|
|
|
|
_In_ ULONG PinCount,
|
|
|
|
_In_reads_(PinCount) BOOL *PinDirection,
|
|
|
|
_In_reads_(PinCount) KSPIN_MEDIUM *MediumList,
|
|
|
|
_In_reads_opt_(PinCount) GUID *CategoryList);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
STREAMAPI
|
|
|
|
StreamClassScheduleTimer(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_opt_ PHW_STREAM_OBJECT StreamObject,
|
|
|
|
_In_ PVOID HwDeviceExtension,
|
|
|
|
_In_ ULONG NumberOfMicroseconds,
|
|
|
|
_In_ PHW_TIMER_ROUTINE TimerRoutine,
|
|
|
|
_In_ PVOID Context);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
|
|
|
VOID
|
|
|
|
__cdecl
|
|
|
|
StreamClassStreamNotification(
|
2013-08-02 23:39:54 +00:00
|
|
|
_In_ STREAM_MINIDRIVER_STREAM_NOTIFICATION_TYPE NotificationType,
|
|
|
|
_In_ PHW_STREAM_OBJECT StreamObject,
|
|
|
|
...);
|
2009-06-26 15:51:14 +00:00
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
#endif /* _STREAM_H */
|