Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2392 lines
55 KiB

  1. #define ENABLE_STREAM_CLASS_AS_ALLOCATOR
  2. #define ENABLE_KS_METHODS
  3. #define ENABLE_MULTIPLE_FILTER_TYPES 1 // enable/disable support for multiple
  4. // filters on a single hardware/driver.
  5. //
  6. // when the code for the method support is finally done, STRMINI.H will have
  7. // to be checked into the tree also, in the include directory.
  8. //
  9. /*++
  10. Copyright (c) 1996 Microsoft Corporation
  11. Module Name:
  12. codcls.h
  13. Abstract:
  14. This file defines the necessary structures, defines, and functions for
  15. the common CODEC class driver.
  16. Author:
  17. Bill Parry (billpa)
  18. Environment:
  19. Kernel mode only
  20. Revision History:
  21. --*/
  22. #ifndef _STREAMCLASS_H
  23. #define _STREAMCLASS_H
  24. #include "messages.h"
  25. #include "strmini.h"
  26. #include <stdarg.h>
  27. #ifndef _WIN64
  28. // 4 byte alignment causes Alignment Fault for spinlock.
  29. #pragma pack(4)
  30. #endif
  31. #if ENABLE_MULTIPLE_FILTER_TYPES
  32. #define IF_MF( s ) s
  33. #define IF_MFS( s ) { s }
  34. #define IFN_MF( s )
  35. #define IFN_MFS( s )
  36. #define MFTRACE( s ) StreamClassDebugPrint s
  37. #else
  38. #define IF_MF( s )
  39. #define IF_MFS( s )
  40. #define IFN_MF( s ) s
  41. #define IFN_MFS( s ) { s }
  42. #define MFTRACE( s )
  43. #endif
  44. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  45. //
  46. // this is a debug string header
  47. //
  48. #define STR_MODULENAME "STREAM.SYS:"
  49. //
  50. // define some data allocation tags
  51. //
  52. #define STREAMCLASS_TAG_STREAMHEADER 'pdCS'
  53. #define STREAMCLASS_TAG_FILTERCONNECTION '10CS'
  54. #define STREAMCLASS_TAG_DATAFORMAT '20CS'
  55. #define ID_DATA_DESTINATION_PIN 0
  56. #define ID_DATA_SOURCE_PIN 1
  57. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  58. #define MAX_STRING_LENGTH 256
  59. #define TRAP DEBUG_BREAKPOINT()
  60. //
  61. // the following macros are used to correctly synchronize class driver entry
  62. // points called by the minidriver.
  63. //
  64. #define BEGIN_MINIDRIVER_STREAM_CALLIN(DeviceExtension, Irql) { \
  65. DeviceExtension->BeginMinidriverCallin(DeviceExtension, \
  66. Irql); \
  67. ASSERT(++DeviceExtension->LowerApiThreads == 1);\
  68. }
  69. #define END_MINIDRIVER_STREAM_CALLIN(StreamObject, Irql) { \
  70. ASSERT(--DeviceExtension->LowerApiThreads == 0);\
  71. DeviceExtension->EndMinidriverStreamCallin(StreamObject, \
  72. Irql); \
  73. }
  74. #define BEGIN_MINIDRIVER_DEVICE_CALLIN(DeviceExtension, Irql) { \
  75. DeviceExtension->BeginMinidriverCallin(DeviceExtension, \
  76. Irql); \
  77. ASSERT(++DeviceExtension->LowerApiThreads == 1);\
  78. }
  79. #define END_MINIDRIVER_DEVICE_CALLIN(DeviceExtension, Irql) { \
  80. ASSERT(--DeviceExtension->LowerApiThreads == 0);\
  81. DeviceExtension->EndMinidriverDeviceCallin(DeviceExtension, \
  82. Irql); \
  83. }
  84. //
  85. // The following flags should not be cleared from the interrupt data structure
  86. // by SCGetInterruptState.
  87. //
  88. #define STREAM_FLAGS_INTERRUPT_FLAG_MASK 0
  89. //
  90. // Device Extension flags follow - PASSIVE LEVEL ACCESS ONLY!!!!!!
  91. //
  92. //
  93. // Indicates that the PNP start function has been received for the device.
  94. //
  95. #define DEVICE_FLAGS_PNP_STARTED 0x00001
  96. //
  97. // Indicates that this device is a child device (PDO)
  98. //
  99. #define DEVICE_FLAGS_CHILD 0x0002
  100. //
  101. // indicates that the device has been removed
  102. //
  103. #define DEVICE_FLAGS_DEVICE_INACCESSIBLE 0x00100
  104. //
  105. // debug flag indicates that we've warned of too many low pri calls
  106. //
  107. #define DEVICE_FLAGS_PRI_WARN_GIVEN 0x00200
  108. //
  109. // flag indicates that we've received an NT style surprise remove call
  110. //
  111. #define DEVICE_FLAGS_SURPRISE_REMOVE_RECEIVED 0x00400
  112. //
  113. // flag indicated that a Child device ( PDO ) has received a remove
  114. //
  115. #define DEVICE_FLAGS_CHILD_MARK_DELETE 0x00800
  116. //
  117. // flag indicates (FDO) has enum children from registry
  118. //
  119. #define DEVICE_FLAGS_CHILDREN_ENUMED 0x01000
  120. //
  121. // device registry flags follow
  122. //
  123. //
  124. // page out the driver when not opened
  125. //
  126. #define DEVICE_REG_FL_PAGE_CLOSED 0x00000001
  127. //
  128. // page out the driver when opened but idle
  129. //
  130. #define DEVICE_REG_FL_PAGE_IDLE 0x00000002
  131. //
  132. // power down the device when not opened
  133. //
  134. #define DEVICE_REG_FL_POWER_DOWN_CLOSED 0x00000004
  135. //
  136. // don't suspend if any pins are running
  137. //
  138. #define DEVICE_REG_FL_NO_SUSPEND_IF_RUNNING 0x00000008
  139. //
  140. // This driver uses SWEnum to load, which means it is a kernel mode
  141. // streaming driver that has no hardware associated with it. We need to
  142. // AddRef/DeRef this driver special.
  143. //
  144. #define DRIVER_USES_SWENUM_TO_LOAD 0x00000010
  145. //
  146. // This flag indicates that the dirver is OK for system power to go to
  147. // hibernation, even the driver does not process/support the irp_mn_query_power
  148. // for system power hinbernation.
  149. //
  150. #define DEVICE_REG_FL_OK_TO_HIBERNATE 0x00000020
  151. //
  152. // The following flags should not be cleared from the interrupt data structure
  153. // by SCGetInterruptState.
  154. //
  155. #define DEVICE_FLAGS_INTERRUPT_FLAG_MASK 0
  156. //
  157. // Interrupt flags follow.
  158. //
  159. //
  160. // Indicates that StreamClassCompletionDpc needs to be run. This is set when
  161. // A minidriver makes a request which must be done at DPC and is cleared when
  162. // when the request information is gotten by MpGetInterruptState.
  163. //
  164. #define INTERRUPT_FLAGS_NOTIFICATION_REQUIRED 0x00001
  165. //
  166. // Indicates the minidriver is wants a timer request. Set by
  167. // StreamClassNotification and cleared by MpGetInterruptState. This flag is
  168. // stored in the interrupt data structure. The timer request parameters are
  169. // stored in the interrupt data structure.
  170. //
  171. #define INTERRUPT_FLAGS_TIMER_CALL_REQUEST 0x00002
  172. //
  173. // Indicates the minidriver is wants a priority change. Set by
  174. // StreamClassRequestNewPriority and cleared by SCGetInterruptState. This flag
  175. // is stored in the interrupt data structure. The timer request parameters are
  176. // stored in the interrupt data structure.
  177. //
  178. #define INTERRUPT_FLAGS_PRIORITY_CHANGE_REQUEST 0x00004
  179. //
  180. // Indicates that the PNP stop function has been received for the device.
  181. //
  182. #define INTERRUPT_FLAGS_LOG_ERROR 0x00008
  183. //
  184. // Indicates that the clock is beinq queried.
  185. //
  186. #define INTERRUPT_FLAGS_CLOCK_QUERY_REQUEST 0x00010
  187. //
  188. // Indicates that the streams need to be rescanned.
  189. //
  190. #define INTERRUPT_FLAGS_NEED_STREAM_RESCAN 0x00020
  191. //
  192. // Pointer to the synchronize execution routine.
  193. //
  194. typedef
  195. BOOLEAN
  196. (__stdcall * PSYNCHRONIZE_ROUTINE) (
  197. IN PKINTERRUPT Interrupt,
  198. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  199. IN PVOID SynchronizeContext);
  200. //
  201. // Pointer to the begin minidriver callin routine.
  202. //
  203. typedef VOID
  204. (__stdcall * PBEGIN_CALLIN_ROUTINE) (
  205. IN struct _DEVICE_EXTENSION * DeviceExtension,
  206. IN PKIRQL Irql
  207. );
  208. //
  209. // Pointer to the end minidriver callin routine.
  210. //
  211. typedef
  212. VOID
  213. (__stdcall * PEND_DEVICE_CALLIN_ROUTINE) (
  214. IN struct _DEVICE_EXTENSION * DeviceExtension,
  215. IN PKIRQL Irql
  216. );
  217. typedef
  218. VOID
  219. (__stdcall * PEND_STREAM_CALLIN_ROUTINE) (
  220. IN struct _STREAM_OBJECT * StreamObject,
  221. IN PKIRQL Irql
  222. );
  223. //
  224. // Queue link for mapped addresses stored for unmapping.
  225. //
  226. typedef struct _MAPPED_ADDRESS {
  227. struct _MAPPED_ADDRESS *NextMappedAddress;
  228. PVOID MappedAddress;
  229. ULONG NumberOfBytes;
  230. LARGE_INTEGER IoAddress;
  231. ULONG BusNumber;
  232. } MAPPED_ADDRESS, *PMAPPED_ADDRESS;
  233. //
  234. // error log entry definition
  235. //
  236. typedef struct _ERROR_LOG_ENTRY {
  237. NTSTATUS ErrorCode; // error code
  238. ULONG SequenceNumber; // request sequence number
  239. ULONG UniqueId; // uniqe ID for the error
  240. } ERROR_LOG_ENTRY, *PERROR_LOG_ENTRY;
  241. //
  242. // callback procedure definition
  243. //
  244. typedef NTSTATUS
  245. (*PSTREAM_CALLBACK_PROCEDURE) (
  246. IN PVOID SRB
  247. );
  248. typedef VOID
  249. (*PSTREAM_ASYNC_CALLBACK_PROCEDURE) (
  250. IN struct _STREAM_REQUEST_BLOCK *SRB
  251. );
  252. //
  253. // STREAM request block
  254. //
  255. typedef struct _STREAM_REQUEST_BLOCK {
  256. HW_STREAM_REQUEST_BLOCK HwSRB;
  257. ULONG Flags;
  258. ULONG SequenceNumber;
  259. ULONG ExtensionLength;
  260. PMDL Mdl;
  261. PVOID MapRegisterBase;
  262. PHYSICAL_ADDRESS PhysicalAddress;
  263. ULONG Length;
  264. PSTREAM_ASYNC_CALLBACK_PROCEDURE Callback;
  265. LIST_ENTRY SRBListEntry;
  266. KEVENT Event;
  267. ULONG StreamHeaderSize;
  268. BOOLEAN DoNotCallBack;
  269. KEVENT DmaEvent;
  270. BOOLEAN bMemPtrValid;
  271. PVOID *pMemPtrArray;
  272. } STREAM_REQUEST_BLOCK, *PSTREAM_REQUEST_BLOCK;
  273. //
  274. // SRB flags (not to be confused with the HW SRB flags)
  275. //
  276. #define SRB_FLAGS_IS_ACTIVE 0x00000001
  277. //
  278. // define the minidriver information structure
  279. //
  280. typedef struct _MINIDRIVER_INFORMATION {
  281. HW_INITIALIZATION_DATA HwInitData;
  282. ULONG Flags;
  283. KEVENT ControlEvent;
  284. ULONG UseCount;
  285. ULONG OpenCount;
  286. } MINIDRIVER_INFORMATION, *PMINIDRIVER_INFORMATION;
  287. //
  288. // flags for minidriver information Flags field above
  289. //
  290. //
  291. // indicates that the driver may not be paged out
  292. //
  293. #define DRIVER_FLAGS_NO_PAGEOUT 0x01
  294. //
  295. // indicates that the driver has been paged out
  296. //
  297. #define DRIVER_FLAGS_PAGED_OUT 0x02
  298. //
  299. // pin info not contained in the pin description
  300. //
  301. typedef struct _ADDITIONAL_PIN_INFO {
  302. ULONG CurrentInstances;
  303. ULONG MaxInstances;
  304. // NextFileObject must be per instance, i.e. can't be here.
  305. // Move to streamobject
  306. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  307. //PFILE_OBJECT NextFileObject; // The chained file object
  308. #endif
  309. ULONG Reserved;
  310. } ADDITIONAL_PIN_INFO, *PADDITIONAL_PIN_INFO;
  311. //
  312. // Define data storage for access at interrupt Irql.
  313. //
  314. typedef struct _INTERRUPT_DATA {
  315. //
  316. // interrupt flags
  317. //
  318. ULONG Flags;
  319. ERROR_LOG_ENTRY LogEntry;
  320. //
  321. // List head for singlely linked list of complete IRPs.
  322. //
  323. PHW_STREAM_REQUEST_BLOCK CompletedSRB;
  324. //
  325. // Minidriver timer request routine.
  326. //
  327. PHW_TIMER_ROUTINE HwTimerRoutine;
  328. //
  329. // Mindriver timer request time in micro seconds.
  330. //
  331. ULONG HwTimerValue;
  332. PVOID HwTimerContext;
  333. //
  334. // Mindriver priority change routine.
  335. //
  336. PHW_PRIORITY_ROUTINE HwPriorityRoutine;
  337. //
  338. // Mindriver priority change level.
  339. //
  340. STREAM_PRIORITY HwPriorityLevel;
  341. PVOID HwPriorityContext;
  342. PHW_QUERY_CLOCK_ROUTINE HwQueryClockRoutine;
  343. TIME_FUNCTION HwQueryClockFunction;
  344. } INTERRUPT_DATA, *PINTERRUPT_DATA;
  345. //
  346. // object common to both stream and filter instances
  347. //
  348. typedef struct _COMMON_OBJECT {
  349. PVOID DeviceHeader;
  350. ULONG Cookie;
  351. #ifdef _WIN64
  352. ULONG Alignment;
  353. #endif // _WIN64
  354. INTERRUPT_DATA InterruptData;
  355. PHW_TIMER_ROUTINE HwTimerRoutine; // Timer request routine
  356. PVOID HwTimerContext;
  357. KTIMER MiniDriverTimer; // Miniclass timer object.
  358. KDPC MiniDriverTimerDpc; // Miniclass DPC for timer object.
  359. WORK_QUEUE_ITEM WorkItem;
  360. #if DBG
  361. BOOLEAN PriorityWorkItemScheduled;
  362. #endif
  363. } COMMON_OBJECT, *PCOMMON_OBJECT;
  364. //
  365. // stream name info
  366. //
  367. typedef struct _STREAM_OPEN_INFORMATION {
  368. WCHAR Guid[11];
  369. ULONG Instance;
  370. } STREAM_OPEN_INFORMATION, *PSTREAM_OPEN_INFORMATION;
  371. //
  372. // clock instance structure
  373. //
  374. typedef struct _CLOCK_INSTANCE {
  375. PVOID DeviceHeader;
  376. PFILE_OBJECT ParentFileObject;
  377. //PFILE_OBJECT ClockFileObject; johnlee
  378. struct _STREAM_OBJECT *StreamObject;
  379. } CLOCK_INSTANCE, *PCLOCK_INSTANCE;
  380. //
  381. // master clock info structure
  382. //
  383. typedef struct _MASTER_CLOCK_INFO {
  384. PFILE_OBJECT ClockFileObject;
  385. KSCLOCK_FUNCTIONTABLE FunctionTable;
  386. } MASTER_CLOCK_INFO, *PMASTER_CLOCK_INFO;
  387. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  388. typedef enum {
  389. PinStopped,
  390. PinStopPending,
  391. PinPrepared,
  392. PinRunning
  393. } PIN_STATE;
  394. typedef enum {
  395. IrpSource,
  396. IrpSink,
  397. } PIN_TYPE;
  398. #define READ 0
  399. #define WRITE 1
  400. typedef struct _QUEUE {
  401. KSPIN_LOCK QueueLock;
  402. LIST_ENTRY ActiveQueue;
  403. WORK_QUEUE_ITEM WorkItem;
  404. BOOL WorkItemQueued;
  405. } QUEUE, PQUEUE;
  406. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  407. //
  408. // TODO: WORKITEM: remove this once KS can multiplex cleanup calls.
  409. //
  410. #define STREAM_OBJECT_COOKIE 0xd73afe3f
  411. typedef struct _COOKIE_CHECK {
  412. PVOID Header;
  413. ULONG PossibleCookie;
  414. } COOKIE_CHECK, *PCOOKIE_CHECK;
  415. //
  416. // stream object definition
  417. //
  418. typedef struct _STREAM_OBJECT {
  419. COMMON_OBJECT ComObj;
  420. PFILE_OBJECT FilterFileObject;
  421. PFILE_OBJECT FileObject;
  422. struct _FILTER_INSTANCE *FilterInstance;
  423. HW_STREAM_OBJECT HwStreamObject;
  424. LIST_ENTRY DataPendingQueue;
  425. LIST_ENTRY ControlPendingQueue;
  426. LIST_ENTRY OutstandingQueue;
  427. LIST_ENTRY NextStream;
  428. LIST_ENTRY NotifyList;
  429. struct _DEVICE_EXTENSION *DeviceExtension;
  430. struct _STREAM_OBJECT *NextNeedyStream;
  431. PKSPROPERTY_SET PropertyInfo;
  432. ULONG PropInfoSize;
  433. PKSEVENT_SET EventInfo;
  434. ULONG EventInfoCount;
  435. KEVENT ControlSetMasterClock; // to serialize SetMasterClock
  436. KSPIN_LOCK LockUseMasterClock; // control use of MasterClockInfo
  437. PMASTER_CLOCK_INFO MasterClockInfo;
  438. PCLOCK_INSTANCE ClockInstance;
  439. PKSPROPERTY_SET ConstructedPropertyInfo;
  440. ULONG ConstructedPropInfoSize;
  441. KSSTATE CurrentState;
  442. BOOLEAN ReadyForNextControlReq;
  443. BOOLEAN ReadyForNextDataReq;
  444. BOOLEAN OnNeedyQueue;
  445. BOOLEAN InFlush;
  446. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  447. PIN_STATE PinState;
  448. PIN_TYPE PinType; // IrpSource or IrpSink
  449. PFILE_OBJECT AllocatorFileObject;
  450. PFILE_OBJECT NextFileObject;
  451. LIST_ENTRY FreeQueue;
  452. KSPIN_LOCK FreeQueueLock;
  453. KEVENT StopEvent;
  454. PKSDATAFORMAT DataFormat;
  455. ULONG PinId;
  456. HANDLE PinToHandle;
  457. KSALLOCATOR_FRAMING Framing;
  458. BOOL EndOfStream;
  459. QUEUE Queues[2];
  460. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  461. #ifdef ENABLE_KS_METHODS
  462. PKSMETHOD_SET MethodInfo;
  463. ULONG MethodInfoSize;
  464. #endif
  465. BOOLEAN StandardTransport;
  466. //
  467. // This keeps track of the number of frames in circulation between the
  468. // output and the downstream input. It is a total count of those frames
  469. // queued to EITHER pin or in a pending list OTHER THAN THE FREE LIST
  470. // on the output pin.
  471. //
  472. LONG QueuedFramesPlusOne;
  473. } STREAM_OBJECT, *PSTREAM_OBJECT;
  474. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  475. //
  476. // NOTE! This is the minimal structure size for STREAM_HEADER_EX.
  477. // The connected pins are queried for the actual header size (including
  478. // whatever extended header size is required).
  479. //
  480. typedef struct _STREAM_HEADER_EX *PSTREAM_HEADER_EX;
  481. typedef struct _STREAM_HEADER_EX {
  482. ULONG WhichQueue;
  483. ULONG Id;
  484. IO_STATUS_BLOCK IoStatus;
  485. KEVENT CompletionEvent;
  486. LIST_ENTRY ListEntry;
  487. ULONG ReferenceCount;
  488. PFILE_OBJECT OwnerFileObject;
  489. PFILE_OBJECT NextFileObject; // next one to stream to.
  490. #if (DBG)
  491. PVOID Data;
  492. ULONG OnFreeList;
  493. ULONG OnActiveList;
  494. #else
  495. ULONG Reserved;
  496. #endif
  497. KSSTREAM_HEADER Header;
  498. } STREAM_HEADER_EX, *PSTREAM_HEADER_EX;
  499. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  500. //
  501. // struct for retrieving the interrupt data
  502. //
  503. typedef struct _INTERRUPT_CONTEXT {
  504. PSTREAM_OBJECT NeedyStream;
  505. struct _DEVICE_EXTENSION *DeviceExtension;
  506. PINTERRUPT_DATA SavedStreamInterruptData;
  507. PINTERRUPT_DATA SavedDeviceInterruptData;
  508. } INTERRUPT_CONTEXT, *PINTERRUPT_CONTEXT;
  509. //
  510. // Performance improvement chance - array for stream prop & event pointers
  511. //
  512. typedef struct _STREAM_ADDITIONAL_INFO {
  513. PKSPROPERTY_SET StreamPropertiesArray;
  514. PKSEVENT_SET StreamEventsArray;
  515. } STREAM_ADDITIONAL_INFO, *PSTREAM_ADDITIONAL_INFO;
  516. //
  517. // filter instance structure
  518. // (right now, this is global across all same filter creates!)
  519. //
  520. #if ENABLE_MULTIPLE_FILTER_TYPES
  521. //
  522. // for forward reference in FILTER_INSTANCE
  523. //
  524. typedef struct _DEVICE_EXTENSION;
  525. //
  526. // I claim that as it currently stands, 5/17/99 "No multiple instance
  527. // mini driver works" because the bug in stream.sys. Therefore, backward
  528. // compatibility is only a concern for single instance mini drivers.
  529. //
  530. // The reason is the implemention following:
  531. // FilterDispatchGlobalCreate()
  532. // {
  533. // ...
  534. // if (!DeviceExtension->GlobalFilterInstance) {
  535. //
  536. //
  537. // Status = SCOpenMinidriverInstance(DeviceExtension,
  538. // &FilterInstance,
  539. // SCGlobalInstanceCallback,
  540. // Irp);
  541. // ...
  542. // if (NT_SUCCESS(Status)) {
  543. // ...
  544. // DeviceExtension->GlobalFilterInstance = FilterInstance;
  545. // ...
  546. // }
  547. // }
  548. // else { // will not call mini drivers
  549. // }
  550. // }
  551. //
  552. // At the 2nd call, the FilterInstance will point to the same 1st one.
  553. //
  554. // We are braching out code here to support Multiple Filters without
  555. // disturbing the exisitng support to max the backward compatibilty.
  556. // The multiple filter support include 1 type n instances,
  557. // and m types p instances.
  558. //
  559. // MinidriverData->HwInitData.
  560. // 1 x 1 FilterInstanceExtensionSize =0 NumNameExtension =0
  561. // 1 x n FilterInstanceExtensionSize!=0 NumNameExtension =0
  562. // m x p FilterInstanceExtensionSize!=0 NumNameExtension!=0
  563. //
  564. typedef struct _FILTER_TYPE_INFORMATION {
  565. UNICODE_STRING *SymbolicLinks;
  566. ULONG LinkNameCount;
  567. PHW_STREAM_DESCRIPTOR StreamDescriptor;
  568. ULONG Reserved;
  569. } FILTER_TYPE_INFO;
  570. typedef FILTER_TYPE_INFO *PFILTER_TYPE_INFO;
  571. #endif
  572. typedef struct _DEVICE_EXTENSION;
  573. typedef struct _FILTER_INSTANCE {
  574. PVOID DeviceHeader;
  575. PDEVICE_OBJECT DeviceObject;
  576. LIST_ENTRY NextFilterInstance; // internal linked list of filter I's.
  577. LIST_ENTRY FirstStream;
  578. PVOID HwInstanceExtension;
  579. PADDITIONAL_PIN_INFO PinInstanceInfo; // pointer to array of pins
  580. // allocated directly below this
  581. // structure.
  582. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  583. //
  584. // Feature work: add per filter filter type when data splitting is enabled!
  585. //
  586. PKSWORKER WorkerRead;
  587. PKSWORKER WorkerWrite;
  588. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  589. #ifdef ENABLE_KS_METHODS
  590. IF_MF(
  591. PKSMETHOD_SET DeviceMethodsArray; // from pDevExt
  592. )
  593. #endif
  594. #define SIGN_FILTER_INSTANCE 'FrtS' //StrF
  595. #if ENABLE_MULTIPLE_FILTER_TYPES
  596. #define ASSERT_FILTER_INSTANCE(FI) ASSERT((FI)->Signature==SIGN_FILTER_INSTANCE)
  597. #else
  598. #define ASSERT_FILTER_INSTANCE(FI)
  599. #endif
  600. IF_MF(
  601. ULONG Signature;
  602. PKSPIN_DESCRIPTOR PinInformation; // moved from pDevExt
  603. //ULONG PinInformationSize; // from pDevExt,not used
  604. ULONG NumberOfPins; // from pDevExt
  605. PKSEVENT_SET EventInfo; // from pDevExt
  606. ULONG EventInfoCount; // from pDevExt
  607. LIST_ENTRY NotifyList; // from pDevExt
  608. PHW_EVENT_ROUTINE HwEventRoutine; // from pDevExt
  609. PKSPROPERTY_SET DevicePropertiesArray; // from pDevExt
  610. PSTREAM_ADDITIONAL_INFO StreamPropEventArray; // ditto
  611. ULONG Reenumerated; // if 1, StreamDescriptor is newly alloc
  612. // need to be freed. Else, it points into
  613. // the global one which belong to DevExt.
  614. ULONG NeedReenumeration; // requesting reenumeration
  615. ULONG StreamDescriptorSize; // the new size for streamdescriptor;
  616. struct _DEVICE_EXTENSION *DeviceExtension;
  617. PHW_STREAM_DESCRIPTOR StreamDescriptor;
  618. ULONG FilterTypeIndex;
  619. //
  620. // Performance improvement chance. Per filterinstance ControlEvent etc might be
  621. // better.For now, let them share ones in DeviceExtension
  622. //
  623. //KEVENT ControlEvent
  624. //PHW_TIMER_ROUTINE HwTimerRoutine; // Timer request routine
  625. //PVOID HwTimerContext;
  626. //KTIMER MiniDriverTimer; // Miniclass timer object.
  627. //KDPC MiniDriverTimerDpc; // Miniclass DPC for timer object.
  628. //WORK_QUEUE_ITEM WorkItem;
  629. ) // IF_MF
  630. } FILTER_INSTANCE, *PFILTER_INSTANCE;
  631. //
  632. // Per Device data
  633. //
  634. typedef struct _DEVICE_EXTENSION {
  635. COMMON_OBJECT ComObj;
  636. ULONG Flags; // per device flags (PD_xx)
  637. PDEVICE_OBJECT DeviceObject; // device object
  638. PDEVICE_OBJECT AttachedPdo; // device object returned from the attach
  639. ULONG RegistryFlags; // registry flags
  640. // callback routine on DMA allocate
  641. // callback function for
  642. // KeSynch execution
  643. PKINTERRUPT InterruptObject; // Interrupt object and routine
  644. PKSERVICE_ROUTINE InterruptRoutine;
  645. PADAPTER_OBJECT DmaAdapterObject; // Dma Adapter information.
  646. ULONG NumberOfMapRegisters; // max. number of map registers
  647. // for
  648. // device
  649. PVOID MapRegisterBase;
  650. PMINIDRIVER_INFORMATION MinidriverData; // pointer to minidriver data
  651. PDEVICE_OBJECT PhysicalDeviceObject; // pointer to PDO for adapter
  652. PVOID HwDeviceExtension; // minidriver's device extension
  653. PPORT_CONFIGURATION_INFORMATION ConfigurationInformation;
  654. // configuration info for adapter
  655. PMAPPED_ADDRESS MappedAddressList; // address map list head
  656. //
  657. // Routine to call to synchronize execution for the minidriver.
  658. //
  659. PSYNCHRONIZE_ROUTINE SynchronizeExecution;
  660. KSPIN_LOCK SpinLock;
  661. ULONG SequenceNumber; // offset 0x30
  662. ULONG DmaBufferLength;
  663. PHYSICAL_ADDRESS DmaBufferPhysical;
  664. PVOID DmaBuffer;
  665. LIST_ENTRY PendingQueue;
  666. LIST_ENTRY OutstandingQueue;
  667. KDPC WorkDpc;
  668. IFN_MF(
  669. //
  670. // Move to FilterInstance for IF_MF
  671. //
  672. PKSPIN_DESCRIPTOR PinInformation;
  673. ULONG PinInformationSize;
  674. ULONG NumberOfPins;
  675. )
  676. #define SIGN_DEVICE_EXTENSION 'DrtS' //StrD
  677. #if ENABLE_MULTIPLE_FILTER_TYPES
  678. #define ASSERT_DEVICE_EXTENSION(DE) ASSERT((DE)->Signature==SIGN_DEVICE_EXTENSION)
  679. #else
  680. #define ASSERT_DEVICE_EXTENSION(DE)
  681. #endif
  682. ULONG Signature2;
  683. LIST_ENTRY FilterInstanceList;
  684. ULONG NumberOfOpenInstances;
  685. IFN_MF(
  686. //
  687. // Don't need for IF_MF
  688. //
  689. PFILTER_INSTANCE GlobalFilterInstance;
  690. ULONG NumberOfGlobalInstances;
  691. )
  692. struct _STREAM_OBJECT *NeedyStream;
  693. PHW_STREAM_DESCRIPTOR StreamDescriptor;
  694. KEVENT ControlEvent;
  695. KEVENT RemoveEvent;
  696. BOOLEAN NoSync;
  697. PMINIDRIVER_INFORMATION DriverInfo;
  698. PBEGIN_CALLIN_ROUTINE BeginMinidriverCallin;
  699. PEND_STREAM_CALLIN_ROUTINE EndMinidriverStreamCallin;
  700. PEND_DEVICE_CALLIN_ROUTINE EndMinidriverDeviceCallin;
  701. LONG OneBasedIoCount;
  702. UNICODE_STRING *SymbolicLinks;
  703. DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
  704. DEVICE_POWER_STATE CurrentPowerState;
  705. LIST_ENTRY Children;
  706. LIST_ENTRY DeadEventList;
  707. WORK_QUEUE_ITEM EventWorkItem;
  708. WORK_QUEUE_ITEM RescanWorkItem;
  709. WORK_QUEUE_ITEM PowerCompletionWorkItem; // this is used for S Irp, S and D Irps dont exclude between.
  710. WORK_QUEUE_ITEM DevIrpCompletionWorkItem; // this is for D Irp as opposed to S Irp which uses above
  711. BOOLEAN ReadyForNextReq;
  712. BOOLEAN DeadEventItemQueued;
  713. IFN_MF(
  714. //
  715. // move to FilterInstace for MF
  716. //
  717. PKSEVENT_SET EventInfo;
  718. ULONG EventInfoCount;
  719. LIST_ENTRY NotifyList;
  720. PHW_EVENT_ROUTINE HwEventRoutine;
  721. PKSPROPERTY_SET DevicePropertiesArray;
  722. PSTREAM_ADDITIONAL_INFO StreamPropEventArray;
  723. )
  724. #ifdef ENABLE_KS_METHODS
  725. IFN_MF(
  726. //
  727. // move to FilterInstance for MF
  728. PKSMETHOD_SET DeviceMethodsArray;
  729. )
  730. #endif
  731. IF_MF(
  732. ULONG NumberOfNameExtensions;
  733. ULONG NumberOfFilterTypes;
  734. PKSOBJECT_CREATE_ITEM CreateItems;
  735. PFILTER_TYPE_INFO FilterTypeInfos;
  736. ULONG Signature;
  737. ULONG FilterExtensionSize;
  738. )
  739. #if DBG
  740. ULONG LowerApiThreads;
  741. ULONG NumberOfRequests;
  742. ULONG NumberOfLowPriCalls;
  743. #endif
  744. LIST_ENTRY PendedIrps;
  745. KSPIN_LOCK PendedIrpsLock;
  746. KSPIN_LOCK PowerLock;
  747. SYSTEM_POWER_STATE CurrentSystemState;
  748. KEVENT BlockPoweredDownEvent;
  749. } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
  750. //
  751. // debug work item trap structure
  752. //
  753. #if DBG
  754. typedef struct _DEBUG_WORK_ITEM {
  755. PCOMMON_OBJECT Object;
  756. PHW_PRIORITY_ROUTINE HwPriorityRoutine;
  757. PVOID HwPriorityContext;
  758. } DEBUG_WORK_ITEM, *PDEBUG_WORK_ITEM;
  759. #endif
  760. //
  761. // registry entry structure
  762. //
  763. typedef struct _STREAM_REGISTRY_ENTRY {
  764. PWCHAR String;
  765. ULONG StringLength;
  766. ULONG Flags;
  767. } STREAM_REGISTRY_ENTRY, *PSTREAM_REGISTRY_ENTRY;
  768. //
  769. // power context structure
  770. //
  771. typedef struct _POWER_CONTEXT {
  772. KEVENT Event;
  773. NTSTATUS Status;
  774. } POWER_CONTEXT, *PPOWER_CONTEXT;
  775. //
  776. // child device extension
  777. //
  778. typedef struct _CHILD_DEVICE_EXTENSION {
  779. COMMON_OBJECT ComObj;
  780. ULONG Flags; // per device flags (PD_xx)
  781. PDEVICE_OBJECT ChildDeviceObject;
  782. PDEVICE_OBJECT ParentDeviceObject;
  783. LIST_ENTRY ChildExtensionList;
  784. PWCHAR DeviceName;
  785. ULONG DeviceIndex;
  786. } CHILD_DEVICE_EXTENSION, *PCHILD_DEVICE_EXTENSION;
  787. //
  788. // Function declarations
  789. //
  790. NTSTATUS
  791. StreamClassOpen(
  792. IN PDEVICE_OBJECT DeviceObject,
  793. IN PIRP Irp
  794. );
  795. NTSTATUS
  796. StreamClassClose(
  797. IN PDEVICE_OBJECT DeviceObject,
  798. IN PIRP Irp
  799. );
  800. NTSTATUS
  801. StreamClassDeviceControl(
  802. IN PDEVICE_OBJECT DeviceObject,
  803. IN PIRP Irp
  804. );
  805. NTSTATUS
  806. StreamClassNull(
  807. IN PDEVICE_OBJECT DeviceObject,
  808. IN PIRP Irp
  809. );
  810. VOID
  811. StreamClassDpc(
  812. IN PKDPC Dpc,
  813. IN PDEVICE_OBJECT DeviceObject,
  814. IN PIRP Irp,
  815. IN PVOID Context
  816. );
  817. BOOLEAN
  818. StreamClassInterrupt(
  819. IN PKINTERRUPT InterruptObject,
  820. IN PDEVICE_OBJECT DeviceObject
  821. );
  822. NTSTATUS
  823. StreamClassShutDown(
  824. IN PDEVICE_OBJECT DeviceObject,
  825. IN PIRP Irp
  826. );
  827. BOOLEAN
  828. SCGetInterruptState(
  829. IN PVOID ServiceContext
  830. );
  831. VOID
  832. SCMinidriverDeviceTimerDpc(
  833. IN struct _KDPC * Dpc,
  834. IN PVOID DeviceObject,
  835. IN PVOID SystemArgument1,
  836. IN PVOID SystemArgument2
  837. );
  838. VOID
  839. SCMinidriverStreamTimerDpc(
  840. IN struct _KDPC * Dpc,
  841. IN PVOID Context,
  842. IN PVOID SystemArgument1,
  843. IN PVOID SystemArgument2
  844. );
  845. PSTREAM_REQUEST_BLOCK
  846. SCBuildRequestPacket(
  847. IN PDEVICE_EXTENSION DeviceExtension,
  848. IN PIRP Irp,
  849. IN ULONG AdditionalSize1,
  850. IN ULONG AdditionalSize2
  851. );
  852. BOOLEAN
  853. SCSynchronizeExecution(
  854. IN PKINTERRUPT Interrupt,
  855. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  856. IN PVOID SynchronizeContext
  857. );
  858. VOID
  859. SCLogError(
  860. IN PDEVICE_OBJECT DeviceObject,
  861. IN ULONG SequenceNumber,
  862. IN NTSTATUS ErrorCode,
  863. IN ULONG UniqueId
  864. );
  865. VOID
  866. SCLogErrorWithString(
  867. IN PDEVICE_OBJECT DeviceObject,
  868. IN OPTIONAL PDEVICE_EXTENSION DeviceExtension,
  869. IN NTSTATUS ErrorCode,
  870. IN ULONG UniqueId,
  871. IN PUNICODE_STRING String1
  872. );
  873. VOID
  874. SCMinidriverTimerDpc(
  875. IN struct _KDPC * Dpc,
  876. IN PVOID Context,
  877. IN PVOID SystemArgument1,
  878. IN PVOID SystemArgument2
  879. );
  880. BOOLEAN
  881. SCSetUpForDMA(
  882. IN PDEVICE_OBJECT DeviceObject,
  883. IN PSTREAM_REQUEST_BLOCK Request
  884. );
  885. IO_ALLOCATION_ACTION
  886. StreamClassDmaCallback(
  887. IN PDEVICE_OBJECT DeviceObject,
  888. IN PIRP Irp,
  889. IN PVOID MapRegisterBase,
  890. IN PVOID Context
  891. );
  892. VOID
  893. SCStartMinidriverRequest(
  894. IN PSTREAM_OBJECT StreamObject,
  895. IN PSTREAM_REQUEST_BLOCK Request,
  896. IN PVOID EntryPoint
  897. );
  898. NTSTATUS
  899. SCProcessCompletedRequest(
  900. IN PSTREAM_REQUEST_BLOCK SRB
  901. );
  902. NTSTATUS
  903. StreamClassUninitializeMinidriver(
  904. IN PDEVICE_OBJECT DeviceObject,
  905. IN PIRP Irp);
  906. NTSTATUS
  907. StreamClassVideoRegister(
  908. IN PVOID Argument1,
  909. IN PVOID Argument2,
  910. IN PHW_INITIALIZATION_DATA HwInitializationData
  911. );
  912. NTSTATUS
  913. StreamClassCleanup (
  914. IN PDEVICE_OBJECT DeviceObject,
  915. IN PIRP Irp
  916. );
  917. void
  918. SCSetCurrentDPowerState (
  919. IN PDEVICE_EXTENSION DeviceExtension,
  920. IN DEVICE_POWER_STATE PowerState
  921. );
  922. void
  923. SCSetCurrentSPowerState (
  924. IN PDEVICE_EXTENSION DeviceExtension,
  925. IN SYSTEM_POWER_STATE PowerState
  926. );
  927. void
  928. SCRedispatchPendedIrps (
  929. IN PDEVICE_EXTENSION DeviceExtension,
  930. IN BOOLEAN FailRequests
  931. );
  932. NTSTATUS
  933. StreamClassPassThroughIrp (
  934. IN PDEVICE_OBJECT DeviceObject,
  935. IN PIRP Irp
  936. );
  937. NTSTATUS
  938. StreamClassPnP(
  939. IN PDEVICE_OBJECT DeviceObject,
  940. IN PIRP Irp
  941. );
  942. NTSTATUS
  943. StreamClassPower(
  944. IN PDEVICE_OBJECT DeviceObject,
  945. IN PIRP Irp
  946. );
  947. NTSTATUS
  948. StreamClassPnPAddDevice(
  949. IN PDRIVER_OBJECT DriverObject,
  950. IN PDEVICE_OBJECT PhysicalDeviceObject
  951. );
  952. VOID
  953. SCFreeAllResources(
  954. IN PDEVICE_EXTENSION DeviceExtension
  955. );
  956. VOID
  957. StreamClassUnload(
  958. IN PDRIVER_OBJECT DriverObject
  959. );
  960. BOOLEAN
  961. StreamClassSynchronizeExecution(
  962. IN PKINTERRUPT Interrupt,
  963. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  964. IN PVOID SynchronizeContext
  965. );
  966. VOID
  967. StreamClassDebugPrint(
  968. STREAM_DEBUG_LEVEL DebugPrintLevel,
  969. PSCHAR DebugMessage,
  970. ...
  971. );
  972. NTSTATUS
  973. SCCompleteIrp(
  974. IN PIRP Irp,
  975. IN NTSTATUS Status,
  976. IN PDEVICE_EXTENSION DeviceExtension
  977. );
  978. NTSTATUS
  979. SCUninitializeMinidriver(
  980. IN PDEVICE_OBJECT DeviceObject,
  981. IN PIRP Irp);
  982. BOOLEAN
  983. SCDummyMinidriverRoutine(
  984. IN PVOID Context
  985. );
  986. NTSTATUS
  987. SCStreamInfoCallback(
  988. IN PSTREAM_REQUEST_BLOCK SRB
  989. );
  990. NTSTATUS
  991. FilterDispatchGlobalCreate(
  992. IN PDEVICE_OBJECT DeviceObject,
  993. IN PIRP Irp
  994. );
  995. NTSTATUS
  996. StreamDispatchCreate(
  997. IN PDEVICE_OBJECT DeviceObject,
  998. IN PIRP Irp
  999. );
  1000. NTSTATUS
  1001. FilterDispatchIoControl(
  1002. IN PDEVICE_OBJECT DeviceObject,
  1003. IN PIRP Irp
  1004. );
  1005. NTSTATUS
  1006. FilterDispatchClose
  1007. (
  1008. IN PDEVICE_OBJECT pdo,
  1009. IN PIRP pIrp
  1010. );
  1011. NTSTATUS
  1012. SCStreamDeviceState
  1013. (
  1014. IN PIRP Irp,
  1015. IN PKSPROPERTY Property,
  1016. IN OUT PKSSTATE DeviceState
  1017. );
  1018. NTSTATUS
  1019. StreamDispatchIoControl
  1020. (
  1021. IN PDEVICE_OBJECT DeviceObject,
  1022. IN PIRP Irp
  1023. );
  1024. NTSTATUS StreamDispatchRead
  1025. (
  1026. IN PDEVICE_OBJECT DeviceObject,
  1027. IN PIRP Irp
  1028. );
  1029. NTSTATUS StreamDispatchWrite
  1030. (
  1031. IN PDEVICE_OBJECT DeviceObject,
  1032. IN PIRP Irp
  1033. );
  1034. NTSTATUS
  1035. SCLocalInstanceCallback(
  1036. IN PSTREAM_REQUEST_BLOCK SRB
  1037. );
  1038. IFN_MF(
  1039. NTSTATUS
  1040. SCGlobalInstanceCallback(
  1041. IN PSTREAM_REQUEST_BLOCK SRB
  1042. );
  1043. )
  1044. NTSTATUS
  1045. SCOpenStreamCallback(
  1046. IN PSTREAM_REQUEST_BLOCK SRB
  1047. );
  1048. VOID
  1049. SCRequestDpcForStream(
  1050. IN PSTREAM_OBJECT StreamObject
  1051. );
  1052. NTSTATUS
  1053. SCSubmitRequest(
  1054. IN SRB_COMMAND Command,
  1055. IN PVOID Buffer,
  1056. IN ULONG BufferLength,
  1057. IN PSTREAM_CALLBACK_PROCEDURE Callback,
  1058. IN PDEVICE_EXTENSION DeviceExtension,
  1059. IN PVOID InstanceExtension,
  1060. IN PHW_STREAM_OBJECT HwStreamObject,
  1061. IN PIRP Irp,
  1062. OUT PBOOLEAN RequestIssued,
  1063. IN PLIST_ENTRY Queue,
  1064. IN PVOID MinidriverRoutine
  1065. );
  1066. NTSTATUS
  1067. SCCloseInstanceCallback(
  1068. IN PSTREAM_REQUEST_BLOCK SRB
  1069. );
  1070. NTSTATUS
  1071. SCFilterPinInstances(
  1072. IN PIRP Irp,
  1073. IN PKSPROPERTY Property,
  1074. IN OUT PVOID Data);
  1075. NTSTATUS
  1076. SCFilterPinDataRouting(
  1077. IN PIRP Irp,
  1078. IN PKSPROPERTY Property,
  1079. IN OUT PVOID Data);
  1080. NTSTATUS
  1081. SCFilterPinDataIntersection(
  1082. IN PIRP Irp,
  1083. IN PKSPROPERTY Property,
  1084. IN OUT PVOID Data);
  1085. NTSTATUS
  1086. SCFilterPinPropertyHandler(
  1087. IN PIRP Irp,
  1088. IN PKSPROPERTY Property,
  1089. IN OUT PVOID Data);
  1090. NTSTATUS
  1091. SCFilterProvider(
  1092. IN PIRP Irp,
  1093. IN PKSPROPERTY Property,
  1094. IN OUT PVOID Data);
  1095. NTSTATUS
  1096. StreamDispatchClose
  1097. (
  1098. IN PDEVICE_OBJECT DeviceObject,
  1099. IN PIRP Irp
  1100. );
  1101. NTSTATUS
  1102. StreamDispatchCleanup
  1103. (
  1104. IN PDEVICE_OBJECT DeviceObject,
  1105. IN PIRP Irp
  1106. );
  1107. NTSTATUS
  1108. SCCloseStreamCallback(
  1109. IN PSTREAM_REQUEST_BLOCK SRB
  1110. );
  1111. BOOLEAN
  1112. SCProcessPioDataBuffers(
  1113. IN PKSSTREAM_HEADER FirstHeader,
  1114. IN ULONG NumberOfHeaders,
  1115. IN PSTREAM_OBJECT StreamObject,
  1116. IN PMDL FirstMdl,
  1117. IN ULONG StreamHeaderSize,
  1118. IN PVOID *pMemPtrArray,
  1119. IN BOOLEAN Write
  1120. );
  1121. VOID
  1122. SCProcessDmaDataBuffers(
  1123. IN PKSSTREAM_HEADER FirstHeader,
  1124. IN ULONG NumberOfHeaders,
  1125. IN PSTREAM_OBJECT StreamObject,
  1126. IN PMDL FirstMdl,
  1127. OUT PULONG NumberOfPages,
  1128. IN ULONG StreamHeaderSize,
  1129. IN BOOLEAN Write
  1130. );
  1131. VOID
  1132. SCErrorDataSRB(
  1133. IN PHW_STREAM_REQUEST_BLOCK SRB
  1134. );
  1135. VOID
  1136. SCCheckOutstandingRequestsForTimeouts(
  1137. IN PLIST_ENTRY ListEntry
  1138. );
  1139. VOID
  1140. SCCheckFilterInstanceStreamsForTimeouts(
  1141. IN PFILTER_INSTANCE FilterInstance
  1142. );
  1143. VOID
  1144. StreamClassTickHandler(
  1145. IN PDEVICE_OBJECT DeviceObject,
  1146. IN PVOID Context
  1147. );
  1148. VOID
  1149. StreamClassCancelOutstandingIrp(
  1150. IN PDEVICE_OBJECT DeviceObject,
  1151. IN PIRP Irp
  1152. );
  1153. VOID
  1154. StreamClassCancelPendingIrp(
  1155. IN PDEVICE_OBJECT DeviceObject,
  1156. IN PIRP Irp
  1157. );
  1158. VOID
  1159. SCCancelOutstandingIrp(
  1160. IN PDEVICE_EXTENSION DeviceExtension,
  1161. IN PIRP Irp
  1162. );
  1163. BOOLEAN
  1164. SCCheckFilterInstanceStreamsForIrp(
  1165. IN PFILTER_INSTANCE FilterInstance,
  1166. IN PIRP Irp
  1167. );
  1168. BOOLEAN
  1169. SCCheckRequestsForIrp(
  1170. IN PLIST_ENTRY ListEntry,
  1171. IN PIRP Irp,
  1172. IN BOOLEAN IsIrpQueue,
  1173. IN PDEVICE_EXTENSION DeviceExtension
  1174. );
  1175. VOID
  1176. SCNotifyMinidriverCancel(
  1177. IN PSTREAM_REQUEST_BLOCK SRB
  1178. );
  1179. NTSTATUS
  1180. SCProcessCompletedPropertyRequest(
  1181. IN PSTREAM_REQUEST_BLOCK SRB
  1182. );
  1183. NTSTATUS
  1184. StreamClassMinidriverDeviceGetProperty
  1185. (
  1186. IN PIRP Irp,
  1187. IN PKSPROPERTY Property,
  1188. IN OUT PVOID PropertyInfo
  1189. );
  1190. NTSTATUS
  1191. StreamClassMinidriverDeviceSetProperty
  1192. (
  1193. IN PIRP Irp,
  1194. IN PKSPROPERTY Property,
  1195. IN OUT PVOID PropertyInfo
  1196. );
  1197. NTSTATUS
  1198. StreamClassMinidriverStreamGetProperty
  1199. (
  1200. IN PIRP Irp,
  1201. IN PKSPROPERTY Property,
  1202. IN OUT PVOID PropertyInfo
  1203. );
  1204. NTSTATUS
  1205. StreamClassMinidriverStreamSetProperty
  1206. (
  1207. IN PIRP Irp,
  1208. IN PKSPROPERTY Property,
  1209. IN OUT PVOID PropertyInfo
  1210. );
  1211. NTSTATUS
  1212. DriverEntry(
  1213. IN PDRIVER_OBJECT DriverObject,
  1214. IN PUNICODE_STRING RegistryPath
  1215. );
  1216. NTSTATUS
  1217. SCOpenMinidriverInstance(
  1218. IN PDEVICE_EXTENSION DeviceExtension,
  1219. OUT PFILTER_INSTANCE * ReturnedFilterInstance,
  1220. IN PSTREAM_CALLBACK_PROCEDURE Callback,
  1221. IN PIRP Irp
  1222. );
  1223. NTSTATUS
  1224. SCMinidriverDevicePropertyHandler
  1225. (
  1226. IN SRB_COMMAND Command,
  1227. IN PIRP Irp,
  1228. IN PKSPROPERTY Property,
  1229. IN OUT PVOID PropertyInfo
  1230. );
  1231. NTSTATUS
  1232. SCMinidriverStreamPropertyHandler
  1233. (
  1234. IN SRB_COMMAND Command,
  1235. IN PIRP Irp,
  1236. IN PKSPROPERTY Property,
  1237. IN OUT PVOID PropertyInfo
  1238. );
  1239. VOID
  1240. SCStartRequestOnStream(
  1241. IN PSTREAM_OBJECT StreamObject,
  1242. IN PDEVICE_EXTENSION DeviceExtension
  1243. );
  1244. NTSTATUS
  1245. StreamClassPnPAddDeviceWorker(
  1246. IN PDRIVER_OBJECT DriverObject,
  1247. IN PDEVICE_OBJECT PhysicalDeviceObject,
  1248. IN OUT PDEVICE_EXTENSION * ReturnedDeviceExtension
  1249. );
  1250. NTSTATUS
  1251. SCProcessDataTransfer(
  1252. IN PDEVICE_EXTENSION DeviceExtension,
  1253. IN PIRP Irp,
  1254. IN SRB_COMMAND Command
  1255. );
  1256. VOID
  1257. SCUpdateMinidriverProperties(
  1258. IN ULONG NumProps,
  1259. IN PKSPROPERTY_SET MinidriverProps,
  1260. IN BOOLEAN Stream
  1261. );
  1262. VOID
  1263. SCInitializeWorkItem(
  1264. IN PSTREAM_REQUEST_BLOCK SRB
  1265. );
  1266. NTSTATUS
  1267. SCInitializeCallback(
  1268. IN PSTREAM_REQUEST_BLOCK SRB
  1269. );
  1270. VOID
  1271. SCStreamInfoWorkItem(
  1272. IN PSTREAM_REQUEST_BLOCK SRB
  1273. );
  1274. NTSTATUS
  1275. SCDequeueAndDeleteSrb(
  1276. IN PSTREAM_REQUEST_BLOCK SRB
  1277. );
  1278. VOID
  1279. SCReadRegistryValues(IN PDEVICE_EXTENSION DeviceExtension,
  1280. IN PDEVICE_OBJECT PhysicalDeviceObject
  1281. );
  1282. NTSTATUS
  1283. SCGetRegistryValue(
  1284. IN HANDLE Handle,
  1285. IN PWCHAR KeyNameString,
  1286. IN ULONG KeyNameStringLength,
  1287. IN PVOID Data,
  1288. IN ULONG DataLength
  1289. );
  1290. VOID
  1291. SCInsertStreamInFilter(
  1292. IN PSTREAM_OBJECT StreamObject,
  1293. IN PDEVICE_EXTENSION DeviceExtension
  1294. );
  1295. VOID
  1296. SCReferenceDriver(
  1297. IN PDEVICE_EXTENSION DeviceExtension
  1298. );
  1299. VOID
  1300. SCDereferenceDriver(
  1301. IN PDEVICE_EXTENSION DeviceExtension
  1302. );
  1303. VOID
  1304. SCQueueSrbWorkItem(
  1305. IN PSTREAM_REQUEST_BLOCK Srb
  1306. );
  1307. VOID
  1308. SCProcessPriorityChangeRequest(
  1309. IN PCOMMON_OBJECT CommonObject,
  1310. IN PINTERRUPT_DATA SavedInterruptData,
  1311. IN PDEVICE_EXTENSION DeviceExtension
  1312. );
  1313. VOID
  1314. SCProcessTimerRequest(
  1315. IN PCOMMON_OBJECT CommonObject,
  1316. IN PINTERRUPT_DATA SavedInterruptData
  1317. );
  1318. NTSTATUS
  1319. SCPowerCallback(
  1320. IN PSTREAM_REQUEST_BLOCK SRB
  1321. );
  1322. BOOLEAN
  1323. SCCheckIfOkToPowerDown(
  1324. IN PDEVICE_EXTENSION DeviceExtension
  1325. );
  1326. NTSTATUS
  1327. SCIssueRequestToDevice(
  1328. IN PDEVICE_EXTENSION DeviceExtension,
  1329. IN PSTREAM_OBJECT StreamObject,
  1330. PSTREAM_REQUEST_BLOCK Request,
  1331. IN PVOID MinidriverRoutine,
  1332. IN PLIST_ENTRY Queue,
  1333. IN PIRP Irp
  1334. );
  1335. VOID
  1336. SCBeginSynchronizedMinidriverCallin(
  1337. IN PDEVICE_EXTENSION DeviceExtension,
  1338. IN PKIRQL Irql
  1339. );
  1340. VOID
  1341. SCBeginUnsynchronizedMinidriverCallin(
  1342. IN PDEVICE_EXTENSION DeviceExtension,
  1343. IN PKIRQL Irql
  1344. );
  1345. VOID
  1346. SCEndUnsynchronizedMinidriverDeviceCallin(
  1347. IN PDEVICE_EXTENSION DeviceExtension,
  1348. IN PKIRQL Irql
  1349. );
  1350. VOID
  1351. SCEndUnsynchronizedMinidriverStreamCallin(
  1352. IN PSTREAM_OBJECT StreamObject,
  1353. IN PKIRQL Irql
  1354. );
  1355. VOID
  1356. SCEndSynchronizedMinidriverStreamCallin(
  1357. IN PSTREAM_OBJECT StreamObject,
  1358. IN PKIRQL Irql
  1359. );
  1360. VOID
  1361. SCEndSynchronizedMinidriverDeviceCallin(
  1362. IN PDEVICE_EXTENSION DeviceExtension,
  1363. IN PKIRQL Irql
  1364. );
  1365. NTSTATUS
  1366. SCStartWorker(
  1367. IN PIRP Irp
  1368. );
  1369. NTSTATUS
  1370. SCShowIoPending(
  1371. IN PDEVICE_EXTENSION DeviceExtension,
  1372. IN PIRP Irp
  1373. );
  1374. VOID
  1375. SCWaitForOutstandingIo(
  1376. IN PDEVICE_EXTENSION DeviceExtension
  1377. );
  1378. VOID
  1379. SCCheckPoweredUp(
  1380. IN PDEVICE_EXTENSION DeviceExtension
  1381. );
  1382. VOID
  1383. SCCheckPowerDown(
  1384. IN PDEVICE_EXTENSION DeviceExtension
  1385. );
  1386. NTSTATUS
  1387. SCUninitializeCallback(
  1388. IN PSTREAM_REQUEST_BLOCK SRB
  1389. );
  1390. NTSTATUS
  1391. SCRemoveComplete(
  1392. IN PDEVICE_OBJECT DeviceObject,
  1393. IN PIRP Irp,
  1394. IN PVOID Context
  1395. );
  1396. VOID
  1397. SCRemoveCompleteWorkItem(
  1398. IN PDEVICE_EXTENSION DeviceExtension
  1399. );
  1400. VOID
  1401. SCDetachDevice(
  1402. IN PDEVICE_OBJECT Fdo,
  1403. IN PDEVICE_OBJECT Pdo
  1404. );
  1405. NTSTATUS
  1406. SCQueryWorker(
  1407. IN PDEVICE_OBJECT DeviceObject,
  1408. IN PIRP Irp
  1409. );
  1410. NTSTATUS
  1411. SCCallNextDriver(
  1412. IN PDEVICE_EXTENSION DeviceExtension,
  1413. IN PIRP Irp
  1414. );
  1415. VOID
  1416. StreamFlushIo(
  1417. IN PDEVICE_EXTENSION DeviceExtension,
  1418. IN PSTREAM_OBJECT StreamObject
  1419. );
  1420. NTSTATUS
  1421. ClockDispatchCreate(
  1422. IN PDEVICE_OBJECT DeviceObject,
  1423. IN PIRP Irp
  1424. );
  1425. NTSTATUS
  1426. SCOpenMasterCallback(
  1427. IN PSTREAM_REQUEST_BLOCK SRB
  1428. );
  1429. NTSTATUS
  1430. SCSetMasterClock(
  1431. IN PIRP Irp,
  1432. IN PKSPROPERTY Property,
  1433. IN OUT PHANDLE ClockHandle
  1434. );
  1435. NTSTATUS
  1436. SCClockGetTime(
  1437. IN PIRP Irp,
  1438. IN PKSPROPERTY Property,
  1439. IN OUT PULONGLONG StreamTime
  1440. );
  1441. NTSTATUS
  1442. SCClockGetPhysicalTime(
  1443. IN PIRP Irp,
  1444. IN PKSPROPERTY Property,
  1445. IN OUT PULONGLONG PhysicalTime
  1446. );
  1447. NTSTATUS
  1448. SCClockGetSynchronizedTime(
  1449. IN PIRP Irp,
  1450. IN PKSPROPERTY Property,
  1451. IN OUT PKSCORRELATED_TIME SyncTime
  1452. );
  1453. NTSTATUS
  1454. SCClockGetFunctionTable(
  1455. IN PIRP Irp,
  1456. IN PKSPROPERTY Property,
  1457. IN OUT PKSCLOCK_FUNCTIONTABLE FunctionTable
  1458. );
  1459. NTSTATUS
  1460. ClockDispatchClose(
  1461. IN PDEVICE_OBJECT DeviceObject,
  1462. IN PIRP Irp
  1463. );
  1464. ULONGLONG FASTCALL
  1465. SCGetSynchronizedTime(
  1466. IN PFILE_OBJECT FileObject,
  1467. IN PULONGLONG SystemTime
  1468. );
  1469. ULONGLONG FASTCALL
  1470. SCGetPhysicalTime(
  1471. IN PFILE_OBJECT FileObject
  1472. );
  1473. ULONGLONG
  1474. SCGetStreamTime(
  1475. IN PFILE_OBJECT FileObject
  1476. );
  1477. VOID
  1478. SCMinidriverTimeFunction(
  1479. IN PHW_TIME_CONTEXT TimeContext
  1480. );
  1481. NTSTATUS
  1482. ClockDispatchIoControl(
  1483. IN PDEVICE_OBJECT DeviceObject,
  1484. IN PIRP Irp
  1485. );
  1486. VOID
  1487. StreamClassQueryMasterClock(
  1488. IN PHW_STREAM_OBJECT HwStreamObject,
  1489. IN HANDLE MasterClockHandle,
  1490. IN TIME_FUNCTION TimeFunction,
  1491. IN PHW_QUERY_CLOCK_ROUTINE ClockCallbackRoutine
  1492. );
  1493. NTSTATUS
  1494. SCSendUnknownCommand(
  1495. IN PIRP Irp,
  1496. IN PDEVICE_EXTENSION DeviceExtension,
  1497. IN PVOID Callback,
  1498. OUT PBOOLEAN RequestIssued
  1499. );
  1500. NTSTATUS
  1501. SCPNPQueryCallback(
  1502. IN PSTREAM_REQUEST_BLOCK SRB
  1503. );
  1504. NTSTATUS
  1505. SCUnknownPNPCallback(
  1506. IN PSTREAM_REQUEST_BLOCK SRB
  1507. );
  1508. NTSTATUS
  1509. SCUnknownPowerCallback(
  1510. IN PSTREAM_REQUEST_BLOCK SRB
  1511. );
  1512. BOOLEAN
  1513. SCMapMemoryAddress(PACCESS_RANGE AccessRanges,
  1514. PHYSICAL_ADDRESS TranslatedAddress,
  1515. PPORT_CONFIGURATION_INFORMATION ConfigInfo,
  1516. PDEVICE_EXTENSION DeviceExtension,
  1517. PCM_RESOURCE_LIST ResourceList,
  1518. PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialResourceDescriptor
  1519. );
  1520. VOID
  1521. SCUpdatePersistedProperties(IN PSTREAM_OBJECT StreamObject,
  1522. IN PDEVICE_EXTENSION DeviceExtension,
  1523. IN PFILE_OBJECT FileObject
  1524. );
  1525. VOID
  1526. SCCreateSymbolicLinks(
  1527. IN PDEVICE_EXTENSION DeviceExtension
  1528. );
  1529. VOID
  1530. SCDestroySymbolicLinks(
  1531. IN PDEVICE_EXTENSION DeviceExtension
  1532. );
  1533. NTSTATUS
  1534. SCSynchCompletionRoutine(
  1535. IN PDEVICE_OBJECT DeviceObject,
  1536. IN PIRP Irp,
  1537. IN PKEVENT Event
  1538. );
  1539. VOID
  1540. SCSignalSRBEvent(
  1541. IN PSTREAM_REQUEST_BLOCK Srb
  1542. );
  1543. NTSTATUS
  1544. SCFilterTopologyHandler(
  1545. IN PIRP Irp,
  1546. IN PKSPROPERTY Property,
  1547. IN OUT PVOID Data);
  1548. NTSTATUS
  1549. SCStreamProposeNewFormat
  1550. (
  1551. IN PIRP Irp,
  1552. IN PKSPROPERTY Property,
  1553. IN OUT PKSDATAFORMAT Format
  1554. );
  1555. NTSTATUS
  1556. SCGetMasterClock(
  1557. IN PIRP Irp,
  1558. IN PKSPROPERTY Property,
  1559. IN OUT PHANDLE ClockHandle
  1560. );
  1561. NTSTATUS
  1562. SCCloseClockCallback(
  1563. IN PSTREAM_REQUEST_BLOCK SRB
  1564. );
  1565. NTSTATUS
  1566. SCStreamDeviceRate
  1567. (
  1568. IN PIRP Irp,
  1569. IN PKSPROPERTY Property,
  1570. IN OUT PKSRATE DeviceRate
  1571. );
  1572. NTSTATUS
  1573. SCStreamDeviceRateCapability
  1574. (
  1575. IN PIRP Irp,
  1576. IN PKSRATE_CAPABILITY RateCap,
  1577. IN OUT PKSRATE DeviceRate
  1578. );
  1579. NTSTATUS
  1580. SCFilterPinIntersectionHandler(
  1581. IN PIRP Irp,
  1582. IN PKSP_PIN Pin,
  1583. OUT PVOID Data
  1584. );
  1585. NTSTATUS
  1586. SCIntersectHandler(
  1587. IN PIRP Irp,
  1588. IN PKSP_PIN Pin,
  1589. IN PKSDATARANGE DataRange,
  1590. OUT PVOID Data
  1591. );
  1592. NTSTATUS
  1593. SCDataIntersectionCallback(
  1594. IN PSTREAM_REQUEST_BLOCK SRB
  1595. );
  1596. NTSTATUS
  1597. SCQueryCapabilities(
  1598. IN PDEVICE_OBJECT PdoDeviceObject,
  1599. IN PDEVICE_CAPABILITIES DeviceCapabilities
  1600. );
  1601. NTSTATUS
  1602. SCSynchPowerCompletionRoutine(
  1603. IN PDEVICE_OBJECT DeviceObject,
  1604. IN UCHAR MinorFunction,
  1605. IN POWER_STATE DeviceState,
  1606. IN PVOID Context,
  1607. IN PIO_STATUS_BLOCK IoStatus
  1608. );
  1609. NTSTATUS
  1610. SCGetStreamDeviceState
  1611. (
  1612. IN PIRP Irp,
  1613. IN PKSPROPERTY Property,
  1614. IN OUT PKSSTATE DeviceState
  1615. );
  1616. NTSTATUS
  1617. SCCreateChildPdo(
  1618. IN PVOID PnpId,
  1619. IN PDEVICE_OBJECT DeviceObject,
  1620. IN ULONG InstanceNumber
  1621. );
  1622. NTSTATUS
  1623. SCEnumerateChildren(
  1624. IN PDEVICE_OBJECT DeviceObject,
  1625. IN PIRP Irp
  1626. );
  1627. NTSTATUS
  1628. StreamClassEnumPnp(
  1629. IN PDEVICE_OBJECT DeviceObject,
  1630. IN PIRP Irp
  1631. );
  1632. NTSTATUS
  1633. StreamClassEnumPower(
  1634. IN PDEVICE_OBJECT DeviceObject,
  1635. IN PIRP Irp
  1636. );
  1637. NTSTATUS
  1638. SCEnumGetCaps(
  1639. IN PCHILD_DEVICE_EXTENSION DeviceExtension,
  1640. OUT PDEVICE_CAPABILITIES Capabilities
  1641. );
  1642. NTSTATUS
  1643. SCQueryEnumId(
  1644. IN PDEVICE_OBJECT DeviceObject,
  1645. IN BUS_QUERY_ID_TYPE BusQueryIdType,
  1646. IN OUT PWSTR * BusQueryId
  1647. );
  1648. NTSTATUS
  1649. AllocatorDispatchCreate(
  1650. IN PDEVICE_OBJECT DeviceObject,
  1651. IN PIRP Irp
  1652. );
  1653. NTSTATUS
  1654. StreamClassEnableEventHandler(
  1655. IN PIRP Irp,
  1656. IN PKSEVENTDATA EventData,
  1657. IN PKSEVENT_ENTRY EventEntry
  1658. );
  1659. VOID
  1660. StreamClassDisableEventHandler(
  1661. IN PFILE_OBJECT FileObject,
  1662. IN PKSEVENT_ENTRY EventEntry
  1663. );
  1664. VOID
  1665. SCUpdateMinidriverEvents(
  1666. IN ULONG NumEvents,
  1667. IN PKSEVENT_SET MinidriverEvents,
  1668. IN BOOLEAN Stream
  1669. );
  1670. NTSTATUS
  1671. SCEnableEventSynchronized(
  1672. IN PVOID ServiceContext
  1673. );
  1674. VOID
  1675. SCGetDeadListSynchronized(
  1676. IN PLIST_ENTRY NewListEntry
  1677. );
  1678. VOID
  1679. SCFreeDeadEvents(
  1680. IN PDEVICE_EXTENSION DeviceExtension
  1681. );
  1682. NTSTATUS
  1683. StreamClassForwardUnsupported(
  1684. IN PDEVICE_OBJECT DeviceObject,
  1685. IN PIRP Irp
  1686. );
  1687. NTSTATUS
  1688. SCStreamSetFormat
  1689. (
  1690. IN PIRP Irp,
  1691. IN PKSPROPERTY Property,
  1692. IN OUT PKSDATAFORMAT Format
  1693. );
  1694. VOID
  1695. SCInsertStreamInfo(
  1696. IN PDEVICE_EXTENSION DeviceExtension,
  1697. IN PKSPIN_DESCRIPTOR PinDescs,
  1698. IN PHW_STREAM_DESCRIPTOR StreamDescriptor,
  1699. IN ULONG NumberOfPins
  1700. );
  1701. VOID
  1702. SCRescanStreams(
  1703. IN PDEVICE_EXTENSION DeviceExtension
  1704. );
  1705. NTSTATUS
  1706. SCGetStreamHeaderSize(
  1707. IN PIRP Irp,
  1708. IN PKSPROPERTY Property,
  1709. IN OUT PULONG StreamHeaderSize
  1710. );
  1711. VOID
  1712. SCInterlockedRemoveEntryList(
  1713. PDEVICE_EXTENSION DeviceExtension,
  1714. PLIST_ENTRY List
  1715. );
  1716. VOID
  1717. SCInsertFiltersInDevice(
  1718. IN PFILTER_INSTANCE FilterInstance,
  1719. IN PDEVICE_EXTENSION DeviceExtension
  1720. );
  1721. NTSTATUS
  1722. SCBustedSynchPowerCompletionRoutine(
  1723. IN PDEVICE_OBJECT DeviceObject,
  1724. IN UCHAR MinorFunction,
  1725. IN POWER_STATE DeviceState,
  1726. IN PVOID Context,
  1727. IN PIO_STATUS_BLOCK IoStatus
  1728. );
  1729. BOOLEAN
  1730. SCCheckIfStreamsRunning(
  1731. IN PFILTER_INSTANCE FilterInstance
  1732. );
  1733. #if DBG
  1734. BOOLEAN
  1735. SCDebugKeSynchronizeExecution(
  1736. IN PKINTERRUPT Interrupt,
  1737. IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine,
  1738. IN PVOID SynchronizeContext
  1739. );
  1740. #endif // DEBUG
  1741. NTSTATUS
  1742. SCEnableDeviceEventSynchronized(
  1743. IN PVOID ServiceContext
  1744. );
  1745. NTSTATUS
  1746. StreamClassEnableDeviceEventHandler(
  1747. IN PIRP Irp,
  1748. IN PKSEVENTDATA EventData,
  1749. IN PKSEVENT_ENTRY EventEntry
  1750. );
  1751. VOID
  1752. StreamClassDisableDeviceEventHandler(
  1753. IN PFILE_OBJECT FileObject,
  1754. IN PKSEVENT_ENTRY EventEntry
  1755. );
  1756. VOID
  1757. SCCallBackSrb(
  1758. IN PSTREAM_REQUEST_BLOCK Srb,
  1759. IN PDEVICE_EXTENSION DeviceExtension
  1760. );
  1761. NTSTATUS
  1762. DllUnload(
  1763. VOID
  1764. );
  1765. VOID
  1766. SCPowerCompletionWorker(
  1767. IN PIRP SystemIrp
  1768. );
  1769. VOID
  1770. SCSendSurpriseNotification(
  1771. IN PDEVICE_EXTENSION DeviceExtension,
  1772. IN PIRP Irp
  1773. );
  1774. #if DBG
  1775. VOID
  1776. SCDebugPriorityWorkItem(
  1777. IN PDEBUG_WORK_ITEM WorkItemStruct
  1778. );
  1779. #endif
  1780. PKSPROPERTY_SET
  1781. SCCopyMinidriverProperties(
  1782. IN ULONG NumProps,
  1783. IN PKSPROPERTY_SET MinidriverProps
  1784. );
  1785. PKSEVENT_SET
  1786. SCCopyMinidriverEvents(
  1787. IN ULONG NumEvents,
  1788. IN PKSEVENT_SET MinidriverEvents
  1789. );
  1790. #ifdef ENABLE_STREAM_CLASS_AS_ALLOCATOR
  1791. NTSTATUS
  1792. SCStreamAllocatorFraming(
  1793. IN PIRP Irp,
  1794. IN PKSPROPERTY Property,
  1795. IN OUT PKSALLOCATOR_FRAMING Framing
  1796. );
  1797. NTSTATUS
  1798. SCStreamAllocator(
  1799. IN PIRP Irp,
  1800. IN PKSPROPERTY Property,
  1801. IN OUT PHANDLE AllocatorHandle
  1802. );
  1803. NTSTATUS
  1804. IoCompletionRoutine(
  1805. PDEVICE_OBJECT DeviceObject,
  1806. PIRP Irp,
  1807. PVOID Context
  1808. );
  1809. NTSTATUS
  1810. CleanupTransfer(
  1811. IN PFILTER_INSTANCE FilterInstance,
  1812. IN PSTREAM_OBJECT StreamObject
  1813. );
  1814. NTSTATUS
  1815. EndTransfer(
  1816. IN PFILTER_INSTANCE FilterInstance,
  1817. IN PSTREAM_OBJECT StreamObject
  1818. );
  1819. NTSTATUS
  1820. BeginTransfer(
  1821. IN PFILTER_INSTANCE FilterInstance,
  1822. IN PSTREAM_OBJECT StreamObject
  1823. );
  1824. NTSTATUS
  1825. PrepareTransfer(
  1826. IN PFILTER_INSTANCE FilterInstance,
  1827. IN PSTREAM_OBJECT StreamObject
  1828. );
  1829. NTSTATUS
  1830. PinCreateHandler(
  1831. IN PIRP Irp,
  1832. IN PSTREAM_OBJECT StreamObject
  1833. );
  1834. NTSTATUS
  1835. AllocateFrame(
  1836. PFILE_OBJECT Allocator,
  1837. PVOID *Frame
  1838. );
  1839. NTSTATUS
  1840. FreeFrame(
  1841. PFILE_OBJECT Allocator,
  1842. PVOID Frame
  1843. );
  1844. #endif //ENABLE_STREAM_CLASS_AS_ALLOCATOR
  1845. #ifdef ENABLE_KS_METHODS
  1846. NTSTATUS
  1847. SCProcessCompletedMethodRequest(
  1848. IN PSTREAM_REQUEST_BLOCK SRB
  1849. );
  1850. NTSTATUS
  1851. StreamClassMinidriverStreamMethod
  1852. (
  1853. IN PIRP Irp,
  1854. IN PKSMETHOD Method,
  1855. IN OUT PVOID MethodInfo
  1856. );
  1857. NTSTATUS
  1858. StreamClassMinidriverDeviceMethod
  1859. (
  1860. IN PIRP Irp,
  1861. IN PKSMETHOD Method,
  1862. IN OUT PVOID MethodInfo
  1863. );
  1864. NTSTATUS
  1865. SCMinidriverStreamMethodHandler(
  1866. IN SRB_COMMAND Command,
  1867. IN PIRP Irp,
  1868. IN PKSMETHOD Method,
  1869. IN OUT PVOID MethodInfo
  1870. );
  1871. NTSTATUS
  1872. SCMinidriverDeviceMethodHandler(
  1873. IN SRB_COMMAND Command,
  1874. IN PIRP Irp,
  1875. IN PKSMETHOD Method,
  1876. IN OUT PVOID MethodInfo
  1877. );
  1878. VOID
  1879. SCUpdateMinidriverMethods(
  1880. IN ULONG NumMethods,
  1881. IN PKSMETHOD_SET MinidriverMethods,
  1882. IN BOOLEAN Stream
  1883. );
  1884. PKSMETHOD_SET
  1885. SCCopyMinidriverMethods(
  1886. IN ULONG NumMethods,
  1887. IN PKSMETHOD_SET MinidriverMethods
  1888. );
  1889. NTSTATUS
  1890. SCStreamMethodHandler(
  1891. IN PIRP Irp,
  1892. IN PKSMETHOD Method,
  1893. IN OUT PVOID MethodInfo
  1894. );
  1895. NTSTATUS
  1896. SCStreamAllocatorMethodHandler(
  1897. IN PIRP Irp,
  1898. IN PKSMETHOD Method,
  1899. IN OUT PVOID MethodInfo
  1900. );
  1901. #endif
  1902. #if ENABLE_MULTIPLE_FILTER_TYPES
  1903. NTSTATUS
  1904. SciOnFilterStreamDescriptor(
  1905. PFILTER_INSTANCE FilterInstance,
  1906. PHW_STREAM_DESCRIPTOR StreamDescriptor);
  1907. VOID
  1908. SciInsertFilterStreamInfo(
  1909. IN PFILTER_INSTANCE FilterInstance,
  1910. IN PKSPIN_DESCRIPTOR PinDescs,
  1911. IN ULONG NumberOfPins);
  1912. NTSTATUS
  1913. SciFreeFilterInstance(
  1914. PFILTER_INSTANCE pFilterInstance
  1915. );
  1916. NTSTATUS
  1917. SciQuerySystemPowerHiberCallback(
  1918. IN PSTREAM_REQUEST_BLOCK SRB
  1919. );
  1920. #endif // ENABLE_MULTIPLE_FILTER_TYPES
  1921. #define SCLOG_FLAGS_CLOCK 0x00000001
  1922. #define SCLOG_FLAGS_PNP 0x00000002
  1923. #define SCLOG_FLAGS_PRINT 0x80000000
  1924. #if (DBG) && !defined(_WIN64)
  1925. NTSTATUS SCLog( ULONG ulTag, ULONG ulArg1, ULONG ulArg2, ULONG ulArg3 );
  1926. NTSTATUS SCLogWithTime( ULONG ulTag, ULONG ulArg1, ULONG ulArg2 );
  1927. #define SCLOG( ulTag, Arg1, Arg2, Arg3 ) SCLog( ulTag, (ULONG)Arg1, (ULONG)Arg2, (ULONG)Arg3 )
  1928. #define SCLOGWITHTIME( ulTag, Arg1, Arg2 ) SCLogWithTime( ulTag, Arg1, Arg2 )
  1929. #else
  1930. #define SCLOG( ulTag, Arg1, Arg2, Arg3 )
  1931. #define SCLOGWITHTIME( ulTag, Arg1, Arg2 )
  1932. #endif
  1933. #endif // #ifndef _STREAMCLASS_H