X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=ntoskrnl%2Finclude%2Finternal%2Fio.h;h=83fe7ce3c7bc302d97df8f42d6153c312bdbdcc3;hp=3749969b1ebef7e5bb4f4f133d708d24dcd4ffbb;hb=108991a6fbae487218812350b1a984887dab084f;hpb=49ab546ac39e559c2b5b544994e527f6c616a346 diff --git a/ntoskrnl/include/internal/io.h b/ntoskrnl/include/internal/io.h index 3749969b1eb..83fe7ce3c7b 100644 --- a/ntoskrnl/include/internal/io.h +++ b/ntoskrnl/include/internal/io.h @@ -1,16 +1,17 @@ /* * PROJECT: ReactOS Kernel * LICENSE: GPL - See COPYING in the top level directory -* FILE: ntoskrnl/include/io.h +* FILE: ntoskrnl/include/internal/io.h * PURPOSE: Internal header for the I/O Manager * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org) */ + #include "ntdddisk.h" // // Define this if you want debugging support // -#define _IO_DEBUG_ 0x01 +#define _IO_DEBUG_ 0x00 // // These define the Debug Masks Supported @@ -80,6 +81,26 @@ // #define RD_SYMLINK_CREATE_FAILED 5 +// +// Max traversal of reparse points for a single open in IoParseDevice +// +#define IOP_MAX_REPARSE_TRAVERSAL 0x20 + +// +// Private flags for IoCreateFile / IoParseDevice +// +#define IOP_USE_TOP_LEVEL_DEVICE_HINT 0x01 +#define IOP_CREATE_FILE_OBJECT_EXTENSION 0x02 + + +typedef struct _FILE_OBJECT_EXTENSION +{ + PDEVICE_OBJECT TopDeviceObjectHint; + +} FILE_OBJECT_EXTENSION, *PFILE_OBJECT_EXTENSION; + + + // // We can call the Ob Inlined API, it's the same thing // @@ -312,16 +333,6 @@ typedef struct _ERROR_LOG_ENTRY LARGE_INTEGER TimeStamp; } ERROR_LOG_ENTRY, *PERROR_LOG_ENTRY; -// -// Event Log LPC Message -// -typedef struct _ELF_API_MSG -{ - PORT_MESSAGE h; - ULONG Unknown[2]; - IO_ERROR_LOG_MESSAGE IoErrorMessage; -} ELF_API_MSG, *PELF_API_MSG; - // // To simplify matters, the kernel is made to support both the checked and free // version of the I/O Remove Lock in the same binary. This structure includes @@ -385,7 +396,7 @@ typedef struct _OPEN_PACKET typedef struct _LOAD_UNLOAD_PARAMS { NTSTATUS Status; - PUNICODE_STRING ServiceName; + PCUNICODE_STRING RegistryPath; WORK_QUEUE_ITEM WorkItem; KEVENT Event; PDRIVER_OBJECT DriverObject; @@ -502,6 +513,18 @@ typedef struct _DEVICETREE_TRAVERSE_CONTEXT PVOID Context; } DEVICETREE_TRAVERSE_CONTEXT, *PDEVICETREE_TRAVERSE_CONTEXT; +// +// Reserve IRP allocator +// Used for read paging IOs in low-memory situations +// +typedef struct _RESERVE_IRP_ALLOCATOR +{ + PIRP ReserveIrp; + volatile LONG ReserveIrpInUse; + KEVENT WaitEvent; + CCHAR StackSize; +} RESERVE_IRP_ALLOCATOR, *PRESERVE_IRP_ALLOCATOR; + // // Resource code // @@ -657,7 +680,6 @@ IoDestroyDriverList( ); NTSTATUS -INIT_FUNCTION IopInitPlugPlayEvents(VOID); NTSTATUS @@ -775,6 +797,12 @@ IopVerifyDiskSignature( OUT PULONG Signature ); +BOOLEAN +NTAPI +IoInitializeCrashDump( + IN HANDLE PageFileHandle +); + // // Device/Volume Routines // @@ -910,6 +938,18 @@ IopAllocateIrpMustSucceed( IN CCHAR StackSize ); +BOOLEAN +NTAPI +IopInitializeReserveIrp( + IN PRESERVE_IRP_ALLOCATOR ReserveIrpAllocator +); + +PIRP +NTAPI +IopAllocateReserveIrp( + IN CCHAR StackSize +); + // // Shutdown routines // @@ -1057,8 +1097,9 @@ NTSTATUS NTAPI IopCreateDriver(IN PUNICODE_STRING DriverName OPTIONAL, IN PDRIVER_INITIALIZE InitializationFunction, - IN PUNICODE_STRING RegistryPath, - PLDR_DATA_TABLE_ENTRY ModuleObject, + IN PUNICODE_STRING RegistryPath OPTIONAL, + IN PCUNICODE_STRING ServiceName, + IN PLDR_DATA_TABLE_ENTRY ModuleObject OPTIONAL, OUT PDRIVER_OBJECT *pDriverObject); VOID @@ -1082,10 +1123,11 @@ IopLoadServiceModule( OUT PLDR_DATA_TABLE_ENTRY *ModuleObject ); -VOID +NTSTATUS NTAPI IopLoadUnloadDriver( - IN OUT PLOAD_UNLOAD_PARAMS LoadParams + _In_opt_ PCUNICODE_STRING RegistryPath, + _Inout_ PDRIVER_OBJECT *DriverObject ); NTSTATUS @@ -1102,6 +1144,8 @@ NTSTATUS FASTCALL IopAttachFilterDrivers( IN PDEVICE_NODE DeviceNode, + IN HANDLE EnumSubKey, + IN HANDLE ClassKey, IN BOOLEAN Lower ); @@ -1162,7 +1206,7 @@ IopDeleteFile( NTSTATUS NTAPI -IopSecurityFile( +IopGetSetSecurityObject( IN PVOID ObjectBody, IN SECURITY_OPERATION_CODE OperationCode, IN PSECURITY_INFORMATION SecurityInformation, @@ -1208,6 +1252,21 @@ IoChangeFileObjectFilterContext( IN BOOLEAN Define ); +VOID +NTAPI +IopDoNameTransmogrify( + IN PIRP Irp, + IN PFILE_OBJECT FileObject, + IN PREPARSE_DATA_BUFFER DataBuffer +); + +NTSTATUS +NTAPI +IoComputeDesiredAccessFileObject( + IN PFILE_OBJECT FileObject, + IN PACCESS_MASK DesiredAccess +); + // // I/O Timer Routines // @@ -1232,6 +1291,17 @@ IopDeleteIoCompletion( PVOID ObjectBody ); +NTSTATUS +NTAPI +IoSetIoCompletion( + IN PVOID IoCompletion, + IN PVOID KeyContext, + IN PVOID ApcContext, + IN NTSTATUS IoStatus, + IN ULONG_PTR IoStatusInformation, + IN BOOLEAN Quota +); + // // Ramdisk Routines // @@ -1275,6 +1345,9 @@ extern ULONG IopNumTriageDumpDataBlocks; extern PVOID IopTriageDumpDataBlocks[64]; extern PIO_BUS_TYPE_GUID_LIST PnpBusTypeGuidList; extern PDRIVER_OBJECT IopRootDriverObject; +extern KSPIN_LOCK IopDeviceActionLock; +extern LIST_ENTRY IopDeviceActionRequestList; +extern RESERVE_IRP_ALLOCATOR IopReserveIrpAllocator; // // Inlined Functions