00001 /*++ 00002 00003 Copyright (c) 1989 Microsoft Corporation 00004 00005 Module Name: 00006 00007 iodata.c 00008 00009 Abstract: 00010 00011 This module contains the global read/write data for the I/O system. 00012 00013 Author: 00014 00015 Darryl E. Havens (darrylh) April 27, 1989 00016 00017 Revision History: 00018 00019 00020 --*/ 00021 00022 #include "iop.h" 00023 00024 // 00025 // Define the global read/write data for the I/O system. 00026 // 00027 // The following lock is used to guard access to the CancelRoutine address 00028 // in IRPs. It must be locked to set the address of a routine, clear the 00029 // address of a routine, when a cancel routine is invoked, or when 00030 // manipulating any structure that will set a cancel routine address in 00031 // a packet. 00032 // 00033 00034 extern KSPIN_LOCK IopCancelSpinLock; 00035 00036 // 00037 // The following lock is used to guard access to VPB data structures. It 00038 // must be held each time the reference count, mount flag, or device object 00039 // fields of a VPB are manipulated. 00040 // 00041 00042 extern KSPIN_LOCK IopVpbSpinLock; 00043 00044 // 00045 // The following lock is used to guard access to the I/O system database for 00046 // unloading drivers. It must be locked to increment or decrement device 00047 // reference counts and to set the unload pending flag in a device object. 00048 // The lock is allocated by the I/O system during phase 1 initialization. 00049 // 00050 // This lock is also used to decrement the count of Associated IRPs for a 00051 // given Master IRP. 00052 // 00053 00054 extern KSPIN_LOCK IopDatabaseLock; 00055 00056 // 00057 // The following resource is used to control access to the I/O system's 00058 // database. It allows exclusive access to the file system queue for 00059 // registering a file system as well as shared access to the same when 00060 // searching for a file system to mount a volume on some media. The resource 00061 // is initialized by the I/O system initialization code during phase 1 00062 // initialization. 00063 // 00064 00065 ERESOURCE IopDatabaseResource; 00066 00067 // 00068 // The following resource is used to control access to security descriptors 00069 // on devices. It allows multiple readers to perform security checks and 00070 // queries on device security, but only a single writer to modify the security 00071 // on a device at a time. 00072 // 00073 00074 ERESOURCE IopSecurityResource; 00075 00076 // 00077 // The following queue header contains the list of disk file systems currently 00078 // loaded into the system. The list actually contains the device objects 00079 // for each of the file systems in the system. Access to this queue is 00080 // protected using the IopDatabaseResource for exclusive (write) or shared 00081 // (read) access locks. 00082 // 00083 00084 LIST_ENTRY IopDiskFileSystemQueueHead; 00085 00086 // 00087 // The following queue header contains the list of CD ROM file systems currently 00088 // loaded into the system. The list actually contains the device objects 00089 // for each of the file systems in the system. Access to this queue is 00090 // protected using the IopDatabaseResource for exclusive (write) or shared 00091 // (read) access locks. 00092 // 00093 00094 LIST_ENTRY IopCdRomFileSystemQueueHead; 00095 00096 // 00097 // The following queue header contains the list of network file systems 00098 // (redirectors) currently loaded into the system. The list actually 00099 // contains the device objects for each of the network file systems in the 00100 // system. Access to this queue is protected using the IopDatabaseResource 00101 // for exclusive (write) or shared (read) access locks. 00102 // 00103 00104 LIST_ENTRY IopNetworkFileSystemQueueHead; 00105 00106 // 00107 // The following queue header contains the list of tape file systems currently 00108 // loaded into the system. The list actually contains the device objects 00109 // for each of the file systems in the system. Access to this queue is 00110 // protected using the IopDatabaseResource for exclusive (write) or shared 00111 // (read) access locks. 00112 // 00113 00114 LIST_ENTRY IopTapeFileSystemQueueHead; 00115 00116 // 00117 // The following queue header contains the list of boot drivers that have 00118 // registered for a call back once all devices have been enumerated. 00119 // 00120 00121 LIST_ENTRY IopBootDriverReinitializeQueueHead; 00122 00123 // 00124 // The following queue header contains the list of drivers that have 00125 // registered reinitialization routines. 00126 // 00127 00128 LIST_ENTRY IopDriverReinitializeQueueHead; 00129 00130 // 00131 // The following queue headers contain the lists of the drivers that have 00132 // registered shutdown notification routines. 00133 // 00134 00135 LIST_ENTRY IopNotifyShutdownQueueHead; 00136 LIST_ENTRY IopNotifyLastChanceShutdownQueueHead; 00137 00138 // 00139 // The following queue header contains the list of the driver that have 00140 // registered to be notified when a file system registers or unregisters itself 00141 // as an active file system. 00142 // 00143 00144 LIST_ENTRY IopFsNotifyChangeQueueHead; 00145 00146 // 00147 // The following are the lookaside lists used to keep track of the two I/O 00148 // Request Packet (IRP), the Memory Descriptor List (MDL) Lookaside list, and 00149 // the I/O Completion List (ICP) Lookaside list. 00150 // 00151 // The "large" IRP contains 4 stack locations, the maximum in the SDK, and the 00152 // "small" IRP contains a single entry, the most common case for devices other 00153 // than disks and network devices. 00154 // 00155 00156 NPAGED_LOOKASIDE_LIST IopCompletionLookasideList; 00157 NPAGED_LOOKASIDE_LIST IopLargeIrpLookasideList; 00158 NPAGED_LOOKASIDE_LIST IopSmallIrpLookasideList; 00159 NPAGED_LOOKASIDE_LIST IopMdlLookasideList; 00160 ULONG IopLargeIrpStackLocations; 00161 00162 00163 // 00164 // The following spinlock is used to control access to the I/O system's error 00165 // log database. It is initialized by the I/O system initialization code when 00166 // the system is being initialized. This lock must be owned in order to insert 00167 // or remove entries from either the free or entry queue. 00168 // 00169 00170 extern KSPIN_LOCK IopErrorLogLock; 00171 00172 // 00173 // The following is the list head for all error log entries in the system which 00174 // have not yet been sent to the error log process. Entries are written placed 00175 // onto the list by the IoWriteElEntry procedure. 00176 // 00177 00178 LIST_ENTRY IopErrorLogListHead; 00179 00180 // 00181 // The following is used to track how much memory is allocated to I/O error log 00182 // packets. The spinlock is used to protect this variable. 00183 // 00184 00185 ULONG IopErrorLogAllocation; 00186 extern KSPIN_LOCK IopErrorLogAllocationLock; 00187 00188 // 00189 // The following spinlock is used by the I/O system to synchronize examining 00190 // the thread field of an I/O Request Packet so that the request can be 00191 // queued as a special kernel APC to the thread. The reason that the 00192 // spinlock must be used is for cases when the request times out, and so 00193 // the thread has been permitted to possibly exit. 00194 // 00195 00196 extern KSPIN_LOCK IopCompletionLock; 00197 00198 // 00199 // The following global contains the queue of informational hard error 00200 // pop-ups. 00201 // 00202 00203 IOP_HARD_ERROR_QUEUE IopHardError; 00204 00205 // 00206 // The following global is non-null when there is a pop-up on the screen 00207 // waiting for user action. It points to that packet. 00208 // 00209 00210 PIOP_HARD_ERROR_PACKET IopCurrentHardError; 00211 00212 // 00213 // The following are used to implement the I/O system's one second timer. 00214 // The lock protects access to the queue, the queue contains an entry for 00215 // each driver that needs to be invoked, and the timer and DPC data 00216 // structures are used to actually get the internal timer routine invoked 00217 // once every second. The count is used to maintain the number of timer 00218 // entries that actually indicate that the driver is to be invoked. 00219 // 00220 00221 extern KSPIN_LOCK IopTimerLock; 00222 LIST_ENTRY IopTimerQueueHead; 00223 KDPC IopTimerDpc; 00224 KTIMER IopTimer; 00225 ULONG IopTimerCount; 00226 00227 // 00228 // The following are the global pointers for the Object Type Descriptors that 00229 // are created when each of the I/O specific object types are created. 00230 // 00231 00232 POBJECT_TYPE IoAdapterObjectType; 00233 POBJECT_TYPE IoControllerObjectType; 00234 POBJECT_TYPE IoCompletionObjectType; 00235 POBJECT_TYPE IoDeviceObjectType; 00236 POBJECT_TYPE IoDriverObjectType; 00237 POBJECT_TYPE IoDeviceHandlerObjectType; 00238 POBJECT_TYPE IoFileObjectType; 00239 ULONG IoDeviceHandlerObjectSize; 00240 00241 // 00242 // The following is a global lock and counters for I/O operations requested 00243 // on a system-wide basis. The first three counters simply track the number 00244 // of read, write, and other types of operations that have been requested. 00245 // The latter three counters track the actual number of bytes that have been 00246 // transferred throughout the system. 00247 // 00248 00249 extern KSPIN_LOCK IoStatisticsLock; 00250 ULONG IoReadOperationCount; 00251 ULONG IoWriteOperationCount; 00252 ULONG IoOtherOperationCount; 00253 LARGE_INTEGER IoReadTransferCount; 00254 LARGE_INTEGER IoWriteTransferCount; 00255 LARGE_INTEGER IoOtherTransferCount; 00256 00257 // 00258 // The following is the base pointer for the crash dump control block that is 00259 // used to control dumping all of physical memory to the paging file after a 00260 // system crash. And, the checksum for the dump control block is also declared. 00261 // 00262 00263 PDUMP_CONTROL_BLOCK IopDumpControlBlock; 00264 ULONG IopDumpControlBlockChecksum; 00265 00266 // 00267 // The following are the spin lock and event that allow the I/O system to 00268 // implement fast file object locks. 00269 // 00270 00271 KEVENT IopFastLockEvent; 00272 00273 // 00274 // The following is a monotonically increasing number (retrieved via 00275 // InterlockedIncrement) that is used by IoCreateDevice to automatically 00276 // generate a device object name when the FILE_AUTOGENERATED_DEVICE_NAME 00277 // device characteristic is specified. 00278 // 00279 00280 LONG IopUniqueDeviceObjectNumber; 00281 00282 // 00283 // IoRemoteBootClient indicates whether the system was booted as a remote 00284 // boot client. 00285 // 00286 00287 BOOLEAN IoRemoteBootClient; 00288 00289 #if defined(REMOTE_BOOT) 00290 // 00291 // The following indicates whether or not the Client Side Caching subsystem 00292 // was successfully initialized. 00293 // 00294 00295 BOOLEAN IoCscInitializationFailed; 00296 #endif 00297 00298 // 00299 // The following are used to synchronize with the link tracking service while establishing a connection. 00300 // 00301 00302 KEVENT IopLinkTrackingPortObject; 00303 LINK_TRACKING_PACKET IopLinkTrackingPacket; 00304 00305 // 00306 // Function pointers of key IO routines. 00307 // The functions need to be in their own cache lines as they are readonly and 00308 // never modified after boot. 00309 // 00310 00311 #define CACHE_SIZE 128 00312 UCHAR IopPrePadding[CACHE_SIZE] = {0}; 00313 PIO_CALL_DRIVER pIofCallDriver = 0; 00314 PIO_COMPLETE_REQUEST pIofCompleteRequest = 0; 00315 PIO_ALLOCATE_IRP pIoAllocateIrp = 0; 00316 PIO_FREE_IRP pIoFreeIrp = 0; 00317 UCHAR IopPostPadding[CACHE_SIZE] = {0}; 00318 00319 //********* 00320 // 00321 // Note: All of the following data is potentially pageable, depending on the 00322 // target platform. 00323 // 00324 //********* 00325 00326 #ifdef ALLOC_DATA_PRAGMA 00327 #pragma data_seg("PAGE") 00328 #endif 00329 00330 // 00331 // The following semaphore is used by the IO system when it reports resource 00332 // usage to the configuration registry on behalf of a driver. This semaphore 00333 // is initialized by the I/O system initialization code when the system is 00334 // started. 00335 // 00336 00337 KSEMAPHORE IopRegistrySemaphore; 00338 00339 // 00340 // The following are used to store the handle and a pointer to the referenced 00341 00342 // whenever a file is moved across systems. 00343 // 00344 00345 PVOID IopLinkTrackingServiceObject; 00346 PKEVENT IopLinkTrackingServiceEvent; 00347 00348 00349 // 00350 // The following array specifies the minimum length of the FileInformation 00351 // buffer for an NtQueryInformationFile service. 00352 // 00353 // WARNING: This array depends on the order of the values in the 00354 // FileInformationClass enumerated type. Note that the 00355 // enumerated type is one-based and the array is zero-based. 00356 // 00357 00358 UCHAR IopQueryOperationLength[] = 00359 { 00360 0, 00361 0, // 1 FileDirectoryInformation 00362 0, // 2 FileFullDirectoryInformation 00363 0, // 3 FileBothDirectoryInformation 00364 sizeof( FILE_BASIC_INFORMATION ), // 4 FileBasicInformation 00365 sizeof( FILE_STANDARD_INFORMATION ), // 5 FileStandardInformation 00366 sizeof( FILE_INTERNAL_INFORMATION ), // 6 FileInternalInformation 00367 sizeof( FILE_EA_INFORMATION ), // 7 FileEaInformation 00368 sizeof( FILE_ACCESS_INFORMATION ), // 8 FileAccessInformation 00369 sizeof( FILE_NAME_INFORMATION ), // 9 FileNameInformation 00370 0, // 10 FileRenameInformation 00371 0, // 11 FileLinkInformation 00372 0, // 12 FileNamesInformation 00373 0, // 13 FileDispositionInformation 00374 sizeof( FILE_POSITION_INFORMATION ), // 14 FilePositionInformation 00375 0, // 15 FileFullEaInformation 00376 sizeof( FILE_MODE_INFORMATION ), // 16 FileModeInformation 00377 sizeof( FILE_ALIGNMENT_INFORMATION ), // 17 FileAlignmentInformation 00378 sizeof( FILE_ALL_INFORMATION ), // 18 FileAllInformation 00379 0, // 19 FileAllocationInformation 00380 0, // 20 FileEndOfFileInformation 00381 sizeof( FILE_NAME_INFORMATION ), // 21 FileAlternateNameInformation 00382 sizeof( FILE_STREAM_INFORMATION ), // 22 FileStreamInformation 00383 sizeof( FILE_PIPE_INFORMATION ), // 23 FilePipeInformation 00384 sizeof( FILE_PIPE_LOCAL_INFORMATION ), // 24 FilePipeLocalInformation 00385 sizeof( FILE_PIPE_REMOTE_INFORMATION ), // 25 FilePipeRemoteInformation 00386 sizeof( FILE_MAILSLOT_QUERY_INFORMATION ), // 26 FileMailslotQueryInformation 00387 0, // 27 FileMailslotSetInformation 00388 sizeof( FILE_COMPRESSION_INFORMATION ), // 28 FileCompressionInformation 00389 sizeof( FILE_OBJECTID_INFORMATION ), // 29 FileObjectIdInformation 00390 0, // 30 FileCompletionInformation 00391 0, // 31 FileMoveClusterInformation 00392 sizeof( FILE_QUOTA_INFORMATION ), // 32 FileQuotaInformation 00393 sizeof( FILE_REPARSE_POINT_INFORMATION ), // 33 FileReparsePointInformation 00394 sizeof( FILE_NETWORK_OPEN_INFORMATION), // 34 FileNetworkOpenInformation 00395 sizeof( FILE_ATTRIBUTE_TAG_INFORMATION), // 35 FileAttributeTagInformation 00396 0, // 36 FileTrackingInformation 00397 0xff // FileMaximumInformation 00398 }; 00399 00400 // 00401 // The following array specifies the minimum length of the FileInformation 00402 // buffer for an NtSetInformationFile service. 00403 // 00404 // WARNING: This array depends on the order of the values in the 00405 // FileInformationClass enumerated type. Note that the 00406 // enumerated type is one-based and the array is zero-based. 00407 // 00408 00409 UCHAR IopSetOperationLength[] = 00410 { 00411 0, 00412 0, // 1 FileDirectoryInformation 00413 0, // 2 FileFullDirectoryInformation 00414 0, // 3 FileBothDirectoryInformation 00415 sizeof( FILE_BASIC_INFORMATION ), // 4 FileBasicInformation 00416 0, // 5 FileStandardInformation 00417 0, // 6 FileInternalInformation 00418 0, // 7 FileEaInformation 00419 0, // 8 FileAccessInformation 00420 0, // 9 FileNameInformation 00421 sizeof( FILE_RENAME_INFORMATION ), // 10 FileRenameInformation 00422 sizeof( FILE_LINK_INFORMATION ), // 11 FileLinkInformation 00423 0, // 12 FileNamesInformation 00424 sizeof( FILE_DISPOSITION_INFORMATION ), // 13 FileDispositionInformation 00425 sizeof( FILE_POSITION_INFORMATION ), // 14 FilePositionInformation 00426 0, // 15 FileFullEaInformation 00427 sizeof( FILE_MODE_INFORMATION ), // 16 FileModeInformation 00428 0, // 17 FileAlignmentInformation 00429 0, // 18 FileAllInformation 00430 sizeof( FILE_ALLOCATION_INFORMATION ), // 19 FileAllocationInformation 00431 sizeof( FILE_END_OF_FILE_INFORMATION ), // 20 FileEndOfFileInformation 00432 0, // 21 FileAlternateNameInformation 00433 0, // 22 FileStreamInformation 00434 sizeof( FILE_PIPE_INFORMATION ), // 23 FilePipeInformation 00435 0, // 24 FilePipeLocalInformation 00436 sizeof( FILE_PIPE_REMOTE_INFORMATION ), // 25 FilePipeRemoteInformation 00437 0, // 26 FileMailslotQueryInformation 00438 sizeof( FILE_MAILSLOT_SET_INFORMATION ), // 27 FileMailslotSetInformation 00439 0, // 28 FileCompressionInformation 00440 sizeof( FILE_OBJECTID_INFORMATION ), // 29 FileObjectIdInformation 00441 sizeof( FILE_COMPLETION_INFORMATION ), // 30 FileCompletionInformation 00442 sizeof( FILE_MOVE_CLUSTER_INFORMATION ), // 31 FileMoveClusterInformation 00443 sizeof( FILE_QUOTA_INFORMATION ), // 32 FileQuotaInformation 00444 0, // 33 FileReparsePointInformation 00445 0, // 34 FileNetworkOpenInformation 00446 0, // 35 FileAttributeTagInformation 00447 sizeof( FILE_TRACKING_INFORMATION ), // 36 FileTrackingInformation 00448 0xff // FileMaximumInformation 00449 }; 00450 00451 // 00452 // The following array specifies the alignment requirement of both all query 00453 // and set operations, including directory operations, but not FS operations. 00454 // 00455 // WARNING: This array depends on the order of the values in the 00456 // FileInformationClass enumerated type. Note that the 00457 // enumerated type is one-based and the array is zero-based. 00458 // 00459 00460 UCHAR IopQuerySetAlignmentRequirement[] = 00461 { 00462 0, 00463 sizeof( LONGLONG ), // 1 FileDirectoryInformation 00464 sizeof( LONGLONG ), // 2 FileFullDirectoryInformation 00465 sizeof( LONGLONG ), // 3 FileBothDirectoryInformation 00466 sizeof( LONGLONG ), // 4 FileBasicInformation 00467 sizeof( LONGLONG ), // 5 FileStandardInformation 00468 sizeof( LONGLONG ), // 6 FileInternalInformation 00469 sizeof( LONG ), // 7 FileEaInformation 00470 sizeof( LONG ), // 8 FileAccessInformation 00471 sizeof( LONG ), // 9 FileNameInformation 00472 sizeof( LONG ), // 10 FileRenameInformation 00473 sizeof( LONG ), // 11 FileLinkInformation 00474 sizeof( LONG ), // 12 FileNamesInformation 00475 sizeof( CHAR ), // 13 FileDispositionInformation 00476 sizeof( LONGLONG ), // 14 FilePositionInformation 00477 sizeof( LONG ), // 15 FileFullEaInformation 00478 sizeof( LONG ), // 16 FileModeInformation 00479 sizeof( LONG ), // 17 FileAlignmentInformation 00480 sizeof( LONGLONG ), // 18 FileAllInformation 00481 sizeof( LONGLONG ), // 19 FileAllocationInformation 00482 sizeof( LONGLONG ), // 20 FileEndOfFileInformation 00483 sizeof( LONG ), // 21 FileAlternateNameInformation 00484 sizeof( LONGLONG ), // 22 FileStreamInformation 00485 sizeof( LONG ), // 23 FilePipeInformation 00486 sizeof( LONG ), // 24 FilePipeLocalInformation 00487 sizeof( LONG ), // 25 FilePipeRemoteInformation 00488 sizeof( LONGLONG ), // 26 FileMailslotQueryInformation 00489 sizeof( LONG ), // 27 FileMailslotSetInformation 00490 sizeof( LONGLONG ), // 28 FileCompressionInformation 00491 sizeof( LONG ), // 29 FileObjectIdInformation 00492 sizeof( LONG ), // 30 FileCompletionInformation 00493 sizeof( LONG ), // 31 FileMoveClusterInformation 00494 sizeof( LONG ), // 32 FileQuotaInformation 00495 sizeof( LONG ), // 33 FileReparsePointInformation 00496 sizeof( LONGLONG ), // 34 FileNetworkOpenInformation 00497 sizeof( LONG ), // 35 FileAttributeTagInformation 00498 sizeof( LONG ), // 36 FileTrackingInformation 00499 0xff // FileMaximumInformation 00500 }; 00501 00502 // 00503 // The following array specifies the required access mask for the caller to 00504 // access information in an NtQueryXxxFile service. 00505 // 00506 // WARNING: This array depends on the order of the values in the 00507 // FileInformationClass enumerated type. Note that the 00508 // enumerated type is one-based and the array is zero-based. 00509 // 00510 00511 ULONG IopQueryOperationAccess[] = 00512 { 00513 0, 00514 0, // 1 FileDirectoryInformation 00515 0, // 2 FileFullDirectoryInformation 00516 0, // 3 FileBothDirectoryInformation 00517 FILE_READ_ATTRIBUTES, // 4 FileBasicInformation 00518 0, // 5 FileStandardInformation 00519 0, // 6 FileInternalInformation 00520 0, // 7 FileEaInformation 00521 0, // 8 FileAccessInformation 00522 0, // 9 FileNameInformation 00523 0, // 10 FileRenameInformation 00524 0, // 11 FileLinkInformation 00525 0, // 12 FileNamesInformation 00526 0, // 13 FileDispositionInformation 00527 0, // 14 FilePositionInformation 00528 FILE_READ_EA, // 15 FileFullEaInformation 00529 0, // 16 FileModeInformation 00530 0, // 17 FileAlignmentInformation 00531 FILE_READ_ATTRIBUTES, // 18 FileAllInformation 00532 0, // 19 FileAllocationInformation 00533 0, // 20 FileEndOfFileInformation 00534 0, // 21 FileAlternateNameInformation 00535 0, // 22 FileStreamInformation 00536 FILE_READ_ATTRIBUTES, // 23 FilePipeInformation 00537 FILE_READ_ATTRIBUTES, // 24 FilePipeLocalInformation 00538 FILE_READ_ATTRIBUTES, // 25 FilePipeRemoteInformation 00539 0, // 26 FileMailslotQueryInformation 00540 0, // 27 FileMailslotSetInformation 00541 0, // 28 FileCompressionInformation 00542 0, // 29 FileObjectIdInformation 00543 0, // 30 FileCompletionInformation 00544 0, // 31 FileMoveClusterInformation 00545 0, // 32 FileQuotaInformation 00546 0, // 33 FileReparsePointInformation 00547 FILE_READ_ATTRIBUTES, // 34 FileNetworkOpenInformation 00548 FILE_READ_ATTRIBUTES, // 35 FileAttributeTagInformation 00549 0, // 36 FileTrackingInformation 00550 0xffffffff // FileMaximumInformation 00551 }; 00552 00553 // 00554 // The following array specifies the required access mask for the caller to 00555 // access information in an NtSetXxxFile service. 00556 // 00557 // WARNING: This array depends on the order of the values in the 00558 // FILE_INFORMATION_CLASS enumerated type. Note that the 00559 // enumerated type is one-based and the array is zero-based. 00560 // 00561 00562 ULONG IopSetOperationAccess[] = 00563 { 00564 0, 00565 0, // 1 FileDirectoryInformation 00566 0, // 2 FileFullDirectoryInformation 00567 0, // 3 FileBothDirectoryInformation 00568 FILE_WRITE_ATTRIBUTES, // 4 FileBasicInformation 00569 0, // 5 FileStandardInformation 00570 0, // 6 FileInternalInformation 00571 0, // 7 FileEaInformation 00572 0, // 8 FileAccessInformation 00573 0, // 9 FileNameInformation 00574 DELETE, // 10 FileRenameInformation 00575 0, // 11 FileLinkInformation 00576 0, // 12 FileNamesInformation 00577 DELETE, // 13 FileDispositionInformation 00578 0, // 14 FilePositionInformation 00579 FILE_WRITE_EA, // 15 FileFullEaInformation 00580 0, // 16 FileModeInformation 00581 0, // 17 FileAlignmentInformation 00582 0, // 18 FileAllInformation 00583 FILE_WRITE_DATA, // 19 FileAllocationInformation 00584 FILE_WRITE_DATA, // 20 FileEndOfFileInformation 00585 0, // 21 FileAlternateNameInformation 00586 0, // 22 FileStreamInformation 00587 FILE_WRITE_ATTRIBUTES, // 23 FilePipeInformation 00588 0, // 24 FilePipeLocalInformation 00589 FILE_WRITE_ATTRIBUTES, // 25 FilePipeRemoteInformation 00590 0, // 26 FileMailslotQueryInformation 00591 0, // 27 FileMailslotSetInformation 00592 0, // 28 FileCompressionInformation 00593 0, // 29 FileObjectIdInformation 00594 0, // 30 FileCompletionInformation 00595 FILE_WRITE_DATA, // 31 FileMoveClusterInformation 00596 0, // 32 FileQuotaInformation 00597 0, // 33 FileReparsePointInformation 00598 0, // 34 FileNetworkOpenInformation 00599 0, // 35 FileAttributeTagInformation 00600 FILE_WRITE_DATA, // 36 FileTrackingInformation 00601 0xffffffff // FileMaximumInformation 00602 }; 00603 00604 // 00605 // The following array specifies the minimum length of the FsInformation 00606 // buffer for an NtQueryVolumeInformation service. 00607 // 00608 // WARNING: This array depends on the order of the values in the 00609 // FS_INFORMATION_CLASS enumerated type. Note that the 00610 // enumerated type is one-based and the array is zero-based. 00611 // 00612 00613 UCHAR IopQueryFsOperationLength[] = 00614 { 00615 0, 00616 sizeof( FILE_FS_VOLUME_INFORMATION ), // 1 FileFsVolumeInformation 00617 0, // 2 FileFsLabelInformation 00618 sizeof( FILE_FS_SIZE_INFORMATION ), // 3 FileFsSizeInformation 00619 sizeof( FILE_FS_DEVICE_INFORMATION ), // 4 FileFsDeviceInformation 00620 sizeof( FILE_FS_ATTRIBUTE_INFORMATION ), // 5 FileFsAttributeInformation 00621 sizeof( FILE_FS_CONTROL_INFORMATION ), // 6 FileFsControlInformation 00622 sizeof( FILE_FS_FULL_SIZE_INFORMATION ), // 7 FileFsFullSizeInformation 00623 sizeof( FILE_FS_OBJECTID_INFORMATION ), // 8 FileFsObjectIdInformation 00624 0xff // FileFsMaximumInformation 00625 }; 00626 00627 // 00628 // The following array specifies the minimum length of the FsInformation 00629 // buffer for an NtSetVolumeInformation service. 00630 // 00631 // WARNING: This array depends on the order of the values in the 00632 // FS_INFORMATION_CLASS enumerated type. Note that the 00633 // enumerated type is one-based and the array is zero-based. 00634 // 00635 00636 UCHAR IopSetFsOperationLength[] = 00637 { 00638 0, 00639 0, // 1 FileFsVolumeInformation 00640 sizeof( FILE_FS_LABEL_INFORMATION ), // 2 FileFsLabelInformation 00641 0, // 3 FileFsSizeInformation 00642 0, // 4 FileFsDeviceInformation 00643 0, // 5 FileFsAttributeInformation 00644 sizeof( FILE_FS_CONTROL_INFORMATION ), // 6 FileFsControlInformation 00645 0, // 7 FileFsFullSizeInformation 00646 sizeof( FILE_FS_OBJECTID_INFORMATION ),// 8 FileFsObjectIdInformation 00647 0xff // FileFsMaximumInformation 00648 }; 00649 00650 // 00651 // The following array specifies the required access mask for the caller to 00652 // access information in an NtQueryVolumeInformation service. 00653 // 00654 // WARNING: This array depends on the order of the values in the 00655 // FS_INFORMATION_CLASS enumerated type. Note that the 00656 // enumerated type is one-based and the array is zero-based. 00657 // 00658 00659 ULONG IopQueryFsOperationAccess[] = 00660 { 00661 0, 00662 0, // 1 FileFsVolumeInformation [any access to file or volume] 00663 0, // 2 FileFsLabelInformation [query is invalid] 00664 0, // 3 FileFsSizeInformation [any access to file or volume] 00665 0, // 4 FileFsDeviceInformation [any access to file or volume] 00666 0, // 5 FileFsAttributeInformation [any access to file or vol] 00667 FILE_READ_DATA, // 6 FileFsControlInformation [vol read access] 00668 0, // 7 FileFsFullSizeInformation [any access to file or volume] 00669 0, // 8 FileFsObjectIdInformation [any access to file or volume] 00670 0xffffffff // FileFsMaximumInformation 00671 }; 00672 00673 // 00674 // The following array specifies the required access mask for the caller to 00675 // access information in an NtSetVolumeInformation service. 00676 // 00677 // WARNING: This array depends on the order of the values in the 00678 // FS_INFORMATION_CLASS enumerated type. Note that the 00679 // enumerated type is one-based and the array is zero-based. 00680 // 00681 00682 ULONG IopSetFsOperationAccess[] = 00683 { 00684 0, 00685 0, // 1 FileFsVolumeInformation [set is invalid] 00686 FILE_WRITE_DATA, // 2 FileFsLabelInformation [write access to volume] 00687 0, // 3 FileFsSizeInformation [set is invalid] 00688 0, // 4 FileFsDeviceInformation [set is invalid] 00689 0, // 5 FileFsAttributeInformation [set is invalid] 00690 FILE_WRITE_DATA, // 6 FileFsControlInformation [vol write access] 00691 0, // 7 FileFsFullSizeInformation [set is invalid] 00692 FILE_WRITE_DATA, // 8 FileFsObjectIdInformation [write access to volume] 00693 0xffffffff // FileFsMaximumInformation 00694 }; 00695 00696 // 00697 // The following array specifies the alignment requirements for all FS query 00698 // and set information services. 00699 // 00700 // WARNING: This array depends on the order of the values in the 00701 // FS_INFORMATION_CLASS enumerated type. Note that the 00702 // enumerated type is one-based and the array is zero-based. 00703 // 00704 00705 UCHAR IopQuerySetFsAlignmentRequirement[] = 00706 { 00707 0, 00708 sizeof( LONGLONG ), // 1 FileFsVolumeInformation 00709 sizeof( LONG ), // 2 FileFsLabelInformation 00710 sizeof( LONGLONG ), // 3 FileFsSizeInformation 00711 sizeof( LONG ), // 4 FileFsDeviceInformation 00712 sizeof( LONG ), // 5 FileFsAttributeInformation 00713 sizeof( LONGLONG ), // 6 FileFsControlInformation 00714 sizeof( LONGLONG ), // 7 FileFsFullSizeInformation 00715 sizeof( LONGLONG ), // 8 FileFsObjectIdInformation 00716 0xff // FileFsMaximumInformation 00717 }; 00718 00719 PVOID IopLoaderBlock = NULL; 00720 00721 BOOLEAN IopRemoteBootCardInitialized = FALSE; 00722 00723 WCHAR IopWstrRaw[] = L".Raw"; 00724 WCHAR IopWstrTranslated[] = L".Translated"; 00725 WCHAR IopWstrBusRaw[] = L".Bus.Raw"; 00726 WCHAR IopWstrBusTranslated[] = L".Bus.Translated"; 00727 WCHAR IopWstrOtherDrivers[] = L"OtherDrivers"; 00728 00729 WCHAR IopWstrAssignedResources[] = L"AssignedSystemResources"; 00730 WCHAR IopWstrRequestedResources[] = L"RequestedSystemResources"; 00731 WCHAR IopWstrSystemResources[] = L"Control\\SystemResources"; 00732 WCHAR IopWstrReservedResources[] = L"ReservedResources"; 00733 WCHAR IopWstrAssignmentOrdering[] = L"AssignmentOrdering"; 00734 WCHAR IopWstrBusValues[] = L"BusValues"; 00735 UNICODE_STRING IoArcBootDeviceName = { 0 }; 00736 UNICODE_STRING IoArcHalDeviceName = { 0 }; 00737 PUCHAR IoLoaderArcBootDeviceName = NULL; 00738 00739 // 00740 // Initialization time data 00741 // 00742 00743 #ifdef ALLOC_DATA_PRAGMA 00744 #pragma data_seg("INIT") 00745 #endif 00746 00747 WCHAR IopWstrHal[] = L"Hardware Abstraction Layer"; 00748 WCHAR IopWstrSystem[] = L"System Resources"; 00749 WCHAR IopWstrPhysicalMemory[] = L"Physical Memory"; 00750 WCHAR IopWstrSpecialMemory[] = L"Reserved"; 00751 00752 #ifdef ALLOC_DATA_PRAGMA 00753 #pragma data_seg() 00754 #endif