ReactOS  0.4.15-dev-2704-gd5265b0
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 // Boot Driver List Entry
396 //
397 typedef struct _DRIVER_INFORMATION
398 {
408 
409 //
410 // Boot Driver Node
411 //
412 typedef struct _BOOT_DRIVER_NODE
413 {
420 
421 //
422 // List of Bus Type GUIDs
423 //
425 {
431 
432 //
433 // Shutdown entry for registed devices
434 //
435 typedef struct _SHUTDOWN_ENTRY
436 {
440 
441 //
442 // F/S Notification entry for registered File Systems
443 //
445 {
450 
451 //
452 // Driver (Boot) Re-Initialization Entry
453 //
454 typedef struct _DRIVER_REINIT_ITEM
455 {
461 
462 //
463 // Called on every visit of a node during a preorder-traversal of the device
464 // node tree.
465 // If the routine returns STATUS_UNSUCCESSFUL the traversal will stop and
466 // STATUS_SUCCESS is returned to the caller who initiated the tree traversal.
467 // Any other returned status code will be returned to the caller. If a status
468 // code that indicates an error (other than STATUS_UNSUCCESSFUL) is returned,
469 // the traversal is stopped immediately and the status code is returned to
470 // the caller.
471 //
472 typedef
473 NTSTATUS
477 );
478 
479 //
480 // Context information for traversing the device tree
481 //
483 {
484  //
485  // Current device node during a traversal
486  //
488 
489  //
490  // Initial device node where we start the traversal
491  //
493 
494  //
495  // Action routine to be called for every device node
496  //
498 
499  //
500  // Context passed to the action routine
501  //
504 
505 //
506 // Reserve IRP allocator
507 // Used for read paging IOs in low-memory situations
508 //
510 {
516 
517 //
518 // Type selection for IopCreateSecurityDescriptorPerType()
519 //
521 {
528 
529 //
530 // Action types and data for PiQueueDeviceAction()
531 //
532 typedef enum _DEVICE_ACTION
533 {
539 } DEVICE_ACTION;
540 
541 //
542 // Resource code
543 //
544 ULONG
545 NTAPI
547 
548 NTSTATUS
549 NTAPI
552 );
553 
554 NTSTATUS
555 NTAPI
559 );
560 
561 NTSTATUS
562 NTAPI
565  IN BOOLEAN Silent,
566  OUT OPTIONAL PCM_PARTIAL_RESOURCE_DESCRIPTOR ConflictingDescriptor
567 );
568 
569 //
570 // PNP Routines
571 //
572 NTSTATUS
573 NTAPI
576  IN BOOLEAN LoadDriver,
578 );
579 
580 CODE_SEG("INIT")
581 NTSTATUS
582 NTAPI
584  VOID
585 );
586 
587 BOOLEAN
588 NTAPI
590  VOID
591 );
592 
593 VOID
594 PnpInit2(
595  VOID
596 );
597 
598 VOID
600  VOID
601 );
602 
603 NTSTATUS
606 );
607 
611 );
612 
613 VOID
616  _In_ PDEVICE_NODE ParentNode);
617 
621  _In_ PNP_DEVNODE_STATE NewState);
622 
623 VOID
626  _In_ UINT32 Problem);
627 
628 VOID
631 
632 NTSTATUS
635 );
636 
637 NTSTATUS
638 NTAPI
640  PDEVICE_CAPABILITIES DeviceCaps);
641 
642 NTSTATUS
645  IN PIO_STACK_LOCATION IoStackLocation,
647 );
648 
649 NTSTATUS
650 NTAPI
656 );
657 
659 FASTCALL
662 );
663 
664 NTSTATUS
666  VOID
667 );
668 
669 NTSTATUS
671  VOID
672 );
673 
674 CODE_SEG("INIT")
675 NTSTATUS
677 
678 NTSTATUS
680  const GUID *Guid,
681  PUNICODE_STRING DeviceIds
682 );
683 
684 NTSTATUS
685 NTAPI
691 
692 NTSTATUS
693 NTAPI
695  IN HANDLE Handle,
698 );
699 
700 NTSTATUS
701 NTAPI
704  IN HANDLE BaseHandle OPTIONAL,
709 );
710 
711 
712 NTSTATUS
715 
716 NTSTATUS
717 NTAPI
721  OUT PHANDLE Handle);
722 
723 //
724 // PnP Routines
725 //
726 CODE_SEG("INIT")
727 NTSTATUS
728 NTAPI
730  VOID
731 );
732 
733 CODE_SEG("INIT")
734 NTSTATUS
735 NTAPI
737  VOID
738 );
739 
740 USHORT
741 NTAPI
743  IN HANDLE ServiceHandle
744 );
745 
746 USHORT
747 NTAPI
749  IN HANDLE ServiceHandle
750 );
751 
752 NTSTATUS
753 NTAPI
755  IN PKEY_VALUE_FULL_INFORMATION KeyValueInformation,
756  OUT PUNICODE_STRING *UnicodeStringList,
757  OUT PULONG UnicodeStringCount
758 );
759 
760 BOOLEAN
761 NTAPI
763  IN PWCHAR RegSzData,
764  IN ULONG RegSzLength,
765  OUT PUSHORT StringLength OPTIONAL
766 );
767 
768 VOID
771  _In_ HANDLE InstanceKey);
772 
773 //
774 // Initialization Routines
775 //
776 CODE_SEG("INIT")
777 NTSTATUS
778 NTAPI
780  IN PLOADER_PARAMETER_BLOCK LoaderBlock
781 );
782 
783 CODE_SEG("INIT")
784 NTSTATUS
785 NTAPI
787  IN PLOADER_PARAMETER_BLOCK LoaderBlock,
788  OUT PANSI_STRING NtBootPath
789 );
790 
791 CODE_SEG("INIT")
792 BOOLEAN
793 NTAPI
795  IN PLOADER_PARAMETER_BLOCK LoaderBlock
796 );
797 
798 BOOLEAN
799 NTAPI
801  IN PDRIVE_LAYOUT_INFORMATION_EX DriveLayout,
802  IN PARC_DISK_SIGNATURE ArcDiskSignature,
804 );
805 
806 BOOLEAN
807 NTAPI
809  IN HANDLE PageFileHandle
810 );
811 
812 CODE_SEG("INIT")
813 VOID
815  VOID);
816 
817 //
818 // Device/Volume Routines
819 //
820 VOID
821 NTAPI
824 );
825 
826 PVPB
827 NTAPI
829  IN POPEN_PACKET OpenPacket,
833 );
834 
835 NTSTATUS
836 NTAPI
839  IN BOOLEAN AllowRawMount,
840  IN BOOLEAN DeviceIsLocked,
842  OUT PVPB *Vpb
843 );
844 
845 PVOID
848 );
849 
850 PVOID
853  IN PWCHAR Name
854 );
855 
856 NTSTATUS
857 NTAPI
860 );
861 
862 VOID
863 NTAPI
865  IN PVPB Vpb
866 );
867 
868 VOID
869 NTAPI
871  VOID
872 );
873 
874 VOID
875 NTAPI
877  VOID
878 );
879 
880 NTSTATUS
881 NTAPI
884 );
885 
886 VOID
887 NTAPI
890  IN BOOLEAN ForceUnload
891 );
892 
893 NTSTATUS
894 NTAPI
898 
899 NTSTATUS
900 NTAPI
904 );
905 
906 VOID
907 NTAPI
910 );
911 
913 NTAPI
916 );
917 
918 //
919 // IRP Routines
920 //
921 NTSTATUS
922 NTAPI
925  IN PKEVENT EventObject,
927 );
928 
929 VOID
930 NTAPI
932  IN PKEVENT EventObject,
933  IN PIRP Irp
934 );
935 
936 PIRP
937 NTAPI
940 );
941 
942 BOOLEAN
943 NTAPI
945  IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator
946 );
947 
948 PIRP
949 NTAPI
952 );
953 
954 //
955 // Shutdown routines
956 //
957 VOID
959  VOID
960 );
961 
962 VOID
963 NTAPI
965  IN ULONG Phase
966 );
967 
968 VOID
969 NTAPI
971  IN PLIST_ENTRY ListHead
972 );
973 
974 //
975 // Boot logging support
976 //
977 CODE_SEG("INIT")
978 VOID
980  IN BOOLEAN StartBootLog
981 );
982 
983 CODE_SEG("INIT")
984 VOID
986  VOID
987 );
988 
989 VOID
991  VOID
992 );
993 
994 VOID
995 IopBootLog(
996  IN PUNICODE_STRING DriverName,
998 );
999 
1000 VOID
1002  VOID
1003 );
1004 
1005 //
1006 // I/O Cancellation Routines
1007 //
1008 VOID
1009 NTAPI
1012 );
1013 
1014 VOID
1016  VOID
1017 );
1018 
1019 //
1020 // I/O Completion
1021 //
1022 VOID
1023 NTAPI
1025  IN PKAPC Apc,
1026  IN PKNORMAL_ROUTINE* NormalRoutine,
1027  IN PVOID* NormalContext,
1030 );
1031 
1032 //
1033 // Error Logging Routines
1034 //
1035 VOID
1036 NTAPI
1038  VOID
1039 );
1040 
1041 VOID
1042 NTAPI
1043 IopLogWorker(
1045 );
1046 
1047 //
1048 // Raw File System MiniDriver
1049 //
1050 BOOLEAN
1053 );
1054 
1055 CODE_SEG("INIT")
1056 NTSTATUS
1057 NTAPI
1061 );
1062 
1063 //
1064 // PnP Root MiniDriver
1065 //
1066 NTSTATUS
1067 NTAPI
1071 );
1072 
1073 NTSTATUS
1078  OUT OPTIONAL PUNICODE_STRING FullInstancePath
1079 );
1080 
1081 NTSTATUS
1084 
1085 //
1086 // Driver Routines
1087 //
1088 CODE_SEG("INIT")
1089 VOID
1090 FASTCALL
1092  VOID
1093 );
1094 
1095 CODE_SEG("INIT")
1096 VOID
1097 FASTCALL
1099  VOID
1100 );
1101 
1102 VOID
1103 NTAPI
1105  IN PVOID ObjectBody
1106 );
1107 
1108 NTSTATUS
1110  _In_ HANDLE ServiceHandle,
1112 
1113 NTSTATUS
1115  _In_ HANDLE ServiceHandle,
1116  _Out_ PUNICODE_STRING DriverName,
1118 
1119 NTSTATUS
1121  _In_ PLDR_DATA_TABLE_ENTRY ModuleObject,
1122  _In_ HANDLE ServiceHandle,
1124  _Out_ NTSTATUS *DriverEntryStatus);
1125 
1126 NTSTATUS
1127 FASTCALL
1130  IN HANDLE EnumSubKey,
1131  IN HANDLE ClassKey,
1132  IN BOOLEAN Lower
1133 );
1134 
1135 VOID
1136 NTAPI
1138  VOID
1139 );
1140 
1141 VOID
1142 NTAPI
1144  VOID
1145 );
1146 
1147 //
1148 // File Routines
1149 //
1150 VOID
1151 NTAPI
1152 IopDeleteDevice(IN PVOID ObjectBody);
1153 
1154 NTSTATUS
1155 NTAPI
1157  IN PVOID ParseObject,
1162  IN OUT PUNICODE_STRING CompleteName,
1164  IN OUT PVOID Context,
1166  OUT PVOID *Object
1167 );
1168 
1169 NTSTATUS
1170 NTAPI
1171 IopParseFile(
1172  IN PVOID ParseObject,
1177  IN OUT PUNICODE_STRING CompleteName,
1181  OUT PVOID *Object
1182 );
1183 
1184 VOID
1185 NTAPI
1187  IN PVOID ObjectBody
1188 );
1189 
1190 NTSTATUS
1191 NTAPI
1193  IN PVOID ObjectBody,
1194  IN SECURITY_OPERATION_CODE OperationCode,
1198  OUT PSECURITY_DESCRIPTOR *OldSecurityDescriptor,
1201 );
1202 
1203 NTSTATUS
1204 NTAPI
1205 IopQueryName(
1206  IN PVOID ObjectBody,
1207  IN BOOLEAN HasName,
1208  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1209  IN ULONG Length,
1212 );
1213 
1214 NTSTATUS
1215 NTAPI
1217  IN PVOID ObjectBody,
1218  IN BOOLEAN HasName,
1219  IN BOOLEAN QueryDosName,
1220  OUT POBJECT_NAME_INFORMATION ObjectNameInfo,
1221  IN ULONG Length,
1224 );
1225 
1226 VOID
1227 NTAPI
1228 IopCloseFile(
1230  IN PVOID Object,
1233  IN ULONG SystemHandleCount
1234 );
1235 
1236 NTSTATUS
1237 NTAPI
1242  _Out_ PBOOLEAN LockFailed
1243 );
1244 
1245 PVOID
1246 NTAPI
1249 );
1250 
1251 NTSTATUS
1252 NTAPI
1256  IN BOOLEAN Define
1257 );
1258 
1259 VOID
1260 NTAPI
1262  IN PIRP Irp,
1264  IN PREPARSE_DATA_BUFFER DataBuffer
1265 );
1266 
1267 NTSTATUS
1268 NTAPI
1272 );
1273 
1274 NTSTATUS
1275 NTAPI
1278  IN ULONG Length,
1279  IN FILE_INFORMATION_CLASS FileInfoClass,
1280  OUT PVOID Buffer,
1282 );
1283 
1284 BOOLEAN
1285 NTAPI
1287  IN PDEVICE_OBJECT BaseDeviceObject,
1288  IN PDEVICE_OBJECT TopDeviceObjectHint
1289 );
1290 
1291 //
1292 // I/O Timer Routines
1293 //
1294 VOID
1295 FASTCALL
1297  VOID
1298 );
1299 
1300 VOID
1301 NTAPI
1304 );
1305 
1306 //
1307 // I/O Completion Routines
1308 //
1309 VOID
1310 NTAPI
1312  PVOID ObjectBody
1313 );
1314 
1315 NTSTATUS
1316 NTAPI
1319  IN PVOID KeyContext,
1322  IN ULONG_PTR IoStatusInformation,
1323  IN BOOLEAN Quota
1324 );
1325 
1326 //
1327 // Ramdisk Routines
1328 //
1329 CODE_SEG("INIT")
1330 NTSTATUS
1331 NTAPI
1333  IN PLOADER_PARAMETER_BLOCK LoaderBlock
1334 );
1335 
1336 //
1337 // Configuration Routines
1338 //
1339 NTSTATUS
1340 NTAPI
1342  IN GUID Guid,
1344  IN PULONG Interfaces
1345 );
1346 
1347 VOID
1348 NTAPI
1349 IopStoreSystemPartitionInformation(IN PUNICODE_STRING NtSystemPartitionDeviceName,
1350  IN PUNICODE_STRING OsLoaderPathName
1351 );
1352 
1353 //
1354 // Device action
1355 //
1356 VOID
1360  _In_opt_ PKEVENT CompletionEvent,
1361  _Out_opt_ NTSTATUS *CompletionStatus);
1362 
1363 NTSTATUS
1367 
1368 //
1369 // PnP notifications
1370 //
1371 CODE_SEG("PAGE")
1372 VOID
1374  _In_ LPCGUID Event,
1377 
1378 CODE_SEG("PAGE")
1379 VOID
1381  _In_ LPCGUID Event);
1382 
1383 CODE_SEG("PAGE")
1384 VOID
1386  _In_ LPCGUID Event,
1388  _In_opt_ PTARGET_DEVICE_CUSTOM_NOTIFICATION CustomNotification);
1389 
1390 //
1391 // PnP IRPs
1392 //
1393 NTSTATUS
1396 
1397 NTSTATUS
1400 
1401 NTSTATUS
1404 
1405 NTSTATUS
1408 
1409 NTSTATUS
1413 
1414 NTSTATUS
1417  _In_ LCID LocaleId,
1419  _Out_ PWSTR *DeviceText);
1420 
1421 NTSTATUS
1425 
1426 //
1427 // Global I/O Data
1428 //
1432 extern ULONG IopTraceLevel;
1440 extern PVOID IopTriageDumpDataBlocks[64];
1447 
1448 //
1449 // Inlined Functions
1450 //
1451 #include "io_x.h"
PVOID Context
Definition: io.h:311
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:98
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:775
* PNTSTATUS
Definition: strlen.c:14
PDEVICE_OBJECT DeviceObject
Definition: io.h:438
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:428
#define IN
Definition: typedefs.h:39
NTSTATUS NTAPI IopReassignSystemRoot(IN PLOADER_PARAMETER_BLOCK LoaderBlock, OUT PANSI_STRING NtBootPath)
Definition: arcname.c:836
_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:310
VOID IopInitBootLog(IN BOOLEAN StartBootLog)
NTSTATUS IopInitPlugPlayEvents(VOID)
NTSTATUS NTAPI IoGetRelatedTargetDevice(IN PFILE_OBJECT FileObject, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1607
USHORT ShareAccess
Definition: io.h:375
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:414
ULONG Options
Definition: io.h:378
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:2616
ULONG_PTR IoStatusInformation
Definition: io.h:290
VOID NTAPI IopReinitializeDrivers(VOID)
Definition: driver.c:1433
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
NTSTATUS PiIrpCancelStopDevice(_In_ PDEVICE_NODE DeviceNode)
Definition: pnpirp.c:154
VOID IopStopBootLog(VOID)
Definition: bootlog.c:46
ULONG EaLength
Definition: io.h:377
NTSTATUS IopTraverseDeviceTree(PDEVICETREE_TRAVERSE_CONTEXT Context)
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:319
struct _ERROR_LOG_ENTRY * PERROR_LOG_ENTRY
VOID IoInitCancelHandling(VOID)
uint16_t * PWSTR
Definition: typedefs.h:56
BOOLEAN NTAPI PpInitSystem(VOID)
Definition: pnpmgr.c:1713
enum _SECURITY_DESCRIPTOR_TYPE * PSECURITY_DESCRIPTOR_TYPE
PVOID Context
Definition: io.h:459
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:255
IO_REMOVE_LOCK_COMMON_BLOCK Common
Definition: io.h:344
ULONG ErrorControl
Definition: io.h:418
char CHAR
Definition: xmlstorage.h:175
NTSTATUS NTAPI IopCreateDeviceKeyPath(IN PCUNICODE_STRING RegistryPath, IN ULONG CreateOptions, OUT PHANDLE Handle)
Definition: pnpmgr.c:523
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
_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:1469
DEVICETREE_TRAVERSE_ROUTINE Action
Definition: io.h:497
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
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:364
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:427
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:332
DWORD LCID
Definition: nls.h:13
RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator
Definition: irp.c:19
LIST_ENTRY ShutdownList
Definition: io.h:437
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:389
_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
#define _In_opt_
Definition: no_sal2.h:212
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:365
PIO_COMPLETION_ROUTINE CompletionRoutine
Definition: io.h:300
uint32_t ULONG_PTR
Definition: typedefs.h:65
PFILE_OBJECT FileObject
Definition: io.h:366
LIST_ENTRY ItemEntry
Definition: io.h:456
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:376
VOID FASTCALL IopInitializeSystemDrivers(VOID)
Definition: driver.c:1147
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
CSHORT Size
Definition: io.h:330
NTSTATUS IopLoadDriver(_In_ HANDLE ServiceHandle, _Out_ PDRIVER_OBJECT *DriverObject)
Definition: driver.c:1874
_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:246
PFILE_OBJECT RelatedFileObject
Definition: io.h:370
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:408
ULONG NTAPI PnpDetermineResourceListSize(IN PCM_RESOURCE_LIST ResourceList)
Definition: pnpmgr.c:1808
BOOLEAN Override
Definition: io.h:384
_In_ PIRP Irp
Definition: csq.h:116
unsigned int UINT32
CREATE_FILE_TYPE CreateFileType
Definition: io.h:382
long LONG
Definition: pedump.c:60
PDEVICE_NODE PipAllocateDeviceNode(IN PDEVICE_OBJECT PhysicalDeviceObject)
CSHORT Type
Definition: io.h:329
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:309
LIST_ENTRY Link
Definition: io.h:399
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:99
NTSTATUS IoDestroyDriverList(VOID)
HANDLE ServiceHandle
Definition: io.h:402
struct _OPEN_PACKET * POPEN_PACKET
#define _Out_
Definition: no_sal2.h:160
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:457
Definition: bufpool.h:45
USHORT TagPosition
Definition: io.h:403
IO_REMOVE_LOCK_DBG_BLOCK Dbg
Definition: io.h:345
CODE_SEG("INIT")
Definition: Interface.c:1810
VOID NTAPI IoInitVpbImplementation(VOID)
VOID FASTCALL IopInitializeBootDrivers(VOID)
Definition: driver.c:966
_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:265
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:406
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:1470
enum _IOP_TRANSFER_TYPE IOP_TRANSFER_TYPE
Status
Definition: gdiplustypes.h:24
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
VOID PiSetDevNodeProblem(_In_ PDEVICE_NODE DeviceNode, _In_ UINT32 Problem)
Definition: devnode.c:132
#define _Out_opt_
Definition: no_sal2.h:214
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:520
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:42
UNICODE_STRING Name
Definition: io.h:416
struct _IO_WORKITEM IO_WORKITEM
PDRIVER_OBJECT DriverObject
Definition: io.h:447
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:417
NTSTATUS IopSynchronousCall(IN PDEVICE_OBJECT DeviceObject, IN PIO_STACK_LOCATION IoStackLocation, OUT PVOID *Information)
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
_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:512
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:371
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
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:492
struct _DRIVER_REINIT_ITEM DRIVER_REINIT_ITEM
PFILE_NETWORK_OPEN_INFORMATION NetworkInformation
Definition: io.h:381
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: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:27
char * PBOOLEAN
Definition: retypes.h:11
PBOOT_DRIVER_LIST_ENTRY DataTableEntry
Definition: io.h:401
Definition: io.h:327
#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:1922
Definition: ketypes.h:535
Definition: typedefs.h:119
PDRIVER_FS_NOTIFICATION FSDNotificationProc
Definition: io.h:448
_In_ USHORT _In_ CCHAR StackSize
Definition: iofuncs.h:1058
LARGE_INTEGER TimeStamp
Definition: io.h:334
ULONG Failed
Definition: io.h:404
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:2675
PVOID IopTriageDumpDataBlocks[64]
Definition: iomgr.c:47
UNICODE_STRING Group
Definition: io.h:415
_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:158
NTSTATUS(* DEVICETREE_TRAVERSE_ROUTINE)(IN PDEVICE_NODE DeviceNode, IN PVOID Context)
Definition: io.h:474
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:1607
NTSTATUS NTAPI IopUpdateRootKey(VOID)
Definition: pnpmgr.c:1398
LIST_ENTRY ListEntry
Definition: io.h:331
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:944
NTSTATUS NTAPI IopOpenRegistryKeyEx(PHANDLE KeyHandle, HANDLE ParentKey, PUNICODE_STRING Name, ACCESS_MASK DesiredAccess)
Definition: pnpmgr.c:1456
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:405
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:532
struct _FILE_OBJECT_EXTENSION FILE_OBJECT_EXTENSION
PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList
Definition: pnpmgr.c:28
PDUMMY_FILE_OBJECT LocalFileObject
Definition: io.h:388
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: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)
_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:333
enum _SECURITY_DESCRIPTOR_TYPE SECURITY_DESCRIPTOR_TYPE
ULONG CreateOptions
Definition: io.h:373
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:513
_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:387
struct _DEVICETREE_TRAVERSE_CONTEXT DEVICETREE_TRAVERSE_CONTEXT
NTSTATUS NTAPI IopAssignDeviceResources(IN PDEVICE_NODE DeviceNode)
Definition: pnpres.c:1106
ULONG Disposition
Definition: io.h:379
__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:446
PDRIVER_REINITIALIZE ReinitRoutine
Definition: io.h:458
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:487
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:435
Definition: io.h:249
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:367
NTSTATUS NTAPI IopInitiatePnpIrp(IN PDEVICE_OBJECT DeviceObject, IN PIO_STATUS_BLOCK IoStatusBlock, IN UCHAR MinorFunction, IN PIO_STACK_LOCATION Stack)
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:1245
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: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:400
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:444
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