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.

1463 lines
33 KiB

  1. /*++
  2. Copyright (c) 1989-2000 Microsoft Corporation
  3. Module Name:
  4. iomgr.h
  5. Abstract:
  6. This module contains the private structure definitions and APIs used by
  7. the NT I/O system.
  8. Author:
  9. Nar Ganapathy (narg) 1-Jan-1999
  10. Revision History:
  11. --*/
  12. #ifndef _IOMGR_
  13. #define _IOMGR_
  14. //
  15. // Define Information fields values for the return value from popups when a
  16. // volume mount is in progress but failed.
  17. //
  18. #define IOP_ABORT 1
  19. #include "ntos.h"
  20. #include "ntdddisk.h"
  21. #include "ntddscsi.h"
  22. #include "mountmgr.h"
  23. #include "ntiolog.h"
  24. #include "ntiologc.h"
  25. #include "ntseapi.h"
  26. #include "fsrtl.h"
  27. #include "zwapi.h"
  28. #include "stdio.h"
  29. #include "stdlib.h"
  30. #include "string.h"
  31. #include "safeboot.h"
  32. #include "ioverifier.h"
  33. #include "iopcmn.h"
  34. #ifdef POOL_TAGGING
  35. #undef ExAllocatePool
  36. #define ExAllocatePool(a,b) ExAllocatePoolWithTag(a,b,' oI')
  37. #undef ExAllocatePoolWithQuota
  38. #define ExAllocatePoolWithQuota(a,b) ExAllocatePoolWithQuotaTag(a,b,' oI')
  39. #endif
  40. typedef struct _DUMP_CONTROL_BLOCK DUMP_CONTROL_BLOCK, *PDUMP_CONTROL_BLOCK;
  41. //
  42. // Define the type for entries placed on the driver reinitialization queue.
  43. // These entries are entered onto the tail when the driver requests that
  44. // it be reinitialized, and removed from the head by the code that actually
  45. // performs the reinitialization.
  46. //
  47. typedef struct _REINIT_PACKET {
  48. LIST_ENTRY ListEntry;
  49. PDRIVER_OBJECT DriverObject;
  50. PDRIVER_REINITIALIZE DriverReinitializationRoutine;
  51. PVOID Context;
  52. } REINIT_PACKET, *PREINIT_PACKET;
  53. //
  54. // Define transfer types for process counters.
  55. //
  56. typedef enum _TRANSFER_TYPE {
  57. ReadTransfer,
  58. WriteTransfer,
  59. OtherTransfer
  60. } TRANSFER_TYPE, *PTRANSFER_TYPE;
  61. //
  62. // Define the maximum amount of memory that can be allocated for all
  63. // outstanding error log packets.
  64. //
  65. #define IOP_MAXIMUM_LOG_ALLOCATION PAGE_SIZE
  66. //
  67. // Define an error log entry.
  68. //
  69. typedef struct _ERROR_LOG_ENTRY {
  70. USHORT Type;
  71. USHORT Size;
  72. LIST_ENTRY ListEntry;
  73. PDEVICE_OBJECT DeviceObject;
  74. PDRIVER_OBJECT DriverObject;
  75. LARGE_INTEGER TimeStamp;
  76. } ERROR_LOG_ENTRY, *PERROR_LOG_ENTRY;
  77. //
  78. // Define both the global IOP_HARD_ERROR_QUEUE and IOP_HARD_ERROR_PACKET
  79. // structures. Also set the maximum number of outstanding hard error
  80. // packets allowed.
  81. //
  82. typedef struct _IOP_HARD_ERROR_QUEUE {
  83. WORK_QUEUE_ITEM ExWorkItem;
  84. LIST_ENTRY WorkQueue;
  85. KSPIN_LOCK WorkQueueSpinLock;
  86. KSEMAPHORE WorkQueueSemaphore;
  87. BOOLEAN ThreadStarted;
  88. ULONG NumPendingApcPopups;
  89. } IOP_HARD_ERROR_QUEUE, *PIOP_HARD_ERROR_QUEUE;
  90. typedef struct _IOP_HARD_ERROR_PACKET {
  91. LIST_ENTRY WorkQueueLinks;
  92. NTSTATUS ErrorStatus;
  93. UNICODE_STRING String;
  94. } IOP_HARD_ERROR_PACKET, *PIOP_HARD_ERROR_PACKET;
  95. typedef struct _IOP_APC_HARD_ERROR_PACKET {
  96. WORK_QUEUE_ITEM Item;
  97. PIRP Irp;
  98. PVPB Vpb;
  99. PDEVICE_OBJECT RealDeviceObject;
  100. } IOP_APC_HARD_ERROR_PACKET, *PIOP_APC_HARD_ERROR_PACKET;
  101. typedef
  102. NTSTATUS
  103. (FASTCALL *PIO_CALL_DRIVER) (
  104. IN PDEVICE_OBJECT DeviceObject,
  105. IN PIRP Irp
  106. );
  107. typedef
  108. VOID
  109. (FASTCALL *PIO_COMPLETE_REQUEST) (
  110. IN PIRP Irp,
  111. IN CCHAR PriorityBoost
  112. );
  113. typedef
  114. VOID
  115. (*PIO_FREE_IRP) (
  116. IN struct _IRP *Irp
  117. );
  118. typedef
  119. PIRP
  120. (*PIO_ALLOCATE_IRP) (
  121. IN CCHAR StackSize,
  122. IN BOOLEAN ChargeQuota
  123. );
  124. extern IOP_HARD_ERROR_QUEUE IopHardError;
  125. extern PIOP_HARD_ERROR_PACKET IopCurrentHardError;
  126. #define IOP_MAXIMUM_OUTSTANDING_HARD_ERRORS 25
  127. typedef struct _IO_WORKITEM {
  128. WORK_QUEUE_ITEM WorkItem;
  129. PIO_WORKITEM_ROUTINE Routine;
  130. PDEVICE_OBJECT DeviceObject;
  131. PVOID Context;
  132. #if DBG
  133. ULONG Size;
  134. #endif
  135. } IO_WORKITEM;
  136. //
  137. // Define the global data for the error logger and I/O system.
  138. //
  139. extern WORK_QUEUE_ITEM IopErrorLogWorkItem;
  140. extern BOOLEAN IopErrorLogPortPending;
  141. extern BOOLEAN IopErrorLogDisabledThisBoot;
  142. extern KSPIN_LOCK IopErrorLogLock;
  143. extern LIST_ENTRY IopErrorLogListHead;
  144. extern ULONG IopErrorLogAllocation;
  145. extern KSPIN_LOCK IopErrorLogAllocationLock;
  146. extern const GENERIC_MAPPING IopFileMapping;
  147. //
  148. // Define a dummy file object for use on stack for fast open operations.
  149. //
  150. typedef struct _DUMMY_FILE_OBJECT {
  151. OBJECT_HEADER ObjectHeader;
  152. CHAR FileObjectBody[ sizeof( FILE_OBJECT ) ];
  153. } DUMMY_FILE_OBJECT, *PDUMMY_FILE_OBJECT;
  154. //
  155. // Define the structures private to the I/O system.
  156. //
  157. #define OPEN_PACKET_PATTERN 0xbeaa0251
  158. //
  159. // Define an Open Packet (OP). An OP is used to communicate information
  160. // between the NtCreateFile service executing in the context of the caller
  161. // and the device object parse routine. It is the parse routine who actually
  162. // creates the file object for the file.
  163. //
  164. typedef struct _OPEN_PACKET {
  165. CSHORT Type;
  166. CSHORT Size;
  167. PFILE_OBJECT FileObject;
  168. NTSTATUS FinalStatus;
  169. ULONG_PTR Information;
  170. ULONG ParseCheck;
  171. PFILE_OBJECT RelatedFileObject;
  172. //
  173. // The following are the open-specific parameters. Notice that the desired
  174. // access field is passed through to the parse routine via the object
  175. // management architecture, so it does not need to be repeated here. Also
  176. // note that the same is true for the file name.
  177. //
  178. LARGE_INTEGER AllocationSize;
  179. ULONG CreateOptions;
  180. USHORT FileAttributes;
  181. USHORT ShareAccess;
  182. PVOID EaBuffer;
  183. ULONG EaLength;
  184. ULONG Options;
  185. ULONG Disposition;
  186. //
  187. // The following is used when performing a fast query during open to get
  188. // back the file attributes for a file.
  189. //
  190. PFILE_BASIC_INFORMATION BasicInformation;
  191. //
  192. // The following is used when performing a fast network query during open
  193. // to get back the network file attributes for a file.
  194. //
  195. PFILE_NETWORK_OPEN_INFORMATION NetworkInformation;
  196. //
  197. // The type of file to create.
  198. //
  199. CREATE_FILE_TYPE CreateFileType;
  200. //
  201. // The following pointer provides a way of passing the parameters
  202. // specific to the file type of the file being created to the parse
  203. // routine.
  204. //
  205. PVOID ExtraCreateParameters;
  206. //
  207. // The following is used to indicate that an open of a device has been
  208. // performed and the access check for the device has already been done,
  209. // but because of a reparse, the I/O system has been called again for
  210. // the same device. Since the access check has already been made, the
  211. // state cannot handle being called again (access was already granted)
  212. // and it need not anyway since the check has already been made.
  213. //
  214. BOOLEAN Override;
  215. //
  216. // The following is used to indicate that a file is being opened for the
  217. // sole purpose of querying its attributes. This causes a considerable
  218. // number of shortcuts to be taken in the parse, query, and close paths.
  219. //
  220. BOOLEAN QueryOnly;
  221. //
  222. // The following is used to indicate that a file is being opened for the
  223. // sole purpose of deleting it. This causes a considerable number of
  224. // shortcurs to be taken in the parse and close paths.
  225. //
  226. BOOLEAN DeleteOnly;
  227. //
  228. // The following is used to indicate that a file being opened for a query
  229. // only is being opened to query its network attributes rather than just
  230. // its FAT file attributes.
  231. //
  232. BOOLEAN FullAttributes;
  233. //
  234. // The following pointer is used when a fast open operation for a fast
  235. // delete or fast query attributes call is being made rather than a
  236. // general file open. The dummy file object is actually stored on the
  237. // the caller's stack rather than allocated pool to speed things up.
  238. //
  239. PDUMMY_FILE_OBJECT LocalFileObject;
  240. //
  241. // The following is used to indicate we passed through a mount point while
  242. // parsing the filename. We use this to do an extra check on the device type
  243. // for the final file
  244. //
  245. BOOLEAN TraversedMountPoint;
  246. //
  247. // Device object where the create should start if present on the stack
  248. // Applicable for kernel opens only.
  249. //
  250. ULONG InternalFlags; // Passed from IopCreateFile
  251. PDEVICE_OBJECT TopDeviceObjectHint;
  252. } OPEN_PACKET, *POPEN_PACKET;
  253. //
  254. // Define a Load Packet (LDP). An LDP is used to communicate load and unload
  255. // driver information between the appropriate system services and the routine
  256. // that actually performs the work. This is implemented using a packet
  257. // because various drivers need to be initialized in the context of THE
  258. // system process because they create threads within its context which open
  259. // handles to objects that henceforth are only valid in the context of that
  260. // process.
  261. //
  262. typedef struct _LOAD_PACKET {
  263. WORK_QUEUE_ITEM WorkQueueItem;
  264. KEVENT Event;
  265. PDRIVER_OBJECT DriverObject;
  266. PUNICODE_STRING DriverServiceName;
  267. NTSTATUS FinalStatus;
  268. } LOAD_PACKET, *PLOAD_PACKET;
  269. //
  270. // Define a Link Tracking Packet. A link tracking packet is used to open the
  271. // user-mode link tracking service's LPC port so that information about objects
  272. // which have been moved can be tracked.
  273. //
  274. typedef struct _LINK_TRACKING_PACKET {
  275. WORK_QUEUE_ITEM WorkQueueItem;
  276. KEVENT Event;
  277. NTSTATUS FinalStatus;
  278. } LINK_TRACKING_PACKET, *PLINK_TRACKING_PACKET;
  279. //
  280. // Define the type for entries placed on the driver shutdown notification queue.
  281. // These entries represent those drivers that would like to be notified that the
  282. // system is begin shutdown before it actually goes down.
  283. //
  284. typedef struct _SHUTDOWN_PACKET {
  285. LIST_ENTRY ListEntry;
  286. PDEVICE_OBJECT DeviceObject;
  287. } SHUTDOWN_PACKET, *PSHUTDOWN_PACKET;
  288. //
  289. // Define the type for entries placed on the file system registration change
  290. // notification queue.
  291. //
  292. typedef struct _NOTIFICATION_PACKET {
  293. LIST_ENTRY ListEntry;
  294. PDRIVER_OBJECT DriverObject;
  295. PDRIVER_FS_NOTIFICATION NotificationRoutine;
  296. } NOTIFICATION_PACKET, *PNOTIFICATION_PACKET;
  297. //
  298. // Define I/O completion packet types.
  299. //
  300. typedef enum _COMPLETION_PACKET_TYPE {
  301. IopCompletionPacketIrp,
  302. IopCompletionPacketMini,
  303. IopCompletionPacketQuota
  304. } COMPLETION_PACKET_TYPE, *PCOMPLETION_PACKET_TYPE;
  305. //
  306. // Define the type for completion packets inserted onto completion ports when
  307. // there is no full I/O request packet that was used to perform the I/O
  308. // operation. This occurs when the fast I/O path is used, and when the user
  309. // directly inserts a completion message.
  310. //
  311. typedef struct _IOP_MINI_COMPLETION_PACKET {
  312. //
  313. // The following unnamed structure must be exactly identical
  314. // to the unnamed structure used in the IRP overlay section used
  315. // for completion queue entries.
  316. //
  317. struct {
  318. //
  319. // List entry - used to queue the packet to completion queue, among
  320. // others.
  321. //
  322. LIST_ENTRY ListEntry;
  323. union {
  324. //
  325. // Current stack location - contains a pointer to the current
  326. // IO_STACK_LOCATION structure in the IRP stack. This field
  327. // should never be directly accessed by drivers. They should
  328. // use the standard functions.
  329. //
  330. struct _IO_STACK_LOCATION *CurrentStackLocation;
  331. //
  332. // Minipacket type.
  333. //
  334. ULONG PacketType;
  335. };
  336. };
  337. PVOID KeyContext;
  338. PVOID ApcContext;
  339. NTSTATUS IoStatus;
  340. ULONG_PTR IoStatusInformation;
  341. } IOP_MINI_COMPLETION_PACKET, *PIOP_MINI_COMPLETION_PACKET;
  342. typedef struct _IO_UNLOAD_SAFE_COMPLETION_CONTEXT {
  343. PDEVICE_OBJECT DeviceObject;
  344. PVOID Context;
  345. PIO_COMPLETION_ROUTINE CompletionRoutine;
  346. } IO_UNLOAD_SAFE_COMPLETION_CONTEXT, *PIO_UNLOAD_SAFE_COMPLETION_CONTEXT;
  347. typedef struct _IOP_RESERVE_IRP_ALLOCATOR {
  348. PIRP ReserveIrp;
  349. LONG IrpAllocated;
  350. KEVENT Event;
  351. CCHAR ReserveIrpStackSize;
  352. } IOP_RESERVE_IRP_ALLOCATOR, *PIOP_RESERVE_IRP_ALLOCATOR;
  353. //
  354. // This structure is the extension to a fileobject if the flag
  355. // FO_FILE_OBJECT_HAS_EXTENSION is set in the fileobject.
  356. //
  357. typedef struct _IOP_FILE_OBJECT_EXTENSION {
  358. ULONG FileObjectExtensionFlags;
  359. PDEVICE_OBJECT TopDeviceObjectHint;
  360. PVOID FilterContext; // Pointer where filter keeps its context
  361. } IOP_FILE_OBJECT_EXTENSION, *PIOP_FILE_OBJECT_EXTENSION;
  362. //
  363. // Structure to bookkeep stack profiler.
  364. //
  365. #define MAX_LOOKASIDE_IRP_STACK_COUNT 20 // Highest value for a lookaside stack count
  366. typedef struct _IOP_IRP_STACK_PROFILER {
  367. ULONG Profile[MAX_LOOKASIDE_IRP_STACK_COUNT];
  368. KTIMER Timer;
  369. KDPC Dpc;
  370. ULONG Flags;
  371. ULONG TriggerCount;
  372. ULONG ProfileDuration;
  373. } IOP_IRP_STACK_PROFILER, *PIOP_IRP_STACK_PROFILER;
  374. #define IOP_CREATE_USE_TOP_DEVICE_OBJECT_HINT 0x1 // Define for internal flags to IopCreateFile
  375. #define IOP_CREATE_IGNORE_SHARE_ACCESS_CHECK 0x2
  376. // Extension Flag definitions.
  377. #define FO_EXTENSION_IGNORE_SHARE_ACCESS_CHECK 0x1 // Ignore share access check.
  378. //
  379. // Define the global data for the I/O system.
  380. //
  381. #define IOP_FIXED_SIZE_MDL_PFNS 0x17
  382. #define MAX_RESERVE_IRP_STACK_SIZE 20 // Define 20 as the number of stacks needed for the reserve IRP
  383. #define IOP_PROFILE_TIME_PERIOD 60 // 60 seconds
  384. #define NUM_SAMPLE_IRPS 2000
  385. #define MIN_IRP_THRESHOLD 400 // At least 20 % should be allocated from a given stack location
  386. //
  387. // Define the default number of I/O stack locations a large IRP should
  388. // have if not specified by the registry.
  389. //
  390. #define DEFAULT_LARGE_IRP_LOCATIONS 8
  391. #define BASE_STACK_COUNT DEFAULT_LARGE_IRP_LOCATIONS
  392. //
  393. // Defines for IopIrpAllocatorFlags.
  394. //
  395. #define IOP_ENABLE_AUTO_SIZING 0x1
  396. #define IOP_PROFILE_STACK_COUNT 0x2
  397. #define IOP_PROFILE_DURATION 1 // 1*60 seconds
  398. #define IOP_PROFILE_TRIGGER_INTERVAL 10 // 10*60 seconds
  399. extern ERESOURCE IopDatabaseResource;
  400. extern ERESOURCE IopSecurityResource;
  401. extern ERESOURCE IopCrashDumpLock;
  402. extern LIST_ENTRY IopDiskFileSystemQueueHead;
  403. extern LIST_ENTRY IopCdRomFileSystemQueueHead;
  404. extern LIST_ENTRY IopNetworkFileSystemQueueHead;
  405. extern LIST_ENTRY IopTapeFileSystemQueueHead;
  406. extern LIST_ENTRY IopBootDriverReinitializeQueueHead;
  407. extern LIST_ENTRY IopNotifyShutdownQueueHead;
  408. extern LIST_ENTRY IopNotifyLastChanceShutdownQueueHead;
  409. extern LIST_ENTRY IopFsNotifyChangeQueueHead;
  410. extern KSPIN_LOCK IoStatisticsLock;
  411. extern KSPIN_LOCK IopTimerLock;
  412. extern LIST_ENTRY IopTimerQueueHead;
  413. extern KDPC IopTimerDpc;
  414. extern KTIMER IopTimer;
  415. extern ULONG IopTimerCount;
  416. extern ULONG IopLargeIrpStackLocations;
  417. extern ULONG IopFsRegistrationOps;
  418. extern POBJECT_TYPE IoAdapterObjectType;
  419. extern POBJECT_TYPE IoCompletionObjectType;
  420. extern POBJECT_TYPE IoControllerObjectType;
  421. extern POBJECT_TYPE IoDeviceHandlerObjectType;
  422. extern GENERAL_LOOKASIDE IopLargeIrpLookasideList;
  423. extern GENERAL_LOOKASIDE IopSmallIrpLookasideList;
  424. extern GENERAL_LOOKASIDE IopMdlLookasideList;
  425. extern GENERAL_LOOKASIDE IopCompletionLookasideList;
  426. extern const UCHAR IopQueryOperationLength[];
  427. extern const UCHAR IopSetOperationLength[];
  428. extern const ULONG IopQueryOperationAccess[];
  429. extern const ULONG IopSetOperationAccess[];
  430. extern const UCHAR IopQuerySetAlignmentRequirement[];
  431. extern const UCHAR IopQueryFsOperationLength[];
  432. extern const UCHAR IopSetFsOperationLength[];
  433. extern const ULONG IopQueryFsOperationAccess[];
  434. extern const ULONG IopSetFsOperationAccess[];
  435. extern const UCHAR IopQuerySetFsAlignmentRequirement[];
  436. extern UNICODE_STRING IoArcHalDeviceName;
  437. extern PUCHAR IoLoaderArcBootDeviceName;
  438. extern LONG IopUniqueDeviceObjectNumber;
  439. extern PVOID IopLinkTrackingServiceObject;
  440. extern PKEVENT IopLinkTrackingServiceEvent;
  441. extern HANDLE IopLinkTrackingServiceEventHandle;
  442. extern KEVENT IopLinkTrackingPortObject;
  443. extern LINK_TRACKING_PACKET IopLinkTrackingPacket;
  444. extern UNICODE_STRING IoArcBootDeviceName;
  445. extern PDUMP_CONTROL_BLOCK IopDumpControlBlock;
  446. extern ULONG IopDumpControlBlockChecksum;
  447. extern LIST_ENTRY IopDriverReinitializeQueueHead;
  448. extern BOOLEAN IopVerifierOn;
  449. extern PIO_CALL_DRIVER pIofCallDriver;
  450. extern PIO_COMPLETE_REQUEST pIofCompleteRequest;
  451. extern PIO_FREE_IRP pIoFreeIrp;
  452. extern PIO_ALLOCATE_IRP pIoAllocateIrp;
  453. extern IOP_RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator;
  454. extern IOP_IRP_STACK_PROFILER IopIrpStackProfiler;
  455. //
  456. // The following declaration cannot go in EX.H since POBJECT_TYPE is not defined
  457. // until OB.H, which depends on EX.H. Hence, it is not exported by the EX
  458. // component at all.
  459. //
  460. extern POBJECT_TYPE ExEventObjectType;
  461. //
  462. // Define routines private to the I/O system.
  463. //
  464. VOID
  465. IopAbortRequest(
  466. IN PKAPC Apc
  467. );
  468. //+
  469. //
  470. // BOOLEAN
  471. // IopAcquireFastLock(
  472. // IN PFILE_OBJECT FileObject
  473. // )
  474. //
  475. // Routine Description:
  476. //
  477. // This routine is invoked to acquire the fast lock for a file object.
  478. // This lock protects the busy indicator in the file object resource.
  479. //
  480. // Arguments:
  481. //
  482. // FileObject - Pointer to the file object to be locked.
  483. //
  484. // Return Values:
  485. //
  486. // FALSE - the fileobject was not locked (it was busy)
  487. // TRUE - the fileobject was locked & the busy flag has been set to TRUE
  488. //
  489. //-
  490. #define IopAcquireFastLock( FileObject ) \
  491. ( InterlockedExchange( &FileObject->Busy, (ULONG) TRUE ) == FALSE )
  492. #define IopAcquireCancelSpinLockAtDpcLevel() \
  493. KiAcquireQueuedSpinLock ( &KeGetCurrentPrcb()->LockQueue[LockQueueIoCancelLock] )
  494. #define IopReleaseCancelSpinLockFromDpcLevel() \
  495. KiReleaseQueuedSpinLock ( &KeGetCurrentPrcb()->LockQueue[LockQueueIoCancelLock] )
  496. #define IopAllocateIrp(StackSize, ChargeQuota) \
  497. IoAllocateIrp((StackSize), (ChargeQuota))
  498. #define IsIoVerifierOn() IopVerifierOn
  499. static __inline VOID
  500. IopProbeAndLockPages(
  501. IN OUT PMDL MemoryDescriptorList,
  502. IN KPROCESSOR_MODE AccessMode,
  503. IN LOCK_OPERATION Operation,
  504. IN PDEVICE_OBJECT DeviceObject,
  505. IN ULONG MajorFunction
  506. )
  507. {
  508. extern LOGICAL MmTrackLockedPages;
  509. MmProbeAndLockPages(MemoryDescriptorList, AccessMode, Operation);
  510. if (MmTrackLockedPages) {
  511. PVOID DriverRoutine;
  512. DriverRoutine = DeviceObject->DriverObject->MajorFunction[MajorFunction];
  513. MmUpdateMdlTracker(MemoryDescriptorList, DriverRoutine, DeviceObject);
  514. }
  515. }
  516. #define IopIsReserveIrp(Irp) ((Irp) == (IopReserveIrpAllocator.ReserveIrp))
  517. //
  518. // Bump the stack profile.
  519. //
  520. #define IopProfileIrpStackCount(StackSize) \
  521. ((StackSize < MAX_LOOKASIDE_IRP_STACK_COUNT) ? \
  522. IopIrpStackProfiler.Profile[StackSize]++ : 0)
  523. //
  524. // True if auto sizing is enabled.
  525. //
  526. #define IopIrpAutoSizingEnabled() ((IopIrpStackProfiler.Flags & IOP_ENABLE_AUTO_SIZING))
  527. //
  528. // True if stack profiling is enabled.
  529. //
  530. #define IopIrpProfileStackCountEnabled() \
  531. ((IopIrpStackProfiler.Flags & (IOP_PROFILE_STACK_COUNT|IOP_ENABLE_AUTO_SIZING)) \
  532. == (IOP_PROFILE_STACK_COUNT|IOP_ENABLE_AUTO_SIZING))
  533. NTSTATUS
  534. IopAcquireFileObjectLock(
  535. IN PFILE_OBJECT FileObject,
  536. IN KPROCESSOR_MODE RequestorMode,
  537. IN BOOLEAN Alertable,
  538. OUT PBOOLEAN Interrupted
  539. );
  540. VOID
  541. IopAllocateIrpCleanup(
  542. IN PFILE_OBJECT FileObject,
  543. IN PKEVENT EventObject OPTIONAL
  544. );
  545. PIRP
  546. IopAllocateIrpMustSucceed(
  547. IN CCHAR StackSize
  548. );
  549. VOID
  550. IopApcHardError(
  551. IN PVOID StartContext
  552. );
  553. VOID
  554. IopCancelAlertedRequest(
  555. IN PKEVENT Event,
  556. IN PIRP Irp
  557. );
  558. VOID
  559. IopCheckBackupRestorePrivilege(
  560. IN PACCESS_STATE AccessState,
  561. IN OUT PULONG CreateOptions,
  562. IN KPROCESSOR_MODE PreviousMode,
  563. IN ULONG Disposition
  564. );
  565. NTSTATUS
  566. IopCheckGetQuotaBufferValidity(
  567. IN PFILE_GET_QUOTA_INFORMATION QuotaBuffer,
  568. IN ULONG QuotaLength,
  569. OUT PULONG_PTR ErrorOffset
  570. );
  571. VOID
  572. IopCloseFile(
  573. IN PEPROCESS Process OPTIONAL,
  574. IN PVOID Object,
  575. IN ULONG GrantedAccess,
  576. IN ULONG ProcessHandleCount,
  577. IN ULONG SystemHandleCount
  578. );
  579. VOID
  580. IopCompleteUnloadOrDelete(
  581. IN PDEVICE_OBJECT DeviceObject,
  582. IN BOOLEAN OnCleanStack,
  583. IN KIRQL Irql
  584. );
  585. VOID
  586. IopCompletePageWrite(
  587. IN PKAPC Apc,
  588. IN PKNORMAL_ROUTINE *NormalRoutine,
  589. IN PVOID *NormalContext,
  590. IN PVOID *SystemArgument1,
  591. IN PVOID *SystemArgument2
  592. );
  593. VOID
  594. IopCompleteRequest(
  595. IN PKAPC Apc,
  596. IN PKNORMAL_ROUTINE *NormalRoutine,
  597. IN PVOID *NormalContext,
  598. IN PVOID *SystemArgument1,
  599. IN PVOID *SystemArgument2
  600. );
  601. BOOLEAN
  602. IopConfigureCrashDump(
  603. IN HANDLE HandlePagingFile
  604. );
  605. VOID
  606. IopConnectLinkTrackingPort(
  607. IN PVOID Parameter
  608. );
  609. NTSTATUS
  610. IopCreateVpb (
  611. IN PDEVICE_OBJECT DeviceObject
  612. );
  613. VOID
  614. IopDeallocateApc(
  615. IN PKAPC Apc,
  616. IN PKNORMAL_ROUTINE *NormalRoutine,
  617. IN PVOID *NormalContext,
  618. IN PVOID *SystemArgument1,
  619. IN PVOID *SystemArgument2
  620. );
  621. VOID
  622. IopDecrementDeviceObjectRef(
  623. IN PDEVICE_OBJECT DeviceObject,
  624. IN BOOLEAN AlwaysUnload,
  625. IN BOOLEAN OnCleanStack
  626. );
  627. VOID
  628. IopDeleteDriver(
  629. IN PVOID Object
  630. );
  631. VOID
  632. IopDeleteDevice(
  633. IN PVOID Object
  634. );
  635. VOID
  636. IopDeleteFile(
  637. IN PVOID Object
  638. );
  639. VOID
  640. IopDeleteIoCompletion(
  641. IN PVOID Object
  642. );
  643. //+
  644. //
  645. // VOID
  646. // IopDequeueThreadIrp(
  647. // IN PIRP Irp
  648. // )
  649. //
  650. // Routine Description:
  651. //
  652. // This routine dequeues the specified I/O Request Packet (IRP) from the
  653. // thread IRP queue which it is currently queued.
  654. //
  655. // In checked we set Flink == Blink so we can assert free's of queue'd IRPs
  656. //
  657. // Arguments:
  658. //
  659. // Irp - Specifies the IRP that is dequeued.
  660. //
  661. // Return Value:
  662. //
  663. // None.
  664. //
  665. //-
  666. #define IopDequeueThreadIrp( Irp ) \
  667. { \
  668. RemoveEntryList( &Irp->ThreadListEntry ); \
  669. InitializeListHead( &Irp->ThreadListEntry ) ; \
  670. }
  671. #ifdef _WIN64
  672. #define IopApcRoutinePresent(ApcRoutine) ARGUMENT_PRESENT((ULONG_PTR)(ApcRoutine) & ~1)
  673. #define IopIsIosb32(ApcRoutine) ((ULONG_PTR)(ApcRoutine) & 1)
  674. #else
  675. #define IopApcRoutinePresent(ApcRoutine) ARGUMENT_PRESENT(ApcRoutine)
  676. #endif
  677. VOID
  678. IopDisassociateThreadIrp(
  679. VOID
  680. );
  681. BOOLEAN
  682. IopDmaDispatch(
  683. IN PKINTERRUPT Interrupt,
  684. IN PVOID ServiceContext
  685. );
  686. VOID
  687. IopDropIrp(
  688. IN PIRP Irp,
  689. IN PFILE_OBJECT FileObject
  690. );
  691. LONG
  692. IopExceptionFilter(
  693. IN PEXCEPTION_POINTERS ExceptionPointers,
  694. OUT PNTSTATUS ExceptionCode
  695. );
  696. VOID
  697. IopExceptionCleanup(
  698. IN PFILE_OBJECT FileObject,
  699. IN PIRP Irp,
  700. IN PKEVENT EventObject OPTIONAL,
  701. IN PKEVENT KernelEvent OPTIONAL
  702. );
  703. VOID
  704. IopErrorLogThread(
  705. IN PVOID StartContext
  706. );
  707. VOID
  708. IopFreeIrpAndMdls(
  709. IN PIRP Irp
  710. );
  711. PDEVICE_OBJECT
  712. IopGetDeviceAttachmentBase(
  713. IN PDEVICE_OBJECT DeviceObject
  714. );
  715. NTSTATUS
  716. IopGetFileInformation(
  717. IN PFILE_OBJECT FileObject,
  718. IN ULONG Length,
  719. IN FILE_INFORMATION_CLASS FileInformationClass,
  720. OUT PVOID FileInformation,
  721. OUT PULONG ReturnedLength
  722. );
  723. BOOLEAN
  724. IopGetMountFlag(
  725. IN PDEVICE_OBJECT DeviceObject
  726. );
  727. NTSTATUS
  728. IopGetRegistryValues(
  729. IN HANDLE KeyHandle,
  730. IN PKEY_VALUE_FULL_INFORMATION *ValueList
  731. );
  732. NTSTATUS
  733. IopGetSetObjectId(
  734. IN PFILE_OBJECT FileObject,
  735. IN OUT PVOID Buffer,
  736. IN ULONG Length,
  737. IN ULONG OperationFlags
  738. );
  739. NTSTATUS
  740. IopGetSetSecurityObject(
  741. IN PVOID Object,
  742. IN SECURITY_OPERATION_CODE OperationCode,
  743. IN PSECURITY_INFORMATION SecurityInformation,
  744. IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor,
  745. IN OUT PULONG CapturedLength,
  746. IN OUT PSECURITY_DESCRIPTOR *ObjectsSecurityDescriptor,
  747. IN POOL_TYPE PoolType,
  748. IN PGENERIC_MAPPING GenericMapping
  749. );
  750. NTSTATUS
  751. IopGetVolumeId(
  752. IN PFILE_OBJECT FileObject,
  753. IN OUT PLINK_TRACKING_INFORMATION ObjectId,
  754. IN ULONG Length
  755. );
  756. VOID
  757. IopHardErrorThread(
  758. PVOID StartContext
  759. );
  760. VOID
  761. IopInsertRemoveDevice(
  762. IN PDRIVER_OBJECT DriverObject,
  763. IN PDEVICE_OBJECT DeviceObject,
  764. IN BOOLEAN Insert
  765. );
  766. //
  767. // Interlocked list manipulation funtions using queued spin locks.
  768. //
  769. PLIST_ENTRY
  770. FASTCALL
  771. IopInterlockedInsertHeadList (
  772. IN PLIST_ENTRY ListHead,
  773. IN PLIST_ENTRY ListEntry
  774. );
  775. PLIST_ENTRY
  776. FASTCALL
  777. IopInterlockedInsertTailList (
  778. IN PLIST_ENTRY ListHead,
  779. IN PLIST_ENTRY ListEntry
  780. );
  781. PLIST_ENTRY
  782. FASTCALL
  783. IopInterlockedRemoveHeadList (
  784. IN PLIST_ENTRY ListHead
  785. );
  786. BOOLEAN
  787. IopIsSameMachine(
  788. IN PFILE_OBJECT SourceFile,
  789. IN HANDLE TargetFile
  790. );
  791. VOID
  792. IopLoadFileSystemDriver(
  793. IN PDEVICE_OBJECT DeviceObject
  794. );
  795. VOID
  796. IopLoadUnloadDriver(
  797. IN PVOID Parameter
  798. );
  799. NTSTATUS
  800. IopLogErrorEvent(
  801. IN ULONG SequenceNumber,
  802. IN ULONG UniqueErrorValue,
  803. IN NTSTATUS FinalStatus,
  804. IN NTSTATUS SpecificIOStatus,
  805. IN ULONG LengthOfInsert1,
  806. IN PWCHAR Insert1,
  807. IN ULONG LengthOfInsert2,
  808. IN PWCHAR Insert2
  809. );
  810. NTSTATUS
  811. IopLookupBusStringFromID (
  812. IN HANDLE KeyHandle,
  813. IN INTERFACE_TYPE InterfaceType,
  814. OUT PWCHAR Buffer,
  815. IN ULONG Length,
  816. OUT PULONG BusFlags OPTIONAL
  817. );
  818. NTSTATUS
  819. IopMountVolume(
  820. IN PDEVICE_OBJECT DeviceObject,
  821. IN BOOLEAN AllowRawMount,
  822. IN BOOLEAN DeviceLockAlreadyHeld,
  823. IN BOOLEAN Alertable,
  824. OUT PVPB *Vpb
  825. );
  826. NTSTATUS
  827. IopOpenLinkOrRenameTarget(
  828. OUT PHANDLE TargetHandle,
  829. IN PIRP Irp,
  830. IN PVOID RenameBuffer,
  831. IN PFILE_OBJECT FileObject
  832. );
  833. NTSTATUS
  834. IopParseDevice(
  835. IN PVOID ParseObject,
  836. IN PVOID ObjectType,
  837. IN PACCESS_STATE AccessState,
  838. IN KPROCESSOR_MODE AccessMode,
  839. IN ULONG Attributes,
  840. IN OUT PUNICODE_STRING CompleteName,
  841. IN OUT PUNICODE_STRING RemainingName,
  842. IN OUT PVOID Context OPTIONAL,
  843. IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
  844. OUT PVOID *Object
  845. );
  846. NTSTATUS
  847. IopParseFile(
  848. IN PVOID ParseObject,
  849. IN PVOID ObjectType,
  850. IN PACCESS_STATE AccessState,
  851. IN KPROCESSOR_MODE AccessMode,
  852. IN ULONG Attributes,
  853. IN OUT PUNICODE_STRING CompleteName,
  854. IN OUT PUNICODE_STRING RemainingName,
  855. IN OUT PVOID Context OPTIONAL,
  856. IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL,
  857. OUT PVOID *Object
  858. );
  859. BOOLEAN
  860. IopProtectSystemPartition(
  861. IN PLOADER_PARAMETER_BLOCK LoaderBlock
  862. );
  863. NTSTATUS
  864. IopQueryName(
  865. IN PVOID Object,
  866. IN BOOLEAN HasObjectName,
  867. OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
  868. IN ULONG Length,
  869. OUT PULONG ReturnLength
  870. );
  871. NTSTATUS
  872. IopQueryNameInternal(
  873. IN PVOID Object,
  874. IN BOOLEAN HasObjectName,
  875. IN BOOLEAN UseDosDeviceName,
  876. OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
  877. IN ULONG Length,
  878. OUT PULONG ReturnLength
  879. );
  880. NTSTATUS
  881. IopQueryXxxInformation(
  882. IN PFILE_OBJECT FileObject,
  883. IN ULONG InformationClass,
  884. IN ULONG Length,
  885. OUT PVOID Information,
  886. OUT PULONG ReturnedLength,
  887. IN BOOLEAN FileInformation
  888. );
  889. VOID
  890. IopQueueWorkRequest(
  891. IN PIRP Irp
  892. );
  893. VOID
  894. IopRaiseHardError(
  895. IN PVOID NormalContext,
  896. IN PVOID SystemArgument1,
  897. IN PVOID SystemArgument2
  898. );
  899. VOID
  900. IopRaiseInformationalHardError(
  901. IN PVOID NormalContext,
  902. IN PVOID SystemArgument1,
  903. IN PVOID SystemArgument2
  904. );
  905. VOID
  906. IopReadyDeviceObjects(
  907. IN PDRIVER_OBJECT DriverObject
  908. );
  909. //+
  910. //
  911. // VOID
  912. // IopReleaseFileObjectLock(
  913. // IN PFILE_OBJECT FileObject
  914. // )
  915. //
  916. // Routine Description:
  917. //
  918. // This routine is invoked to release ownership of the file object lock.
  919. //
  920. // Arguments:
  921. //
  922. // FileObject - Pointer to the file object whose ownership is to be
  923. // released.
  924. //
  925. // Return Value:
  926. //
  927. // None.
  928. //
  929. //-
  930. #define IopReleaseFileObjectLock( FileObject ) { \
  931. ULONG Result; \
  932. Result = InterlockedExchange( &FileObject->Busy, FALSE ); \
  933. ASSERT(Result != FALSE); \
  934. if (FileObject->Waiters != 0) { \
  935. KeSetEvent( &FileObject->Lock, 0, FALSE ); \
  936. } \
  937. }
  938. #if _WIN32_WINNT >= 0x0500
  939. NTSTATUS
  940. IopSendMessageToTrackService(
  941. IN PLINK_TRACKING_INFORMATION SourceVolumeId,
  942. IN PFILE_OBJECTID_BUFFER SourceObjectId,
  943. IN PFILE_TRACKING_INFORMATION TargetObjectInformation
  944. );
  945. #endif
  946. NTSTATUS
  947. IopSetEaOrQuotaInformationFile(
  948. IN HANDLE FileHandle,
  949. OUT PIO_STATUS_BLOCK IoStatusBlock,
  950. IN PVOID Buffer,
  951. IN ULONG Length,
  952. IN BOOLEAN SetEa
  953. );
  954. NTSTATUS
  955. IopSetRemoteLink(
  956. IN PFILE_OBJECT FileObject,
  957. IN PFILE_OBJECT DestinationFileObject OPTIONAL,
  958. IN PFILE_TRACKING_INFORMATION FileInformation OPTIONAL
  959. );
  960. VOID
  961. IopStartApcHardError(
  962. IN PVOID StartContext
  963. );
  964. NTSTATUS
  965. IopSynchronousApiServiceTail(
  966. IN NTSTATUS ReturnedStatus,
  967. IN PKEVENT Event,
  968. IN PIRP Irp,
  969. IN KPROCESSOR_MODE RequestorMode,
  970. IN PIO_STATUS_BLOCK LocalIoStatus,
  971. OUT PIO_STATUS_BLOCK IoStatusBlock
  972. );
  973. NTSTATUS
  974. IopSynchronousServiceTail(
  975. IN PDEVICE_OBJECT DeviceObject,
  976. IN PIRP Irp,
  977. IN PFILE_OBJECT FileObject,
  978. IN BOOLEAN DeferredIoCompletion,
  979. IN KPROCESSOR_MODE RequestorMode,
  980. IN BOOLEAN SynchronousIo,
  981. IN TRANSFER_TYPE TransferType
  982. );
  983. VOID
  984. IopTimerDispatch(
  985. IN PKDPC Dpc,
  986. IN PVOID DeferredContext,
  987. IN PVOID SystemArgument1,
  988. IN PVOID SystemArgument2
  989. );
  990. NTSTATUS
  991. IopTrackLink(
  992. IN PFILE_OBJECT FileObject,
  993. IN OUT PIO_STATUS_BLOCK IoStatusBlock,
  994. IN PFILE_TRACKING_INFORMATION FileInformation,
  995. IN ULONG Length,
  996. IN PKEVENT Event,
  997. IN KPROCESSOR_MODE RequestorMode
  998. );
  999. VOID
  1000. IopUserCompletion(
  1001. IN PKAPC Apc,
  1002. IN PKNORMAL_ROUTINE *NormalRoutine,
  1003. IN PVOID *NormalContext,
  1004. IN PVOID *SystemArgument1,
  1005. IN PVOID *SystemArgument2
  1006. );
  1007. NTSTATUS
  1008. IopXxxControlFile(
  1009. IN HANDLE FileHandle,
  1010. IN HANDLE Event OPTIONAL,
  1011. IN PIO_APC_ROUTINE ApcRoutine OPTIONAL,
  1012. IN PVOID ApcContext OPTIONAL,
  1013. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1014. IN ULONG IoControlCode,
  1015. IN PVOID InputBuffer OPTIONAL,
  1016. IN ULONG InputBufferLength,
  1017. OUT PVOID OutputBuffer OPTIONAL,
  1018. IN ULONG OutputBufferLength,
  1019. IN BOOLEAN DeviceIoControl
  1020. );
  1021. NTSTATUS
  1022. IopReportResourceUsage(
  1023. IN PUNICODE_STRING DriverClassName OPTIONAL,
  1024. IN PDRIVER_OBJECT DriverObject,
  1025. IN PCM_RESOURCE_LIST DriverList OPTIONAL,
  1026. IN ULONG DriverListSize OPTIONAL,
  1027. IN PDEVICE_OBJECT DeviceObject OPTIONAL,
  1028. IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
  1029. IN ULONG DeviceListSize OPTIONAL,
  1030. IN BOOLEAN OverrideConflict,
  1031. OUT PBOOLEAN ConflictDetected
  1032. );
  1033. VOID
  1034. IopDoNameTransmogrify(
  1035. IN PIRP Irp,
  1036. IN PFILE_OBJECT FileObject,
  1037. IN PREPARSE_DATA_BUFFER ReparseBuffer
  1038. );
  1039. VOID
  1040. IopUpdateOtherOperationCount(
  1041. VOID
  1042. );
  1043. VOID
  1044. IopUpdateReadOperationCount(
  1045. VOID
  1046. );
  1047. VOID
  1048. IopUpdateWriteOperationCount(
  1049. VOID
  1050. );
  1051. VOID
  1052. IopUpdateOtherTransferCount(
  1053. IN ULONG TransferCount
  1054. );
  1055. VOID
  1056. IopUpdateReadTransferCount(
  1057. IN ULONG TransferCount
  1058. );
  1059. VOID
  1060. IopUpdateWriteTransferCount(
  1061. IN ULONG TransferCount
  1062. );
  1063. NTSTATUS
  1064. FASTCALL
  1065. IopfCallDriver(
  1066. PDEVICE_OBJECT DeviceObject,
  1067. PIRP Irp
  1068. );
  1069. VOID
  1070. FASTCALL
  1071. IopfCompleteRequest(
  1072. IN PIRP Irp,
  1073. IN CCHAR PriorityBost
  1074. );
  1075. PIRP
  1076. IopAllocateIrpPrivate(
  1077. IN CCHAR StackSize,
  1078. IN BOOLEAN ChargeQuota
  1079. );
  1080. VOID
  1081. IopFreeIrp(
  1082. IN PIRP Irp
  1083. );
  1084. PVOID
  1085. IopAllocateErrorLogEntry(
  1086. IN PDEVICE_OBJECT deviceObject,
  1087. IN PDRIVER_OBJECT driverObject,
  1088. IN UCHAR EntrySize
  1089. );
  1090. VOID
  1091. IopNotifyAlreadyRegisteredFileSystems(
  1092. IN PLIST_ENTRY ListHead,
  1093. IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine,
  1094. IN BOOLEAN SkipRaw
  1095. );
  1096. NTSTATUS
  1097. IopCheckUnloadDriver(
  1098. IN PDRIVER_OBJECT driverObject,
  1099. OUT PBOOLEAN unloadDriver
  1100. );
  1101. //
  1102. // Interlocked increment/decrement functions using queued spin locks.
  1103. //
  1104. ULONG
  1105. FASTCALL
  1106. IopInterlockedDecrementUlong (
  1107. IN KSPIN_LOCK_QUEUE_NUMBER Number,
  1108. IN OUT PULONG Addend
  1109. );
  1110. ULONG
  1111. FASTCALL
  1112. IopInterlockedIncrementUlong (
  1113. IN KSPIN_LOCK_QUEUE_NUMBER Number,
  1114. IN OUT PULONG Addend
  1115. );
  1116. VOID
  1117. IopShutdownBaseFileSystems(
  1118. IN PLIST_ENTRY ListHead
  1119. );
  1120. VOID
  1121. IopPerfLogFileCreate(
  1122. IN PFILE_OBJECT FileObject,
  1123. IN PUNICODE_STRING CompleteName
  1124. );
  1125. BOOLEAN
  1126. IopInitializeReserveIrp(
  1127. PIOP_RESERVE_IRP_ALLOCATOR Allocator
  1128. );
  1129. PIRP
  1130. IopAllocateReserveIrp(
  1131. IN CCHAR StackSize
  1132. );
  1133. VOID
  1134. IopFreeReserveIrp(
  1135. IN PIRP Irp,
  1136. IN CCHAR PriorityBoost
  1137. );
  1138. NTSTATUS
  1139. IopGetBasicInformationFile(
  1140. IN PFILE_OBJECT FileObject,
  1141. IN PFILE_BASIC_INFORMATION BasicInformationBuffer
  1142. );
  1143. NTSTATUS
  1144. IopCreateFile(
  1145. OUT PHANDLE FileHandle,
  1146. IN ACCESS_MASK DesiredAccess,
  1147. IN POBJECT_ATTRIBUTES ObjectAttributes,
  1148. OUT PIO_STATUS_BLOCK IoStatusBlock,
  1149. IN PLARGE_INTEGER AllocationSize OPTIONAL,
  1150. IN ULONG FileAttributes,
  1151. IN ULONG ShareAccess,
  1152. IN ULONG Disposition,
  1153. IN ULONG CreateOptions,
  1154. IN PVOID EaBuffer OPTIONAL,
  1155. IN ULONG EaLength,
  1156. IN CREATE_FILE_TYPE CreateFileType,
  1157. IN PVOID ExtraCreateParameters OPTIONAL,
  1158. IN ULONG Options,
  1159. IN ULONG InternalFlags,
  1160. IN PVOID DeviceObject
  1161. );
  1162. BOOLEAN
  1163. IopVerifyDeviceObjectOnStack(
  1164. IN PDEVICE_OBJECT BaseDeviceObject,
  1165. IN PDEVICE_OBJECT TopDeviceObject
  1166. );
  1167. BOOLEAN
  1168. IopVerifyDiskSignature(
  1169. IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
  1170. IN PARC_DISK_SIGNATURE LoaderDiskBlock,
  1171. OUT PULONG DiskSignature
  1172. );
  1173. NTSTATUS
  1174. IopGetDriverPathInformation(
  1175. IN PFILE_OBJECT FileObject,
  1176. IN PFILE_FS_DRIVER_PATH_INFORMATION FsDpInfo,
  1177. IN ULONG Length
  1178. );
  1179. BOOLEAN
  1180. IopVerifyDriverObjectOnStack(
  1181. IN PDEVICE_OBJECT DeviceObject,
  1182. IN PDRIVER_OBJECT DriverObject
  1183. );
  1184. NTSTATUS
  1185. IopInitializeIrpStackProfiler(
  1186. VOID
  1187. );
  1188. VOID
  1189. IopIrpStackProfilerTimer(
  1190. IN struct _KDPC *Dpc,
  1191. IN PVOID DeferredContext,
  1192. IN PVOID SystemArgument1,
  1193. IN PVOID SystemArgument2
  1194. );
  1195. VOID
  1196. IopProcessIrpStackProfiler(
  1197. VOID
  1198. );
  1199. PDEVICE_OBJECT
  1200. IopAttachDeviceToDeviceStackSafe(
  1201. IN PDEVICE_OBJECT SourceDevice,
  1202. IN PDEVICE_OBJECT TargetDevice,
  1203. OUT PDEVICE_OBJECT *AttachedToDeviceObject OPTIONAL
  1204. );
  1205. #endif // _IOMGR_