00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef _IO_
00025
#define _IO_
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #define IO_TYPE_ADAPTER 0x00000001
00036 #define IO_TYPE_CONTROLLER 0x00000002
00037 #define IO_TYPE_DEVICE 0x00000003
00038 #define IO_TYPE_DRIVER 0x00000004
00039 #define IO_TYPE_FILE 0x00000005
00040 #define IO_TYPE_IRP 0x00000006
00041 #define IO_TYPE_MASTER_ADAPTER 0x00000007
00042 #define IO_TYPE_OPEN_PACKET 0x00000008
00043 #define IO_TYPE_TIMER 0x00000009
00044 #define IO_TYPE_VPB 0x0000000a
00045 #define IO_TYPE_ERROR_LOG 0x0000000b
00046 #define IO_TYPE_ERROR_MESSAGE 0x0000000c
00047 #define IO_TYPE_DEVICE_OBJECT_EXTENSION 0x0000000d
00048
00049
00050
00051
00052
00053
00054
00055 #define IRP_MJ_CREATE 0x00
00056 #define IRP_MJ_CREATE_NAMED_PIPE 0x01
00057 #define IRP_MJ_CLOSE 0x02
00058 #define IRP_MJ_READ 0x03
00059 #define IRP_MJ_WRITE 0x04
00060 #define IRP_MJ_QUERY_INFORMATION 0x05
00061 #define IRP_MJ_SET_INFORMATION 0x06
00062 #define IRP_MJ_QUERY_EA 0x07
00063 #define IRP_MJ_SET_EA 0x08
00064 #define IRP_MJ_FLUSH_BUFFERS 0x09
00065 #define IRP_MJ_QUERY_VOLUME_INFORMATION 0x0a
00066 #define IRP_MJ_SET_VOLUME_INFORMATION 0x0b
00067 #define IRP_MJ_DIRECTORY_CONTROL 0x0c
00068 #define IRP_MJ_FILE_SYSTEM_CONTROL 0x0d
00069 #define IRP_MJ_DEVICE_CONTROL 0x0e
00070 #define IRP_MJ_INTERNAL_DEVICE_CONTROL 0x0f
00071 #define IRP_MJ_SHUTDOWN 0x10
00072 #define IRP_MJ_LOCK_CONTROL 0x11
00073 #define IRP_MJ_CLEANUP 0x12
00074 #define IRP_MJ_CREATE_MAILSLOT 0x13
00075 #define IRP_MJ_QUERY_SECURITY 0x14
00076 #define IRP_MJ_SET_SECURITY 0x15
00077 #define IRP_MJ_POWER 0x16
00078 #define IRP_MJ_SYSTEM_CONTROL 0x17
00079 #define IRP_MJ_DEVICE_CHANGE 0x18
00080 #define IRP_MJ_QUERY_QUOTA 0x19
00081 #define IRP_MJ_SET_QUOTA 0x1a
00082 #define IRP_MJ_PNP 0x1b
00083 #define IRP_MJ_PNP_POWER IRP_MJ_PNP // Obsolete....
00084 #define IRP_MJ_MAXIMUM_FUNCTION 0x1b
00085
00086
00087
00088
00089
00090 #define IRP_MJ_SCSI IRP_MJ_INTERNAL_DEVICE_CONTROL
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103 #define IRP_MN_QUERY_DIRECTORY 0x01
00104 #define IRP_MN_NOTIFY_CHANGE_DIRECTORY 0x02
00105
00106
00107
00108
00109
00110
00111
00112 #define IRP_MN_USER_FS_REQUEST 0x00
00113 #define IRP_MN_MOUNT_VOLUME 0x01
00114 #define IRP_MN_VERIFY_VOLUME 0x02
00115 #define IRP_MN_LOAD_FILE_SYSTEM 0x03
00116 #define IRP_MN_TRACK_LINK 0x04 // To be obsoleted soon
00117 #define IRP_MN_KERNEL_CALL 0x04
00118
00119
00120
00121
00122
00123 #define IRP_MN_LOCK 0x01
00124 #define IRP_MN_UNLOCK_SINGLE 0x02
00125 #define IRP_MN_UNLOCK_ALL 0x03
00126 #define IRP_MN_UNLOCK_ALL_BY_KEY 0x04
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 #define IRP_MN_NORMAL 0x00
00139 #define IRP_MN_DPC 0x01
00140 #define IRP_MN_MDL 0x02
00141 #define IRP_MN_COMPLETE 0x04
00142 #define IRP_MN_COMPRESSED 0x08
00143
00144 #define IRP_MN_MDL_DPC (IRP_MN_MDL | IRP_MN_DPC)
00145 #define IRP_MN_COMPLETE_MDL (IRP_MN_COMPLETE | IRP_MN_MDL)
00146 #define IRP_MN_COMPLETE_MDL_DPC (IRP_MN_COMPLETE_MDL | IRP_MN_DPC)
00147
00148
00149
00150
00151
00152
00153
00154 #define IRP_MN_SCSI_CLASS 0x01
00155
00156
00157
00158
00159
00160 #define IRP_MN_START_DEVICE 0x00
00161 #define IRP_MN_QUERY_REMOVE_DEVICE 0x01
00162 #define IRP_MN_REMOVE_DEVICE 0x02
00163 #define IRP_MN_CANCEL_REMOVE_DEVICE 0x03
00164 #define IRP_MN_STOP_DEVICE 0x04
00165 #define IRP_MN_QUERY_STOP_DEVICE 0x05
00166 #define IRP_MN_CANCEL_STOP_DEVICE 0x06
00167
00168 #define IRP_MN_QUERY_DEVICE_RELATIONS 0x07
00169 #define IRP_MN_QUERY_INTERFACE 0x08
00170 #define IRP_MN_QUERY_CAPABILITIES 0x09
00171 #define IRP_MN_QUERY_RESOURCES 0x0A
00172 #define IRP_MN_QUERY_RESOURCE_REQUIREMENTS 0x0B
00173 #define IRP_MN_QUERY_DEVICE_TEXT 0x0C
00174 #define IRP_MN_FILTER_RESOURCE_REQUIREMENTS 0x0D
00175
00176 #define IRP_MN_READ_CONFIG 0x0F
00177 #define IRP_MN_WRITE_CONFIG 0x10
00178 #define IRP_MN_EJECT 0x11
00179 #define IRP_MN_SET_LOCK 0x12
00180 #define IRP_MN_QUERY_ID 0x13
00181 #define IRP_MN_QUERY_PNP_DEVICE_STATE 0x14
00182 #define IRP_MN_QUERY_BUS_INFORMATION 0x15
00183 #define IRP_MN_DEVICE_USAGE_NOTIFICATION 0x16
00184 #define IRP_MN_SURPRISE_REMOVAL 0x17
00185
00186 #define IRP_MN_QUERY_LEGACY_BUS_INFORMATION 0x18
00187
00188
00189
00190
00191
00192 #define IRP_MN_WAIT_WAKE 0x00
00193 #define IRP_MN_POWER_SEQUENCE 0x01
00194 #define IRP_MN_SET_POWER 0x02
00195 #define IRP_MN_QUERY_POWER 0x03
00196
00197
00198
00199
00200
00201
00202 #define IRP_MN_QUERY_ALL_DATA 0x00
00203 #define IRP_MN_QUERY_SINGLE_INSTANCE 0x01
00204 #define IRP_MN_CHANGE_SINGLE_INSTANCE 0x02
00205 #define IRP_MN_CHANGE_SINGLE_ITEM 0x03
00206 #define IRP_MN_ENABLE_EVENTS 0x04
00207 #define IRP_MN_DISABLE_EVENTS 0x05
00208 #define IRP_MN_ENABLE_COLLECTION 0x06
00209 #define IRP_MN_DISABLE_COLLECTION 0x07
00210 #define IRP_MN_REGINFO 0x08
00211 #define IRP_MN_EXECUTE_METHOD 0x09
00212
00213
00214
00215
00216
00217
00218
00219
00220 #define IRP_MN_SET_TRACE_NOTIFY 0x0A
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233 #define IO_FORCE_ACCESS_CHECK 0x0001
00234 #define IO_OPEN_PAGING_FILE 0x0002
00235 #define IO_OPEN_TARGET_DIRECTORY 0x0004
00236
00237
00238
00239
00240
00241
00242
00243 #define IO_NO_PARAMETER_CHECKING 0x0100
00244
00245
00246
00247
00248
00249
00250 #define IO_REPARSE 0x0
00251 #define IO_REMOUNT 0x1
00252
00253
00254
00255 #define IO_CHECK_CREATE_PARAMETERS 0x0200
00256 #define IO_ATTACH_DEVICE 0x0400
00257
00258
00259
00260
00261
00262 #define IO_ATTACH_DEVICE_API 0x80000000
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
typedef
00276
VOID
00277 (*PSTALL_ROUTINE) (
00278 IN ULONG
Delay
00279 );
00280
00281
00282
00283
00284
00285
typedef
00286 BOOLEAN
00287 (*PDUMP_DRIVER_OPEN) (
00288 IN LARGE_INTEGER PartitionOffset
00289 );
00290
00291
typedef
00292
NTSTATUS
00293 (*PDUMP_DRIVER_WRITE) (
00294 IN PLARGE_INTEGER DiskByteOffset,
00295 IN
PMDL Mdl
00296 );
00297
00298
00299
typedef
00300
VOID
00301 (*PDUMP_DRIVER_FINISH) (
00302
VOID
00303 );
00304
00305
struct _ADAPTER_OBJECT;
00306
00307
00308
00309
00310
00311
00312 typedef struct _INITIALIZATION_CONTEXT {
00313 ULONG
Length;
00314 ULONG
DiskSignature;
00315 PVOID
MemoryBlock;
00316 PVOID
CommonBuffer[2];
00317 PHYSICAL_ADDRESS
PhysicalAddress[2];
00318 PSTALL_ROUTINE StallRoutine;
00319 PDUMP_DRIVER_OPEN OpenRoutine;
00320 PDUMP_DRIVER_WRITE WriteRoutine;
00321 PDUMP_DRIVER_FINISH FinishRoutine;
00322 struct _ADAPTER_OBJECT *
AdapterObject;
00323 PVOID
MappedRegisterBase;
00324 PVOID
PortConfiguration;
00325 BOOLEAN
CrashDump;
00326 ULONG
MaximumTransferSize;
00327 ULONG
CommonBufferSize;
00328 PVOID
TargetAddress;
00329 }
INITIALIZATION_CONTEXT, *
PINITIALIZATION_CONTEXT;
00330
00331
00332
00333
00334
00335
00336 typedef NTSTATUS (*
PIO_QUERY_DEVICE_ROUTINE)(
00337 IN PVOID Context,
00338 IN PUNICODE_STRING PathName,
00339 IN INTERFACE_TYPE BusType,
00340 IN ULONG
BusNumber,
00341 IN PKEY_VALUE_FULL_INFORMATION *BusInformation,
00342 IN
CONFIGURATION_TYPE ControllerType,
00343 IN ULONG ControllerNumber,
00344 IN PKEY_VALUE_FULL_INFORMATION *ControllerInformation,
00345 IN
CONFIGURATION_TYPE PeripheralType,
00346 IN ULONG PeripheralNumber,
00347 IN PKEY_VALUE_FULL_INFORMATION *PeripheralInformation
00348 );
00349
00350
00351
00352
00353
00354
00355 typedef enum _IO_QUERY_DEVICE_DATA_FORMAT {
00356
IoQueryDeviceIdentifier = 0,
00357
IoQueryDeviceConfigurationData,
00358
IoQueryDeviceComponentInformation,
00359
IoQueryDeviceMaxData
00360 }
IO_QUERY_DEVICE_DATA_FORMAT, *
PIO_QUERY_DEVICE_DATA_FORMAT;
00361
00362
00363
00364
00365
00366
00367 typedef enum _CREATE_FILE_TYPE {
00368
CreateFileTypeNone,
00369
CreateFileTypeNamedPipe,
00370
CreateFileTypeMailslot
00371 }
CREATE_FILE_TYPE;
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382 typedef struct _NAMED_PIPE_CREATE_PARAMETERS {
00383 ULONG
NamedPipeType;
00384 ULONG
ReadMode;
00385 ULONG
CompletionMode;
00386 ULONG
MaximumInstances;
00387 ULONG
InboundQuota;
00388 ULONG
OutboundQuota;
00389 LARGE_INTEGER
DefaultTimeout;
00390 BOOLEAN
TimeoutSpecified;
00391 }
NAMED_PIPE_CREATE_PARAMETERS, *
PNAMED_PIPE_CREATE_PARAMETERS;
00392
00393
00394
00395
00396
00397
00398
00399
00400 typedef struct _MAILSLOT_CREATE_PARAMETERS {
00401 ULONG
MailslotQuota;
00402 ULONG
MaximumMessageSize;
00403 LARGE_INTEGER
ReadTimeout;
00404 BOOLEAN
TimeoutSpecified;
00405 }
MAILSLOT_CREATE_PARAMETERS, *
PMAILSLOT_CREATE_PARAMETERS;
00406
00407
00408
00409
00410
00411 typedef struct {
00412 LIST_ENTRY Link;
00413 PLDR_DATA_TABLE_ENTRY Image;
00414 PVOID ImageBase;
00415 ULONG SizeOfImage;
00416 }
DUMP_STACK_IMAGE, *
PDUMP_STACK_IMAGE;
00417
00418 typedef struct {
00419 INITIALIZATION_CONTEXT Init;
00420 LARGE_INTEGER PartitionOffset;
00421 PVOID DumpPointers;
00422 ULONG PointersLength;
00423 PWCHAR ModulePrefix;
00424 LIST_ENTRY DriverList;
00425 ANSI_STRING InitMsg;
00426 ANSI_STRING ProgMsg;
00427 ANSI_STRING DoneMsg;
00428 PVOID FileObject;
00429 enum _DEVICE_USAGE_NOTIFICATION_TYPE UsageType;
00430 }
DUMP_STACK_CONTEXT, *
PDUMP_STACK_CONTEXT;
00431
00432 #define IO_DUMP_MAX_MDL_PAGES 8
00433 #define IO_DUMP_MEMORY_BLOCK_PAGES 8
00434 #define IO_DUMP_COMMON_BUFFER_SIZE 0x2000
00435
00436
NTSTATUS
00437
IoGetDumpStack(
00438 IN PWCHAR ModulePrefix,
00439 OUT PDUMP_STACK_CONTEXT *DumpStack,
00440 IN
enum _DEVICE_USAGE_NOTIFICATION_TYPE UsageType,
00441 IN ULONG IgnoreDeviceUsageFailure
00442 );
00443
00444
NTSTATUS
00445
IoInitializeDumpStack(
00446 IN PDUMP_STACK_CONTEXT DumpStack,
00447 IN PUCHAR MessageBuffer OPTIONAL
00448 );
00449
00450
VOID
00451
IoGetDumpHiberRanges (
00452 IN PVOID HiberContext,
00453 IN PDUMP_STACK_CONTEXT DumpStack
00454 );
00455
00456
NTKERNELAPI
00457 BOOLEAN
00458
IoWriteCrashDump(
00459 IN ULONG BugCheckCode,
00460 IN ULONG_PTR BugCheckParameter1,
00461 IN ULONG_PTR BugCheckParameter2,
00462 IN ULONG_PTR BugCheckParameter3,
00463 IN ULONG_PTR BugCheckParameter4,
00464 IN PVOID Context
00465 );
00466
00467
VOID
00468
IoFreeDumpStack(
00469 IN PDUMP_STACK_CONTEXT DumpStack
00470 );
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
struct _DEVICE_DESCRIPTION;
00483
struct _DEVICE_OBJECT;
00484
struct _DMA_ADAPTER;
00485
struct _DRIVER_OBJECT;
00486
struct _DRIVE_LAYOUT_INFORMATION;
00487
struct _DISK_PARTITION;
00488
struct _FILE_OBJECT;
00489
struct _IRP;
00490
struct _SCSI_REQUEST_BLOCK;
00491
00492
00493
00494
00495
00496
typedef
00497
VOID
00498 (*PIO_DPC_ROUTINE) (
00499 IN
PKDPC Dpc,
00500 IN
struct _DEVICE_OBJECT *DeviceObject,
00501 IN
struct _IRP *
Irp,
00502 IN PVOID Context
00503 );
00504
00505
00506
00507
00508
00509
typedef
00510
VOID
00511 (*PIO_TIMER_ROUTINE) (
00512 IN
struct _DEVICE_OBJECT *DeviceObject,
00513 IN PVOID Context
00514 );
00515
00516
00517
00518
00519
00520
typedef
00521
NTSTATUS
00522 (*PDRIVER_INITIALIZE) (
00523 IN
struct _DRIVER_OBJECT *DriverObject,
00524 IN PUNICODE_STRING RegistryPath
00525 );
00526
00527
00528
00529
00530
00531
00532
typedef
00533
VOID
00534 (*PDRIVER_REINITIALIZE) (
00535 IN
struct _DRIVER_OBJECT *DriverObject,
00536 IN PVOID Context,
00537 IN ULONG
Count
00538 );
00539
00540
00541
00542
00543
00544
00545
typedef
00546
VOID
00547 (*PDRIVER_CANCEL) (
00548 IN
struct _DEVICE_OBJECT *DeviceObject,
00549 IN
struct _IRP *
Irp
00550 );
00551
00552
00553
00554
00555
00556
typedef
00557
NTSTATUS
00558 (*PDRIVER_DISPATCH) (
00559 IN
struct _DEVICE_OBJECT *DeviceObject,
00560 IN
struct _IRP *
Irp
00561 );
00562
00563
00564
00565
00566
00567
typedef
00568
VOID
00569 (*PDRIVER_STARTIO) (
00570 IN
struct _DEVICE_OBJECT *DeviceObject,
00571 IN
struct _IRP *
Irp
00572 );
00573
00574
00575
00576
00577
00578
typedef
00579
VOID
00580 (*PDRIVER_UNLOAD) (
00581 IN
struct _DRIVER_OBJECT *DriverObject
00582 );
00583
00584
00585
00586
00587
00588
typedef
00589
NTSTATUS
00590 (*PDRIVER_ADD_DEVICE) (
00591 IN
struct _DRIVER_OBJECT *DriverObject,
00592 IN
struct _DEVICE_OBJECT *PhysicalDeviceObject
00593 );
00594
00595
00596
00597
00598
00599
00600
00601
typedef
00602
VOID
00603 (*PDRIVER_FS_NOTIFICATION) (
00604 IN
struct _DEVICE_OBJECT *DeviceObject,
00605 IN BOOLEAN FsActive
00606 );
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
typedef
00617 BOOLEAN
00618 (*PFAST_IO_CHECK_IF_POSSIBLE) (
00619 IN
struct _FILE_OBJECT *FileObject,
00620 IN PLARGE_INTEGER FileOffset,
00621 IN ULONG Length,
00622 IN BOOLEAN Wait,
00623 IN ULONG LockKey,
00624 IN BOOLEAN CheckForReadOperation,
00625 OUT PIO_STATUS_BLOCK IoStatus,
00626 IN
struct _DEVICE_OBJECT *DeviceObject
00627 );
00628
00629
typedef
00630 BOOLEAN
00631 (*PFAST_IO_READ) (
00632 IN
struct _FILE_OBJECT *FileObject,
00633 IN PLARGE_INTEGER FileOffset,
00634 IN ULONG Length,
00635 IN BOOLEAN Wait,
00636 IN ULONG LockKey,
00637 OUT PVOID
Buffer,
00638 OUT PIO_STATUS_BLOCK IoStatus,
00639 IN
struct _DEVICE_OBJECT *DeviceObject
00640 );
00641
00642
typedef
00643 BOOLEAN
00644 (*PFAST_IO_WRITE) (
00645 IN
struct _FILE_OBJECT *FileObject,
00646 IN PLARGE_INTEGER FileOffset,
00647 IN ULONG Length,
00648 IN BOOLEAN Wait,
00649 IN ULONG LockKey,
00650 IN PVOID
Buffer,
00651 OUT PIO_STATUS_BLOCK IoStatus,
00652 IN
struct _DEVICE_OBJECT *DeviceObject
00653 );
00654
00655
00656
00657
00658
00659
typedef
00660 BOOLEAN
00661 (*PFAST_IO_QUERY_BASIC_INFO) (
00662 IN
struct _FILE_OBJECT *FileObject,
00663 IN BOOLEAN Wait,
00664 OUT PFILE_BASIC_INFORMATION
Buffer,
00665 OUT PIO_STATUS_BLOCK IoStatus,
00666 IN
struct _DEVICE_OBJECT *DeviceObject
00667 );
00668
00669
typedef
00670 BOOLEAN
00671 (*PFAST_IO_QUERY_STANDARD_INFO) (
00672 IN
struct _FILE_OBJECT *FileObject,
00673 IN BOOLEAN Wait,
00674 OUT PFILE_STANDARD_INFORMATION
Buffer,
00675 OUT PIO_STATUS_BLOCK IoStatus,
00676 IN
struct _DEVICE_OBJECT *DeviceObject
00677 );
00678
00679
00680
00681
00682
00683
typedef
00684 BOOLEAN
00685 (*PFAST_IO_LOCK) (
00686 IN
struct _FILE_OBJECT *FileObject,
00687 IN PLARGE_INTEGER FileOffset,
00688 IN PLARGE_INTEGER Length,
00689
PEPROCESS ProcessId,
00690 ULONG
Key,
00691 BOOLEAN FailImmediately,
00692 BOOLEAN ExclusiveLock,
00693 OUT PIO_STATUS_BLOCK IoStatus,
00694 IN
struct _DEVICE_OBJECT *DeviceObject
00695 );
00696
00697
typedef
00698 BOOLEAN
00699 (*PFAST_IO_UNLOCK_SINGLE) (
00700 IN
struct _FILE_OBJECT *FileObject,
00701 IN PLARGE_INTEGER FileOffset,
00702 IN PLARGE_INTEGER Length,
00703
PEPROCESS ProcessId,
00704 ULONG
Key,
00705 OUT PIO_STATUS_BLOCK IoStatus,
00706 IN
struct _DEVICE_OBJECT *DeviceObject
00707 );
00708
00709
typedef
00710 BOOLEAN
00711 (*PFAST_IO_UNLOCK_ALL) (
00712 IN
struct _FILE_OBJECT *FileObject,
00713
PEPROCESS ProcessId,
00714 OUT PIO_STATUS_BLOCK IoStatus,
00715 IN
struct _DEVICE_OBJECT *DeviceObject
00716 );
00717
00718
typedef
00719 BOOLEAN
00720 (*PFAST_IO_UNLOCK_ALL_BY_KEY) (
00721 IN
struct _FILE_OBJECT *FileObject,
00722 PVOID ProcessId,
00723 ULONG
Key,
00724 OUT PIO_STATUS_BLOCK IoStatus,
00725 IN
struct _DEVICE_OBJECT *DeviceObject
00726 );
00727
00728
00729
00730
00731
00732
typedef
00733 BOOLEAN
00734 (*PFAST_IO_DEVICE_CONTROL) (
00735 IN
struct _FILE_OBJECT *FileObject,
00736 IN BOOLEAN Wait,
00737 IN PVOID InputBuffer OPTIONAL,
00738 IN ULONG InputBufferLength,
00739 OUT PVOID OutputBuffer OPTIONAL,
00740 IN ULONG OutputBufferLength,
00741 IN ULONG IoControlCode,
00742 OUT PIO_STATUS_BLOCK IoStatus,
00743 IN
struct _DEVICE_OBJECT *DeviceObject
00744 );
00745
00746
00747
00748
00749
00750
00751
00752
typedef
00753
VOID
00754 (*PFAST_IO_ACQUIRE_FILE) (
00755 IN
struct _FILE_OBJECT *FileObject
00756 );
00757
00758
typedef
00759
VOID
00760 (*PFAST_IO_RELEASE_FILE) (
00761 IN
struct _FILE_OBJECT *FileObject
00762 );
00763
00764
00765
00766
00767
00768
00769
00770
typedef
00771
VOID
00772 (*PFAST_IO_DETACH_DEVICE) (
00773 IN
struct _DEVICE_OBJECT *SourceDevice,
00774 IN
struct _DEVICE_OBJECT *TargetDevice
00775 );
00776
00777
00778
00779
00780
00781
00782
00783
00784
typedef
00785 BOOLEAN
00786 (*PFAST_IO_QUERY_NETWORK_OPEN_INFO) (
00787 IN
struct _FILE_OBJECT *FileObject,
00788 IN BOOLEAN Wait,
00789 OUT
struct _FILE_NETWORK_OPEN_INFORMATION *
Buffer,
00790 OUT
struct _IO_STATUS_BLOCK *IoStatus,
00791 IN
struct _DEVICE_OBJECT *DeviceObject
00792 );
00793
00794
00795
00796
00797
00798
typedef
00799 BOOLEAN
00800 (*PFAST_IO_MDL_READ) (
00801 IN
struct _FILE_OBJECT *FileObject,
00802 IN PLARGE_INTEGER FileOffset,
00803 IN ULONG Length,
00804 IN ULONG LockKey,
00805 OUT
PMDL *MdlChain,
00806 OUT PIO_STATUS_BLOCK IoStatus,
00807 IN
struct _DEVICE_OBJECT *DeviceObject
00808 );
00809
00810
typedef
00811 BOOLEAN
00812 (*PFAST_IO_MDL_READ_COMPLETE) (
00813 IN
struct _FILE_OBJECT *FileObject,
00814 IN
PMDL MdlChain,
00815 IN
struct _DEVICE_OBJECT *DeviceObject
00816 );
00817
00818
typedef
00819 BOOLEAN
00820 (*PFAST_IO_PREPARE_MDL_WRITE) (
00821 IN
struct _FILE_OBJECT *FileObject,
00822 IN PLARGE_INTEGER FileOffset,
00823 IN ULONG Length,
00824 IN ULONG LockKey,
00825 OUT
PMDL *MdlChain,
00826 OUT PIO_STATUS_BLOCK IoStatus,
00827 IN
struct _DEVICE_OBJECT *DeviceObject
00828 );
00829
00830
typedef
00831 BOOLEAN
00832 (*PFAST_IO_MDL_WRITE_COMPLETE) (
00833 IN
struct _FILE_OBJECT *FileObject,
00834 IN PLARGE_INTEGER FileOffset,
00835 IN
PMDL MdlChain,
00836 IN
struct _DEVICE_OBJECT *DeviceObject
00837 );
00838
00839
00840
00841
00842
00843
00844
typedef
00845
NTSTATUS
00846 (*PFAST_IO_ACQUIRE_FOR_MOD_WRITE) (
00847 IN
struct _FILE_OBJECT *FileObject,
00848 IN PLARGE_INTEGER EndingOffset,
00849 OUT
struct _ERESOURCE **ResourceToRelease,
00850 IN
struct _DEVICE_OBJECT *DeviceObject
00851 );
00852
00853
typedef
00854
NTSTATUS
00855 (*PFAST_IO_RELEASE_FOR_MOD_WRITE) (
00856 IN
struct _FILE_OBJECT *FileObject,
00857 IN
struct _ERESOURCE *ResourceToRelease,
00858 IN
struct _DEVICE_OBJECT *DeviceObject
00859 );
00860
00861
00862
00863
00864
00865
00866
typedef
00867
NTSTATUS
00868 (*PFAST_IO_ACQUIRE_FOR_CCFLUSH) (
00869 IN
struct _FILE_OBJECT *FileObject,
00870 IN
struct _DEVICE_OBJECT *DeviceObject
00871 );
00872
00873
typedef
00874
NTSTATUS
00875 (*PFAST_IO_RELEASE_FOR_CCFLUSH) (
00876 IN
struct _FILE_OBJECT *FileObject,
00877 IN
struct _DEVICE_OBJECT *DeviceObject
00878 );
00879
00880
typedef
00881 BOOLEAN
00882 (*PFAST_IO_READ_COMPRESSED) (
00883 IN
struct _FILE_OBJECT *FileObject,
00884 IN PLARGE_INTEGER FileOffset,
00885 IN ULONG Length,
00886 IN ULONG LockKey,
00887 OUT PVOID
Buffer,
00888 OUT
PMDL *MdlChain,
00889 OUT PIO_STATUS_BLOCK IoStatus,
00890 OUT
struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
00891 IN ULONG CompressedDataInfoLength,
00892 IN
struct _DEVICE_OBJECT *DeviceObject
00893 );
00894
00895
typedef
00896 BOOLEAN
00897 (*PFAST_IO_WRITE_COMPRESSED) (
00898 IN
struct _FILE_OBJECT *FileObject,
00899 IN PLARGE_INTEGER FileOffset,
00900 IN ULONG Length,
00901 IN ULONG LockKey,
00902 IN PVOID
Buffer,
00903 OUT
PMDL *MdlChain,
00904 OUT PIO_STATUS_BLOCK IoStatus,
00905 IN
struct _COMPRESSED_DATA_INFO *CompressedDataInfo,
00906 IN ULONG CompressedDataInfoLength,
00907 IN
struct _DEVICE_OBJECT *DeviceObject
00908 );
00909
00910
typedef
00911 BOOLEAN
00912 (*PFAST_IO_MDL_READ_COMPLETE_COMPRESSED) (
00913 IN
struct _FILE_OBJECT *FileObject,
00914 IN
PMDL MdlChain,
00915 IN
struct _DEVICE_OBJECT *DeviceObject
00916 );
00917
00918
typedef
00919 BOOLEAN
00920 (*PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED) (
00921 IN
struct _FILE_OBJECT *FileObject,
00922 IN PLARGE_INTEGER FileOffset,
00923 IN
PMDL MdlChain,
00924 IN
struct _DEVICE_OBJECT *DeviceObject
00925 );
00926
00927
typedef
00928 BOOLEAN
00929 (*PFAST_IO_QUERY_OPEN) (
00930 IN
struct _IRP *
Irp,
00931 OUT PFILE_NETWORK_OPEN_INFORMATION NetworkInformation,
00932 IN
struct _DEVICE_OBJECT *DeviceObject
00933 );
00934
00935
00936
00937
00938
00939
00940
00941 typedef struct _FAST_IO_DISPATCH {
00942 ULONG
SizeOfFastIoDispatch;
00943 PFAST_IO_CHECK_IF_POSSIBLE FastIoCheckIfPossible;
00944 PFAST_IO_READ FastIoRead;
00945 PFAST_IO_WRITE FastIoWrite;
00946 PFAST_IO_QUERY_BASIC_INFO FastIoQueryBasicInfo;
00947 PFAST_IO_QUERY_STANDARD_INFO FastIoQueryStandardInfo;
00948 PFAST_IO_LOCK FastIoLock;
00949 PFAST_IO_UNLOCK_SINGLE FastIoUnlockSingle;
00950 PFAST_IO_UNLOCK_ALL FastIoUnlockAll;
00951 PFAST_IO_UNLOCK_ALL_BY_KEY FastIoUnlockAllByKey;
00952 PFAST_IO_DEVICE_CONTROL FastIoDeviceControl;
00953 PFAST_IO_ACQUIRE_FILE AcquireFileForNtCreateSection;
00954 PFAST_IO_RELEASE_FILE ReleaseFileForNtCreateSection;
00955 PFAST_IO_DETACH_DEVICE FastIoDetachDevice;
00956 PFAST_IO_QUERY_NETWORK_OPEN_INFO FastIoQueryNetworkOpenInfo;
00957 PFAST_IO_ACQUIRE_FOR_MOD_WRITE AcquireForModWrite;
00958 PFAST_IO_MDL_READ MdlRead;
00959 PFAST_IO_MDL_READ_COMPLETE MdlReadComplete;
00960 PFAST_IO_PREPARE_MDL_WRITE PrepareMdlWrite;
00961 PFAST_IO_MDL_WRITE_COMPLETE MdlWriteComplete;
00962 PFAST_IO_READ_COMPRESSED FastIoReadCompressed;
00963 PFAST_IO_WRITE_COMPRESSED FastIoWriteCompressed;
00964 PFAST_IO_MDL_READ_COMPLETE_COMPRESSED MdlReadCompleteCompressed;
00965 PFAST_IO_MDL_WRITE_COMPLETE_COMPRESSED MdlWriteCompleteCompressed;
00966 PFAST_IO_QUERY_OPEN FastIoQueryOpen;
00967 PFAST_IO_RELEASE_FOR_MOD_WRITE ReleaseForModWrite;
00968 PFAST_IO_ACQUIRE_FOR_CCFLUSH AcquireForCcFlush;
00969 PFAST_IO_RELEASE_FOR_CCFLUSH ReleaseForCcFlush;
00970 }
FAST_IO_DISPATCH, *
PFAST_IO_DISPATCH;
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980 typedef enum _IO_ALLOCATION_ACTION {
00981
KeepObject = 1,
00982
DeallocateObject,
00983
DeallocateObjectKeepRegisters
00984 }
IO_ALLOCATION_ACTION, *
PIO_ALLOCATION_ACTION;
00985
00986
00987
00988
00989
00990
typedef
00991
IO_ALLOCATION_ACTION
00992 (*PDRIVER_CONTROL) (
00993 IN
struct _DEVICE_OBJECT *DeviceObject,
00994 IN
struct _IRP *
Irp,
00995 IN PVOID MapRegisterBase,
00996 IN PVOID Context
00997 );
00998
00999
01000
01001
01002
01003
01004
01005
01006 typedef struct _IO_INTERRUPT_STRUCTURE {
01007 KINTERRUPT InterruptObject;
01008 PKINTERRUPT InterruptArray[
MAXIMUM_PROCESSORS];
01009 KSPIN_LOCK
SpinLock;
01010 }
IO_INTERRUPT_STRUCTURE, *
PIO_INTERRUPT_STRUCTURE;
01011
01012
01013
01014
01015
01016
01017
01018 typedef struct _IO_SECURITY_CONTEXT {
01019 PSECURITY_QUALITY_OF_SERVICE
SecurityQos;
01020 PACCESS_STATE AccessState;
01021 ACCESS_MASK
DesiredAccess;
01022 ULONG
FullCreateOptions;
01023 }
IO_SECURITY_CONTEXT, *
PIO_SECURITY_CONTEXT;
01024
01025
01026
01027
01028
01029
01030
01031 typedef struct _IO_TIMER {
01032 CSHORT
Type;
01033 CSHORT
TimerFlag;
01034 LIST_ENTRY
TimerList;
01035 PIO_TIMER_ROUTINE TimerRoutine;
01036 PVOID Context;
01037 struct _DEVICE_OBJECT *DeviceObject;
01038 }
IO_TIMER, *
PIO_TIMER;
01039
01040
01041
01042
01043
01044 typedef struct _IO_CLIENT_EXTENSION {
01045 struct _IO_CLIENT_EXTENSION *
NextExtension;
01046 PVOID
ClientIdentificationAddress;
01047 }
IO_CLIENT_EXTENSION, *
PIO_CLIENT_EXTENSION;
01048
01049
01050
01051
01052
01053
01054 #define VPB_MOUNTED 0x00000001
01055 #define VPB_LOCKED 0x00000002
01056 #define VPB_PERSISTENT 0x00000004
01057 #define VPB_REMOVE_PENDING 0x00000008
01058 #define VPB_RAW_MOUNT 0x00000010
01059
01060
01061
01062
01063
01064
01065 #define MAXIMUM_VOLUME_LABEL_LENGTH (32 * sizeof(WCHAR)) // 32 characters
01066
01067 typedef struct _VPB {
01068 CSHORT
Type;
01069 CSHORT
Size;
01070 USHORT Flags;
01071 USHORT VolumeLabelLength;
01072 struct _DEVICE_OBJECT *DeviceObject;
01073 struct _DEVICE_OBJECT *
RealDevice;
01074 ULONG
SerialNumber;
01075 ULONG
ReferenceCount;
01076 WCHAR
VolumeLabel[
MAXIMUM_VOLUME_LABEL_LENGTH /
sizeof(WCHAR)];
01077 }
VPB, *
PVPB;
01078
01079
01080
#if defined(_AXP64_)
01081
01082
01083
01084
01085
#ifndef USE_DMA_MACROS
01086
#define USE_DMA_MACROS
01087
#endif
01088
01089
01090
01091
01092
#ifndef NO_LEGACY_DRIVERS
01093
#define NO_LEGACY_DRIVERS
01094
#endif
01095
01096
#endif // _AXP64_
01097
01098
01099
#if defined(USE_DMA_MACROS) && (defined(_NTDDK_) || defined(_NTDRIVER_))
01100
01101
01102
01103
01104
01105
01106
typedef struct _DMA_ADAPTER *
PADAPTER_OBJECT;
01107
01108
01109
#else
01110
01111
01112
01113
01114
01115 typedef struct _ADAPTER_OBJECT *
PADAPTER_OBJECT;
01116
01117
#endif // USE_DMA_MACROS && (_NTDDK_ || _NTDRIVER_)
01118
01119
01120
01121
01122
01123
01124 typedef struct _WAIT_CONTEXT_BLOCK {
01125 KDEVICE_QUEUE_ENTRY WaitQueueEntry;
01126 PDRIVER_CONTROL DeviceRoutine;
01127 PVOID
DeviceContext;
01128 ULONG
NumberOfMapRegisters;
01129 PVOID DeviceObject;
01130 PVOID
CurrentIrp;
01131 PKDPC BufferChainingDpc;
01132 }
WAIT_CONTEXT_BLOCK, *
PWAIT_CONTEXT_BLOCK;
01133
01134
01135
01136 typedef struct _CONTROLLER_OBJECT {
01137 CSHORT
Type;
01138 CSHORT
Size;
01139 PVOID
ControllerExtension;
01140 KDEVICE_QUEUE DeviceWaitQueue;
01141
01142 ULONG
Spare1;
01143 LARGE_INTEGER
Spare2;
01144
01145 }
CONTROLLER_OBJECT, *
PCONTROLLER_OBJECT;
01146
01147
01148
01149
01150
01151
01152
01153 #define DO_VERIFY_VOLUME 0x00000002 // ntddk nthal ntifs
01154 #define DO_BUFFERED_IO 0x00000004 // ntddk nthal ntifs wdm
01155 #define DO_EXCLUSIVE 0x00000008 // ntddk nthal ntifs wdm
01156 #define DO_DIRECT_IO 0x00000010 // ntddk nthal ntifs wdm
01157 #define DO_MAP_IO_BUFFER 0x00000020 // ntddk nthal ntifs wdm
01158 #define DO_DEVICE_HAS_NAME 0x00000040 // ntddk nthal ntifs
01159 #define DO_DEVICE_INITIALIZING 0x00000080 // ntddk nthal ntifs wdm
01160 #define DO_SYSTEM_BOOT_PARTITION 0x00000100 // ntddk nthal ntifs
01161 #define DO_LONG_TERM_REQUESTS 0x00000200 // ntddk nthal ntifs
01162 #define DO_NEVER_LAST_DEVICE 0x00000400 // ntddk nthal ntifs
01163 #define DO_SHUTDOWN_REGISTERED 0x00000800 // ntddk nthal ntifs wdm
01164 #define DO_BUS_ENUMERATED_DEVICE 0x00001000 // ntddk nthal ntifs wdm
01165 #define DO_POWER_PAGABLE 0x00002000 // ntddk nthal ntifs wdm
01166 #define DO_POWER_INRUSH 0x00004000 // ntddk nthal ntifs wdm
01167 #define DO_POWER_NOOP 0x00008000
01168 #define DO_LOW_PRIORITY_FILESYSTEM 0x00010000 // ntddk nthal ntifs
01169
01170
01171
01172
01173
01174
01175 typedef struct _DEVICE_OBJECT {
01176 CSHORT
Type;
01177 USHORT Size;
01178 LONG
ReferenceCount;
01179 struct _DRIVER_OBJECT *DriverObject;
01180 struct _DEVICE_OBJECT *
NextDevice;
01181 struct _DEVICE_OBJECT *
AttachedDevice;
01182 struct _IRP *
CurrentIrp;
01183 PIO_TIMER Timer;
01184 ULONG
Flags;
01185 ULONG
Characteristics;
01186 PVPB Vpb;
01187 PVOID
DeviceExtension;
01188 DEVICE_TYPE
DeviceType;
01189 CCHAR
StackSize;
01190
union {
01191 LIST_ENTRY ListEntry;
01192 WAIT_CONTEXT_BLOCK Wcb;
01193 } Queue;
01194 ULONG
AlignmentRequirement;
01195 KDEVICE_QUEUE DeviceQueue;
01196 KDPC Dpc;
01197
01198
01199
01200
01201
01202
01203 ULONG
ActiveThreadCount;
01204 PSECURITY_DESCRIPTOR
SecurityDescriptor;
01205 KEVENT DeviceLock;
01206
01207 USHORT SectorSize;
01208 USHORT Spare1;
01209
01210 struct _DEVOBJ_EXTENSION *
DeviceObjectExtension;
01211 PVOID
Reserved;
01212 }
DEVICE_OBJECT;
01213 typedef struct _DEVICE_OBJECT *
PDEVICE_OBJECT;
01214
01215
01216
01217
01218
01219
01220 #define DOE_UNLOAD_PENDING 0x00000001
01221 #define DOE_DELETE_PENDING 0x00000002
01222 #define DOE_REMOVE_PENDING 0x00000004
01223 #define DOE_REMOVE_PROCESSED 0x00000008
01224 #define DOE_START_PENDING 0x00000010
01225
01226
01227
01228
struct _DEVICE_OBJECT_POWER_EXTENSION;
01229
01230 typedef struct _DEVOBJ_EXTENSION {
01231
01232 CSHORT
Type;
01233 USHORT Size;
01234
01235
01236
01237
01238
01239 PDEVICE_OBJECT DeviceObject;
01240
01241
01242
01243
01244
01245
01246
01247 ULONG
PowerFlags;
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258 struct _DEVICE_OBJECT_POWER_EXTENSION *
Dope;
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268 ULONG
ExtensionFlags;
01269
01270
01271
01272
01273
01274 PVOID
DeviceNode;
01275
01276
01277
01278
01279
01280
01281
01282
01283 PDEVICE_OBJECT AttachedTo;
01284
01285
01286
01287
01288
01289 LIST_ENTRY
FileObjectList;
01290
01291
01292
01293 }
DEVOBJ_EXTENSION, *
PDEVOBJ_EXTENSION;
01294
01295
01296
01297
01298
01299 #define DRVO_UNLOAD_INVOKED 0x00000001
01300 #define DRVO_LEGACY_DRIVER 0x00000002
01301 #define DRVO_BUILTIN_DRIVER 0x00000004 // Driver objects for Hal, PnP Mgr
01302
01303 #define DRVO_REINIT_REGISTERED 0x00000008
01304 #define DRVO_INITIALIZED 0x00000010
01305 #define DRVO_BOOTREINIT_REGISTERED 0x00000020
01306 #define DRVO_LEGACY_RESOURCES 0x00000040
01307
01308
01309 typedef struct _DRIVER_EXTENSION {
01310
01311
01312
01313
01314
01315 struct _DRIVER_OBJECT *DriverObject;
01316
01317
01318
01319
01320
01321
01322
01323 PDRIVER_ADD_DEVICE AddDevice;
01324
01325
01326
01327
01328
01329
01330 ULONG
Count;
01331
01332
01333
01334
01335
01336
01337 UNICODE_STRING
ServiceKeyName;
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350 PIO_CLIENT_EXTENSION ClientDriverExtension;
01351
01352
01353
01354 }
DRIVER_EXTENSION, *
PDRIVER_EXTENSION;
01355
01356 typedef struct _DRIVER_OBJECT {
01357 CSHORT
Type;
01358 CSHORT
Size;
01359
01360
01361
01362
01363
01364
01365
01366 PDEVICE_OBJECT DeviceObject;
01367 ULONG
Flags;
01368
01369
01370
01371
01372
01373
01374
01375 PVOID
DriverStart;
01376 ULONG
DriverSize;
01377 PVOID
DriverSection;
01378 PDRIVER_EXTENSION DriverExtension;
01379
01380
01381
01382
01383
01384
01385 UNICODE_STRING
DriverName;
01386
01387
01388
01389
01390
01391
01392 PUNICODE_STRING
HardwareDatabase;
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403 PFAST_IO_DISPATCH FastIoDispatch;
01404
01405
01406
01407
01408
01409
01410
01411 PDRIVER_INITIALIZE DriverInit;
01412 PDRIVER_STARTIO DriverStartIo;
01413 PDRIVER_UNLOAD DriverUnload;
01414 PDRIVER_DISPATCH MajorFunction[
IRP_MJ_MAXIMUM_FUNCTION + 1];
01415
01416 }
DRIVER_OBJECT;
01417 typedef struct _DRIVER_OBJECT *
PDRIVER_OBJECT;
01418
01419
01420
01421
01422
01423
01424
01425
01426
01427
01428 typedef struct _DEVICE_HANDLER_OBJECT {
01429 CSHORT
Type;
01430 USHORT Size;
01431
01432
01433
01434
01435
01436
01437 struct _BUS_HANDLER *
BusHandler;
01438
01439
01440
01441
01442
01443 ULONG
SlotNumber;
01444
01445
01446
01447
01448
01449
01450
01451
01452
01453
01454
01455 UNICODE_STRING
ServiceKeyName;
01456 ULONG
InstanceOrdinal;
01457
01458
01459
01460
01461 }
DEVICE_HANDLER_OBJECT, *
PDEVICE_HANDLER_OBJECT;
01462
01463
01464
01465
01466
01467
01468
01469
01470 typedef struct _SECTION_OBJECT_POINTERS {
01471 PVOID
DataSectionObject;
01472 PVOID
SharedCacheMap;
01473 PVOID
ImageSectionObject;
01474 }
SECTION_OBJECT_POINTERS;
01475 typedef SECTION_OBJECT_POINTERS *
PSECTION_OBJECT_POINTERS;
01476
01477
01478
01479
01480
01481 typedef struct _IO_COMPLETION_CONTEXT {
01482 PVOID
Port;
01483 PVOID
Key;
01484 }
IO_COMPLETION_CONTEXT, *
PIO_COMPLETION_CONTEXT;
01485
01486
01487
01488
01489
01490 #define FO_FILE_OPEN 0x00000001
01491 #define FO_SYNCHRONOUS_IO 0x00000002
01492 #define FO_ALERTABLE_IO 0x00000004
01493 #define FO_NO_INTERMEDIATE_BUFFERING 0x00000008
01494 #define FO_WRITE_THROUGH 0x00000010
01495 #define FO_SEQUENTIAL_ONLY 0x00000020
01496 #define FO_CACHE_SUPPORTED 0x00000040
01497 #define FO_NAMED_PIPE 0x00000080
01498 #define FO_STREAM_FILE 0x00000100
01499 #define FO_MAILSLOT 0x00000200
01500 #define FO_GENERATE_AUDIT_ON_CLOSE 0x00000400
01501 #define FO_DIRECT_DEVICE_OPEN 0x00000800
01502 #define FO_FILE_MODIFIED 0x00001000
01503 #define FO_FILE_SIZE_CHANGED 0x00002000
01504 #define FO_CLEANUP_COMPLETE 0x00004000
01505 #define FO_TEMPORARY_FILE 0x00008000
01506 #define FO_DELETE_ON_CLOSE 0x00010000
01507 #define FO_OPENED_CASE_SENSITIVE 0x00020000
01508 #define FO_HANDLE_CREATED 0x00040000
01509 #define FO_FILE_FAST_IO_READ 0x00080000
01510 #define FO_RANDOM_ACCESS 0x00100000
01511 #define FO_FILE_OPEN_CANCELLED 0x00200000
01512 #define FO_VOLUME_OPEN 0x00400000
01513
01514 typedef struct _FILE_OBJECT {
01515 CSHORT
Type;
01516 CSHORT
Size;
01517 PDEVICE_OBJECT DeviceObject;
01518 PVPB Vpb;
01519 PVOID
FsContext;
01520 PVOID
FsContext2;
01521 PSECTION_OBJECT_POINTERS SectionObjectPointer;
01522 PVOID
PrivateCacheMap;
01523 NTSTATUS FinalStatus;
01524 struct _FILE_OBJECT *
RelatedFileObject;
01525 BOOLEAN
LockOperation;
01526 BOOLEAN
DeletePending;
01527 BOOLEAN
ReadAccess;
01528 BOOLEAN
WriteAccess;
01529 BOOLEAN
DeleteAccess;
01530 BOOLEAN
SharedRead;
01531 BOOLEAN
SharedWrite;
01532 BOOLEAN
SharedDelete;
01533 ULONG
Flags;
01534 UNICODE_STRING
FileName;
01535 LARGE_INTEGER
CurrentByteOffset;
01536 ULONG
Waiters;
01537 ULONG
Busy;
01538 PVOID
LastLock;
01539 KEVENT Lock;
01540 KEVENT Event;
01541 PIO_COMPLETION_CONTEXT CompletionContext;
01542 }
FILE_OBJECT;
01543 typedef struct _FILE_OBJECT *
PFILE_OBJECT;
01544
01545
01546
01547
01548
01549 #define IRP_NOCACHE 0x00000001
01550 #define IRP_PAGING_IO 0x00000002
01551 #define IRP_MOUNT_COMPLETION 0x00000002
01552 #define IRP_SYNCHRONOUS_API 0x00000004
01553 #define IRP_ASSOCIATED_IRP 0x00000008
01554 #define IRP_BUFFERED_IO 0x00000010
01555 #define IRP_DEALLOCATE_BUFFER 0x00000020
01556 #define IRP_INPUT_OPERATION 0x00000040
01557 #define IRP_SYNCHRONOUS_PAGING_IO 0x00000040
01558 #define IRP_CREATE_OPERATION 0x00000080
01559 #define IRP_READ_OPERATION 0x00000100
01560 #define IRP_WRITE_OPERATION 0x00000200
01561 #define IRP_CLOSE_OPERATION 0x00000400
01562
01563
01564 #define IRP_DEFER_IO_COMPLETION 0x00000800
01565 #define IRP_OB_QUERY_NAME 0x00001000
01566 #define IRP_HOLD_DEVICE_QUEUE 0x00002000
01567 #define IRP_RETRY_IO_COMPLETION 0x00004000
01568
01569
01570
01571
01572
01573
01574 #define IRP_QUOTA_CHARGED 0x01
01575 #define IRP_ALLOCATED_MUST_SUCCEED 0x02
01576 #define IRP_ALLOCATED_FIXED_SIZE 0x04
01577 #define IRP_LOOKASIDE_ALLOCATION 0x08
01578
01579
01580
01581
01582
01583 typedef struct _IRP {
01584 CSHORT
Type;
01585 USHORT Size;
01586
01587
01588
01589
01590
01591
01592
01593
01594
01595
01596 PMDL MdlAddress;
01597
01598
01599
01600
01601
01602 ULONG
Flags;
01603
01604
01605
01606
01607
01608
01609
01610
01611
01612
01613
01614
01615
01616
01617
01618
union {
01619 struct _IRP *
MasterIrp;
01620 LONG
IrpCount;
01621 PVOID
SystemBuffer;
01622 } AssociatedIrp;
01623
01624
01625
01626
01627
01628
01629 LIST_ENTRY
ThreadListEntry;
01630
01631
01632
01633
01634
01635 IO_STATUS_BLOCK IoStatus;
01636
01637
01638
01639
01640
01641 KPROCESSOR_MODE RequestorMode;
01642
01643
01644
01645
01646
01647
01648 BOOLEAN
PendingReturned;
01649
01650
01651
01652
01653
01654 CHAR StackCount;
01655 CHAR CurrentLocation;
01656
01657
01658
01659
01660
01661 BOOLEAN
Cancel;
01662
01663
01664
01665
01666
01667 KIRQL
CancelIrql;
01668
01669
01670
01671
01672
01673
01674 CCHAR
ApcEnvironment;
01675
01676
01677
01678
01679
01680 UCHAR
AllocationFlags;
01681
01682
01683
01684
01685
01686 PIO_STATUS_BLOCK
UserIosb;
01687 PKEVENT UserEvent;
01688
union {
01689
struct {
01690 PIO_APC_ROUTINE UserApcRoutine;
01691 PVOID UserApcContext;
01692 } AsynchronousParameters;
01693 LARGE_INTEGER AllocationSize;
01694 } Overlay;
01695
01696
01697
01698
01699
01700
01701 PDRIVER_CANCEL CancelRoutine;
01702
01703
01704
01705
01706
01707
01708
01709
01710
01711 PVOID
UserBuffer;
01712
01713
01714
01715
01716
01717
01718
01719
01720
01721
01722
01723
union {
01724
01725
struct {
01726
01727
union {
01728
01729
01730
01731
01732
01733
01734 KDEVICE_QUEUE_ENTRY DeviceQueueEntry;
01735
01736
struct {
01737
01738
01739
01740
01741
01742
01743
01744 PVOID
DriverContext[4];
01745
01746 } ;
01747
01748 } ;
01749
01750
01751
01752
01753
01754 PETHREAD Thread;
01755
01756
01757
01758
01759
01760
01761
01762 PCHAR
AuxiliaryBuffer;
01763
01764
01765
01766
01767
01768
01769
01770
struct {
01771
01772
01773
01774
01775
01776
01777 LIST_ENTRY
ListEntry;
01778
01779
union {
01780
01781
01782
01783
01784
01785
01786
01787
01788 struct _IO_STACK_LOCATION *
CurrentStackLocation;
01789
01790
01791
01792
01793
01794 ULONG
PacketType;
01795 };
01796 };
01797
01798
01799
01800
01801
01802
01803
01804 PFILE_OBJECT OriginalFileObject;
01805
01806 } Overlay;
01807
01808
01809
01810
01811
01812
01813
01814
01815
01816 KAPC Apc;
01817
01818
01819
01820
01821
01822
01823 PVOID
CompletionKey;
01824
01825 } Tail;
01826
01827 }
IRP, *
PIRP;
01828
01829
01830
01831
01832
01833
typedef
01834
NTSTATUS
01835 (*PIO_COMPLETION_ROUTINE) (
01836 IN
PDEVICE_OBJECT DeviceObject,
01837 IN
PIRP Irp,
01838 IN PVOID Context
01839 );
01840
01841
01842
01843
01844
01845 #define SL_PENDING_RETURNED 0x01
01846 #define SL_INVOKE_ON_CANCEL 0x20
01847 #define SL_INVOKE_ON_SUCCESS 0x40
01848 #define SL_INVOKE_ON_ERROR 0x80
01849
01850
01851
01852
01853
01854
01855
01856
01857
01858
01859
01860
01861
01862
01863 #define SL_FORCE_ACCESS_CHECK 0x01
01864 #define SL_OPEN_PAGING_FILE 0x02
01865 #define SL_OPEN_TARGET_DIRECTORY 0x04
01866
01867 #define SL_CASE_SENSITIVE 0x80
01868
01869
01870
01871
01872
01873 #define SL_KEY_SPECIFIED 0x01
01874 #define SL_OVERRIDE_VERIFY_VOLUME 0x02
01875 #define SL_WRITE_THROUGH 0x04
01876 #define SL_FT_SEQUENTIAL_WRITE 0x08
01877
01878
01879
01880
01881
01882
01883
01884
01885
01886
01887
01888
01889 #define SL_FAIL_IMMEDIATELY 0x01
01890 #define SL_EXCLUSIVE_LOCK 0x02
01891
01892
01893
01894
01895
01896 #define SL_RESTART_SCAN 0x01
01897 #define SL_RETURN_SINGLE_ENTRY 0x02
01898 #define SL_INDEX_SPECIFIED 0x04
01899
01900
01901
01902
01903
01904 #define SL_WATCH_TREE 0x01
01905
01906
01907
01908
01909
01910
01911
01912 #define SL_ALLOW_RAW_MOUNT 0x01
01913
01914
01915
01916
01917
01918 typedef enum _DEVICE_RELATION_TYPE {
01919
BusRelations,
01920
EjectionRelations,
01921
PowerRelations,
01922
RemovalRelations,
01923
TargetDeviceRelation
01924 }
DEVICE_RELATION_TYPE, *
PDEVICE_RELATION_TYPE;
01925
01926 typedef struct _DEVICE_RELATIONS {
01927 ULONG
Count;
01928 PDEVICE_OBJECT Objects[1];
01929 }
DEVICE_RELATIONS, *
PDEVICE_RELATIONS;
01930
01931 typedef enum _DEVICE_USAGE_NOTIFICATION_TYPE {
01932
DeviceUsageTypeUndefined,
01933
DeviceUsageTypePaging,
01934
DeviceUsageTypeHibernation,
01935
DeviceUsageTypeDumpFile
01936 }
DEVICE_USAGE_NOTIFICATION_TYPE;
01937
01938
01939
01940 typedef struct _INTERFACE {
01941 USHORT Size;
01942 USHORT Version;
01943 PVOID Context;
01944 PINTERFACE_REFERENCE
InterfaceReference;
01945 PINTERFACE_DEREFERENCE
InterfaceDereference;
01946
01947 }
INTERFACE, *
PINTERFACE;
01948
01949
01950
01951 typedef struct _DEVICE_CAPABILITIES {
01952 USHORT Size;
01953 USHORT Version;
01954 ULONG
DeviceD1:1;
01955 ULONG
DeviceD2:1;
01956 ULONG
LockSupported:1;
01957 ULONG
EjectSupported:1;
01958 ULONG
Removable:1;
01959 ULONG
DockDevice:1;
01960 ULONG
UniqueID:1;
01961 ULONG
SilentInstall:1;
01962 ULONG
RawDeviceOK:1;
01963 ULONG
SurpriseRemovalOK:1;
01964 ULONG
WakeFromD0:1;
01965 ULONG
WakeFromD1:1;
01966 ULONG
WakeFromD2:1;
01967 ULONG
WakeFromD3:1;
01968 ULONG
HardwareDisabled:1;
01969 ULONG
NonDynamic:1;
01970 ULONG
WarmEjectSupported:1;
01971 ULONG
NoDisplayInUI:1;
01972 ULONG
Reserved:14;
01973
01974 ULONG
Address;
01975 ULONG
UINumber;
01976
01977 DEVICE_POWER_STATE
DeviceState[PowerSystemMaximum];
01978 SYSTEM_POWER_STATE
SystemWake;
01979 DEVICE_POWER_STATE
DeviceWake;
01980 ULONG
D1Latency;
01981 ULONG
D2Latency;
01982 ULONG
D3Latency;
01983 }
DEVICE_CAPABILITIES, *
PDEVICE_CAPABILITIES;
01984
01985 typedef struct _POWER_SEQUENCE {
01986 ULONG
SequenceD1;
01987 ULONG
SequenceD2;
01988 ULONG
SequenceD3;
01989 }
POWER_SEQUENCE, *
PPOWER_SEQUENCE;
01990
01991 typedef enum {
01992
BusQueryDeviceID = 0,
01993
BusQueryHardwareIDs = 1,
01994
BusQueryCompatibleIDs = 2,
01995
BusQueryInstanceID = 3,
01996
BusQueryDeviceSerialNumber = 4
01997 }
BUS_QUERY_ID_TYPE, *
PBUS_QUERY_ID_TYPE;
01998
01999 typedef ULONG
PNP_DEVICE_STATE, *
PPNP_DEVICE_STATE;
02000
02001 #define PNP_DEVICE_DISABLED 0x00000001
02002 #define PNP_DEVICE_DONT_DISPLAY_IN_UI 0x00000002
02003 #define PNP_DEVICE_FAILED 0x00000004
02004 #define PNP_DEVICE_REMOVED 0x00000008
02005 #define PNP_DEVICE_RESOURCE_REQUIREMENTS_CHANGED 0x00000010
02006 #define PNP_DEVICE_NOT_DISABLEABLE 0x00000020
02007
02008 typedef enum {
02009
DeviceTextDescription = 0,
02010
DeviceTextLocationInformation = 1
02011 }
DEVICE_TEXT_TYPE, *
PDEVICE_TEXT_TYPE;
02012
02013
02014
02015
02016
02017
#if !defined(_ALPHA_) && !defined(_IA64_)
02018
#include "pshpack4.h"
02019
#endif
02020
02021
#if defined(_WIN64)
02022
#define POINTER_ALIGNMENT DECLSPEC_ALIGN(8)
02023
#else
02024 #define POINTER_ALIGNMENT
02025
#endif
02026
02027 typedef struct _IO_STACK_LOCATION {
02028 UCHAR
MajorFunction;
02029 UCHAR
MinorFunction;
02030 UCHAR
Flags;
02031 UCHAR
Control;
02032
02033
02034
02035
02036
02037
02038
02039
union {
02040
02041
02042
02043
02044
02045
struct {
02046
PIO_SECURITY_CONTEXT SecurityContext;
02047 ULONG
Options;
02048 USHORT POINTER_ALIGNMENT FileAttributes;
02049
USHORT ShareAccess;
02050 ULONG
POINTER_ALIGNMENT EaLength;
02051 } Create;
02052
02053
02054
02055
02056
02057
02058
02059
02060
02061
02062
02063
02064
struct {
02065
PIO_SECURITY_CONTEXT SecurityContext;
02066 ULONG Options;
02067
USHORT POINTER_ALIGNMENT Reserved;
02068
USHORT ShareAccess;
02069 PNAMED_PIPE_CREATE_PARAMETERS Parameters;
02070 } CreatePipe;
02071
02072
02073
02074
02075
02076
02077
02078
02079
02080
02081
struct {
02082 PIO_SECURITY_CONTEXT SecurityContext;
02083 ULONG
Options;
02084 USHORT POINTER_ALIGNMENT Reserved;
02085 USHORT ShareAccess;
02086 PMAILSLOT_CREATE_PARAMETERS Parameters;
02087 } CreateMailslot;
02088
02089
02090
02091
02092
02093
02094
02095
struct {
02096 ULONG Length;
02097 ULONG
POINTER_ALIGNMENT Key;
02098 LARGE_INTEGER ByteOffset;
02099 }
Read;
02100
02101
02102
02103
02104
02105
struct {
02106 ULONG Length;
02107 ULONG
POINTER_ALIGNMENT Key;
02108 LARGE_INTEGER
ByteOffset;
02109 }
Write;
02110
02111
02112
02113
02114
02115
02116
02117
struct {
02118 ULONG Length;
02119 PSTRING
FileName;
02120 FILE_INFORMATION_CLASS
FileInformationClass;
02121 ULONG
POINTER_ALIGNMENT FileIndex;
02122 } QueryDirectory;
02123
02124
02125
02126
02127
02128
struct {
02129 ULONG Length;
02130 ULONG
POINTER_ALIGNMENT CompletionFilter;
02131 } NotifyDirectory;
02132
02133
02134
02135
02136
02137
02138
02139
struct {
02140 ULONG Length;
02141 FILE_INFORMATION_CLASS
POINTER_ALIGNMENT FileInformationClass;
02142 }
QueryFile;
02143
02144
02145
02146
02147
02148
struct {
02149 ULONG Length;
02150 FILE_INFORMATION_CLASS
POINTER_ALIGNMENT FileInformationClass;
02151
PFILE_OBJECT FileObject;
02152
union {
02153
struct {
02154 BOOLEAN
ReplaceIfExists;
02155 BOOLEAN
AdvanceOnly;
02156 };
02157 ULONG
ClusterCount;
02158 HANDLE
DeleteHandle;
02159 };
02160 }
SetFile;
02161
02162
02163
02164
02165
02166
02167
02168
struct {
02169 ULONG Length;
02170 PVOID
EaList;
02171 ULONG
EaListLength;
02172 ULONG
POINTER_ALIGNMENT EaIndex;
02173 } QueryEa;
02174
02175
02176
02177
02178
02179
struct {
02180 ULONG Length;
02181 }
SetEa;
02182
02183
02184
02185
02186
02187
02188
02189
struct {
02190 ULONG Length;
02191 FS_INFORMATION_CLASS
POINTER_ALIGNMENT FsInformationClass;
02192 }
QueryVolume;
02193
02194
02195
02196
02197
02198
02199
02200
struct {
02201 ULONG Length;
02202 FS_INFORMATION_CLASS
POINTER_ALIGNMENT FsInformationClass;
02203 } SetVolume;
02204
02205
02206
02207
02208
02209
02210
02211
02212
struct {
02213 ULONG OutputBufferLength;
02214 ULONG
POINTER_ALIGNMENT InputBufferLength;
02215 ULONG
POINTER_ALIGNMENT FsControlCode;
02216 PVOID
Type3InputBuffer;
02217 } FileSystemControl;
02218
02219
02220
02221
02222
02223
struct {
02224 PLARGE_INTEGER Length;
02225 ULONG
POINTER_ALIGNMENT Key;
02226 LARGE_INTEGER
ByteOffset;
02227 } LockControl;
02228
02229
02230
02231
02232
02233
02234
02235
02236
02237
02238
02239
02240
02241
02242
02243
02244
02245
02246
02247
02248
02249
02250
02251
02252
02253
02254
struct {
02255 ULONG OutputBufferLength;
02256 ULONG
POINTER_ALIGNMENT InputBufferLength;
02257 ULONG
POINTER_ALIGNMENT IoControlCode;
02258 PVOID
Type3InputBuffer;
02259 } DeviceIoControl;
02260
02261
02262
02263
02264
02265
02266
struct {
02267 SECURITY_INFORMATION SecurityInformation;
02268 ULONG
POINTER_ALIGNMENT Length;
02269 }
QuerySecurity;
02270
02271
02272
02273
02274
02275
struct {
02276 SECURITY_INFORMATION
SecurityInformation;
02277 PSECURITY_DESCRIPTOR
SecurityDescriptor;
02278 } SetSecurity;
02279
02280
02281
02282
02283
02284
02285
02286
02287
struct {
02288
PVPB Vpb;
02289
PDEVICE_OBJECT DeviceObject;
02290 }
MountVolume;
02291
02292
02293
02294
02295
02296
struct {
02297 PVPB Vpb;
02298
PDEVICE_OBJECT DeviceObject;
02299 } VerifyVolume;
02300
02301
02302
02303
02304
02305
struct {
02306 struct _SCSI_REQUEST_BLOCK *
Srb;
02307 } Scsi;
02308
02309
02310
02311
02312
02313
02314
02315
struct {
02316 ULONG Length;
02317 PSID StartSid;
02318 PFILE_GET_QUOTA_INFORMATION SidList;
02319 ULONG SidListLength;
02320 } QueryQuota;
02321
02322
02323
02324
02325
02326
struct {
02327 ULONG Length;
02328 } SetQuota;
02329
02330
02331
02332
02333
02334
02335
02336
struct {
02337 DEVICE_RELATION_TYPE Type;
02338 } QueryDeviceRelations;
02339
02340
02341
02342
02343
02344
struct {
02345 CONST GUID *
InterfaceType;
02346 USHORT Size;
02347 USHORT Version;
02348 PINTERFACE Interface;
02349 PVOID
InterfaceSpecificData;
02350 } QueryInterface;
02351
02352
02353
02354
02355
02356
02357
02358
struct {
02359 PDEVICE_CAPABILITIES Capabilities;
02360 } DeviceCapabilities;
02361
02362
02363
02364
02365
02366
struct {
02367 PIO_RESOURCE_REQUIREMENTS_LIST
IoResourceRequirementList;
02368 } FilterResourceRequirements;
02369
02370
02371
02372
02373
02374
struct {
02375 ULONG
WhichSpace;
02376 PVOID
Buffer;
02377 ULONG
Offset;
02378 ULONG
POINTER_ALIGNMENT Length;
02379 } ReadWriteConfig;
02380
02381
02382
02383
02384
02385
struct {
02386 BOOLEAN
Lock;
02387 } SetLock;
02388
02389
02390
02391
02392
02393
struct {
02394 BUS_QUERY_ID_TYPE IdType;
02395 } QueryId;
02396
02397
02398
02399
02400
02401
struct {
02402 DEVICE_TEXT_TYPE DeviceTextType;
02403 LCID
POINTER_ALIGNMENT LocaleId;
02404 } QueryDeviceText;
02405
02406
02407
02408
02409
02410
struct {
02411 BOOLEAN
InPath;
02412 BOOLEAN
Reserved[3];
02413 DEVICE_USAGE_NOTIFICATION_TYPE POINTER_ALIGNMENT Type;
02414 } UsageNotification;
02415
02416
02417
02418
02419
02420
struct {
02421 SYSTEM_POWER_STATE
PowerState;
02422 } WaitWake;
02423
02424
02425
02426
02427
02428
struct {
02429 PPOWER_SEQUENCE PowerSequence;
02430 } PowerSequence;
02431
02432
02433
02434
02435
02436
struct {
02437 ULONG
SystemContext;
02438 POWER_STATE_TYPE
POINTER_ALIGNMENT Type;
02439 POWER_STATE
POINTER_ALIGNMENT State;
02440 POWER_ACTION
POINTER_ALIGNMENT ShutdownType;
02441 } Power;
02442
02443
02444
02445
02446
02447
struct {
02448 PCM_RESOURCE_LIST
AllocatedResources;
02449 PCM_RESOURCE_LIST
AllocatedResourcesTranslated;
02450 } StartDevice;
02451
02452
02453
02454
02455
02456
02457
02458
02459
02460
02461
02462
02463
struct {
02464 ULONG_PTR
ProviderId;
02465 PVOID
DataPath;
02466 ULONG
BufferSize;
02467 PVOID
Buffer;
02468 } WMI;
02469
02470
02471
02472
02473
02474
struct {
02475 PVOID
Argument1;
02476 PVOID
Argument2;
02477 PVOID
Argument3;
02478 PVOID
Argument4;
02479 } Others;
02480
02481 }
Parameters;
02482
02483
02484
02485
02486
02487
02488 PDEVICE_OBJECT DeviceObject;
02489
02490
02491
02492
02493
02494 PFILE_OBJECT FileObject;
02495
02496
02497
02498
02499
02500
02501 PIO_COMPLETION_ROUTINE CompletionRoutine;
02502
02503
02504
02505
02506
02507
02508 PVOID Context;
02509
02510 }
IO_STACK_LOCATION, *
PIO_STACK_LOCATION;
02511
#if !defined(_ALPHA_) && !defined(_IA64_)
02512
#include "poppack.h"
02513
#endif
02514
02515
02516
02517
02518
02519
02520 typedef struct _SHARE_ACCESS {
02521 ULONG
OpenCount;
02522 ULONG
Readers;
02523 ULONG
Writers;
02524 ULONG
Deleters;
02525 ULONG
SharedRead;
02526 ULONG
SharedWrite;
02527 ULONG
SharedDelete;
02528 }
SHARE_ACCESS, *
PSHARE_ACCESS;
02529
02530
02531
02532
02533
02534
02535
02536
02537
02538
02539
02540 typedef struct _CONFIGURATION_INFORMATION {
02541
02542
02543
02544
02545
02546
02547
02548
02549 ULONG
DiskCount;
02550 ULONG
FloppyCount;
02551 ULONG
CdRomCount;
02552 ULONG
TapeCount;
02553 ULONG
ScsiPortCount;
02554 ULONG
SerialCount;
02555 ULONG
ParallelCount;
02556
02557
02558
02559
02560
02561
02562 BOOLEAN
AtDiskPrimaryAddressClaimed;
02563 BOOLEAN
AtDiskSecondaryAddressClaimed;
02564
02565
02566
02567
02568
02569
02570 ULONG
Version;
02571
02572
02573
02574
02575
02576
02577
02578 ULONG
MediumChangerCount;
02579
02580 }
CONFIGURATION_INFORMATION, *
PCONFIGURATION_INFORMATION;
02581
02582
02583
02584
02585
02586
02587
02588
02589
02590
02591
02592 extern KSPIN_LOCK
IoStatisticsLock;
02593 extern ULONG
IoReadOperationCount;
02594 extern ULONG
IoWriteOperationCount;
02595 extern ULONG
IoOtherOperationCount;
02596 extern LARGE_INTEGER
IoReadTransferCount;
02597 extern LARGE_INTEGER
IoWriteTransferCount;
02598 extern LARGE_INTEGER
IoOtherTransferCount;
02599
02600
02601
02602
02603
02604
02605
02606
02607
02608
02609
02610
02611
02612
02613
02614
02615 #define IO_FILE_OBJECT_NON_PAGED_POOL_CHARGE 64
02616 #define IO_FILE_OBJECT_PAGED_POOL_CHARGE 1024
02617
02618
02619
02620
02621
02622
02623
02624
NTKERNELAPI
02625
VOID
02626
IoAcquireCancelSpinLock(
02627 OUT PKIRQL Irql
02628 );
02629
02630
02631
02632
NTKERNELAPI
02633
VOID
02634
IoAcquireVpbSpinLock(
02635 OUT PKIRQL Irql
02636 );
02637
02638
02639
02640
NTKERNELAPI
02641
NTSTATUS
02642
IoAllocateAdapterChannel(
02643 IN
PADAPTER_OBJECT AdapterObject,
02644 IN
PDEVICE_OBJECT DeviceObject,
02645 IN ULONG NumberOfMapRegisters,
02646 IN PDRIVER_CONTROL ExecutionRoutine,
02647 IN PVOID Context
02648 );
02649
02650
NTKERNELAPI
02651
VOID
02652
IoAllocateController(
02653 IN PCONTROLLER_OBJECT ControllerObject,
02654 IN
PDEVICE_OBJECT DeviceObject,
02655 IN PDRIVER_CONTROL ExecutionRoutine,
02656 IN PVOID Context
02657 );
02658
02659
02660
02661
NTKERNELAPI
02662
NTSTATUS
02663
IoAllocateDriverObjectExtension(
02664 IN
PDRIVER_OBJECT DriverObject,
02665 IN PVOID ClientIdentificationAddress,
02666 IN ULONG DriverObjectExtensionSize,
02667 OUT PVOID *DriverObjectExtension
02668 );
02669
02670
02671
02672
NTKERNELAPI
02673 PVOID
02674
IoAllocateErrorLogEntry(
02675 IN PVOID IoObject,
02676 IN UCHAR EntrySize
02677 );
02678
02679
NTKERNELAPI
02680
PIRP
02681
IoAllocateIrp(
02682 IN CCHAR StackSize,
02683 IN BOOLEAN ChargeQuota
02684 );
02685
02686
NTKERNELAPI
02687
PMDL
02688
IoAllocateMdl(
02689 IN PVOID VirtualAddress,
02690 IN ULONG Length,
02691 IN BOOLEAN SecondaryBuffer,
02692 IN BOOLEAN ChargeQuota,
02693 IN OUT PIRP Irp OPTIONAL
02694 );
02695
02696
02697
02698
02699
02700
02701
02702
02703
02704
02705
02706
02707
02708
02709
02710
02711
02712
02713
02714
02715
02716
02717
02718
02719
02720
02721
02722
02723
02724
02725 #define IoAssignArcName( ArcName, DeviceName ) ( \
02726
IoCreateSymbolicLink( (ArcName), (DeviceName) ) )
02727
02728
NTKERNELAPI
02729
NTSTATUS
02730
IoAssignResources (
02731 IN PUNICODE_STRING RegistryPath,
02732 IN PUNICODE_STRING DriverClassName OPTIONAL,
02733 IN
PDRIVER_OBJECT DriverObject,
02734 IN
PDEVICE_OBJECT DeviceObject OPTIONAL,
02735 IN PIO_RESOURCE_REQUIREMENTS_LIST RequestedResources,
02736 IN OUT PCM_RESOURCE_LIST *AllocatedResources
02737 );
02738
02739
02740
02741
NTKERNELAPI
02742
NTSTATUS
02743
IoAsynchronousPageWrite(
02744 IN
PFILE_OBJECT FileObject,
02745 IN
PMDL MemoryDescriptorList,
02746 IN PLARGE_INTEGER StartingOffset,
02747 IN PIO_APC_ROUTINE ApcRoutine,
02748 IN PVOID ApcContext,
02749 OUT PIO_STATUS_BLOCK IoStatusBlock,
02750 OUT PIRP *Irp OPTIONAL
02751 );
02752
02753
02754
02755
NTKERNELAPI
02756
NTSTATUS
02757
IoAttachDevice(
02758 IN
PDEVICE_OBJECT SourceDevice,
02759 IN PUNICODE_STRING TargetDevice,
02760 OUT
PDEVICE_OBJECT *AttachedDevice
02761 );
02762
02763
02764
02765
NTKERNELAPI
02766
NTSTATUS
02767
IoAttachDeviceByPointer(
02768 IN
PDEVICE_OBJECT SourceDevice,
02769 IN
PDEVICE_OBJECT TargetDevice
02770 );
02771
02772
02773
02774
NTKERNELAPI
02775
PDEVICE_OBJECT
02776
IoAttachDeviceToDeviceStack(
02777 IN
PDEVICE_OBJECT SourceDevice,
02778 IN
PDEVICE_OBJECT TargetDevice
02779 );
02780
02781
NTKERNELAPI
02782
PIRP
02783
IoBuildAsynchronousFsdRequest(
02784 IN ULONG MajorFunction,
02785 IN
PDEVICE_OBJECT DeviceObject,
02786 IN OUT PVOID Buffer OPTIONAL,
02787 IN ULONG Length OPTIONAL,
02788 IN PLARGE_INTEGER StartingOffset OPTIONAL,
02789 IN PIO_STATUS_BLOCK IoStatusBlock OPTIONAL
02790 );
02791
02792
NTKERNELAPI
02793
PIRP
02794
IoBuildDeviceIoControlRequest(
02795 IN ULONG IoControlCode,
02796 IN
PDEVICE_OBJECT DeviceObject,
02797 IN PVOID InputBuffer OPTIONAL,
02798 IN ULONG InputBufferLength,
02799 OUT PVOID OutputBuffer OPTIONAL,
02800 IN ULONG OutputBufferLength,
02801 IN BOOLEAN InternalDeviceIoControl,
02802 IN
PKEVENT Event,
02803 OUT PIO_STATUS_BLOCK IoStatusBlock
02804 );
02805
02806
NTKERNELAPI
02807
VOID
02808
IoBuildPartialMdl(
02809 IN
PMDL SourceMdl,
02810 IN OUT
PMDL TargetMdl,
02811 IN PVOID VirtualAddress,
02812 IN ULONG Length
02813 );
02814
02815 typedef struct _BOOTDISK_INFORMATION {
02816 LONGLONG
BootPartitionOffset;
02817 LONGLONG
SystemPartitionOffset;
02818 ULONG
BootDeviceSignature;
02819 ULONG
SystemDeviceSignature;
02820 }
BOOTDISK_INFORMATION, *
PBOOTDISK_INFORMATION;
02821
02822
NTKERNELAPI
02823
NTSTATUS
02824
IoGetBootDiskInformation(
02825 IN OUT PBOOTDISK_INFORMATION BootDiskInformation,
02826 IN ULONG Size
02827 );
02828
02829
02830
02831
NTSTATUS
02832
IoBuildPoDeviceNotifyList (
02833 IN OUT PVOID Order
02834 );
02835
02836
NTSTATUS
02837
IoNotifyPowerOperationVetoed(
02838 IN POWER_ACTION VetoedPowerOperation,
02839 IN
PDEVICE_OBJECT TargetedDeviceObject OPTIONAL,
02840 IN
PDEVICE_OBJECT VetoingDeviceObject
02841 );
02842
02843
02844
02845
NTKERNELAPI
02846
PIRP
02847
IoBuildSynchronousFsdRequest(
02848 IN ULONG MajorFunction,
02849 IN
PDEVICE_OBJECT DeviceObject,
02850 IN OUT PVOID Buffer OPTIONAL,
02851 IN ULONG Length OPTIONAL,
02852 IN PLARGE_INTEGER StartingOffset OPTIONAL,
02853 IN
PKEVENT Event,
02854 OUT PIO_STATUS_BLOCK IoStatusBlock
02855 );
02856
02857
NTKERNELAPI
02858
NTSTATUS
02859
FASTCALL
02860
IofCallDriver(
02861 IN
PDEVICE_OBJECT DeviceObject,
02862 IN OUT PIRP Irp
02863 );
02864
02865 #define IoCallDriver(a,b) \
02866
IofCallDriver(a,b)
02867
02868
NTKERNELAPI
02869 BOOLEAN
02870
IoCancelIrp(
02871 IN PIRP Irp
02872 );
02873
02874
02875
02876
NTKERNELAPI
02877
VOID
02878
IoCancelThreadIo(
02879 IN
PETHREAD Thread
02880 );
02881
02882
02883
02884
NTKERNELAPI
02885
NTSTATUS
02886
IoCheckDesiredAccess(
02887 IN OUT PACCESS_MASK DesiredAccess,
02888 IN ACCESS_MASK GrantedAccess
02889 );
02890
02891
NTKERNELAPI
02892
NTSTATUS
02893
IoCheckEaBufferValidity(
02894 IN PFILE_FULL_EA_INFORMATION EaBuffer,
02895 IN ULONG EaLength,
02896 OUT PULONG ErrorOffset
02897 );
02898
02899
NTKERNELAPI
02900
NTSTATUS
02901
IoCheckFunctionAccess(
02902 IN ACCESS_MASK GrantedAccess,
02903 IN UCHAR MajorFunction,
02904 IN UCHAR MinorFunction,
02905 IN ULONG IoControlCode,
02906 IN PVOID Arg1 OPTIONAL,
02907 IN PVOID Arg2 OPTIONAL
02908 );
02909
02910
02911
02912
02913
NTKERNELAPI
02914
NTSTATUS
02915
IoCheckQuerySetFileInformation(
02916 IN FILE_INFORMATION_CLASS FileInformationClass,
02917 IN ULONG Length,
02918 IN BOOLEAN SetOperation
02919 );
02920
02921
NTKERNELAPI
02922
NTSTATUS
02923
IoCheckQuerySetVolumeInformation(
02924 IN FS_INFORMATION_CLASS FsInformationClass,
02925 IN ULONG Length,
02926 IN BOOLEAN SetOperation
02927 );
02928
02929
02930
02931
NTKERNELAPI
02932
NTSTATUS
02933
IoCheckQuotaBufferValidity(
02934 IN PFILE_QUOTA_INFORMATION QuotaBuffer,
02935 IN ULONG QuotaLength,
02936 OUT PULONG ErrorOffset
02937 );
02938
02939
02940
02941
02942
NTKERNELAPI
02943
NTSTATUS
02944
IoCheckShareAccess(
02945 IN ACCESS_MASK DesiredAccess,
02946 IN ULONG DesiredShareAccess,
02947 IN OUT
PFILE_OBJECT FileObject,
02948 IN OUT PSHARE_ACCESS ShareAccess,
02949 IN BOOLEAN Update
02950 );
02951
02952
NTKERNELAPI
02953
VOID
02954
FASTCALL
02955
IofCompleteRequest(
02956 IN PIRP Irp,
02957 IN CCHAR
PriorityBoost
02958 );
02959
02960 #define IoCompleteRequest(a,b) \
02961
IofCompleteRequest(a,b)
02962
02963
02964
02965
NTKERNELAPI
02966
NTSTATUS
02967
IoConnectInterrupt(
02968 OUT
PKINTERRUPT *InterruptObject,
02969 IN PKSERVICE_ROUTINE ServiceRoutine,
02970 IN PVOID ServiceContext,
02971 IN PKSPIN_LOCK SpinLock OPTIONAL,
02972 IN ULONG Vector,
02973 IN KIRQL Irql,
02974 IN KIRQL SynchronizeIrql,
02975 IN KINTERRUPT_MODE InterruptMode,
02976 IN BOOLEAN ShareVector,
02977 IN KAFFINITY ProcessorEnableMask,
02978 IN BOOLEAN FloatingSave
02979 );
02980
02981
02982
02983
NTKERNELAPI
02984
PCONTROLLER_OBJECT
02985
IoCreateController(
02986 IN ULONG Size
02987 );
02988
02989
02990
02991
NTKERNELAPI
02992
NTSTATUS
02993
IoCreateDevice(
02994 IN
PDRIVER_OBJECT DriverObject,
02995 IN ULONG DeviceExtensionSize,
02996 IN PUNICODE_STRING DeviceName OPTIONAL,
02997 IN DEVICE_TYPE DeviceType,
02998 IN ULONG DeviceCharacteristics,
02999 IN BOOLEAN Exclusive,
03000 OUT
PDEVICE_OBJECT *DeviceObject
03001 );
03002
03003 #define WDM_MAJORVERSION 0x01
03004 #define WDM_MINORVERSION 0x10
03005
03006
NTKERNELAPI
03007 BOOLEAN
03008
IoIsWdmVersionAvailable(
03009 IN UCHAR MajorVersion,
03010 IN UCHAR MinorVersion
03011 );
03012
03013
03014
03015
NTKERNELAPI
03016
NTSTATUS
03017
IoCreateFile(
03018 OUT PHANDLE FileHandle,
03019 IN ACCESS_MASK DesiredAccess,
03020 IN POBJECT_ATTRIBUTES ObjectAttributes,
03021 OUT PIO_STATUS_BLOCK IoStatusBlock,
03022 IN PLARGE_INTEGER AllocationSize OPTIONAL,
03023 IN ULONG FileAttributes,
03024 IN ULONG ShareAccess,
03025 IN ULONG Disposition,
03026 IN ULONG CreateOptions,
03027 IN PVOID EaBuffer OPTIONAL,
03028 IN ULONG EaLength,
03029 IN CREATE_FILE_TYPE CreateFileType,
03030 IN PVOID ExtraCreateParameters OPTIONAL,
03031 IN ULONG Options
03032 );
03033
03034
03035
03036
NTKERNELAPI
03037
PFILE_OBJECT
03038
IoCreateStreamFileObject(
03039 IN
PFILE_OBJECT FileObject OPTIONAL,
03040 IN
PDEVICE_OBJECT DeviceObject OPTIONAL
03041 );
03042
03043
NTKERNELAPI
03044
PFILE_OBJECT
03045
IoCreateStreamFileObjectLite(
03046 IN
PFILE_OBJECT FileObject OPTIONAL,
03047 IN
PDEVICE_OBJECT DeviceObject OPTIONAL
03048 );
03049
03050
03051
03052
NTKERNELAPI
03053
PKEVENT
03054
IoCreateNotificationEvent(
03055 IN PUNICODE_STRING EventName,
03056 OUT PHANDLE EventHandle
03057 );
03058
03059
NTKERNELAPI
03060
NTSTATUS
03061
IoCreateSymbolicLink(
03062 IN PUNICODE_STRING SymbolicLinkName,
03063 IN PUNICODE_STRING DeviceName
03064 );
03065
03066
03067
03068
NTKERNELAPI
03069
PKEVENT
03070
IoCreateSynchronizationEvent(
03071 IN PUNICODE_STRING EventName,
03072 OUT PHANDLE EventHandle
03073 );
03074
03075
03076
03077
NTKERNELAPI
03078
NTSTATUS
03079
IoCreateUnprotectedSymbolicLink(
03080 IN PUNICODE_STRING SymbolicLinkName,
03081 IN PUNICODE_STRING DeviceName
03082 );
03083
03084
03085
03086
03087
03088
03089
03090
03091
03092
03093
03094
03095
03096
03097
03098
03099
03100
03101
03102
03103
03104
03105
03106
03107
03108
03109
03110 #define IoDeassignArcName( ArcName ) ( \
03111
IoDeleteSymbolicLink( (ArcName) ) )
03112
03113
03114
03115
NTKERNELAPI
03116
VOID
03117
IoDeleteController(
03118 IN PCONTROLLER_OBJECT ControllerObject
03119 );
03120
03121
03122
03123
NTKERNELAPI
03124
VOID
03125
IoDeleteDevice(
03126 IN
PDEVICE_OBJECT DeviceObject
03127 );
03128
03129
NTKERNELAPI
03130
NTSTATUS
03131
IoDeleteSymbolicLink(
03132 IN PUNICODE_STRING SymbolicLinkName
03133 );
03134
03135
NTKERNELAPI
03136
VOID
03137
IoDetachDevice(
03138 IN OUT
PDEVICE_OBJECT TargetDevice
03139 );
03140
03141
03142
03143
NTKERNELAPI
03144
VOID
03145
IoDisconnectInterrupt(
03146 IN
PKINTERRUPT InterruptObject
03147 );
03148
03149
03150
03151
NTKERNELAPI
03152
VOID
03153
IoEnqueueIrp(
03154 IN PIRP Irp
03155 );
03156
03157
03158
NTKERNELAPI
03159 BOOLEAN
03160
IoFastQueryNetworkAttributes(
03161 IN POBJECT_ATTRIBUTES ObjectAttributes,
03162 IN ACCESS_MASK DesiredAccess,
03163 IN ULONG OpenOptions,
03164 OUT PIO_STATUS_BLOCK IoStatus,
03165 OUT PFILE_NETWORK_OPEN_INFORMATION Buffer
03166 );
03167
03168
03169
03170
NTKERNELAPI
03171
VOID
03172
IoFreeController(
03173 IN PCONTROLLER_OBJECT ControllerObject
03174 );
03175
03176
03177
03178
NTKERNELAPI
03179
VOID
03180
IoFreeIrp(
03181 IN PIRP Irp
03182 );
03183
03184
NTKERNELAPI
03185
VOID
03186
IoFreeMdl(
03187 IN
PMDL Mdl
03188 );
03189
03190
03191
03192
VOID
03193
IoFreePoDeviceNotifyList (
03194 IN OUT PVOID Order
03195 );
03196
03197
NTSTATUS
03198
IoGetLegacyVetoList(
03199 OUT PWSTR *VetoList OPTIONAL,
03200 OUT PPNP_VETO_TYPE VetoType
03201 );
03202
03203
03204
03205
NTKERNELAPI
03206
PDEVICE_OBJECT
03207
IoGetAttachedDevice(
03208 IN
PDEVICE_OBJECT DeviceObject
03209 );
03210
03211
NTKERNELAPI
03212
PDEVICE_OBJECT
03213
IoGetAttachedDeviceReference(
03214 IN
PDEVICE_OBJECT DeviceObject
03215 );
03216
03217
NTKERNELAPI
03218
PDEVICE_OBJECT
03219
IoGetBaseFileSystemDeviceObject(
03220 IN
PFILE_OBJECT FileObject
03221 );
03222
03223
NTKERNELAPI
03224
PCONFIGURATION_INFORMATION
03225
IoGetConfigurationInformation( VOID );
03226
03227
03228
03229
03230
03231
03232
03233
03234
03235
03236
03237
03238
03239
03240
03241
03242
03243
03244
03245
03246
03247
03248
03249
03250
03251
03252 #define IoGetCurrentIrpStackLocation( Irp ) ( (Irp)->Tail.Overlay.CurrentStackLocation )
03253
03254
03255
03256
NTKERNELAPI
03257
PDEVICE_OBJECT
03258
IoGetDeviceToVerify(
03259 IN
PETHREAD Thread
03260 );
03261
03262
03263
03264
NTKERNELAPI
03265 PVOID
03266
IoGetDriverObjectExtension(
03267 IN
PDRIVER_OBJECT DriverObject,
03268 IN PVOID ClientIdentificationAddress
03269 );
03270
03271
NTKERNELAPI
03272
PEPROCESS
03273
IoGetCurrentProcess(
03274 VOID
03275 );
03276
03277
03278
03279
NTKERNELAPI
03280
NTSTATUS
03281
IoGetDeviceObjectPointer(
03282 IN PUNICODE_STRING ObjectName,
03283 IN ACCESS_MASK DesiredAccess,
03284 OUT
PFILE_OBJECT *FileObject,
03285 OUT
PDEVICE_OBJECT *DeviceObject
03286 );
03287
03288
NTKERNELAPI
03289
struct _DMA_ADAPTER *
03290
IoGetDmaAdapter(
03291 IN
PDEVICE_OBJECT PhysicalDeviceObject, OPTIONAL
03292 IN
struct _DEVICE_DESCRIPTION *DeviceDescription,
03293 IN OUT PULONG NumberOfMapRegisters
03294 );
03295
03296
03297
03298
NTKERNELAPI
03299 PGENERIC_MAPPING
03300
IoGetFileObjectGenericMapping(
03301 VOID
03302 );
03303
03304
03305
03306
03307
03308
03309
03310
03311
03312
03313
03314
03315
03316
03317
03318
03319
03320
03321
03322
03323
03324
03325
03326
03327
03328
03329
03330
03331
03332
03333
03334
03335
03336
03337
03338 #define IoGetFunctionCodeFromCtlCode( ControlCode ) (\
03339
( ControlCode >> 2) & 0x00000FFF )
03340
03341
03342
03343
NTKERNELAPI
03344 PVOID
03345
IoGetInitialStack(
03346 VOID
03347 );
03348
03349
NTKERNELAPI
03350
VOID
03351
IoGetStackLimits (
03352 OUT PULONG_PTR LowLimit,
03353 OUT PULONG_PTR HighLimit
03354 );
03355
03356
03357
03358
03359
03360
03361 __inline
03362 ULONG_PTR
03363 IoGetRemainingStackSize (
03364 VOID
03365 )
03366 {
03367 ULONG_PTR Top;
03368 ULONG_PTR Bottom;
03369
03370
IoGetStackLimits( &Bottom, &Top );
03371
return((ULONG_PTR)(&Top) - Bottom );
03372 }
03373
03374
03375
03376
03377
03378
03379
03380
03381
03382
03383
03384
03385
03386
03387
03388
03389
03390
03391
03392
03393
03394
03395
03396
03397
03398 #define IoGetNextIrpStackLocation( Irp ) (\
03399
(Irp)->Tail.Overlay.CurrentStackLocation - 1 )
03400
03401
NTKERNELAPI
03402
PDEVICE_OBJECT
03403
IoGetRelatedDeviceObject(
03404 IN
PFILE_OBJECT FileObject
03405 );
03406
03407
03408
03409
NTKERNELAPI
03410 ULONG
03411
IoGetRequestorProcessId(
03412 IN PIRP Irp
03413 );
03414
03415
NTKERNELAPI
03416
PEPROCESS
03417
IoGetRequestorProcess(
03418 IN PIRP Irp
03419 );
03420
03421
NTKERNELAPI
03422
PIRP
03423
IoGetTopLevelIrp(
03424 VOID
03425 );
03426
03427
03428
03429
03430
03431
03432
03433
03434
03435
03436
03437
03438
03439
03440
03441
03442
03443
03444
03445
03446
03447
03448
03449
03450
03451
03452
03453
03454
03455
03456
03457 #define IoInitializeDpcRequest( DeviceObject, DpcRoutine ) (\
03458
KeInitializeDpc( &(DeviceObject)->Dpc, \
03459
(PKDEFERRED_ROUTINE) (DpcRoutine), \
03460
(DeviceObject) ) )
03461
03462
NTKERNELAPI
03463
VOID
03464
IoInitializeIrp(
03465 IN OUT PIRP Irp,
03466 IN USHORT PacketSize,
03467 IN CCHAR StackSize
03468 );
03469
03470
NTKERNELAPI
03471
NTSTATUS
03472
IoInitializeTimer(
03473 IN
PDEVICE_OBJECT DeviceObject,
03474 IN PIO_TIMER_ROUTINE TimerRoutine,
03475 IN PVOID Context
03476 );
03477
03478
03479
03480
03481
03482
NTKERNELAPI
03483
VOID
03484
IoReuseIrp(
03485 IN OUT PIRP Irp,
03486 IN NTSTATUS Iostatus
03487 );
03488
03489
03490
NTKERNELAPI
03491
VOID
03492
IoCancelFileOpen(
03493 IN
PDEVICE_OBJECT DeviceObject,
03494 IN
PFILE_OBJECT FileObject
03495 );
03496
03497
03498
NTKERNELAPI
03499 BOOLEAN
03500
IoInitSystem(
03501
PLOADER_PARAMETER_BLOCK LoaderBlock
03502 );
03503
03504
03505
03506
03507
03508
03509
03510
03511
03512
03513
03514
03515
03516
03517
03518
03519
03520
03521
03522
03523
03524
03525
03526
03527
03528 #define IoIsErrorUserInduced( Status ) ((BOOLEAN) \
03529
(((Status) == STATUS_DEVICE_NOT_READY) || \
03530
((Status) == STATUS_IO_TIMEOUT) || \
03531
((Status) == STATUS_MEDIA_WRITE_PROTECTED) || \
03532
((Status) == STATUS_NO_MEDIA_IN_DEVICE) || \
03533
((Status) == STATUS_VERIFY_REQUIRED) || \
03534
((Status) == STATUS_UNRECOGNIZED_MEDIA) || \
03535
((Status) == STATUS_WRONG_VOLUME)))
03536
03537
03538
03539
03540
03541
03542
03543
03544
03545
03546
03547
03548
03549
03550
03551
03552
03553
03554
03555
03556
03557
03558
03559
03560
03561
03562
03563 #define IoIsFileOpenedExclusively( FileObject ) (\
03564
(BOOLEAN) !((FileObject)->SharedRead || (FileObject)->SharedWrite || (FileObject)->SharedDelete))
03565
03566
NTKERNELAPI
03567 BOOLEAN
03568
IoIsOperationSynchronous(
03569 IN PIRP Irp
03570 );
03571
03572
NTKERNELAPI
03573 BOOLEAN
03574
IoIsSystemThread(
03575 IN
PETHREAD Thread
03576 );
03577
03578
NTKERNELAPI
03579 BOOLEAN
03580
IoIsValidNameGraftingBuffer(
03581 IN PIRP Irp,
03582 IN PREPARSE_DATA_BUFFER ReparseBuffer
03583 );
03584
03585
03586
03587
NTKERNELAPI
03588
PIRP
03589
IoMakeAssociatedIrp(
03590 IN PIRP Irp,
03591 IN CCHAR StackSize
03592 );
03593
03594
03595
03596
03597
03598
03599
03600
03601
03602
03603
03604
03605
03606
03607
03608
03609
03610
03611
03612
03613
03614
03615
03616
03617
03618
03619
03620 #define IoMarkIrpPending( Irp ) ( \
03621
IoGetCurrentIrpStackLocation( (Irp) )->Control |= SL_PENDING_RETURNED )
03622
03623
03624
03625
NTKERNELAPI
03626 BOOLEAN
03627
IoPageFileCreated(
03628 IN HANDLE FileHandle
03629 );
03630
03631
NTKERNELAPI
03632
NTSTATUS
03633
IoPageRead(
03634 IN
PFILE_OBJECT FileObject,
03635 IN
PMDL MemoryDescriptorList,
03636 IN PLARGE_INTEGER StartingOffset,
03637 IN
PKEVENT Event,
03638 OUT PIO_STATUS_BLOCK IoStatusBlock
03639 );
03640
03641
NTKERNELAPI
03642
NTSTATUS
03643
IoQueryDeviceDescription(
03644 IN PINTERFACE_TYPE BusType OPTIONAL,
03645 IN PULONG BusNumber OPTIONAL,
03646 IN PCONFIGURATION_TYPE ControllerType OPTIONAL,
03647 IN PULONG ControllerNumber OPTIONAL,
03648 IN PCONFIGURATION_TYPE PeripheralType OPTIONAL,
03649 IN PULONG PeripheralNumber OPTIONAL,
03650 IN PIO_QUERY_DEVICE_ROUTINE CalloutRoutine,
03651 IN PVOID Context
03652 );
03653
03654
03655
03656
NTKERNELAPI
03657
NTSTATUS
03658
IoQueryFileInformation(
03659 IN
PFILE_OBJECT FileObject,
03660 IN FILE_INFORMATION_CLASS FileInformationClass,
03661 IN ULONG Length,
03662 OUT PVOID FileInformation,
03663 OUT PULONG ReturnedLength
03664 );
03665
03666
NTKERNELAPI
03667
NTSTATUS
03668
IoQueryVolumeInformation(
03669 IN
PFILE_OBJECT FileObject,
03670 IN FS_INFORMATION_CLASS FsInformationClass,
03671 IN ULONG Length,
03672 OUT PVOID FsInformation,
03673 OUT PULONG ReturnedLength
03674 );
03675
03676
03677
03678
NTKERNELAPI
03679
VOID
03680
IoQueueThreadIrp(
03681 IN PIRP Irp
03682 );
03683
03684
03685
03686
NTKERNELAPI
03687
VOID
03688
IoRaiseHardError(
03689 IN PIRP Irp,
03690 IN PVPB Vpb OPTIONAL,
03691 IN
PDEVICE_OBJECT RealDeviceObject
03692 );
03693
03694
NTKERNELAPI
03695 BOOLEAN
03696
IoRaiseInformationalHardError(
03697 IN NTSTATUS ErrorStatus,
03698 IN PUNICODE_STRING String OPTIONAL,
03699 IN
PKTHREAD Thread OPTIONAL
03700 );
03701
03702
NTKERNELAPI
03703 BOOLEAN
03704
IoSetThreadHardErrorMode(
03705 IN BOOLEAN EnableHardErrors
03706 );
03707
03708
NTKERNELAPI
03709
VOID
03710
IoRegisterBootDriverReinitialization(
03711 IN
PDRIVER_OBJECT DriverObject,
03712 IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
03713 IN PVOID Context
03714 );
03715
03716
NTKERNELAPI
03717
VOID
03718
IoRegisterDriverReinitialization(
03719 IN
PDRIVER_OBJECT DriverObject,
03720 IN PDRIVER_REINITIALIZE DriverReinitializationRoutine,
03721 IN PVOID Context
03722 );
03723
03724
03725
03726
NTKERNELAPI
03727
VOID
03728
IoRegisterFileSystem(
03729 IN OUT
PDEVICE_OBJECT DeviceObject
03730 );
03731
03732
NTKERNELAPI
03733
NTSTATUS
03734
IoRegisterFsRegistrationChange(
03735 IN
PDRIVER_OBJECT DriverObject,
03736 IN
PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
03737 );
03738
03739
03740
03741
NTKERNELAPI
03742
NTSTATUS
03743
IoRegisterShutdownNotification(
03744 IN
PDEVICE_OBJECT DeviceObject
03745 );
03746
03747
NTKERNELAPI
03748
NTSTATUS
03749
IoRegisterLastChanceShutdownNotification(
03750 IN
PDEVICE_OBJECT DeviceObject
03751 );
03752
03753
03754
03755
NTKERNELAPI
03756
VOID
03757
IoReleaseCancelSpinLock(
03758 IN KIRQL Irql
03759 );
03760
03761
03762
03763
NTKERNELAPI
03764
VOID
03765
IoReleaseVpbSpinLock(
03766 IN KIRQL Irql
03767 );
03768
03769
03770
03771
NTKERNELAPI
03772
VOID
03773
IoRemoveShareAccess(
03774 IN
PFILE_OBJECT FileObject,
03775 IN OUT PSHARE_ACCESS ShareAccess
03776 );
03777
03778
03779
03780
NTKERNELAPI
03781
NTSTATUS
03782
IoReportHalResourceUsage(
03783 IN PUNICODE_STRING HalName,
03784 IN PCM_RESOURCE_LIST RawResourceList,
03785 IN PCM_RESOURCE_LIST TranslatedResourceList,
03786 IN ULONG ResourceListSize
03787 );
03788
03789
03790
03791
NTKERNELAPI
03792
NTSTATUS
03793
IoReportResourceUsage(
03794 IN PUNICODE_STRING DriverClassName OPTIONAL,
03795 IN
PDRIVER_OBJECT DriverObject,
03796 IN PCM_RESOURCE_LIST DriverList OPTIONAL,
03797 IN ULONG DriverListSize OPTIONAL,
03798 IN
PDEVICE_OBJECT DeviceObject,
03799 IN PCM_RESOURCE_LIST DeviceList OPTIONAL,
03800 IN ULONG DeviceListSize OPTIONAL,
03801 IN BOOLEAN OverrideConflict,
03802 OUT PBOOLEAN ConflictDetected
03803 );
03804
03805
03806
03807
03808
03809
03810
03811
03812
03813
03814
03815
03816
03817
03818
03819
03820
03821
03822
03823
03824
03825
03826
03827
03828
03829
03830
03831
03832
03833
03834
03835
03836
03837
03838 #define IoRequestDpc( DeviceObject, Irp, Context ) ( \
03839
KeInsertQueueDpc( &(DeviceObject)->Dpc, (Irp), (Context) ) )
03840
03841
03842
03843
03844
03845
03846
03847
03848
03849
03850
03851
03852
03853
03854
03855
03856
03857
03858
03859
03860
03861
03862
03863
03864
03865
03866
03867 #define IoSetCancelRoutine( Irp, NewCancelRoutine ) ( \
03868
(PDRIVER_CANCEL) InterlockedExchangePointer( (PVOID *) &(Irp)->CancelRoutine, (PVOID) (NewCancelRoutine) ) )
03869
03870
03871
03872
03873
03874
03875
03876
03877
03878
03879
03880
03881
03882
03883
03884
03885
03886
03887
03888
03889
03890
03891
03892
03893
03894
03895
03896
03897
03898
03899
03900
03901
03902
03903
03904
03905
03906
03907
03908
03909
03910
03911
03912
03913 #define IoSetCompletionRoutine( Irp, Routine, CompletionContext, Success, Error, Cancel ) { \
03914
PIO_STACK_LOCATION irpSp; \
03915
ASSERT( (Success) | (Error) | (Cancel) ? (Routine) != NULL : TRUE ); \
03916
irpSp = IoGetNextIrpStackLocation( (Irp) ); \
03917
irpSp->CompletionRoutine = (Routine); \
03918
irpSp->Context = (CompletionContext); \
03919
irpSp->Control = 0; \
03920
if ((Success)) { irpSp->Control = SL_INVOKE_ON_SUCCESS; } \
03921
if ((Error)) { irpSp->Control |= SL_INVOKE_ON_ERROR; } \
03922
if ((Cancel)) { irpSp->Control |= SL_INVOKE_ON_CANCEL; } }
03923
03924
03925
03926
NTKERNELAPI
03927
VOID
03928
IoSetDeviceToVerify(
03929 IN
PETHREAD Thread,
03930 IN
PDEVICE_OBJECT DeviceObject
03931 );
03932
03933
03934
03935
NTKERNELAPI
03936
VOID
03937
IoSetHardErrorOrVerifyDevice(
03938 IN PIRP Irp,
03939 IN
PDEVICE_OBJECT DeviceObject
03940 );
03941
03942
03943
03944
NTKERNELAPI
03945
NTSTATUS
03946
IoSetInformation(
03947 IN
PFILE_OBJECT FileObject,
03948 IN FILE_INFORMATION_CLASS FileInformationClass,
03949 IN ULONG Length,
03950 IN PVOID FileInformation
03951 );
03952
03953
03954
03955
03956
03957
03958
03959
03960
03961
03962
03963
03964
03965
03966
03967
03968
03969
03970
03971
03972
03973
03974
03975
03976
03977 #define IoSetNextIrpStackLocation( Irp ) { \
03978
(Irp)->CurrentLocation--; \
03979
(Irp)->Tail.Overlay.CurrentStackLocation--; }
03980
03981
03982
03983
03984
03985
03986
03987
03988
03989
03990
03991
03992
03993
03994
03995
03996
03997
03998
03999
04000
04001
04002
04003
04004
04005
04006
04007
04008
04009 #define IoCopyCurrentIrpStackLocationToNext( Irp ) { \
04010
PIO_STACK_LOCATION irpSp; \
04011
PIO_STACK_LOCATION nextIrpSp; \
04012
irpSp = IoGetCurrentIrpStackLocation( (Irp) ); \
04013
nextIrpSp = IoGetNextIrpStackLocation( (Irp) ); \
04014
RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \
04015
nextIrpSp->Control = 0; }
04016
04017
04018
04019
04020
04021
04022
04023
04024
04025
04026
04027
04028
04029
04030
04031
04032
04033
04034
04035
04036
04037
04038
04039
04040
04041
04042
04043
04044 #define IoSkipCurrentIrpStackLocation( Irp ) \
04045
(Irp)->CurrentLocation++; \
04046
(Irp)->Tail.Overlay.CurrentStackLocation++;
04047
04048
04049
NTKERNELAPI
04050
VOID
04051
IoSetShareAccess(
04052 IN ACCESS_MASK DesiredAccess,
04053 IN ULONG DesiredShareAccess,
04054 IN OUT
PFILE_OBJECT FileObject,
04055 OUT PSHARE_ACCESS ShareAccess
04056 );
04057
04058
04059
04060
NTKERNELAPI
04061
VOID
04062
IoSetTopLevelIrp(
04063 IN PIRP Irp
04064 );
04065
04066
04067
04068
04069
04070
04071 typedef struct _IO_REMOVE_LOCK_TRACKING_BLOCK *
PIO_REMOVE_LOCK_TRACKING_BLOCK;
04072
04073 typedef struct _IO_REMOVE_LOCK_COMMON_BLOCK {
04074 BOOLEAN
Removed;
04075 BOOLEAN
Reserved [3];
04076 LONG
IoCount;
04077 KEVENT RemoveEvent;
04078
04079 }
IO_REMOVE_LOCK_COMMON_BLOCK;
04080
04081 typedef struct _IO_REMOVE_LOCK_DBG_BLOCK {
04082 LONG
Signature;
04083 LONG
HighWatermark;
04084 LONGLONG
MaxLockedTicks;
04085 LONG
AllocateTag;
04086 LIST_ENTRY
LockList;
04087 KSPIN_LOCK
Spin;
04088 LONG
LowMemoryCount;
04089 ULONG
Reserved1[4];
04090 PVOID
Reserved2;
04091 PIO_REMOVE_LOCK_TRACKING_BLOCK Blocks;
04092 }
IO_REMOVE_LOCK_DBG_BLOCK;
04093
04094 typedef struct _IO_REMOVE_LOCK {
04095 IO_REMOVE_LOCK_COMMON_BLOCK Common;
04096
#if DBG
04097
IO_REMOVE_LOCK_DBG_BLOCK Dbg;
04098
#endif
04099
}
IO_REMOVE_LOCK, *
PIO_REMOVE_LOCK;
04100
04101 #define IoInitializeRemoveLock(Lock, Tag, Maxmin, HighWater) \
04102
IoInitializeRemoveLockEx (Lock, Tag, Maxmin, HighWater, sizeof (IO_REMOVE_LOCK))
04103
04104 NTSYSAPI
04105
VOID
04106 NTAPI
04107
IoInitializeRemoveLockEx(
04108 IN PIO_REMOVE_LOCK Lock,
04109 IN ULONG AllocateTag,
04110 IN ULONG MaxLockedMinutes,
04111 IN ULONG HighWatermark,
04112 IN ULONG RemlockSize
04113 );
04114
04115
04116
04117
04118
04119
04120
04121
04122 #define IoAcquireRemoveLock(RemoveLock, Tag) \
04123
IoAcquireRemoveLockEx(RemoveLock, Tag, __FILE__, __LINE__, sizeof (IO_REMOVE_LOCK))
04124
04125 NTSYSAPI
04126
NTSTATUS
04127 NTAPI
04128
IoAcquireRemoveLockEx (
04129 IN PIO_REMOVE_LOCK RemoveLock,
04130 IN OPTIONAL PVOID Tag,
04131 IN PCSTR File,
04132 IN ULONG Line,
04133 IN ULONG RemlockSize
04134 );
04135
04136
04137
04138
04139
04140
04141
04142
04143
04144
04145
04146
04147
04148
04149
04150
04151
04152
04153
04154
04155
04156
04157
04158
04159
04160
04161
04162
04163
04164
04165
04166
04167
04168
04169
04170
04171 #define IoReleaseRemoveLock(RemoveLock, Tag) \
04172
IoReleaseRemoveLockEx(RemoveLock, Tag, sizeof (IO_REMOVE_LOCK))
04173
04174 NTSYSAPI
04175
VOID
04176 NTAPI
04177
IoReleaseRemoveLockEx(
04178 IN PIO_REMOVE_LOCK RemoveLock,
04179 IN PVOID Tag,
04180 IN ULONG RemlockSize
04181 );
04182
04183
04184
04185
04186
04187
04188
04189
04190
04191
04192
04193
04194
04195
04196
04197
04198
04199
04200
04201
04202
04203
04204
04205
04206
04207 #define IoReleaseRemoveLockAndWait(RemoveLock, Tag) \
04208
IoReleaseRemoveLockAndWaitEx(RemoveLock, Tag, sizeof (IO_REMOVE_LOCK))
04209
04210 NTSYSAPI
04211
VOID
04212 NTAPI
04213
IoReleaseRemoveLockAndWaitEx(
04214 IN PIO_REMOVE_LOCK RemoveLock,
04215 IN PVOID Tag,
04216 IN ULONG RemlockSize
04217 );
04218
04219
04220
04221
04222
04223
04224
04225
04226
04227
04228
04229
04230
04231
04232
04233
04234
04235
04236
04237
04238
04239
NTKERNELAPI
04240
VOID
04241
IoShutdownSystem(
04242 IN ULONG Phase
04243 );
04244
04245
04246
04247
04248
04249
04250
04251
04252
04253
04254
04255
04256
04257
04258
04259
04260
04261
04262
04263
04264
04265
04266
04267
04268
04269 #define IoSizeOfIrp( StackSize ) \
04270
((USHORT) (sizeof( IRP ) + ((StackSize) * (sizeof( IO_STACK_LOCATION )))))
04271
04272
04273
04274
04275
NTKERNELAPI
04276
VOID
04277
IoStartNextPacket(
04278 IN
PDEVICE_OBJECT DeviceObject,
04279 IN BOOLEAN Cancelable
04280 );
04281
04282
NTKERNELAPI
04283
VOID
04284
IoStartNextPacketByKey(
04285 IN
PDEVICE_OBJECT DeviceObject,
04286 IN BOOLEAN Cancelable,
04287 IN ULONG Key
04288 );
04289
04290
NTKERNELAPI
04291
VOID
04292
IoStartPacket(
04293 IN
PDEVICE_OBJECT DeviceObject,
04294 IN PIRP Irp,
04295 IN PULONG Key OPTIONAL,
04296 IN PDRIVER_CANCEL CancelFunction OPTIONAL
04297 );
04298
04299
04300
04301
NTKERNELAPI
04302
VOID
04303
IoStartTimer(
04304 IN
PDEVICE_OBJECT DeviceObject
04305 );
04306
04307
NTKERNELAPI
04308
VOID
04309
IoStopTimer(
04310 IN
PDEVICE_OBJECT DeviceObject
04311 );
04312
04313
04314
04315
NTKERNELAPI
04316
NTSTATUS
04317
IoSynchronousPageWrite(
04318 IN
PFILE_OBJECT FileObject,
04319 IN
PMDL MemoryDescriptorList,
04320 IN PLARGE_INTEGER StartingOffset,
04321 IN
PKEVENT Event,
04322 OUT PIO_STATUS_BLOCK IoStatusBlock
04323 );
04324
04325
NTKERNELAPI
04326
PEPROCESS
04327
IoThreadToProcess(
04328 IN
PETHREAD Thread
04329 );
04330
04331
NTKERNELAPI
04332
VOID
04333
IoUnregisterFileSystem(
04334 IN OUT
PDEVICE_OBJECT DeviceObject
04335 );
04336
04337
NTKERNELAPI
04338
VOID
04339
IoUnregisterFsRegistrationChange(
04340 IN
PDRIVER_OBJECT DriverObject,
04341 IN PDRIVER_FS_NOTIFICATION DriverNotificationRoutine
04342 );
04343
04344
04345
04346
NTKERNELAPI
04347
VOID
04348
IoUnregisterShutdownNotification(
04349 IN
PDEVICE_OBJECT DeviceObject
04350 );
04351
04352
04353
04354
NTKERNELAPI
04355
VOID
04356
IoUpdateShareAccess(
04357 IN
PFILE_OBJECT FileObject,
04358 IN OUT PSHARE_ACCESS ShareAccess
04359 );
04360
04361
04362
04363
NTKERNELAPI
04364
NTSTATUS
04365
IoVerifyVolume(
04366 IN
PDEVICE_OBJECT DeviceObject,
04367 IN BOOLEAN AllowRawMount
04368 );
04369
04370
04371
NTKERNELAPI
04372
VOID
04373
IoWriteErrorLogEntry(
04374 IN PVOID ElEntry
04375 );
04376
04377
04378
04379
04380 typedef BOOLEAN (*
PIO_TRAVERSE_WORKER)(
04381 IN ULONG Level,
04382 IN PVOID DeviceNode,
04383 IN
PDEVICE_OBJECT DeviceObject,
04384 IN PVOID Context
04385 );
04386
04387 typedef BOOLEAN (*
PIO_LEVEL_END_WORKER)(
04388 IN ULONG Level,
04389 IN PVOID Context
04390 );
04391
04392
04393
04394
04395
04396
VOID
04397
IoTraverseDeviceTree(
04398 IN BOOLEAN Inverted,
04399 IN LONG CurrentLevel,
04400 IN PIO_TRAVERSE_WORKER WorkerFunction,
04401 IN PIO_LEVEL_END_WORKER LevelEndFunction,
04402 IN PVOID Context
04403 );
04404
04405
04406
04407
NTKERNELAPI
04408
NTSTATUS
04409
IoCreateDriver (
04410 IN PUNICODE_STRING DriverName, OPTIONAL
04411 IN PDRIVER_INITIALIZE InitializationFunction
04412 );
04413
04414
NTKERNELAPI
04415
VOID
04416
IoDeleteDriver (
04417 IN
PDRIVER_OBJECT DriverObject
04418 );
04419
04420
04421
04422 #define _WMIKM_
04423
04424
04425
04426
04427
04428 typedef enum tagWMIACTIONCODE
04429 {
04430
WmiGetAllData =
IRP_MN_QUERY_ALL_DATA,
04431
WmiGetSingleInstance =
IRP_MN_QUERY_SINGLE_INSTANCE,
04432
WmiChangeSingleInstance =
IRP_MN_CHANGE_SINGLE_INSTANCE,
04433
WmiChangeSingleItem =
IRP_MN_CHANGE_SINGLE_ITEM,
04434
WmiEnableEvents =
IRP_MN_ENABLE_EVENTS,
04435
WmiDisableEvents =
IRP_MN_DISABLE_EVENTS,
04436
WmiEnableCollection =
IRP_MN_ENABLE_COLLECTION,
04437
WmiDisableCollection =
IRP_MN_DISABLE_COLLECTION,
04438
WmiRegisterInfo =
IRP_MN_REGINFO,
04439
WmiExecuteMethodCall =
IRP_MN_EXECUTE_METHOD
04440 }
WMIACTIONCODE;
04441
04442
04443
04444
04445
04446
04447 typedef NTSTATUS (*
WMIENTRY)(
04448 IN
WMIACTIONCODE ActionCode,
04449 IN PVOID DataPath,
04450 IN ULONG
BufferSize,
04451 IN OUT PVOID
Buffer
04452 );
04453
04454 #define WMIREG_FLAG_CALLBACK 0x80000000
04455
04456
04457
04458
04459
04460 #define WMIREG_FLAG_TRACE_PROVIDER 0x00010000
04461
04462
04463
04464
04465 #define WMIREG_FLAG_TRACE_NOTIFY_MASK 0x00F00000
04466
04467
04468
04469
04470 #define WMIREG_NOTIFY_DISK_IO 1 << 20
04471 #define WMIREG_NOTIFY_TDI_IO 2 << 20
04472
04473
04474
04475
04476
04477 typedef struct _IO_WORKITEM *
PIO_WORKITEM;
04478
04479
typedef
04480
VOID
04481 (*PIO_WORKITEM_ROUTINE) (
04482 IN
PDEVICE_OBJECT DeviceObject,
04483 IN PVOID Context
04484 );
04485
04486
PIO_WORKITEM
04487
IoAllocateWorkItem(
04488
PDEVICE_OBJECT DeviceObject
04489 );
04490
04491
VOID
04492
IoFreeWorkItem(
04493
PIO_WORKITEM IoWorkItem
04494 );
04495
04496
VOID
04497
IoQueueWorkItem(
04498 IN
PIO_WORKITEM IoWorkItem,
04499 IN
PIO_WORKITEM_ROUTINE WorkerRoutine,
04500 IN WORK_QUEUE_TYPE QueueType,
04501 IN PVOID Context
04502 );
04503
04504
04505
04506
04507
04508
NTKERNELAPI
04509
NTSTATUS
04510
IoWMIRegistrationControl(
04511 IN
PDEVICE_OBJECT DeviceObject,
04512 IN ULONG Action
04513 );
04514
04515
04516
04517
04518
04519 #define WMIREG_ACTION_REGISTER 1
04520 #define WMIREG_ACTION_DEREGISTER 2
04521 #define WMIREG_ACTION_REREGISTER 3
04522 #define WMIREG_ACTION_UPDATE_GUIDS 4
04523 #define WMIREG_ACTION_BLOCK_IRPS 5
04524
04525
04526
04527
04528
04529 #define WMIREGISTER 0
04530 #define WMIUPDATE 1
04531
04532
NTKERNELAPI
04533
NTSTATUS
04534
IoWMIAllocateInstanceIds(
04535 IN GUID *Guid,
04536 IN ULONG InstanceCount,
04537 OUT ULONG *FirstInstanceId
04538 );
04539
04540
NTKERNELAPI
04541
NTSTATUS
04542
IoWMISuggestInstanceName(
04543 IN
PDEVICE_OBJECT PhysicalDeviceObject OPTIONAL,
04544 IN PUNICODE_STRING SymbolicLinkName OPTIONAL,
04545 IN BOOLEAN CombineNames,
04546 OUT PUNICODE_STRING SuggestedInstanceName
04547 );
04548
04549
NTKERNELAPI
04550
NTSTATUS
04551
IoWMIWriteEvent(
04552 IN PVOID WnodeEventItem
04553 );
04554
04555
#if defined(_WIN64)
04556
ULONG
IoWMIDeviceObjectToProviderId(
04557
PDEVICE_OBJECT DeviceObject
04558 );
04559
#else
04560 #define IoWMIDeviceObjectToProviderId(DeviceObject) ((ULONG)(DeviceObject))
04561
#endif
04562
04563
04564
04565
04566
04567
NTKERNELAPI
04568 BOOLEAN
04569
WMIInitialize(
04570 );
04571
04572
04573
04574
04575
04576
04577 extern BOOLEAN
IoRemoteBootClient;
04578
#if defined(REMOTE_BOOT)
04579
extern BOOLEAN IoCscInitializationFailed;
04580
#endif // defined(REMOTE_BOOT)
04581
04582
NTSTATUS
04583
IoSetCrashDumpState(
04584 IN SYSTEM_CRASH_STATE_INFORMATION *dumpState
04585 );
04586
04587
04588
NTKERNELAPI
04589
NTSTATUS
04590
IoGetCrashDumpInformation(
04591 OUT PSYSTEM_CRASH_DUMP_INFORMATION pCrashDumpInfo
04592 );
04593
04594
04595
NTKERNELAPI
04596
NTSTATUS
04597
IoGetCrashDumpStateInformation(
04598 OUT PSYSTEM_CRASH_STATE_INFORMATION pCrashDumpState
04599 );
04600
04601
04602
NTSTATUS
04603
IoGetRelatedTargetDevice(
04604 IN
PFILE_OBJECT FileObject,
04605 OUT
PDEVICE_OBJECT *DeviceObject
04606 );
04607
04608
04609
NTKERNELAPI
04610
NTSTATUS
04611
IoSetDumpRange(
04612 IN PVOID DumpContext,
04613 IN PVOID StartVA,
04614 IN ULONG_PTR Pages,
04615 IN BOOLEAN IsPhysicalAddress
04616 );
04617
04618
04619
NTKERNELAPI
04620
NTSTATUS
04621
IoFreeDumpRange(
04622 IN PVOID DumpContext,
04623 IN PVOID StartVA,
04624 IN ULONG_PTR Pages,
04625 IN BOOLEAN IsPhysicalAddress
04626 );
04627
04628
NTKERNELAPI
04629
NTSTATUS
04630
IoSetIoCompletion (
04631 IN PVOID IoCompletion,
04632 IN PVOID KeyContext,
04633 IN PVOID ApcContext,
04634 IN NTSTATUS IoStatus,
04635 IN ULONG_PTR IoStatusInformation,
04636 IN BOOLEAN Quota
04637 );
04638
04639
04640
04641
04642
04643 typedef struct _BOOT_LOG_RECORD {
04644 UNICODE_STRING
LoadedString;
04645 UNICODE_STRING
NotLoadedString;
04646 UNICODE_STRING
LogFileName;
04647 UNICODE_STRING
HeaderString;
04648 ERESOURCE Resource;
04649 ULONG
NextKey;
04650 BOOLEAN
FileLogging;
04651 }
BOOT_LOG_RECORD, *
PBOOT_LOG_RECORD;
04652
04653
VOID
04654
IopCopyBootLogRegistryToFile(
04655 VOID
04656 );
04657
04658
VOID
04659
IopInitializeBootLogging(
04660
PLOADER_PARAMETER_BLOCK LoaderBlock,
04661 PCHAR HeaderString
04662 );
04663
04664
VOID
04665
IopBootLog(
04666 PUNICODE_STRING LogEntry,
04667 BOOLEAN Loaded
04668 );
04669
04670
NTSTATUS
04671
IopSetRegistryStringValue(
04672 IN HANDLE KeyHandle,
04673 IN PUNICODE_STRING ValueName,
04674 IN PUNICODE_STRING ValueData
04675 );
04676
04677
NTKERNELAPI
04678
NTSTATUS
04679
IoGetRequestorSessionId(
04680 IN PIRP Irp,
04681 OUT PULONG pSessionId
04682 );
04683
04684
04685
VOID
04686
IovFreeIrp(
04687 IN PIRP Irp
04688 );
04689
04690
PIRP
04691
IovAllocateIrp(
04692 IN CCHAR StackSize,
04693 IN BOOLEAN ChargeQuota
04694 );
04695
04696 #define IOVERIFIERINIT_PHASE0 0x00000001
04697 #define IOVERIFIERINIT_EVERYTHING_TRACKED 0x00000002
04698 #define IOVERIFIERINIT_ASYNCHRONOUSINIT 0x00000004
04699 #define IOVERIFIERINIT_NO_REINIT 0x00000008
04700 #define IOVERIFIERINIT_VERIFIER_DRIVER_LIST 0x00000010
04701 #define IOVERIFIERINIT_RANDOMLY_CANCEL_IRPS 0x00000020
04702
04703
VOID
04704
IoVerifierInit(
04705 IN ULONG VerifierFlags,
04706 IN ULONG InitFlags
04707 );
04708
04709
NTSTATUS
04710
FASTCALL
04711
IovCallDriver(
04712 IN
PDEVICE_OBJECT DeviceObject,
04713 IN OUT PIRP Irp
04714 );
04715
04716
VOID
04717
FASTCALL
04718
IovCompleteRequest(
04719 IN PIRP Irp,
04720 IN CCHAR PriorityBoost
04721 );
04722
04723
PIRP
04724
IovBuildAsynchronousFsdRequest(
04725 IN ULONG MajorFunction,
04726 IN
PDEVICE_OBJECT DeviceObject,
04727 IN OUT PVOID Buffer OPTIONAL,
04728 IN ULONG Length OPTIONAL,
04729 IN PLARGE_INTEGER StartingOffset OPTIONAL,
04730 IN PIO_STATUS_BLOCK IoStatusBlock OPTIONAL
04731 );
04732
04733
04734
PIRP
04735
IovBuildDeviceIoControlRequest(
04736 IN ULONG IoControlCode,
04737 IN
PDEVICE_OBJECT DeviceObject,
04738 IN PVOID InputBuffer OPTIONAL,
04739 IN ULONG InputBufferLength,
04740 OUT PVOID OutputBuffer OPTIONAL,
04741 IN ULONG OutputBufferLength,
04742 IN BOOLEAN InternalDeviceIoControl,
04743 IN
PKEVENT Event,
04744 OUT PIO_STATUS_BLOCK IoStatusBlock
04745 );
04746
04747
NTSTATUS
04748
IovInitializeTimer(
04749 IN
PDEVICE_OBJECT DeviceObject,
04750 IN PIO_TIMER_ROUTINE TimerRoutine,
04751 IN PVOID Context
04752 );
04753
04754
NTKERNELAPI
04755 PVOID
04756
IoAllocateGenericErrorLogEntry(
04757 IN UCHAR EntrySize
04758 );
04759
04760
VOID
04761
IoRetryIrpCompletions(
04762 VOID
04763 );
04764
04765
#endif // _IO_
04766