ReactOS  0.4.15-dev-3440-g915569a
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 // Unable to create system root path when creating the RAM disk
85 //
86 #define RD_SYSROOT_INIT_FAILED 6
87 
88 //
89 // Max traversal of reparse points for a single open in IoParseDevice
90 //
91 #define IOP_MAX_REPARSE_TRAVERSAL 0x20
92 
93 //
94 // Private flags for IoCreateFile / IoParseDevice
95 //
96 #define IOP_USE_TOP_LEVEL_DEVICE_HINT 0x01
97 #define IOP_CREATE_FILE_OBJECT_EXTENSION 0x02
98 
99 
101 {
104 
106 
107 
108 
109 //
110 // We can call the Ob Inlined API, it's the same thing
111 //
112 #define IopAllocateMdlFromLookaside \
113  ObpAllocateObjectCreateInfoBuffer
114 #define IopFreeMdlFromLookaside \
115  ObpFreeCapturedAttributes
116 
117 //
118 // Determines if the IRP is Synchronous
119 //
120 #define IsIrpSynchronous(Irp, FileObject) \
121  ((Irp->Flags & IRP_SYNCHRONOUS_API) || \
122  (!(FileObject) ? \
123  FALSE : \
124  FileObject->Flags & FO_SYNCHRONOUS_IO)) \
125 
126 //
127 // Returns the internal Device Object Extension
128 //
129 #define IoGetDevObjExtension(DeviceObject) \
130  ((PEXTENDED_DEVOBJ_EXTENSION) \
131  (DeviceObject->DeviceObjectExtension)) \
132 
133 //
134 // Returns the internal Driver Object Extension
135 //
136 #define IoGetDrvObjExtension(DriverObject) \
137  ((PEXTENDED_DRIVER_EXTENSION) \
138  (DriverObject->DriverExtension)) \
139 
140 /*
141  * VOID
142  * IopDeviceNodeSetFlag(
143  * PDEVICE_NODE DeviceNode,
144  * ULONG Flag);
145  */
146 #define IopDeviceNodeSetFlag(DeviceNode, Flag) \
147  ((DeviceNode)->Flags |= (Flag))
148 
149 /*
150  * VOID
151  * IopDeviceNodeClearFlag(
152  * PDEVICE_NODE DeviceNode,
153  * ULONG Flag);
154  */
155 #define IopDeviceNodeClearFlag(DeviceNode, Flag) \
156  ((DeviceNode)->Flags &= ~(Flag))
157 
158 /*
159  * BOOLEAN
160  * IopDeviceNodeHasFlag(
161  * PDEVICE_NODE DeviceNode,
162  * ULONG Flag);
163  */
164 #define IopDeviceNodeHasFlag(DeviceNode, Flag) \
165  (((DeviceNode)->Flags & (Flag)) > 0)
166 
167 /*
168  * VOID
169  * IopDeviceNodeSetUserFlag(
170  * PDEVICE_NODE DeviceNode,
171  * ULONG UserFlag);
172  */
173 #define IopDeviceNodeSetUserFlag(DeviceNode, UserFlag) \
174  ((DeviceNode)->UserFlags |= (UserFlag))
175 
176 /*
177  * VOID
178  * IopDeviceNodeClearUserFlag(
179  * PDEVICE_NODE DeviceNode,
180  * ULONG UserFlag);
181  */
182 #define IopDeviceNodeClearUserFlag(DeviceNode, UserFlag)\
183  ((DeviceNode)->UserFlags &= ~(UserFlag))
184 
185 /*
186  * BOOLEAN
187  * IopDeviceNodeHasUserFlag(
188  * PDEVICE_NODE DeviceNode,
189  * ULONG UserFlag);
190  */
191 #define IopDeviceNodeHasUserFlag(DeviceNode, UserFlag) \
192  (((DeviceNode)->UserFlags & (UserFlag)) > 0)
193 
194  /*
195  * VOID
196  * IopDeviceNodeSetProblem(
197  * PDEVICE_NODE DeviceNode,
198  * ULONG Problem);
199  */
200 #define IopDeviceNodeSetProblem(DeviceNode, Problem) \
201  ((DeviceNode)->Problem |= (Problem))
202 
203 /*
204  * VOID
205  * IopDeviceNodeClearProblem(
206  * PDEVICE_NODE DeviceNode,
207  * ULONG Problem);
208  */
209 #define IopDeviceNodeClearProblem(DeviceNode, Problem) \
210  ((DeviceNode)->Problem &= ~(Problem))
211 
212 /*
213  * BOOLEAN
214  * IopDeviceNodeHasProblem(
215  * PDEVICE_NODE DeviceNode,
216  * ULONG Problem);
217  */
218 #define IopDeviceNodeHasProblem(DeviceNode, Problem) \
219  (((DeviceNode)->Problem & (Problem)) > 0)
220 
221 /*
222  * VOID
223  * IopInitDeviceTreeTraverseContext(
224  * PDEVICETREE_TRAVERSE_CONTEXT DeviceTreeTraverseContext,
225  * PDEVICE_NODE DeviceNode,
226  * DEVICETREE_TRAVERSE_ROUTINE Action,
227  * PVOID Context);
228  */
229 #define IopInitDeviceTreeTraverseContext( \
230  _DeviceTreeTraverseContext, _DeviceNode, _Action, \
231  _Context) { \
232  (_DeviceTreeTraverseContext)->FirstDeviceNode = \
233  (_DeviceNode); \
234  (_DeviceTreeTraverseContext)->Action = (_Action); \
235  (_DeviceTreeTraverseContext)->Context = (_Context); }
236 
237 /*
238  * BOOLEAN
239  * IopIsValidPhysicalDeviceObject(
240  * IN PDEVICE_OBJECT PhysicalDeviceObject);
241  */
242 #define IopIsValidPhysicalDeviceObject(PhysicalDeviceObject) \
243  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject) && \
244  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode) && \
245  (((PEXTENDED_DEVOBJ_EXTENSION)PhysicalDeviceObject->DeviceObjectExtension)->DeviceNode->Flags & DNF_ENUMERATED))
246 
247 //
248 // Device List Operations
249 //
251 {
255 
256 //
257 // Transfer statistics
258 //
259 typedef enum _IOP_TRANSFER_TYPE
260 {
265 
266 //
267 // Packet Types when piggybacking on the IRP Overlay
268 //
270  {
275 
276 //
277 // Special version of the IRP Overlay used to optimize I/O completion
278 // by not using up a separate structure.
279 //
281 {
282  struct
283  {
285  union
286  {
289  };
290  };
296 
297 //
298 // I/O Completion Context for IoSetIoCompletionRoutineEx
299 //
301 {
306 
307 //
308 // I/O Wrapper around the Executive Work Item
309 //
310 typedef struct _IO_WORKITEM
311 {
316 } IO_WORKITEM;
317 
318 //
319 // I/O Wrapper around the Kernel Interrupt
320 //
321 typedef struct _IO_INTERRUPT
322 {
327 
328 //
329 // I/O Error Log Packet Header
330 //
331 typedef struct _ERROR_LOG_ENTRY
332 {
340 
341 //
342 // To simplify matters, the kernel is made to support both the checked and free
343 // version of the I/O Remove Lock in the same binary. This structure includes
344 // both, since the DDK has the structure with a compile-time #ifdef.
345 //
347 {
351 
352 //
353 // Dummy File Object used inside the Open Packet so that OB knows how to
354 // deal with the Object Pointer even though it's not a real file.
355 //
356 typedef struct _DUMMY_FILE_OBJECT
357 {
361 
362 //
363 // Open packet used as a context for Device/File parsing so that the parse
364 // routine can know what operation is being requested.
365 //
366 typedef struct _OPEN_PACKET
367 {
397 
398 //
399 // Boot Driver List Entry
400 //
401 typedef struct _DRIVER_INFORMATION
402 {
412 
413 //
414 // Boot Driver Node
415 //
416 typedef struct _BOOT_DRIVER_NODE
417 {
424 
425 //
426 // List of Bus Type GUIDs
427 //
429 {
435 
436 //
437 // Shutdown entry for registed devices
438 //
439 typedef struct _SHUTDOWN_ENTRY
440 {
444 
445 //
446 // F/S Notification entry for registered File Systems
447 //
449 {
454 
455 //
456 // Driver (Boot) Re-Initialization Entry
457 //
458 typedef struct _DRIVER_REINIT_ITEM
459 {
465 
466 //
467 // Called on every visit of a node during a preorder-traversal of the device
468 // node tree.
469 // If the routine returns STATUS_UNSUCCESSFUL the traversal will stop and
470 // STATUS_SUCCESS is returned to the caller who initiated the tree traversal.
471 // Any other returned status code will be returned to the caller. If a status
472 // code that indicates an error (other than STATUS_UNSUCCESSFUL) is returned,
473 // the traversal is stopped immediately and the status code is returned to
474 // the caller.
475 //
476 typedef
477 NTSTATUS
481 );
482 
483 //
484 // Context information for traversing the device tree
485 //
487 {
488  //
489  // Current device node during a traversal
490  //
492 
493  //
494  // Initial device node where we start the traversal
495  //
497 
498  //
499  // Action routine to be called for every device node
500  //
502 
503  //
504  // Context passed to the action routine
505  //
508 
509 //
510 // Reserve IRP allocator
511 // Used for read paging IOs in low-memory situations
512 //
514 {
520 
521 //
522 // Type selection for IopCreateSecurityDescriptorPerType()
523 //
525 {
532 
533 //
534 // Action types and data for PiQueueDeviceAction()
535 //
536 typedef enum _DEVICE_ACTION
537 {
543 } DEVICE_ACTION;
544 
545 //
546 // Resource code
547 //
548 ULONG
549 NTAPI
551 
552 NTSTATUS
553 NTAPI
556 );
557 
558 NTSTATUS
559 NTAPI
563 );
564 
565 NTSTATUS
566 NTAPI
569  IN BOOLEAN Silent,
570  OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor
571 );
572 
573 //
574 // PNP Routines
575 //
576 NTSTATUS
577 NTAPI
580  IN BOOLEAN LoadDriver,
582 );
583 
584 CODE_SEG("INIT")
585 NTSTATUS
586 NTAPI
588  VOID
589 );
590 
591 BOOLEAN
592 NTAPI
594  VOID
595 );
596 
597 VOID
598 PnpInit2(
599  VOID
600 );
601 
602 VOID
604  VOID
605 );
606 
607 NTSTATUS
610 );
611 
615 );
616 
617 VOID
620  _In_ PDEVICE_NODE ParentNode);
621 
625  _In_ PNP_DEVNODE_STATE NewState);
626 
627 VOID
630  _In_ UINT32 Problem);
631 
632 VOID
635 
636 NTSTATUS
639 );
640 
641 NTSTATUS
642 NTAPI
644  PDEVICE_CAPABILITIES DeviceCaps);
645 
646 NTSTATUS
649  IN PIO_STACK_LOCATION IoStackLocation,
651 );
652 
653 NTSTATUS
654 NTAPI
660 );
661 
663 FASTCALL
666 );
667 
668 NTSTATUS
670  VOID
671 );
672 
673 NTSTATUS
675  VOID
676 );
677 
678 CODE_SEG("INIT")
679 NTSTATUS
681 
682 NTSTATUS
684  const GUID *Guid,
685  PUNICODE_STRING DeviceIds
686 );
687 
688 NTSTATUS
689 NTAPI
695 
696 NTSTATUS
697 NTAPI
699  IN HANDLE Handle,
702 );
703 
704 NTSTATUS
705 NTAPI
708  IN HANDLE BaseHandle OPTIONAL,
713 );
714 
715 
716 NTSTATUS
719 
720 NTSTATUS
721 NTAPI
725  OUT PHANDLE Handle);
726 
727 //
728 // PnP Routines
729 //
730 CODE_SEG("INIT")
731 NTSTATUS
732 NTAPI
734  VOID
735 );
736 
737 CODE_SEG("INIT")
738 NTSTATUS
739 NTAPI
741  VOID
742 );
743 
744 USHORT
745 NTAPI
747  IN HANDLE ServiceHandle
748 );
749 
750 USHORT
751 NTAPI
753  IN HANDLE ServiceHandle
754 );
755 
756 NTSTATUS
757 NTAPI
759  IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation,
760  OUT PUNICODE_STRING *UnicodeStringList,
761  OUT PULONG UnicodeStringCount
762 );
763 
764 BOOLEAN
765 NTAPI
767  IN PWCHAR RegSzData,
768  IN ULONG RegSzLength,
769  OUT PUSHORT StringLength OPTIONAL
770 );
771 
772 VOID
775  _In_ HANDLE InstanceKey);
776 
777 //
778 // Initialization Routines
779 //
780 CODE_SEG("INIT")
781 NTSTATUS
782 NTAPI
784  IN PLOADER_PARAMETER_BLOCK LoaderBlock
785 );
786 
787 CODE_SEG("INIT")
788 NTSTATUS
789 NTAPI
791  IN PLOADER_PARAMETER_BLOCK LoaderBlock,
792  OUT PANSI_STRING NtBootPath
793 );
794 
795 CODE_SEG("INIT")
796 BOOLEAN
797 NTAPI
799  IN PLOADER_PARAMETER_BLOCK LoaderBlock
800 );
801 
802 BOOLEAN
803 NTAPI
805  IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
806  IN PARC_DISK_SIGNATURE ArcDiskSignature,
808 );
809 
810 BOOLEAN
811 NTAPI
813  IN HANDLE PageFileHandle
814 );
815 
816 CODE_SEG("INIT")
817 VOID
819  VOID);
820 
821 //
822 // Device/Volume Routines
823 //
824 VOID
825 NTAPI
828 );
829 
830 PVPB
831 NTAPI
833  IN POPEN_PACKET OpenPacket,
837 );
838 
839 NTSTATUS
840 NTAPI
843  IN BOOLEAN AllowRawMount,
844  IN BOOLEAN DeviceIsLocked,
846  OUT PVPB *Vpb
847 );
848 
849 PVOID
852 );
853 
854 PVOID
857  IN PWCHAR Name
858 );
859 
860 NTSTATUS
861 NTAPI
864 );
865 
866 VOID
867 NTAPI
869  IN PVPB Vpb
870 );
871 
872 VOID
873 NTAPI
875  VOID
876 );
877 
878 VOID
879 NTAPI
881  VOID
882 );
883 
884 NTSTATUS
885 NTAPI
888 );
889 
890 VOID
891 NTAPI
894  IN BOOLEAN ForceUnload
895 );
896 
897 NTSTATUS
898 NTAPI
902 
903 NTSTATUS
904 NTAPI
908 );
909 
910 VOID
911 NTAPI
914 );
915 
917 NTAPI
920 );
921 
922 //
923 // IRP Routines
924 //
925 NTSTATUS
926 NTAPI
929  IN PKEVENT EventObject,
931 );
932 
933 VOID
934 NTAPI
936  IN PKEVENT EventObject,
937  IN PIRP Irp
938 );
939 
940 PIRP
941 NTAPI
944 );
945 
946 BOOLEAN
947 NTAPI
949  IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator
950 );
951 
952 PIRP
953 NTAPI
956 );
957 
958 //
959 // Shutdown routines
960 //
961 VOID
963  VOID
964 );
965 
966 VOID
967 NTAPI
969  IN ULONG Phase
970 );
971 
972 VOID
973 NTAPI
975  IN PLIST_ENTRY ListHead
976 );
977 
978 //
979 // Boot logging support
980 //
981 CODE_SEG("INIT")
982 VOID
984  IN BOOLEAN StartBootLog
985 );
986 
987 CODE_SEG("INIT")
988 VOID
990  VOID
991 );
992 
993 VOID
995  VOID
996 );
997 
998 VOID
999 IopBootLog(
1000  IN PUNICODE_STRING DriverName,
1002 );
1003 
1004 VOID
1006  VOID
1007 );
1008 
1009 //
1010 // I/O Cancellation Routines
1011 //
1012 VOID
1013 NTAPI
1016 );
1017 
1018 VOID
1020  VOID
1021 );
1022 
1023 //
1024 // I/O Completion
1025 //
1026 VOID
1027 NTAPI
1029  IN PKAPC Apc,
1030  IN PKNORMAL_ROUTINE* NormalRoutine,
1031  IN PVOID* NormalContext,
1034 );
1035 
1036 //
1037 // Error Logging Routines
1038 //
1039 VOID
1040 NTAPI
1042  VOID
1043 );
1044 
1045 VOID
1046 NTAPI
1047 IopLogWorker(
1049 );
1050 
1051 //
1052 // Raw File System MiniDriver
1053 //
1054 BOOLEAN
1057 );
1058 
1059 CODE_SEG("INIT")
1060 NTSTATUS
1061 NTAPI
1065 );
1066 
1067 //
1068 // PnP Root MiniDriver
1069 //
1070 NTSTATUS
1071 NTAPI
1075 );
1076 
1077 NTSTATUS
1082  OUT OPTIONAL PUNICODE_STRING FullInstancePath
1083 );
1084 
1085 NTSTATUS
1088 
1089 //
1090 // Driver Routines
1091 //
1092 CODE_SEG("INIT")
1093 VOID
1094 FASTCALL
1096  VOID
1097 );
1098 
1099 CODE_SEG("INIT")
1100 VOID
1101 FASTCALL
1103  VOID
1104 );
1105 
1106 VOID
1107 NTAPI
1109  IN PVOID ObjectBody
1110 );
1111 
1112 NTSTATUS
1114  _In_ HANDLE ServiceHandle,
1116 
1117 NTSTATUS
1119  _In_ HANDLE ServiceHandle,
1120  _Out_ PUNICODE_STRING DriverName,
1122 
1123 NTSTATUS
1125  _In_ PLDR_DATA_TABLE_ENTRY ModuleObject,
1126  _In_ HANDLE ServiceHandle,
1128  _Out_ NTSTATUS *DriverEntryStatus);
1129 
1130 NTSTATUS
1131 FASTCALL
1134  IN HANDLE EnumSubKey,
1135  IN HANDLE ClassKey,
1136  IN BOOLEAN Lower
1137 );
1138 
1139 VOID
1140 NTAPI
1142  VOID
1143 );
1144 
1145 VOID
1146 NTAPI
1148  VOID
1149 );
1150 
1151 //
1152 // File Routines
1153 //
1154 VOID
1155 NTAPI
1156 IopDeleteDevice(IN PVOID ObjectBody);
1157 
1158 NTSTATUS
1159 NTAPI
1161  IN PVOID ParseObject,
1166  IN OUT PUNICODE_STRING CompleteName,
1168  IN OUT PVOID Context,
1170  OUT PVOID *Object
1171 );
1172 
1173 NTSTATUS
1174 NTAPI
1175 IopParseFile(
1176  IN PVOID ParseObject,
1181  IN OUT PUNICODE_STRING CompleteName,
1185  OUT PVOID *Object
1186 );
1187 
1188 VOID
1189 NTAPI
1191  IN PVOID ObjectBody
1192 );
1193 
1194 NTSTATUS
1195 NTAPI
1197  IN PVOID ObjectBody,
1198  IN SECURITY_OPERATION_CODE OperationCode,
1202  OUT PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
1205 );
1206 
1207 NTSTATUS
1208 NTAPI
1209 IopQueryName(
1210  IN PVOID ObjectBody,
1211  IN BOOLEAN HasName,
1212  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1213  IN ULONG Length,
1216 );
1217 
1218 NTSTATUS
1219 NTAPI
1221  IN PVOID ObjectBody,
1222  IN BOOLEAN HasName,
1223  IN BOOLEAN QueryDosName,
1224  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1225  IN ULONG Length,
1228 );
1229 
1230 VOID
1231 NTAPI
1232 IopCloseFile(
1234  IN PVOID Object,
1237  IN ULONG SystemHandleCount
1238 );
1239 
1240 NTSTATUS
1241 NTAPI
1246  _Out_ PBOOLEAN LockFailed
1247 );
1248 
1249 PVOID
1250 NTAPI
1253 );
1254 
1255 NTSTATUS
1256 NTAPI
1260  IN BOOLEAN Define
1261 );
1262 
1263 VOID
1264 NTAPI
1266  IN PIRP Irp,
1268  IN PREPARSE_DATA_BUFFER DataBuffer
1269 );
1270 
1271 NTSTATUS
1272 NTAPI
1276 );
1277 
1278 NTSTATUS
1279 NTAPI
1282  IN ULONG Length,
1283  IN FILE_INFORMATION_CLASS FileInfoClass,
1284  OUT PVOID Buffer,
1286 );
1287 
1288 BOOLEAN
1289 NTAPI
1291  IN PDEVICE_OBJECT BaseDeviceObject,
1292  IN PDEVICE_OBJECT TopDeviceObjectHint
1293 );
1294 
1295 //
1296 // I/O Timer Routines
1297 //
1298 VOID
1299 FASTCALL
1301  VOID
1302 );
1303 
1304 VOID
1305 NTAPI
1308 );
1309 
1310 //
1311 // I/O Completion Routines
1312 //
1313 VOID
1314 NTAPI
1316  PVOID ObjectBody
1317 );
1318 
1319 NTSTATUS
1320 NTAPI
1323  IN PVOID KeyContext,
1326  IN ULONG_PTR IoStatusInformation,
1327  IN BOOLEAN Quota
1328 );
1329 
1330 //
1331 // Ramdisk Routines
1332 //
1333 CODE_SEG("INIT")
1334 NTSTATUS
1335 NTAPI
1337  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1338 );
1339 
1340 //
1341 // Configuration Routines
1342 //
1343 NTSTATUS
1344 NTAPI
1346  IN GUID Guid,
1348  IN PULONG Interfaces
1349 );
1350 
1351 VOID
1352 NTAPI
1353 IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceName,
1354  IN PUNICODE_STRING OsLoaderPathName
1355 );
1356 
1357 //
1358 // Device action
1359 //
1360 VOID
1364  _In_opt_ PKEVENT CompletionEvent,
1365  _Out_opt_ NTSTATUS *CompletionStatus);
1366 
1367 NTSTATUS
1371 
1372 //
1373 // PnP notifications
1374 //
1375 CODE_SEG("PAGE")
1376 VOID
1378  _In_ LPCGUID Event,
1381 
1382 CODE_SEG("PAGE")
1383 VOID
1385  _In_ LPCGUID Event);
1386 
1387 CODE_SEG("PAGE")
1388 VOID
1390  _In_ LPCGUID Event,
1392  _In_opt_ PTARGET_DEVICE_CUSTOM_NOTIFICATION CustomNotification);
1393 
1394 //
1395 // PnP IRPs
1396 //
1397 NTSTATUS
1400 
1401 NTSTATUS
1404 
1405 NTSTATUS
1408 
1409 NTSTATUS
1412 
1413 NTSTATUS
1417 
1418 NTSTATUS
1421  _In_ LCID LocaleId,
1423  _Out_ PWSTR *DeviceText);
1424 
1425 NTSTATUS
1429 
1430 //
1431 // Global I/O Data
1432 //
1436 extern ULONG IopTraceLevel;
1444 extern PVOID IopTriageDumpDataBlocks[64];
1451 
1452 //
1453 // Inlined Functions
1454 //
1455 #include "io_x.h"
PVOID Context
Definition: io.h:315
NTSTATUS NTAPI PipCallDriverAddDevice(IN PDEVICE_NODE DeviceNode, IN BOOLEAN LoadDriver, IN PDRIVER_OBJECT DriverObject)
#define MAXIMUM_PROCESSORS
Definition: rwlock.h:5
PDEVICE_OBJECT TopDeviceObjectHint
Definition: io.h:102
NTSTATUS PnpRootRegisterDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: pnproot.c:129
NTSTATUS NTAPI IopGetFileInformation(IN PFILE_OBJECT FileObject, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInfoClass, OUT PVOID Buffer, OUT PULONG ReturnedLength)
Definition: iofunc.c:777
* PNTSTATUS
Definition: strlen.c:14
PDEVICE_OBJECT DeviceObject
Definition: io.h:442
ObjectType
Definition: metafile.c:80
VOID PiNotifyHardwareProfileChange(_In_ LPCGUID Event)
Delivers the event to all drivers subscribed to EventCategoryHardwareProfileChange PnP event.
Definition: pnpnotify.c:214
_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
IN CINT OUT PVOID IN ULONG OUT PULONG ReturnLength
Definition: dumpinfo.c:39
NTSTATUS NTAPI PiInitCacheGroupInformation(VOID)
Definition: pnpinit.c:100
GUID Guids[1]
Definition: io.h:432
#define IN
Definition: typedefs.h:39
NTSTATUS NTAPI IopReassignSystemRoot(IN PLOADER_PARAMETER_BLOCK LoaderBlock, OUT PANSI_STRING NtBootPath)
Definition: arcname.c:840
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG BufferLength
Definition: wdfdevice.h:3767
NTSTATUS NTAPI RawFsDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: rawfs.c:1193
_In_opt_ HANDLE _In_opt_ PIO_APC_ROUTINE _In_opt_ PVOID ApcContext
Definition: iofuncs.h:719
NTSTATUS IopGetDriverNames(_In_ HANDLE ServiceHandle, _Out_ PUNICODE_STRING DriverName, _Out_opt_ PUNICODE_STRING ServiceName)
Definition: driver.c:125
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2654
PIO_WORKITEM_ROUTINE WorkerRoutine
Definition: io.h:314
VOID IopInitBootLog(IN BOOLEAN StartBootLog)
NTSTATUS IopInitPlugPlayEvents(VOID)
Definition: plugplay.c:31
NTSTATUS NTAPI IoGetRelatedTargetDevice(IN PFILE_OBJECT FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1607
USHORT ShareAccess
Definition: io.h:379
PDEVICE_NODE IopRootDeviceNode
Definition: devnode.c:18
BOOLEAN NTAPI IoInitSystem(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: iomgr.c:465
enum _COMPLETION_PACKET_TYPE * PCOMPLETION_PACKET_TYPE
_In_opt_ PDEVICE_OBJECT _In_ ULONG _Outptr_result_nullonfailure_ _At_ * SymbolicLinkList(return==0, __drv_allocatesMem(Mem))) PZZWSTR *SymbolicLinkList
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID NTAPI IopAbortInterruptedIrp(IN PKEVENT EventObject, IN PIRP Irp)
Definition: irp.c:67
HAL_DISPATCH _HalDispatchTable
BOOT_DRIVER_LIST_ENTRY ListEntry
Definition: io.h:418
ULONG Options
Definition: io.h:382
#define _In_opt_
Definition: ms_sal.h:309
PVOID IoOpenFileOnDevice(IN PVOID SymbolicLink, IN PWCHAR Name)
VOID NTAPI IoCancelThreadIo(IN PETHREAD Thread)
Definition: irp.c:1146
PNP_DEVNODE_STATE PiSetDevNodeState(_In_ PDEVICE_NODE DeviceNode, _In_ PNP_DEVNODE_STATE NewState)
Definition: devnode.c:108
_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)
VOID PiQueueDeviceAction(_In_ PDEVICE_OBJECT DeviceObject, _In_ DEVICE_ACTION Action, _In_opt_ PKEVENT CompletionEvent, _Out_opt_ NTSTATUS *CompletionStatus)
Queue a device operation to a worker thread.
Definition: devaction.c:2634
ULONG_PTR IoStatusInformation
Definition: io.h:294
VOID NTAPI IopReinitializeDrivers(VOID)
Definition: driver.c:1470
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:372
NTSTATUS PiIrpCancelStopDevice(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpirp.c:154
VOID IopStopBootLog(VOID)
Definition: bootlog.c:46
ULONG EaLength
Definition: io.h:381
NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
#define _Out_
Definition: ms_sal.h:345
NTSTATUS PiIrpQueryDeviceText(_In_ PDEVICE_NODE DeviceNode, _In_ LCID LocaleId, _In_ DEVICE_TEXT_TYPE Type, _Out_ PWSTR *DeviceText)
Definition: pnpirp.c:201
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
IO_WORKITEM_ROUTINE * PIO_WORKITEM_ROUTINE
Definition: iotypes.h:515
NTSTATUS NTAPI IopMountVolume(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN AllowRawMount, IN BOOLEAN DeviceIsLocked, IN BOOLEAN Alertable, OUT PVPB *Vpb)
Definition: volume.c:462
_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:323
struct _ERROR_LOG_ENTRY * PERROR_LOG_ENTRY
VOID IoInitCancelHandling(VOID)
uint16_t * PWSTR
Definition: typedefs.h:56
BOOLEAN NTAPI PpInitSystem(VOID)
Definition: pnpmgr.c:1712
enum _SECURITY_DESCRIPTOR_TYPE * PSECURITY_DESCRIPTOR_TYPE
PVOID Context
Definition: io.h:463
ULONG IopNumTriageDumpDataBlocks
Definition: iomgr.c:46
enum _COMPLETION_PACKET_TYPE COMPLETION_PACKET_TYPE
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_INTERRUPT_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFINTERRUPT * Interrupt
Definition: wdfinterrupt.h:372
_IOP_TRANSFER_TYPE
Definition: io.h:259
IO_REMOVE_LOCK_COMMON_BLOCK Common
Definition: io.h:348
ULONG ErrorControl
Definition: io.h:422
char CHAR
Definition: xmlstorage.h:175
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:522
struct _OPEN_PACKET OPEN_PACKET
LONG NTSTATUS
Definition: precomp.h:26
ULONG ParseCheck
Definition: io.h:373
PVOID ExtraCreateParameters
Definition: io.h:387
PFILE_BASIC_INFORMATION BasicInformation
Definition: io.h:384
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
VOID IopStartBootLog(VOID)
Definition: bootlog.c:38
VOID NTAPI IopReinitializeBootDrivers(VOID)
Definition: driver.c:1506
DEVICETREE_TRAVERSE_ROUTINE Action
Definition: io.h:501
VOID NTAPI IopDereferenceDeviceObject(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN ForceUnload)
Definition: device.c:462
OBJECT_HEADER ObjectHeader
Definition: io.h:358
LARGE_INTEGER AllocationSize
Definition: io.h:376
static const CLASS_AND_INTERFACES ExpectedInterfaces[]
Definition: browseui.c:13
NTSTATUS PiIrpQueryStopDevice(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpirp.c:133
CSHORT Type
Definition: io.h:368
NTSTATUS NTAPI IopGetRelatedTargetDevice(IN PFILE_OBJECT FileObject, OUT PDEVICE_NODE *DeviceNode)
Definition: device.c:653
struct _IO_UNLOAD_SAFE_COMPLETION_CONTEXT * PIO_UNLOAD_SAFE_COMPLETION_CONTEXT
struct _BOOT_DRIVER_NODE * PBOOT_DRIVER_NODE
FAST_MUTEX Lock
Definition: io.h:431
struct _DRIVER_INFORMATION DRIVER_INFORMATION
VOID FASTCALL IopInitTimerImplementation(VOID)
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:336
DWORD LCID
Definition: nls.h:13
RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator
Definition: irp.c:19
LIST_ENTRY ShutdownList
Definition: io.h:441
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:56
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:1155
_In_ PVOID Parameter
Definition: ldrtypes.h:241
ULONG IopTraceLevel
Definition: iomgr.c:16
VOID IoInitShutdownNotification(VOID)
enum _DEVICE_TEXT_TYPE DEVICE_TEXT_TYPE
NTSTATUS PiIrpStartDevice(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpirp.c:87
#define FASTCALL
Definition: nt_native.h:50
BOOLEAN TraversedMountPoint
Definition: io.h:393
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
NTSTATUS NTAPI IopFixupResourceListWithRequirements(IN PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList, OUT PCM_RESOURCE_LIST *ResourceList)
Definition: pnpres.c:219
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:50
KSPIN_LOCK IopDeviceActionLock
Definition: devaction.c:49
GENERIC_MAPPING IopCompletionMapping
Definition: iocomp.c:20
USHORT NTAPI PpInitGetGroupOrderIndex(IN HANDLE ServiceHandle)
Definition: pnpinit.c:155
BOOLEAN NTAPI IoInitializeCrashDump(IN HANDLE PageFileHandle)
Definition: iomgr.c:657
struct _DRIVER_INFORMATION * PDRIVER_INFORMATION
CSHORT Size
Definition: io.h:369
PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: io.h:304
uint32_t ULONG_PTR
Definition: typedefs.h:65
PFILE_OBJECT FileObject
Definition: io.h:370
LIST_ENTRY ItemEntry
Definition: io.h:460
struct LOOKASIDE_ALIGN _GENERAL_LOOKASIDE GENERAL_LOOKASIDE
Definition: arc.h:198
GENERAL_LOOKASIDE IopMdlLookasideList
Definition: iomgr.c:84
NTSTATUS NTAPI IopFetchConfigurationInformation(OUT PWSTR *SymbolicLinkList, IN GUID Guid, IN ULONG ExpectedInterfaces, IN PULONG Interfaces)
Definition: iorsrce.c:656
PVOID EaBuffer
Definition: io.h:380
VOID FASTCALL IopInitializeSystemDrivers(VOID)
Definition: driver.c:1184
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
CSHORT Size
Definition: io.h:334
NTSTATUS IopLoadDriver(_In_ HANDLE ServiceHandle, _Out_ PDRIVER_OBJECT *DriverObject)
Definition: driver.c:1911
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
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)
_In_ WDFDEVICE _Out_ PWDF_DEVICE_STATE DeviceState
Definition: wdfdevice.h:1996
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:250
PFILE_OBJECT RelatedFileObject
Definition: io.h:374
NTSTATUS IopInitializeDriverModule(_In_ PLDR_DATA_TABLE_ENTRY ModuleObject, _In_ HANDLE ServiceHandle, _Out_ PDRIVER_OBJECT *DriverObject, _Out_ NTSTATUS *DriverEntryStatus)
Initialize a loaded driver.
Definition: driver.c:430
ULONG NTAPI PnpDetermineResourceListSize(IN PCM_RESOURCE_LIST ResourceList)
Definition: pnpmgr.c:1807
BOOLEAN Override
Definition: io.h:388
_In_ PIRP Irp
Definition: csq.h:116
unsigned int UINT32
CREATE_FILE_TYPE CreateFileType
Definition: io.h:386
long LONG
Definition: pedump.c:60
PDEVICE_NODE PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
CSHORT Type
Definition: io.h:333
struct _IO_INTERRUPT * PIO_INTERRUPT
_In_ UCHAR _In_ UCHAR MinorFunction
Definition: wdfdevice.h:1697
_In_ PEPROCESS _In_ KPROCESSOR_MODE AccessMode
Definition: mmfuncs.h:395
ULONG * PPNP_DEVICE_STATE
Definition: iotypes.h:997
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
VOID PiClearDevNodeProblem(_In_ PDEVICE_NODE DeviceNode)
Definition: devnode.c:141
struct _IO_BUS_TYPE_GUID_LIST * PIO_BUS_TYPE_GUID_LIST
PDEVICE_OBJECT DeviceObject
Definition: io.h:313
LIST_ENTRY Link
Definition: io.h:403
BOOLEAN NTAPI IopInitializeReserveIrp(IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator)
Definition: irp.c:549
LIST_ENTRY IopDeviceActionRequestList
Definition: devaction.c:46
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
unsigned char BOOLEAN
enum _PNP_DEVNODE_STATE PNP_DEVNODE_STATE
VOID(NTAPI * PDRIVER_REINITIALIZE)(_In_ struct _DRIVER_OBJECT *DriverObject, _In_opt_ PVOID Context, _In_ ULONG Count)
Definition: iotypes.h:4455
PVOID FilterContext
Definition: io.h:103
NTSTATUS IoDestroyDriverList(VOID)
HANDLE ServiceHandle
Definition: io.h:406
struct _OPEN_PACKET * POPEN_PACKET
#define _In_
Definition: ms_sal.h:308
VOID NTAPI IopDeleteFile(IN PVOID ObjectBody)
Definition: file.c:1354
_Must_inspect_result_ _In_ PFILE_OBJECT _In_ SECURITY_INFORMATION SecurityInformation
Definition: fltkernel.h:1339
NTSTATUS PiIrpStopDevice(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpirp.c:111
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
PDRIVER_OBJECT DriverObject
Definition: io.h:461
Definition: bufpool.h:45
USHORT TagPosition
Definition: io.h:407
IO_REMOVE_LOCK_DBG_BLOCK Dbg
Definition: io.h:349
VOID NTAPI IoInitVpbImplementation(VOID)
VOID FASTCALL IopInitializeBootDrivers(VOID)
Definition: driver.c:1003
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2697
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:547
struct _DEVICETREE_TRAVERSE_CONTEXT * PDEVICETREE_TRAVERSE_CONTEXT
_COMPLETION_PACKET_TYPE
Definition: io.h:269
BOOLEAN IoRemoteBootClient
Definition: init.c:68
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
enum _DEVICE_RELATION_TYPE DEVICE_RELATION_TYPE
NTSTATUS Status
Definition: io.h:410
enum _DEVICE_ACTION DEVICE_ACTION
Definition: io.h:252
struct _BOOT_DRIVER_NODE BOOT_DRIVER_NODE
NTSTATUS NTAPI PnpRootDriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: pnproot.c:1470
enum _IOP_TRANSFER_TYPE IOP_TRANSFER_TYPE
Status
Definition: gdiplustypes.h:24
BOOLEAN DeleteOnly
Definition: io.h:390
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
VOID PiSetDevNodeProblem(_In_ PDEVICE_NODE DeviceNode, _In_ UINT32 Problem)
Definition: devnode.c:132
NTSTATUS NTAPI IopCleanupFailedIrp(IN PFILE_OBJECT FileObject, IN PKEVENT EventObject, IN PVOID Buffer OPTIONAL)
Definition: irp.c:45
struct _SHUTDOWN_ENTRY SHUTDOWN_ENTRY
_SECURITY_DESCRIPTOR_TYPE
Definition: io.h:524
VOID PnpInit2(VOID)
_In_ KPROCESSOR_MODE PreviousMode
Definition: sefuncs.h:103
NTSTATUS IoCreateDriverList(VOID)
CHAR FileObjectBody[sizeof(FILE_OBJECT)]
Definition: io.h:359
NTSTATUS IopQueueTargetDeviceEvent(const GUID *Guid, PUNICODE_STRING DeviceIds)
Definition: plugplay.c:43
UNICODE_STRING Name
Definition: io.h:420
struct _IO_WORKITEM IO_WORKITEM
PDRIVER_OBJECT DriverObject
Definition: io.h:451
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:389
ULONG Tag
Definition: io.h:421
NTSTATUS IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IoStackLocation, OUT PVOID *Information)
PDEVICE_OBJECT DeviceObject
Definition: io.h:302
NTSTATUS NTAPI IopReferenceDeviceObject(IN PDEVICE_OBJECT DeviceObject)
DWORD * PSECURITY_INFORMATION
Definition: ms-dtyp.idl:311
USHORT FileAttributes
Definition: io.h:378
char CCHAR
Definition: typedefs.h:51
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:760
INT POOL_TYPE
Definition: typedefs.h:78
VOID NTAPI IopRemoveTimerFromTimerList(IN PIO_TIMER Timer)
Definition: iotimer.c:70
struct _IO_INTERRUPT IO_INTERRUPT
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
NTSTATUS NTAPI IopInitializePlugPlayServices(VOID)
Definition: pnpinit.c:293
VOID IopBootLog(IN PUNICODE_STRING DriverName, IN BOOLEAN Success)
volatile LONG ReserveIrpInUse
Definition: io.h:516
struct _IO_BUS_TYPE_GUID_LIST IO_BUS_TYPE_GUID_LIST
VOID NTAPI IopInitErrorLog(VOID)
PIO_BUS_TYPE_GUID_LIST IopBusTypeGuidList
Type
Definition: Type.h:6
struct _EXTENDED_IO_REMOVE_LOCK * PEXTENDED_IO_REMOVE_LOCK
enum _IOP_DEVICE_LIST_OPERATION * PIOP_DEVICE_LIST_OPERATION
OBJECT_ATTRIBUTES OriginalAttributes
Definition: io.h:375
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2652
NTSTATUS NTAPI IopCreateArcNames(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: arcname.c:39
PVPB NTAPI IopCheckVpbMounted(IN POPEN_PACKET OpenPacket, IN PDEVICE_OBJECT DeviceObject, IN PUNICODE_STRING RemainingName, OUT PNTSTATUS Status)
Definition: volume.c:76
PDEVICE_NODE FirstDeviceNode
Definition: io.h:496
struct _DRIVER_REINIT_ITEM DRIVER_REINIT_ITEM
PFILE_NETWORK_OPEN_INFORMATION NetworkInformation
Definition: io.h:385
ULONG InternalFlags
Definition: io.h:394
CCHAR KPROCESSOR_MODE
Definition: ketypes.h:7
VOID NTAPI IopReadyDeviceObjects(IN PDRIVER_OBJECT Driver)
Definition: device.c:34
KSPIN_LOCK SpinLock
Definition: io.h:325
* PFILE_OBJECT
Definition: iotypes.h:1998
VOID NTAPI IopDeleteIoCompletion(PVOID ObjectBody)
Definition: iocomp.c:100
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
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING _In_ PCUNICODE_STRING _In_ LCID LocaleId
Definition: wdfpdo.h:430
NTSTATUS NTAPI IopCreateVpb(IN PDEVICE_OBJECT DeviceObject)
Definition: volume.c:158
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:240
unsigned char UCHAR
Definition: xmlstorage.h:181
PDRIVER_OBJECT IopRootDriverObject
Definition: pnpmgr.c:26
char * PBOOLEAN
Definition: retypes.h:11
PBOOT_DRIVER_LIST_ENTRY DataTableEntry
Definition: io.h:405
Definition: io.h:331
#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:287
_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:312
Definition: btrfs_drv.h:1922
Definition: ketypes.h:535
Definition: typedefs.h:119
PDRIVER_FS_NOTIFICATION FSDNotificationProc
Definition: io.h:452
_In_ USHORT _In_ CCHAR StackSize
Definition: iofuncs.h:1058
LARGE_INTEGER TimeStamp
Definition: io.h:338
ULONG Failed
Definition: io.h:408
struct _FILE_OBJECT_EXTENSION * PFILE_OBJECT_EXTENSION
* PDEVICE_CAPABILITIES
Definition: iotypes.h:965
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG CreateOptions
Definition: wdfregistry.h:112
NTSTATUS PiPerformSyncDeviceAction(_In_ PDEVICE_OBJECT DeviceObject, _In_ DEVICE_ACTION Action)
Perfom a device operation synchronously via PiQueueDeviceAction.
Definition: devaction.c:2693
PVOID IopTriageDumpDataBlocks[64]
Definition: iomgr.c:47
UNICODE_STRING Group
Definition: io.h:419
_In_opt_ PVOID _In_opt_ PVOID _In_opt_ PVOID SystemArgument2
Definition: ketypes.h:675
struct _IOP_MINI_COMPLETION_PACKET * PIOP_MINI_COMPLETION_PACKET
NTSTATUS(* DEVICETREE_TRAVERSE_ROUTINE)(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
Definition: io.h:478
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: devnode.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:1606
NTSTATUS NTAPI IopUpdateRootKey(VOID)
Definition: pnpmgr.c:1397
LIST_ENTRY ListEntry
Definition: io.h:335
VOID PiSetDevNodeText(_In_ PDEVICE_NODE DeviceNode, _In_ HANDLE InstanceKey)
Sets the DeviceNode's DeviceDesc and LocationInformation registry values.
Definition: devaction.c:1088
_Must_inspect_result_ _In_opt_ WDFKEY ParentKey
Definition: wdfregistry.h:69
BOOLEAN NTAPI IopVerifyDiskSignature(IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout, IN PARC_DISK_SIGNATURE ArcDiskSignature, OUT PULONG Signature)
Definition: arcname.c:948
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:1455
PVOID IoOpenSymlink(IN PVOID SymbolicLink)
VOID NTAPI IopShutdownBaseFileSystems(IN PLIST_ENTRY ListHead)
Definition: volume.c:349
NTSTATUS PiIrpQueryPnPDeviceState(_In_ PDEVICE_NODE DeviceNode, _Out_ PPNP_DEVICE_STATE DeviceState)
Definition: pnpirp.c:232
VOID NTAPI IopLogWorker(IN PVOID Parameter)
Definition: error.c:148
ULONG Processed
Definition: io.h:409
unsigned short USHORT
Definition: pedump.c:61
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
_DEVICE_ACTION
Definition: io.h:536
struct _FILE_OBJECT_EXTENSION FILE_OBJECT_EXTENSION
PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList
Definition: pnpmgr.c:27
PDUMMY_FILE_OBJECT LocalFileObject
Definition: io.h:392
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: devaction.c:853
LIST_ENTRY ListEntry
Definition: io.h:284
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)
#define _Out_opt_
Definition: ms_sal.h:346
_In_ CONST GUID * InterfaceClassGuid
Definition: iofuncs.h:1136
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
struct _EXTENDED_IO_REMOVE_LOCK EXTENDED_IO_REMOVE_LOCK
IO_COMPLETION_ROUTINE * PIO_COMPLETION_ROUTINE
Definition: iotypes.h:2835
_In_ WDFIORESREQLIST RequirementsList
Definition: wdfresource.h:65
BOOLEAN NTAPI PnpRegSzToString(IN PWCHAR RegSzData, IN ULONG RegSzLength, OUT PUSHORT StringLength OPTIONAL)
Definition: pnputil.c:171
PDRIVER_OBJECT DriverObject
Definition: io.h:337
enum _SECURITY_DESCRIPTOR_TYPE SECURITY_DESCRIPTOR_TYPE
ULONG CreateOptions
Definition: io.h:377
VOID IopInitDriverImplementation(VOID)
VOID PiNotifyTargetDeviceChange(_In_ LPCGUID Event, _In_ PDEVICE_OBJECT DeviceObject, _In_opt_ PTARGET_DEVICE_CUSTOM_NOTIFICATION CustomNotification)
Delivers the event to all drivers subscribed to EventCategoryTargetDeviceChange PnP event.
Definition: pnpnotify.c:258
KEVENT WaitEvent
Definition: io.h:517
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
_In_ HANDLE Handle
Definition: extypes.h:390
Definition: iotypes.h:189
VOID PiInsertDevNode(_In_ PDEVICE_NODE DeviceNode, _In_ PDEVICE_NODE ParentNode)
Definition: devnode.c:80
struct tagContext Context
Definition: acpixf.h:1034
#define OUT
Definition: typedefs.h:40
VOID NTAPI IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceName, IN PUNICODE_STRING OsLoaderPathName)
Definition: iorsrce.c:697
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
BOOLEAN FullAttributes
Definition: io.h:391
struct _DEVICETREE_TRAVERSE_CONTEXT DEVICETREE_TRAVERSE_CONTEXT
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1116
ULONG Disposition
Definition: io.h:383
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:155
struct _SHUTDOWN_ENTRY * PSHUTDOWN_ENTRY
unsigned int ULONG
Definition: retypes.h:1
#define const
Definition: zconf.h:230
ACCESS_MASK * PACCESS_MASK
Definition: nt_native.h:41
VOID NTAPI IopDereferenceVpbAndFree(IN PVPB Vpb)
Definition: volume.c:186
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)
NTSTATUS NTAPI IopStartRamdisk(IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: ramdisk.c:26
LIST_ENTRY FsChangeNotifyList
Definition: io.h:450
PDRIVER_REINITIALIZE ReinitRoutine
Definition: io.h:462
NTSTATUS NTAPI IopAcquireFileObjectLock(_In_ PFILE_OBJECT FileObject, _In_ KPROCESSOR_MODE AccessMode, _In_ BOOLEAN Alertable, _Out_ PBOOLEAN LockFailed)
Definition: file.c:2449
VOID PiNotifyDeviceInterfaceChange(_In_ LPCGUID Event, _In_ LPCGUID InterfaceClassGuid, _In_ PUNICODE_STRING SymbolicLinkName)
Delivers the event to all drivers subscribed to EventCategoryDeviceInterfaceChange.
Definition: pnpnotify.c:161
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:79
VOID(NTAPI * PKNORMAL_ROUTINE)(IN PVOID NormalContext OPTIONAL, IN PVOID SystemArgument1 OPTIONAL, IN PVOID SystemArgument2 OPTIONAL)
Definition: ketypes.h:674
PDEVICE_NODE DeviceNode
Definition: io.h:491
PDEVICE_OBJECT TopDeviceObjectHint
Definition: io.h:395
_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:439
Definition: io.h:253
static const WCHAR Signature[]
Definition: parser.c:141
short CSHORT
Definition: umtypes.h:127
_Must_inspect_result_ _In_ WDFDRIVER Driver
Definition: wdfcontrol.h:83
NTSTATUS PiIrpQueryDeviceRelations(_In_ PDEVICE_NODE DeviceNode, _In_ DEVICE_RELATION_TYPE Type)
Definition: pnpirp.c:176
NTSTATUS FinalStatus
Definition: io.h:371
NTSTATUS NTAPI IopInitiatePnpIrp(IN PDEVICE_OBJECT DeviceObject, IN PIO_STATUS_BLOCK IoStatusBlock, IN UCHAR MinorFunction, IN PIO_STACK_LOCATION Stack)
static CODE_SEG("PAGE")
Definition: isapnp.c:1482
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:1255
SECURITY_OPERATION_CODE
Definition: setypes.h:170
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:1673
VOID IopSaveBootLogToFile(VOID)
Definition: bootlog.c:288
DRIVER_FS_NOTIFICATION * PDRIVER_FS_NOTIFICATION
Definition: iotypes.h:7361
static const WCHAR SymbolicLink[]
Definition: interface.c:31
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:404
NTSTATUS PnpRootCreateDevice(IN PUNICODE_STRING ServiceName, IN OPTIONAL PDRIVER_OBJECT DriverObject, OUT PDEVICE_OBJECT *PhysicalDeviceObject, OUT OPTIONAL PUNICODE_STRING FullInstancePath)
Definition: pnproot.c:185
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
Definition: wdfdevice.h:3736
Definition: io.h:448
enum _IOP_TRANSFER_TYPE * PIOP_TRANSFER_TYPE
VOID PiInitializeNotifications(VOID)
Definition: pnpnotify.c:55
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
Definition: cdprocs.h:801
USHORT NTAPI PipGetDriverTagPriority(IN HANDLE ServiceHandle)
Definition: pnpinit.c:198
enum _CREATE_FILE_TYPE CREATE_FILE_TYPE
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68