ReactOS  0.4.14-dev-1296-g56aa513
io.h
Go to the documentation of this file.
1 /*
2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/include/internal/io.h
5 * PURPOSE: Internal header for the I/O Manager
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
7 */
8 
9 #include "ntdddisk.h"
10 
11 //
12 // Define this if you want debugging support
13 //
14 #define _IO_DEBUG_ 0x00
15 
16 //
17 // These define the Debug Masks Supported
18 //
19 #define IO_IRP_DEBUG 0x01
20 #define IO_FILE_DEBUG 0x02
21 #define IO_API_DEBUG 0x04
22 #define IO_CTL_DEBUG 0x08
23 
24 //
25 // Debug/Tracing support
26 //
27 #if _IO_DEBUG_
28 #ifdef NEW_DEBUG_SYSTEM_IMPLEMENTED // enable when Debug Filters are implemented
29 #define IOTRACE(x, ...) \
30  { \
31  DbgPrintEx("%s [%.16s] - ", \
32  __FUNCTION__, \
33  PsGetCurrentProcess()->ImageFileName); \
34  DbgPrintEx(__VA_ARGS__); \
35  }
36 #else
37 #define IOTRACE(x, ...) \
38  if (x & IopTraceLevel) \
39  { \
40  DbgPrint("%s [%.16s] - ", \
41  __FUNCTION__, \
42  PsGetCurrentProcess()->ImageFileName); \
43  DbgPrint(__VA_ARGS__); \
44  }
45 #endif
46 #else
47 #define IOTRACE(x, fmt, ...) DPRINT(fmt, ##__VA_ARGS__)
48 #endif
49 
50 //
51 // Registry path to the enumeration root key
52 //
53 #define ENUM_ROOT L"\\Registry\\Machine\\System\\CurrentControlSet\\Enum"
54 
55 //
56 // Returns the type of METHOD_ used in this IOCTL
57 //
58 #define IO_METHOD_FROM_CTL_CODE(c) (c & 0x00000003)
59 
60 //
61 // Bugcheck codes for RAM disk booting
62 //
63 //
64 // No LoaderXIPRom descriptor was found in the loader memory list
65 //
66 #define RD_NO_XIPROM_DESCRIPTOR 1
67 //
68 // Unable to open the RAM disk driver (ramdisk.sys or \Device\Ramdisk)
69 //
70 #define RD_NO_RAMDISK_DRIVER 2
71 //
72 // FSCTL_CREATE_RAM_DISK failed
73 //
74 #define RD_FSCTL_FAILED 3
75 //
76 // Unable to create GUID string from binary GUID
77 //
78 #define RD_GUID_CONVERT_FAILED 4
79 //
80 // Unable to create symbolic link pointing to the RAM disk device
81 //
82 #define RD_SYMLINK_CREATE_FAILED 5
83 
84 //
85 // Max traversal of reparse points for a single open in IoParseDevice
86 //
87 #define IOP_MAX_REPARSE_TRAVERSAL 0x20
88 
89 //
90 // Private flags for IoCreateFile / IoParseDevice
91 //
92 #define IOP_USE_TOP_LEVEL_DEVICE_HINT 0x01
93 #define IOP_CREATE_FILE_OBJECT_EXTENSION 0x02
94 
95 
96 typedef struct _FILE_OBJECT_EXTENSION
97 {
100 
102 
103 
104 
105 //
106 // We can call the Ob Inlined API, it's the same thing
107 //
108 #define IopAllocateMdlFromLookaside \
109  ObpAllocateObjectCreateInfoBuffer
110 #define IopFreeMdlFromLookaside \
111  ObpFreeCapturedAttributes
112 
113 //
114 // Determines if the IRP is Synchronous
115 //
116 #define IsIrpSynchronous(Irp, FileObject) \
117  ((Irp->Flags & IRP_SYNCHRONOUS_API) || \
118  (!(FileObject) ? \
119  FALSE : \
120  FileObject->Flags & FO_SYNCHRONOUS_IO)) \
121 
122 //
123 // Returns the internal Device Object Extension
124 //
125 #define IoGetDevObjExtension(DeviceObject) \
126  ((PEXTENDED_DEVOBJ_EXTENSION) \
127  (DeviceObject->DeviceObjectExtension)) \
128 
129 //
130 // Returns the internal Driver Object Extension
131 //
132 #define IoGetDrvObjExtension(DriverObject) \
133  ((PEXTENDED_DRIVER_EXTENSION) \
134  (DriverObject->DriverExtension)) \
135 
136 /*
137  * VOID
138  * IopDeviceNodeSetFlag(
139  * PDEVICE_NODE DeviceNode,
140  * ULONG Flag);
141  */
142 #define IopDeviceNodeSetFlag(DeviceNode, Flag) \
143  ((DeviceNode)->Flags |= (Flag))
144 
145 /*
146  * VOID
147  * IopDeviceNodeClearFlag(
148  * PDEVICE_NODE DeviceNode,
149  * ULONG Flag);
150  */
151 #define IopDeviceNodeClearFlag(DeviceNode, Flag) \
152  ((DeviceNode)->Flags &= ~(Flag))
153 
154 /*
155  * BOOLEAN
156  * IopDeviceNodeHasFlag(
157  * PDEVICE_NODE DeviceNode,
158  * ULONG Flag);
159  */
160 #define IopDeviceNodeHasFlag(DeviceNode, Flag) \
161  (((DeviceNode)->Flags & (Flag)) > 0)
162 
163 /*
164  * VOID
165  * IopDeviceNodeSetUserFlag(
166  * PDEVICE_NODE DeviceNode,
167  * ULONG UserFlag);
168  */
169 #define IopDeviceNodeSetUserFlag(DeviceNode, UserFlag) \
170  ((DeviceNode)->UserFlags |= (UserFlag))
171 
172 /*
173  * VOID
174  * IopDeviceNodeClearUserFlag(
175  * PDEVICE_NODE DeviceNode,
176  * ULONG UserFlag);
177  */
178 #define IopDeviceNodeClearUserFlag(DeviceNode, UserFlag)\
179  ((DeviceNode)->UserFlags &= ~(UserFlag))
180 
181 /*
182  * BOOLEAN
183  * IopDeviceNodeHasUserFlag(
184  * PDEVICE_NODE DeviceNode,
185  * ULONG UserFlag);
186  */
187 #define IopDeviceNodeHasUserFlag(DeviceNode, UserFlag) \
188  (((DeviceNode)->UserFlags & (UserFlag)) > 0)
189 
190  /*
191  * VOID
192  * IopDeviceNodeSetProblem(
193  * PDEVICE_NODE DeviceNode,
194  * ULONG Problem);
195  */
196 #define IopDeviceNodeSetProblem(DeviceNode, Problem) \
197  ((DeviceNode)->Problem |= (Problem))
198 
199 /*
200  * VOID
201  * IopDeviceNodeClearProblem(
202  * PDEVICE_NODE DeviceNode,
203  * ULONG Problem);
204  */
205 #define IopDeviceNodeClearProblem(DeviceNode, Problem) \
206  ((DeviceNode)->Problem &= ~(Problem))
207 
208 /*
209  * BOOLEAN
210  * IopDeviceNodeHasProblem(
211  * PDEVICE_NODE DeviceNode,
212  * ULONG Problem);
213  */
214 #define IopDeviceNodeHasProblem(DeviceNode, Problem) \
215  (((DeviceNode)->Problem & (Problem)) > 0)
216 
217 /*
218  * VOID
219  * IopInitDeviceTreeTraverseContext(
220  * PDEVICETREE_TRAVERSE_CONTEXT DeviceTreeTraverseContext,
221  * PDEVICE_NODE DeviceNode,
222  * DEVICETREE_TRAVERSE_ROUTINE Action,
223  * PVOID Context);
224  */
225 #define IopInitDeviceTreeTraverseContext( \
226  _DeviceTreeTraverseContext, _DeviceNode, _Action, \
227  _Context) { \
228  (_DeviceTreeTraverseContext)->FirstDeviceNode = \
229  (_DeviceNode); \
230  (_DeviceTreeTraverseContext)->Action = (_Action); \
231  (_DeviceTreeTraverseContext)->Context = (_Context); }
232 
233 /*
234  * BOOLEAN
235  * IopIsValidPhysicalDeviceObject(
236  * IN PDEVICE_OBJECT PhysicalDeviceObject);
237  */
238 #define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject) \
239  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject) && \
240  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode) && \
241  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode->Flags & DNF_ENUMERATED))
242 
243 //
244 // Device List Operations
245 //
247 {
251 
252 //
253 // Transfer statistics
254 //
255 typedef enum _IOP_TRANSFER_TYPE
256 {
261 
262 //
263 // Packet Types when piggybacking on the IRP Overlay
264 //
266  {
271 
272 //
273 // Special version of the IRP Overlay used to optimize I/O completion
274 // by not using up a separate structure.
275 //
277 {
278  struct
279  {
281  union
282  {
285  };
286  };
292 
293 //
294 // I/O Completion Context for IoSetIoCompletionRoutineEx
295 //
297 {
302 
303 //
304 // I/O Wrapper around the Executive Work Item
305 //
306 typedef struct _IO_WORKITEM
307 {
312 } IO_WORKITEM;
313 
314 //
315 // I/O Wrapper around the Kernel Interrupt
316 //
317 typedef struct _IO_INTERRUPT
318 {
323 
324 //
325 // I/O Error Log Packet Header
326 //
327 typedef struct _ERROR_LOG_ENTRY
328 {
336 
337 //
338 // To simplify matters, the kernel is made to support both the checked and free
339 // version of the I/O Remove Lock in the same binary. This structure includes
340 // both, since the DDK has the structure with a compile-time #ifdef.
341 //
343 {
347 
348 //
349 // Dummy File Object used inside the Open Packet so that OB knows how to
350 // deal with the Object Pointer even though it's not a real file.
351 //
352 typedef struct _DUMMY_FILE_OBJECT
353 {
357 
358 //
359 // Open packet used as a context for Device/File parsing so that the parse
360 // routine can know what operation is being requested.
361 //
362 typedef struct _OPEN_PACKET
363 {
393 
394 //
395 // Parameters packet for Load/Unload work item's context
396 //
397 typedef struct _LOAD_UNLOAD_PARAMS
398 {
405 
406 //
407 // Boot Driver List Entry
408 //
409 typedef struct _DRIVER_INFORMATION
410 {
420 
421 //
422 // Boot Driver Node
423 //
424 typedef struct _BOOT_DRIVER_NODE
425 {
432 
433 //
434 // List of Bus Type GUIDs
435 //
437 {
443 
444 //
445 // Shutdown entry for registed devices
446 //
447 typedef struct _SHUTDOWN_ENTRY
448 {
452 
453 //
454 // F/S Notification entry for registered File Systems
455 //
457 {
462 
463 //
464 // Driver (Boot) Re-Initialization Entry
465 //
466 typedef struct _DRIVER_REINIT_ITEM
467 {
473 
474 //
475 // Called on every visit of a node during a preorder-traversal of the device
476 // node tree.
477 // If the routine returns STATUS_UNSUCCESSFUL the traversal will stop and
478 // STATUS_SUCCESS is returned to the caller who initiated the tree traversal.
479 // Any other returned status code will be returned to the caller. If a status
480 // code that indicates an error (other than STATUS_UNSUCCESSFUL) is returned,
481 // the traversal is stopped immediately and the status code is returned to
482 // the caller.
483 //
484 typedef
485 NTSTATUS
489 );
490 
491 //
492 // Context information for traversing the device tree
493 //
495 {
496  //
497  // Current device node during a traversal
498  //
500 
501  //
502  // Initial device node where we start the traversal
503  //
505 
506  //
507  // Action routine to be called for every device node
508  //
510 
511  //
512  // Context passed to the action routine
513  //
516 
517 //
518 // Reserve IRP allocator
519 // Used for read paging IOs in low-memory situations
520 //
522 {
528 
529 //
530 // Type selection for IopCreateSecurityDescriptorPerType()
531 //
533 {
540 
541 //
542 // Action types and data for IopQueueDeviceAction()
543 //
544 typedef enum _DEVICE_ACTION
545 {
548 } DEVICE_ACTION;
549 
550 typedef struct _DEVICE_ACTION_DATA
551 {
555  union
556  {
557  struct
558  {
561  };
563 
564 //
565 // Resource code
566 //
567 ULONG
568 NTAPI
570 
571 NTSTATUS
572 NTAPI
575 );
576 
577 NTSTATUS
578 NTAPI
580  IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList,
582 );
583 
584 NTSTATUS
585 NTAPI
588  IN BOOLEAN Silent,
589  OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor
590 );
591 
592 //
593 // PNP Routines
594 //
595 NTSTATUS
596 NTAPI
599  IN BOOLEAN LoadDriver,
601 );
602 
603 INIT_FUNCTION
604 NTSTATUS
605 NTAPI
607  VOID
608 );
609 
610 BOOLEAN
611 NTAPI
613  VOID
614 );
615 
616 VOID
617 PnpInit2(
618  VOID
619 );
620 
621 VOID
623  VOID
624 );
625 
626 VOID
628  VOID
629 );
630 
631 VOID
634  IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory,
635  IN LPCGUID Event,
636  IN PVOID EventCategoryData1,
637  IN PVOID EventCategoryData2
638 );
639 
640 NTSTATUS
643 );
644 
646 NTAPI
649 );
650 
651 NTSTATUS
653  IN PDEVICE_NODE ParentNode,
657 );
658 
659 NTSTATUS
662 );
663 
664 NTSTATUS
665 NTAPI
667  PDEVICE_CAPABILITIES DeviceCaps);
668 
669 NTSTATUS
670 NTAPI
673  IN PIO_STACK_LOCATION IoStackLocation,
675 );
676 
677 NTSTATUS
678 NTAPI
683  IN PIO_STACK_LOCATION Stack
684 );
685 
687 FASTCALL
690 );
691 
692 NTSTATUS
696 );
697 
698 NTSTATUS
702 );
703 
704 NTSTATUS
707 );
708 
709 NTSTATUS
711  VOID
712 );
713 
714 NTSTATUS
716  VOID
717 );
718 
719 INIT_FUNCTION
720 NTSTATUS
722 
723 NTSTATUS
725  const GUID *Guid,
726  PUNICODE_STRING DeviceIds
727 );
728 
729 NTSTATUS
732 
733 NTSTATUS
734 NTAPI
737  HANDLE ParentKey,
740 
741 NTSTATUS
742 NTAPI
744  IN HANDLE Handle,
747 );
748 
749 NTSTATUS
750 NTAPI
753  IN HANDLE BaseHandle OPTIONAL,
758 );
759 
760 
761 NTSTATUS
764 
765 //
766 // PnP Routines
767 //
768 INIT_FUNCTION
769 NTSTATUS
770 NTAPI
772  VOID
773 );
774 
775 INIT_FUNCTION
776 NTSTATUS
777 NTAPI
779  VOID
780 );
781 
782 USHORT
783 NTAPI
785  IN HANDLE ServiceHandle
786 );
787 
788 USHORT
789 NTAPI
791  IN HANDLE ServiceHandle
792 );
793 
794 NTSTATUS
795 NTAPI
797  IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation,
798  OUT PUNICODE_STRING *UnicodeStringList,
799  OUT PULONG UnicodeStringCount
800 );
801 
802 BOOLEAN
803 NTAPI
805  IN PWCHAR RegSzData,
806  IN ULONG RegSzLength,
807  OUT PUSHORT StringLength OPTIONAL
808 );
809 
810 //
811 // Initialization Routines
812 //
813 INIT_FUNCTION
814 NTSTATUS
815 NTAPI
817  IN PLOADER_PARAMETER_BLOCK LoaderBlock
818 );
819 
820 INIT_FUNCTION
821 NTSTATUS
822 NTAPI
824  IN PLOADER_PARAMETER_BLOCK LoaderBlock,
825  OUT PANSI_STRING NtBootPath
826 );
827 
828 INIT_FUNCTION
829 BOOLEAN
830 NTAPI
832  IN PLOADER_PARAMETER_BLOCK LoaderBlock
833 );
834 
835 BOOLEAN
836 NTAPI
838  IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
839  IN PARC_DISK_SIGNATURE ArcDiskSignature,
841 );
842 
843 BOOLEAN
844 NTAPI
846  IN HANDLE PageFileHandle
847 );
848 
849 //
850 // Device/Volume Routines
851 //
852 VOID
853 NTAPI
856 );
857 
858 NTSTATUS
859 FASTCALL
863 );
864 
865 NTSTATUS
868 );
869 
870 NTSTATUS
873 );
874 
875 NTSTATUS
878 );
879 
880 PVPB
881 NTAPI
883  IN POPEN_PACKET OpenPacket,
887 );
888 
889 NTSTATUS
890 NTAPI
893  IN BOOLEAN AllowRawMount,
894  IN BOOLEAN DeviceIsLocked,
896  OUT PVPB *Vpb
897 );
898 
899 PVOID
902 );
903 
904 PVOID
907  IN PWCHAR Name
908 );
909 
910 NTSTATUS
911 NTAPI
914 );
915 
916 VOID
917 NTAPI
919  IN PVPB Vpb
920 );
921 
922 VOID
923 NTAPI
925  VOID
926 );
927 
928 VOID
929 NTAPI
931  VOID
932 );
933 
934 NTSTATUS
935 NTAPI
938 );
939 
940 VOID
941 NTAPI
944  IN BOOLEAN ForceUnload
945 );
946 
947 NTSTATUS
948 NTAPI
952 );
953 
954 VOID
955 NTAPI
958 );
959 
961 NTAPI
964 );
965 
966 //
967 // IRP Routines
968 //
969 NTSTATUS
970 NTAPI
973  IN PKEVENT EventObject,
975 );
976 
977 VOID
978 NTAPI
980  IN PKEVENT EventObject,
981  IN PIRP Irp
982 );
983 
984 PIRP
985 NTAPI
988 );
989 
990 BOOLEAN
991 NTAPI
993  IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator
994 );
995 
996 PIRP
997 NTAPI
1000 );
1001 
1002 //
1003 // Shutdown routines
1004 //
1005 VOID
1007  VOID
1008 );
1009 
1010 VOID
1011 NTAPI
1013  IN ULONG Phase
1014 );
1015 
1016 VOID
1017 NTAPI
1019  IN PLIST_ENTRY ListHead
1020 );
1021 
1022 //
1023 // Boot logging support
1024 //
1025 INIT_FUNCTION
1026 VOID
1028  IN BOOLEAN StartBootLog
1029 );
1030 
1031 INIT_FUNCTION
1032 VOID
1034  VOID
1035 );
1036 
1037 VOID
1039  VOID
1040 );
1041 
1042 VOID
1043 IopBootLog(
1044  IN PUNICODE_STRING DriverName,
1046 );
1047 
1048 VOID
1050  VOID
1051 );
1052 
1053 //
1054 // I/O Cancellation Routines
1055 //
1056 VOID
1057 NTAPI
1060 );
1061 
1062 VOID
1064  VOID
1065 );
1066 
1067 //
1068 // I/O Completion
1069 //
1070 VOID
1071 NTAPI
1073  IN PKAPC Apc,
1074  IN PKNORMAL_ROUTINE* NormalRoutine,
1075  IN PVOID* NormalContext,
1078 );
1079 
1080 //
1081 // Error Logging Routines
1082 //
1083 VOID
1084 NTAPI
1086  VOID
1087 );
1088 
1089 VOID
1090 NTAPI
1091 IopLogWorker(
1093 );
1094 
1095 //
1096 // Raw File System MiniDriver
1097 //
1098 BOOLEAN
1101 );
1102 
1103 INIT_FUNCTION
1104 NTSTATUS
1105 NTAPI
1109 );
1110 
1111 //
1112 // PnP Root MiniDriver
1113 //
1114 NTSTATUS
1115 NTAPI
1119 );
1120 
1121 NTSTATUS
1126  OUT OPTIONAL PUNICODE_STRING FullInstancePath
1127 );
1128 
1129 NTSTATUS
1132 
1133 //
1134 // Driver Routines
1135 //
1136 INIT_FUNCTION
1137 VOID
1138 FASTCALL
1140  VOID
1141 );
1142 
1143 INIT_FUNCTION
1144 VOID
1145 FASTCALL
1147  VOID
1148 );
1149 
1150 NTSTATUS
1151 NTAPI
1153  IN PDRIVER_INITIALIZE InitializationFunction,
1156  IN PLDR_DATA_TABLE_ENTRY ModuleObject OPTIONAL,
1157  OUT PDRIVER_OBJECT *pDriverObject);
1158 
1159 VOID
1160 NTAPI
1162  IN PVOID ObjectBody
1163 );
1164 
1165 NTSTATUS
1166 FASTCALL
1171 );
1172 
1173 NTSTATUS
1174 FASTCALL
1177  OUT PLDR_DATA_TABLE_ENTRY *ModuleObject
1178 );
1179 
1180 NTSTATUS
1181 NTAPI
1185 );
1186 
1187 NTSTATUS
1188 FASTCALL
1191  IN PLDR_DATA_TABLE_ENTRY ModuleObject,
1193  IN BOOLEAN FileSystemDriver,
1195 );
1196 
1197 NTSTATUS
1198 FASTCALL
1201  IN HANDLE EnumSubKey,
1202  IN HANDLE ClassKey,
1203  IN BOOLEAN Lower
1204 );
1205 
1206 VOID
1207 NTAPI
1209  VOID
1210 );
1211 
1212 VOID
1213 NTAPI
1215  VOID
1216 );
1217 
1218 //
1219 // File Routines
1220 //
1221 VOID
1222 NTAPI
1223 IopDeleteDevice(IN PVOID ObjectBody);
1224 
1225 NTSTATUS
1226 NTAPI
1228  IN PVOID ParseObject,
1233  IN OUT PUNICODE_STRING CompleteName,
1235  IN OUT PVOID Context,
1237  OUT PVOID *Object
1238 );
1239 
1240 NTSTATUS
1241 NTAPI
1242 IopParseFile(
1243  IN PVOID ParseObject,
1248  IN OUT PUNICODE_STRING CompleteName,
1252  OUT PVOID *Object
1253 );
1254 
1255 VOID
1256 NTAPI
1258  IN PVOID ObjectBody
1259 );
1260 
1261 NTSTATUS
1262 NTAPI
1264  IN PVOID ObjectBody,
1265  IN SECURITY_OPERATION_CODE OperationCode,
1269  OUT PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
1272 );
1273 
1274 NTSTATUS
1275 NTAPI
1276 IopQueryName(
1277  IN PVOID ObjectBody,
1278  IN BOOLEAN HasName,
1279  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1280  IN ULONG Length,
1283 );
1284 
1285 NTSTATUS
1286 NTAPI
1288  IN PVOID ObjectBody,
1289  IN BOOLEAN HasName,
1290  IN BOOLEAN QueryDosName,
1291  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1292  IN ULONG Length,
1295 );
1296 
1297 VOID
1298 NTAPI
1299 IopCloseFile(
1301  IN PVOID Object,
1304  IN ULONG SystemHandleCount
1305 );
1306 
1307 NTSTATUS
1308 NTAPI
1313  _Out_ PBOOLEAN LockFailed
1314 );
1315 
1316 PVOID
1317 NTAPI
1320 );
1321 
1322 NTSTATUS
1323 NTAPI
1327  IN BOOLEAN Define
1328 );
1329 
1330 VOID
1331 NTAPI
1333  IN PIRP Irp,
1335  IN PREPARSE_DATA_BUFFER DataBuffer
1336 );
1337 
1338 NTSTATUS
1339 NTAPI
1343 );
1344 
1345 NTSTATUS
1346 NTAPI
1349  IN ULONG Length,
1350  IN FILE_INFORMATION_CLASS FileInfoClass,
1351  OUT PVOID Buffer,
1353 );
1354 
1355 BOOLEAN
1356 NTAPI
1358  IN PDEVICE_OBJECT BaseDeviceObject,
1359  IN PDEVICE_OBJECT TopDeviceObjectHint
1360 );
1361 
1362 //
1363 // I/O Timer Routines
1364 //
1365 VOID
1366 FASTCALL
1368  VOID
1369 );
1370 
1371 VOID
1372 NTAPI
1375 );
1376 
1377 //
1378 // I/O Completion Routines
1379 //
1380 VOID
1381 NTAPI
1383  PVOID ObjectBody
1384 );
1385 
1386 NTSTATUS
1387 NTAPI
1390  IN PVOID KeyContext,
1393  IN ULONG_PTR IoStatusInformation,
1394  IN BOOLEAN Quota
1395 );
1396 
1397 //
1398 // Ramdisk Routines
1399 //
1400 INIT_FUNCTION
1401 NTSTATUS
1402 NTAPI
1404  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1405 );
1406 
1407 //
1408 // Configuration Routines
1409 //
1410 NTSTATUS
1411 NTAPI
1413  IN GUID Guid,
1415  IN PULONG Interfaces
1416 );
1417 
1418 VOID
1419 NTAPI
1420 IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceName,
1421  IN PUNICODE_STRING OsLoaderPathName
1422 );
1423 
1424 //
1425 // Device action
1426 //
1427 VOID
1429  _In_ PDEVICE_ACTION_DATA ActionData
1430 );
1431 
1432 //
1433 // Global I/O Data
1434 //
1438 extern ULONG IopTraceLevel;
1446 extern PVOID IopTriageDumpDataBlocks[64];
1453 
1454 //
1455 // Inlined Functions
1456 //
1457 #include "io_x.h"
PVOID Context
Definition: io.h:311
NTSTATUS NTAPI PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, IN BOOLEAN LoadDriver, IN PDRIVER_OBJECT DriverObject)
Definition: pnpinit.c:240
#define MAXIMUM_PROCESSORS
Definition: rwlock.h:5
PDEVICE_OBJECT TopDeviceObjectHint
Definition: io.h:98
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:130
NTSTATUS NTAPI IopGetFileInformation(IN PFILE_OBJECT FileObject, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInfoClass, OUT PVOID Buffer, OUT PULONG ReturnedLength)
Definition: iofunc.c:775
* PNTSTATUS
Definition: strlen.c:14
PDEVICE_OBJECT DeviceObject
Definition: io.h:450
ObjectType
Definition: metafile.c:80
_In_ PVOID _In_ BOOLEAN Alertable
Definition: exfuncs.h:452
VOID NTAPI IopCompleteRequest(IN PKAPC Apc, IN PKNORMAL_ROUTINE *NormalRoutine, IN PVOID *NormalContext, IN PVOID *SystemArgument1, IN PVOID *SystemArgument2)
Definition: irp.c:238
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING KeyName
Definition: ndis.h:4711
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
VOID IopQueueDeviceAction(_In_ PDEVICE_ACTION_DATA ActionData)
Definition: pnpmgr.c:1121
GUID Guids[1]
Definition: io.h:440
#define IN
Definition: typedefs.h:39
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
Definition: iofuncs.h:719
PIO_WORKITEM_ROUTINE WorkerRoutine
Definition: io.h:310
NTSTATUS NTAPI IoGetRelatedTargetDevice(IN PFILE_OBJECT FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1607
USHORT ShareAccess
Definition: io.h:375
NTSTATUS NTAPI IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IoStackLocation, OUT PVOID *Information)
Definition: pnpmgr.c:1490
PDEVICE_NODE IopRootDeviceNode
Definition: pnpmgr.c:18
enum _COMPLETION_PACKET_TYPE * PCOMPLETION_PACKET_TYPE
NTSTATUS IopInitializePnpServices(IN PDEVICE_NODE DeviceNode)
Definition: pnpmgr.c:3181
INIT_FUNCTION NTSTATUS NTAPI RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: rawfs.c:1193
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_ * SymbolicLinkList(return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList
VOID NTAPI IopAbortInterruptedIrp(IN PKEVENT EventObject, IN PIRP Irp)
Definition: irp.c:67
HAL_DISPATCH _HalDispatchTable
BOOT_DRIVER_LIST_ENTRY ListEntry
Definition: io.h:426
ULONG Options
Definition: io.h:378
PVOID IoOpenFileOnDevice(IN PVOID SymbolicLink, IN PWCHAR Name)
INIT_FUNCTION BOOLEAN NTAPI IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: iomgr.c:470
PWCHAR FileSystem
Definition: format.c:72
VOID NTAPI IoCancelThreadIo(IN PETHREAD Thread)
Definition: irp.c:1146
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG _In_opt_ PVOID _In_opt_ PVOID FilterContext
Definition: fsrtlfuncs.h:738
VOID NTAPI IoInitFileSystemImplementation(VOID)
ULONG_PTR IoStatusInformation
Definition: io.h:290
VOID NTAPI IopReinitializeDrivers(VOID)
Definition: driver.c:1413
VOID NTAPI IopCloseFile(IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
Definition: file.c:2177
VOID NTAPI IoShutdownSystem(IN ULONG Phase)
Definition: device.c:133
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4711
struct _RESERVE_IRP_ALLOCATOR RESERVE_IRP_ALLOCATOR
struct _FS_CHANGE_NOTIFY_ENTRY * PFS_CHANGE_NOTIFY_ENTRY
BOOLEAN RawFsIsRawFileSystemDeviceObject(IN PDEVICE_OBJECT DeviceObject)
ULONG_PTR Information
Definition: io.h:368
VOID IopStopBootLog(VOID)
Definition: bootlog.c:51
ULONG EaLength
Definition: io.h:377
NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
Definition: pnpmgr.c:1640
IN PLARGE_INTEGER IN ULONG IN BOOLEAN IN ULONG IN BOOLEAN OUT PIO_STATUS_BLOCK IoStatus
Definition: fatprocs.h:2650
NTSTATUS NTAPI IopParseFile(IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
Definition: file.c:1318
struct _IO_UNLOAD_SAFE_COMPLETION_CONTEXT IO_UNLOAD_SAFE_COMPLETION_CONTEXT
_In_ PIRP Irp
Definition: csq.h:116
IO_WORKITEM_ROUTINE * PIO_WORKITEM_ROUTINE
Definition: iotypes.h:483
NTSTATUS NTAPI IopMountVolume(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN AllowRawMount, IN BOOLEAN DeviceIsLocked, IN BOOLEAN Alertable, OUT PVPB *Vpb)
Definition: volume.c:467
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
struct _ERROR_LOG_ENTRY ERROR_LOG_ENTRY
KINTERRUPT FirstInterrupt
Definition: io.h:319
struct _ERROR_LOG_ENTRY * PERROR_LOG_ENTRY
VOID IoInitCancelHandling(VOID)
uint16_t * PWSTR
Definition: typedefs.h:55
BOOLEAN NTAPI PpInitSystem(VOID)
Definition: pnpmgr.c:4017
enum _SECURITY_DESCRIPTOR_TYPE * PSECURITY_DESCRIPTOR_TYPE
PVOID Context
Definition: io.h:471
ULONG IopNumTriageDumpDataBlocks
Definition: iomgr.c:46
enum _COMPLETION_PACKET_TYPE COMPLETION_PACKET_TYPE
_IOP_TRANSFER_TYPE
Definition: io.h:255
IO_REMOVE_LOCK_COMMON_BLOCK Common
Definition: io.h:344
ULONG ErrorControl
Definition: io.h:430
char CHAR
Definition: xmlstorage.h:175
struct _OPEN_PACKET OPEN_PACKET
LONG NTSTATUS
Definition: precomp.h:26
ULONG ParseCheck
Definition: io.h:369
PVOID ExtraCreateParameters
Definition: io.h:383
PFILE_BASIC_INFORMATION BasicInformation
Definition: io.h:380
NTSTATUS IopCreateDeviceNode(IN PDEVICE_NODE ParentNode, IN PDEVICE_OBJECT PhysicalDeviceObject, IN PUNICODE_STRING ServiceName, OUT PDEVICE_NODE *DeviceNode)
VOID NTAPI IopReinitializeBootDrivers(VOID)
Definition: driver.c:1449
DEVICETREE_TRAVERSE_ROUTINE Action
Definition: io.h:509
VOID NTAPI IopDereferenceDeviceObject(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN ForceUnload)
Definition: device.c:462
OBJECT_HEADER ObjectHeader
Definition: io.h:354
LARGE_INTEGER AllocationSize
Definition: io.h:372
WORK_QUEUE_ITEM WorkItem
Definition: io.h:401
static const CLASS_AND_INTERFACES ExpectedInterfaces[]
Definition: browseui.c:13
CSHORT Type
Definition: io.h:364
NTSTATUS FASTCALL IopLoadServiceModule(IN PUNICODE_STRING ServiceName, OUT PLDR_DATA_TABLE_ENTRY *ModuleObject)
Definition: driver.c:314
struct _IO_UNLOAD_SAFE_COMPLETION_CONTEXT * PIO_UNLOAD_SAFE_COMPLETION_CONTEXT
struct _BOOT_DRIVER_NODE * PBOOT_DRIVER_NODE
FAST_MUTEX Lock
Definition: io.h:439
struct _DRIVER_INFORMATION DRIVER_INFORMATION
VOID FASTCALL IopInitTimerImplementation(VOID)
struct _DEVICE_ACTION_DATA::@1741::@1743 InvalidateDeviceRelations
NTSTATUS NTAPI IoSetIoCompletion(IN PVOID IoCompletion, IN PVOID KeyContext, IN PVOID ApcContext, IN NTSTATUS IoStatus, IN ULONG_PTR IoStatusInformation, IN BOOLEAN Quota)
Definition: iocomp.c:147
PDEVICE_OBJECT DeviceObject
Definition: io.h:332
RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator
Definition: irp.c:19
LIST_ENTRY ShutdownList
Definition: io.h:449
LIST_ENTRY IopErrorLogListHead
Definition: error.c:30
BOOLEAN NTAPI IopVerifyDeviceObjectOnStack(IN PDEVICE_OBJECT BaseDeviceObject, IN PDEVICE_OBJECT TopDeviceObjectHint)
Definition: device.c:695
uint16_t * PWCHAR
Definition: typedefs.h:55
NTSTATUS NTAPI IopGetSetSecurityObject(IN PVOID ObjectBody, IN SECURITY_OPERATION_CODE OperationCode, IN PSECURITY_INFORMATION SecurityInformation, IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN OUT PULONG BufferLength, OUT PSECURITY_DESCRIPTOR *OldSecurityDescriptor, IN POOL_TYPE PoolType, IN OUT PGENERIC_MAPPING GenericMapping)
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1122
_In_ PVOID Parameter
Definition: ldrtypes.h:241
KEVENT Event
Definition: io.h:402
ULONG IopTraceLevel
Definition: iomgr.c:16
VOID IoInitShutdownNotification(VOID)
DEVICE_ACTION Action
Definition: io.h:554
#define FASTCALL
Definition: nt_native.h:50
BOOLEAN TraversedMountPoint
Definition: io.h:389
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
NTSTATUS NTAPI IopFixupResourceListWithRequirements(IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList, OUT PCM_RESOURCE_LIST *ResourceList)
Definition: pnpres.c:206
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:50
enum _IO_NOTIFICATION_EVENT_CATEGORY IO_NOTIFICATION_EVENT_CATEGORY
INIT_FUNCTION NTSTATUS IopInitPlugPlayEvents(VOID)
Definition: plugplay.c:34
#define _In_opt_
Definition: no_sal2.h:213
KSPIN_LOCK IopDeviceActionLock
Definition: pnpmgr.c:39
GENERIC_MAPPING IopCompletionMapping
Definition: iocomp.c:20
USHORT NTAPI PpInitGetGroupOrderIndex(IN HANDLE ServiceHandle)
Definition: pnpinit.c:103
BOOLEAN NTAPI IoInitializeCrashDump(IN HANDLE PageFileHandle)
Definition: iomgr.c:656
struct _DRIVER_INFORMATION * PDRIVER_INFORMATION
CSHORT Size
Definition: io.h:365
PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: io.h:300
uint32_t ULONG_PTR
Definition: typedefs.h:64
PFILE_OBJECT FileObject
Definition: io.h:366
LIST_ENTRY ItemEntry
Definition: io.h:468
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE GENERAL_LOOKASIDE
Definition: arc.h:198
GENERAL_LOOKASIDE IopMdlLookasideList
Definition: iomgr.c:85
NTSTATUS NTAPI IopFetchConfigurationInformation(OUT PWSTR *SymbolicLinkList, IN GUID Guid, IN ULONG ExpectedInterfaces, IN PULONG Interfaces)
Definition: iorsrce.c:656
INIT_FUNCTION NTSTATUS NTAPI IopStartRamdisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: ramdisk.c:28
PVOID EaBuffer
Definition: io.h:376
NTSTATUS IopStartDevice(IN PDEVICE_NODE DeviceNode)
CSHORT Size
Definition: io.h:330
_In_ PUNICODE_STRING ValueName
Definition: cmfuncs.h:264
NTSTATUS NTAPI IopCreateRegistryKeyEx(OUT PHANDLE Handle, IN HANDLE BaseHandle OPTIONAL, IN PUNICODE_STRING KeyName, IN ACCESS_MASK DesiredAccess, IN ULONG CreateOptions, OUT PULONG Disposition OPTIONAL)
PDEVICE_NODE NTAPI PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: pnpmgr.c:4045
NTSTATUS NTAPI IopCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction, IN PUNICODE_STRING RegistryPath OPTIONAL, IN PCUNICODE_STRING ServiceName, IN PLDR_DATA_TABLE_ENTRY ModuleObject OPTIONAL, OUT PDRIVER_OBJECT *pDriverObject)
Definition: driver.c:1485
POBJECT_TYPE _IoFileObjectType
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_IOP_DEVICE_LIST_OPERATION
Definition: io.h:246
PFILE_OBJECT RelatedFileObject
Definition: io.h:370
ULONG NTAPI PnpDetermineResourceListSize(IN PCM_RESOURCE_LIST ResourceList)
Definition: pnpmgr.c:4155
BOOLEAN Override
Definition: io.h:384
LIST_ENTRY RequestListEntry
Definition: io.h:552
CREATE_FILE_TYPE CreateFileType
Definition: io.h:382
long LONG
Definition: pedump.c:60
_In_ ULONG BufferLength
Definition: usbdlib.h:225
NTSTATUS IopRemoveDevice(IN PDEVICE_NODE DeviceNode)
CSHORT Type
Definition: io.h:329
struct _IO_INTERRUPT * PIO_INTERRUPT
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:396
INIT_FUNCTION NTSTATUS NTAPI IopInitializePlugPlayServices(VOID)
Definition: pnpinit.c:380
NTSTATUS NTAPI IopParseDevice(IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
Definition: file.c:324
struct _IO_BUS_TYPE_GUID_LIST * PIO_BUS_TYPE_GUID_LIST
PDEVICE_OBJECT DeviceObject
Definition: io.h:309
LIST_ENTRY Link
Definition: io.h:411
BOOLEAN NTAPI IopInitializeReserveIrp(IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator)
Definition: irp.c:549
LIST_ENTRY IopDeviceActionRequestList
Definition: pnpmgr.c:36
struct _DRIVER_REINIT_ITEM * PDRIVER_REINIT_ITEM
VOID NTAPI IopDeleteDevice(IN PVOID ObjectBody)
Definition: device.c:52
PIRP NTAPI IopAllocateReserveIrp(IN CCHAR StackSize)
Definition: irp.c:573
NTSTATUS IopStopDevice(IN PDEVICE_NODE DeviceNode)
unsigned char BOOLEAN
VOID(NTAPI * PDRIVER_REINITIALIZE)(_In_ struct _DRIVER_OBJECT *DriverObject, _In_opt_ PVOID Context, _In_ ULONG Count)
Definition: iotypes.h:4099
static GUID * Guid
Definition: apphelp.c:93
PVOID FilterContext
Definition: io.h:99
NTSTATUS IoDestroyDriverList(VOID)
HANDLE ServiceHandle
Definition: io.h:414
struct _OPEN_PACKET * POPEN_PACKET
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID NTAPI IopDeleteFile(IN PVOID ObjectBody)
Definition: file.c:1354
INIT_FUNCTION VOID FASTCALL IopInitializeSystemDrivers(VOID)
Definition: driver.c:1135
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
NTSTATUS NTAPI IopQueryNameInternal(IN PVOID ObjectBody, IN BOOLEAN HasName, IN BOOLEAN QueryDosName, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength, IN KPROCESSOR_MODE PreviousMode)
Definition: file.c:1943
struct _LOAD_UNLOAD_PARAMS * PLOAD_UNLOAD_PARAMS
PDRIVER_OBJECT DriverObject
Definition: io.h:469
Definition: bufpool.h:45
USHORT TagPosition
Definition: io.h:415
NTSTATUS FASTCALL IopInitializeDevice(IN PDEVICE_NODE DeviceNode, IN PDRIVER_OBJECT DriverObject)
IO_REMOVE_LOCK_DBG_BLOCK Dbg
Definition: io.h:345
VOID NTAPI IoInitVpbImplementation(VOID)
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
_In_ PCUNICODE_STRING _In_ PVOID Driver
Definition: cmfuncs.h:32
INIT_FUNCTION VOID FASTCALL IopInitializeBootDrivers(VOID)
Definition: driver.c:939
struct _DEVICETREE_TRAVERSE_CONTEXT * PDEVICETREE_TRAVERSE_CONTEXT
_COMPLETION_PACKET_TYPE
Definition: io.h:265
BOOLEAN IoRemoteBootClient
Definition: init.c:67
NTSTATUS IopEnumerateDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnpmgr.c:2740
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
NTSTATUS Status
Definition: io.h:418
enum _DEVICE_ACTION DEVICE_ACTION
Definition: io.h:248
struct _BOOT_DRIVER_NODE BOOT_DRIVER_NODE
NTSTATUS NTAPI PnpRootDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: pnproot.c:1419
enum _IOP_TRANSFER_TYPE IOP_TRANSFER_TYPE
BOOLEAN DeleteOnly
Definition: io.h:386
FAST_MUTEX
Definition: extypes.h:17
_In_opt_ PVOID _In_opt_ PVOID SystemArgument1
Definition: ketypes.h:675
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: directory.c:44
NTSTATUS NTAPI IopCleanupFailedIrp(IN PFILE_OBJECT FileObject, IN PKEVENT EventObject, IN PVOID Buffer OPTIONAL)
Definition: irp.c:45
_In_ HANDLE Handle
Definition: extypes.h:390
struct _SHUTDOWN_ENTRY SHUTDOWN_ENTRY
_SECURITY_DESCRIPTOR_TYPE
Definition: io.h:532
VOID PnpInit2(VOID)
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
NTSTATUS IoCreateDriverList(VOID)
CHAR FileObjectBody[sizeof(FILE_OBJECT)]
Definition: io.h:355
NTSTATUS IopQueueTargetDeviceEvent(const GUID *Guid, PUNICODE_STRING DeviceIds)
Definition: plugplay.c:46
UNICODE_STRING Name
Definition: io.h:428
struct _IO_WORKITEM IO_WORKITEM
PDRIVER_OBJECT DriverObject
Definition: io.h:459
PIRP NTAPI IopAllocateIrpMustSucceed(IN CCHAR StackSize)
Definition: irp.c:716
LPTSTR ServiceName
Definition: ServiceMain.c:15
PDEVICE_OBJECT NTAPI IopGetDeviceAttachmentBase(IN PDEVICE_OBJECT DeviceObject)
Definition: file.c:1485
BOOLEAN QueryOnly
Definition: io.h:385
ULONG Tag
Definition: io.h:429
DEVICE_RELATION_TYPE Type
Definition: io.h:559
PDEVICE_OBJECT DeviceObject
Definition: io.h:298
NTSTATUS NTAPI IopReferenceDeviceObject(IN PDEVICE_OBJECT DeviceObject)
DWORD * PSECURITY_INFORMATION
Definition: ms-dtyp.idl:311
USHORT FileAttributes
Definition: io.h:374
char CCHAR
Definition: typedefs.h:51
INT POOL_TYPE
Definition: typedefs.h:77
VOID NTAPI IopRemoveTimerFromTimerList(IN PIO_TIMER Timer)
Definition: iotimer.c:70
struct _IO_INTERRUPT IO_INTERRUPT
INIT_FUNCTION NTSTATUS NTAPI IopReassignSystemRoot(IN PLOADER_PARAMETER_BLOCK LoaderBlock, OUT PANSI_STRING NtBootPath)
Definition: arcname.c:836
PVOID NTAPI IoGetFileObjectFilterContext(IN PFILE_OBJECT FileObject)
Definition: file.c:2495
NTSTATUS NTAPI IoComputeDesiredAccessFileObject(IN PFILE_OBJECT FileObject, IN PACCESS_MASK DesiredAccess)
Definition: util.c:26
VOID IopBootLog(IN PUNICODE_STRING DriverName, IN BOOLEAN Success)
volatile LONG ReserveIrpInUse
Definition: io.h:524
struct _IO_BUS_TYPE_GUID_LIST IO_BUS_TYPE_GUID_LIST
VOID NTAPI IopInitErrorLog(VOID)
PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList
struct _EXTENDED_IO_REMOVE_LOCK * PEXTENDED_IO_REMOVE_LOCK
enum _IOP_DEVICE_LIST_OPERATION * PIOP_DEVICE_LIST_OPERATION
OBJECT_ATTRIBUTES OriginalAttributes
Definition: io.h:371
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
PVPB NTAPI IopCheckVpbMounted(IN POPEN_PACKET OpenPacket, IN PDEVICE_OBJECT DeviceObject, IN PUNICODE_STRING RemainingName, OUT PNTSTATUS Status)
Definition: volume.c:81
PDEVICE_NODE FirstDeviceNode
Definition: io.h:504
NTSTATUS FASTCALL IopGetDriverObject(OUT PDRIVER_OBJECT *DriverObject, IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystem)
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG CreateOptions
Definition: fltkernel.h:1230
#define _Inout_
Definition: no_sal2.h:244
struct _DRIVER_REINIT_ITEM DRIVER_REINIT_ITEM
PFILE_NETWORK_OPEN_INFORMATION NetworkInformation
Definition: io.h:381
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
ULONG InternalFlags
Definition: io.h:390
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID NTAPI IopReadyDeviceObjects(IN PDRIVER_OBJECT Driver)
Definition: device.c:34
KSPIN_LOCK SpinLock
Definition: io.h:321
* PFILE_OBJECT
Definition: iotypes.h:1955
VOID NTAPI IopDeleteIoCompletion(PVOID ObjectBody)
Definition: iocomp.c:100
static IUnknown Object
Definition: main.c:512
Definition: Node.h:9
NTSTATUS IopGetSystemPowerDeviceObject(IN PDEVICE_OBJECT *DeviceObject)
_In_opt_ PVOID _In_opt_ PUNICODE_STRING _In_ PSECURITY_DESCRIPTOR _In_ PACCESS_STATE AccessState
Definition: sefuncs.h:414
NTSTATUS NTAPI IopCreateVpb(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:163
unsigned char UCHAR
Definition: xmlstorage.h:181
VOID IopNotifyPlugPlayNotification(IN PDEVICE_OBJECT DeviceObject, IN IO_NOTIFICATION_EVENT_CATEGORY EventCategory, IN LPCGUID Event, IN PVOID EventCategoryData1, IN PVOID EventCategoryData2)
Definition: pnpnotify.c:36
PDRIVER_OBJECT IopRootDriverObject
Definition: pnpmgr.c:34
char * PBOOLEAN
Definition: retypes.h:11
PBOOT_DRIVER_LIST_ENTRY DataTableEntry
Definition: io.h:413
DRIVER_INITIALIZE * PDRIVER_INITIALIZE
Definition: iotypes.h:2127
Definition: io.h:327
NTSTATUS Status
Definition: io.h:399
#define NTSTATUS
Definition: precomp.h:20
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
NTSTATUS NTAPI PnpRegMultiSzToUnicodeStrings(IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation, OUT PUNICODE_STRING *UnicodeStringList, OUT PULONG UnicodeStringCount)
Definition: pnputil.c:47
struct _IO_STACK_LOCATION * CurrentStackLocation
Definition: io.h:283
_In_ ULONG _In_ BATTERY_QUERY_INFORMATION_LEVEL _In_ LONG _In_ ULONG _Out_ PULONG ReturnedLength
Definition: batclass.h:187
WORK_QUEUE_ITEM Item
Definition: io.h:308
Definition: btrfs_drv.h:1853
Definition: ketypes.h:535
Definition: typedefs.h:118
PDRIVER_FS_NOTIFICATION FSDNotificationProc
Definition: io.h:460
_In_ USHORT _In_ CCHAR StackSize
Definition: iofuncs.h:1056
struct _DEVICE_ACTION_DATA * PDEVICE_ACTION_DATA
LARGE_INTEGER TimeStamp
Definition: io.h:334
_In_ UCHAR MinorFunction
Definition: pofuncs.h:42
ULONG Failed
Definition: io.h:416
struct _FILE_OBJECT_EXTENSION * PFILE_OBJECT_EXTENSION
* PDEVICE_CAPABILITIES
Definition: iotypes.h:928
PVOID IopTriageDumpDataBlocks[64]
Definition: iomgr.c:47
PDRIVER_OBJECT DriverObject
Definition: io.h:403
UNICODE_STRING Group
Definition: io.h:427
Status
Definition: gdiplustypes.h:24
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
struct _IOP_MINI_COMPLETION_PACKET * PIOP_MINI_COMPLETION_PACKET
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
NTSTATUS NTAPI IopLoadUnloadDriver(_In_opt_ PCUNICODE_STRING RegistryPath, _Inout_ PDRIVER_OBJECT *DriverObject)
Definition: driver.c:1905
NTSTATUS(* DEVICETREE_TRAVERSE_ROUTINE)(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
Definition: io.h:486
VOID NTAPI IopUnloadDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:390
struct _FS_CHANGE_NOTIFY_ENTRY FS_CHANGE_NOTIFY_ENTRY
static GENERIC_MAPPING GenericMapping
Definition: SeInheritance.c:11
KSPIN_LOCK IopDeviceTreeLock
Definition: pnpmgr.c:19
struct _RESERVE_IRP_ALLOCATOR * PRESERVE_IRP_ALLOCATOR
NTSTATUS NTAPI IopGetRegistryValue(IN HANDLE Handle, IN PWSTR ValueName, OUT PKEY_VALUE_FULL_INFORMATION *Information)
Definition: pnpmgr.c:3911
PCUNICODE_STRING RegistryPath
Definition: io.h:400
LIST_ENTRY ListEntry
Definition: io.h:331
_Must_inspect_result_ _In_ USHORT _In_ PHIDP_PREPARSED_DATA _Out_writes_to_ LengthAttributes PHIDP_EXTENDED_ATTRIBUTES Attributes
Definition: hidpi.h:348
struct _DEVICE_ACTION_DATA DEVICE_ACTION_DATA
BOOLEAN NTAPI IopVerifyDiskSignature(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout, IN PARC_DISK_SIGNATURE ArcDiskSignature, OUT PULONG Signature)
Definition: arcname.c:944
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:3760
PVOID IoOpenSymlink(IN PVOID SymbolicLink)
VOID NTAPI IopShutdownBaseFileSystems(IN PLIST_ENTRY ListHead)
Definition: volume.c:354
struct _LOAD_UNLOAD_PARAMS LOAD_UNLOAD_PARAMS
VOID NTAPI IopLogWorker(IN PVOID Parameter)
Definition: error.c:148
ULONG Processed
Definition: io.h:417
unsigned short USHORT
Definition: pedump.c:61
_DEVICE_ACTION
Definition: io.h:544
INIT_FUNCTION NTSTATUS NTAPI IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: arcname.c:41
struct _FILE_OBJECT_EXTENSION FILE_OBJECT_EXTENSION
PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList
Definition: pnpmgr.c:35
PDUMMY_FILE_OBJECT LocalFileObject
Definition: io.h:388
NTSTATUS FASTCALL IopInitializeDriverModule(IN PDEVICE_NODE DeviceNode, IN PLDR_DATA_TABLE_ENTRY ModuleObject, IN PUNICODE_STRING ServiceName, IN BOOLEAN FileSystemDriver, OUT PDRIVER_OBJECT *DriverObject)
Definition: driver.c:467
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
enum _IOP_DEVICE_LIST_OPERATION IOP_DEVICE_LIST_OPERATION
ULONG KSPIN_LOCK
Definition: env_spec_w32.h:72
NTSTATUS NTAPI IopQueryDeviceCapabilities(PDEVICE_NODE DeviceNode, PDEVICE_CAPABILITIES DeviceCaps)
Definition: pnpmgr.c:980
LIST_ENTRY ListEntry
Definition: io.h:280
static OUT PIO_STATUS_BLOCK IoStatusBlock
Definition: pipe.c:75
NTSTATUS FASTCALL IopAttachFilterDrivers(IN PDEVICE_NODE DeviceNode, IN HANDLE EnumSubKey, IN HANDLE ClassKey, IN BOOLEAN Lower)
unsigned int * PULONG
Definition: retypes.h:1
struct _IOP_MINI_COMPLETION_PACKET IOP_MINI_COMPLETION_PACKET
struct _DUMMY_FILE_OBJECT DUMMY_FILE_OBJECT
NTSTATUS NTAPI IoChangeFileObjectFilterContext(IN PFILE_OBJECT FileObject, IN PVOID FilterContext, IN BOOLEAN Define)
Definition: file.c:2510
VOID IopInitPnpNotificationImplementation(VOID)
INIT_FUNCTION NTSTATUS NTAPI IopUpdateRootKey(VOID)
Definition: pnpmgr.c:3702
struct _EXTENDED_IO_REMOVE_LOCK EXTENDED_IO_REMOVE_LOCK
IO_COMPLETION_ROUTINE * PIO_COMPLETION_ROUTINE
Definition: iotypes.h:2480
BOOLEAN NTAPI PnpRegSzToString(IN PWCHAR RegSzData, IN ULONG RegSzLength, OUT PUSHORT StringLength OPTIONAL)
Definition: pnputil.c:171
PDRIVER_OBJECT DriverObject
Definition: io.h:333
enum _SECURITY_DESCRIPTOR_TYPE SECURITY_DESCRIPTOR_TYPE
ULONG CreateOptions
Definition: io.h:373
VOID IopInitDriverImplementation(VOID)
KEVENT WaitEvent
Definition: io.h:525
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
Definition: iotypes.h:166
#define OUT
Definition: typedefs.h:40
VOID NTAPI IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceName, IN PUNICODE_STRING OsLoaderPathName)
Definition: iorsrce.c:697
BOOLEAN FullAttributes
Definition: io.h:387
struct _DEVICETREE_TRAVERSE_CONTEXT DEVICETREE_TRAVERSE_CONTEXT
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1069
ULONG Disposition
Definition: io.h:379
struct tagContext Context
Definition: acpixf.h:1034
struct _SHUTDOWN_ENTRY * PSHUTDOWN_ENTRY
unsigned int ULONG
Definition: retypes.h:1
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
VOID NTAPI IopDereferenceVpbAndFree(IN PVPB Vpb)
Definition: volume.c:191
VOID NTAPI IopDoNameTransmogrify(IN PIRP Irp, IN PFILE_OBJECT FileObject, IN PREPARSE_DATA_BUFFER DataBuffer)
Definition: file.c:170
NTSTATUS IopFreeDeviceNode(IN PDEVICE_NODE DeviceNode)
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:28
LIST_ENTRY FsChangeNotifyList
Definition: io.h:458
PDRIVER_REINITIALIZE ReinitRoutine
Definition: io.h:470
NTSTATUS NTAPI IopAcquireFileObjectLock(_In_ PFILE_OBJECT FileObject, _In_ KPROCESSOR_MODE AccessMode, _In_ BOOLEAN Alertable, _Out_ PBOOLEAN LockFailed)
Definition: file.c:2449
NTSTATUS NTAPI IopQueryName(IN PVOID ObjectBody, IN BOOLEAN HasName, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength, IN KPROCESSOR_MODE PreviousMode)
Definition: file.c:1925
VOID NTAPI IopDeleteDriver(IN PVOID ObjectBody)
Definition: driver.c:58
VOID(NTAPI * PKNORMAL_ROUTINE)(IN PVOID NormalContext OPTIONAL, IN PVOID SystemArgument1 OPTIONAL, IN PVOID SystemArgument2 OPTIONAL)
Definition: ketypes.h:632
PDEVICE_NODE DeviceNode
Definition: io.h:499
PKINTERRUPT Interrupt[MAXIMUM_PROCESSORS]
Definition: io.h:320
PDEVICE_OBJECT TopDeviceObjectHint
Definition: io.h:391
_In_ PSECURITY_SUBJECT_CONTEXT _In_ BOOLEAN _In_ ACCESS_MASK _In_ ACCESS_MASK _Outptr_opt_ PPRIVILEGE_SET _In_ PGENERIC_MAPPING _In_ KPROCESSOR_MODE _Out_ PACCESS_MASK GrantedAccess
Definition: sefuncs.h:13
GENERIC_MAPPING IopFileMapping
Definition: iomgr.c:49
Definition: io.h:447
Definition: io.h:249
static const WCHAR Signature[]
Definition: parser.c:141
PDEVICE_OBJECT DeviceObject
Definition: io.h:553
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444
short CSHORT
Definition: umtypes.h:127
NTSTATUS FinalStatus
Definition: io.h:367
NTSTATUS NTAPI IopInitiatePnpIrp(IN PDEVICE_OBJECT DeviceObject, IN PIO_STATUS_BLOCK IoStatusBlock, IN UCHAR MinorFunction, IN PIO_STACK_LOCATION Stack)
NTSTATUS IopActionInitChildServices(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
POBJECT_TYPE IoCompletionType
Definition: iocomp.c:16
NTSTATUS NTAPI IopDetectResourceConflict(IN PCM_RESOURCE_LIST ResourceList, IN BOOLEAN Silent, OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor)
Definition: pnpres.c:1209
NTSTATUS IopActionConfigureChildServices(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
INIT_FUNCTION NTSTATUS NTAPI PiInitCacheGroupInformation(VOID)
Definition: pnpinit.c:48
SECURITY_OPERATION_CODE
Definition: setypes.h:142
unsigned short * PUSHORT
Definition: retypes.h:2
ULONG ACCESS_MASK
Definition: nt_native.h:40
struct _DUMMY_FILE_OBJECT * PDUMMY_FILE_OBJECT
IN OUT PVCB IN PDEVICE_OBJECT IN PVPB Vpb
Definition: fatprocs.h:1664
VOID IopSaveBootLogToFile(VOID)
Definition: bootlog.c:293
INIT_FUNCTION VOID IopStartBootLog(VOID)
Definition: bootlog.c:43
DRIVER_FS_NOTIFICATION * PDRIVER_FS_NOTIFICATION
Definition: iotypes.h:7005
static const WCHAR SymbolicLink[]
Definition: interface.c:31
Iosb Information
Definition: create.c:4377
PDEVICE_NODE FASTCALL IopGetDeviceNode(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS NTAPI IoCompletion(PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Ctx)
Definition: control.c:382
PDRIVER_OBJECT DriverObject
Definition: io.h:412
NTSTATUS PnpRootCreateDevice(IN PUNICODE_STRING ServiceName, IN OPTIONAL PDRIVER_OBJECT DriverObject, OUT PDEVICE_OBJECT *PhysicalDeviceObject, OUT OPTIONAL PUNICODE_STRING FullInstancePath)
Definition: pnproot.c:186
Definition: io.h:456
INIT_FUNCTION VOID IopInitBootLog(IN BOOLEAN StartBootLog)
enum _IOP_TRANSFER_TYPE * PIOP_TRANSFER_TYPE
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
Definition: cdprocs.h:806
USHORT NTAPI PipGetDriverTagPriority(IN HANDLE ServiceHandle)
Definition: pnpinit.c:146
enum _CREATE_FILE_TYPE CREATE_FILE_TYPE
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68