52#pragma alloc_text(PAGE, Ext2LockUserBuffer)
53#pragma alloc_text(PAGE, Ext2ReadSync)
54#pragma alloc_text(PAGE, Ext2ReadDisk)
55#pragma alloc_text(PAGE, Ext2DiskIoControl)
56#pragma alloc_text(PAGE, Ext2MediaEjectControl)
57#pragma alloc_text(PAGE, Ext2DiskShutDown)
150 if (
Irp->MdlAddress) {
152#if (_WIN32_WINNT >= 0x0500)
159 return Irp->UserBuffer;
237 pContext->
FileObject->CurrentByteOffset.QuadPart =
268 PIRP MasterIrp = IrpContext->Irp;
285 DEBUG(
DL_ERR, (
"Ex2ReadWriteBlocks: failed to allocate pContext.\n"));
300 if (pContext->
Wait) {
304 }
else if (IrpContext->Fcb->Identifier.Type ==
EXT2FCB) {
307 pContext->
Resource = &IrpContext->Fcb->PagingIoResource;
309 pContext->
Resource = &IrpContext->Fcb->MainResource;
312 pContext->
FileObject = IrpContext->FileObject;
317 if (
NULL == Chain->Next && 0 == Chain->Offset) {
344 Chain->Irp = MasterIrp;
345 pContext->Blocks = 1;
353 (
CCHAR)(
Vcb->TargetDeviceObject->StackSize + 1) );
411 pContext->Blocks += 1;
437 bMasterCompleted =
TRUE;
451 if (IrpContext->ExceptionInProgress) {
468 if (bMasterCompleted) {
469 IrpContext->Irp =
NULL;
504 DEBUG(
DL_ERR, (
"Ex2ReadSync: failed to allocate Event.\n"));
514 Vcb->TargetDeviceObject,
577 DEBUG(
DL_ERR, (
"Ext2ReadDisk: failed to allocate Buffer.\n"));
625 if (OutputBufferSize)
645 DEBUG(
DL_ERR, (
"Ext2DiskIoControl: failed to build Irp!\n"));
656 if (OutputBufferSize) {
717 Vcb->TargetDeviceObject,
759 Vcb->TargetDeviceObject,
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define InterlockedDecrement
NTSTATUS Ext2ReadSync(IN PEXT2_VCB Vcb, IN ULONGLONG Offset, IN ULONG Length, OUT PVOID Buffer, BOOLEAN bVerify)
VOID Ext2MediaEjectControl(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN BOOLEAN bPrevent)
NTSTATUS Ext2ReadWriteBlocks(IN PEXT2_IRP_CONTEXT IrpContext, IN PEXT2_VCB Vcb, IN PEXT2_EXTENT Chain, IN ULONG Length)
NTSTATUS Ext2LockUserBuffer(IN PIRP Irp, IN ULONG Length, IN LOCK_OPERATION Operation)
PVOID Ext2GetUserBuffer(IN PIRP Irp)
NTSTATUS Ext2ReadWriteBlockSyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
NTSTATUS Ext2DiskShutDown(PEXT2_VCB Vcb)
NTSTATUS Ext2ReadDisk(IN PEXT2_VCB Vcb, IN ULONGLONG Offset, IN ULONG Size, IN PVOID Buffer, IN BOOLEAN bVerify)
NTSTATUS Ext2DiskIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG IoctlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer, IN OUT PULONG OutputBufferSize)
NTSTATUS Ext2MediaEjectControlCompletion(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Contxt)
NTSTATUS Ext2ReadWriteBlockAsyncCompletionRoutine(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
PMDL Ext2CreateMdl(IN PVOID Buffer, IN ULONG Length, IN LOCK_OPERATION op)
VOID Ext2DestroyMdl(IN PMDL Mdl)
#define IOCTL_DISK_MEDIA_REMOVAL
#define NT_SUCCESS(StatCode)
_In_ PIO_STACK_LOCATION IrpSp
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define ExGetCurrentResourceThread()
#define KeSetEvent(pEvt, foo, foo2)
#define ExAcquireResourceExclusiveLite(res, wait)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
VOID Ext2FreePool(IN PVOID P, IN ULONG Tag)
#define ClearFlag(_F, _SF)
#define EXT2_RW_CONTEXT_WRITE
#define IRP_CONTEXT_FLAG_VERIFY_READ
PVOID Ext2AllocatePool(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag)
#define IRP_CONTEXT_FLAG_WRITE_THROUGH
#define VCB_REMOVAL_PREVENTED
#define DEC_MEM_COUNT(_i, _p, _s)
#define EXT2_BUGCHK_BLOCK
#define Ext2BugCheck(A, B, C, D)
struct _EXT2_RW_CONTEXT * PEXT2_RW_CONTEXT
#define INC_MEM_COUNT(_i, _p, _s)
#define EXCEPTION_EXECUTE_HANDLER
VOID NTAPI IoBuildPartialMdl(IN PMDL SourceMdl, IN PMDL TargetMdl, IN PVOID VirtualAddress, IN ULONG Length)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
VOID NTAPI MmProbeAndLockPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode, IN LOCK_OPERATION Operation)
VOID NTAPI MmUnlockPages(IN PMDL Mdl)
VOID NTAPI MmBuildMdlForNonPagedPool(IN PMDL Mdl)
BOOLEAN NTAPI MmIsNonPagedSystemAddressValid(IN PVOID VirtualAddress)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define UNREFERENCED_PARAMETER(P)
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
PIRP NTAPI IoBuildDeviceIoControlRequest(IN ULONG IoControlCode, IN PDEVICE_OBJECT DeviceObject, IN PVOID InputBuffer, IN ULONG InputBufferLength, IN PVOID OutputBuffer, IN ULONG OutputBufferLength, IN BOOLEAN InternalDeviceIoControl, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
VOID NTAPI IoFreeIrp(IN PIRP Irp)
PIRP NTAPI IoMakeAssociatedIrp(IN PIRP Irp, IN CCHAR StackSize)
#define _SEH2_EXCEPT(...)
#define STATUS_MORE_PROCESSING_REQUIRED
ERESOURCE_THREAD ThreadId
struct _IO_STACK_LOCATION::@3974::@3978 Read
union _IO_STACK_LOCATION::@1575 Parameters
union _IRP::@1577 AssociatedIrp
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_INVALID_USER_BUFFER
#define STATUS_INSUFFICIENT_RESOURCES
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFDPC _In_ BOOLEAN Wait
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR OutputBuffer
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_ ULONG IoctlCode
_Must_inspect_result_ _In_ WDFIOTARGET _In_opt_ WDFREQUEST _In_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_Must_inspect_result_ _In_ ULONG Flags
#define ExReleaseResourceForThread
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
FORCEINLINE VOID IoSetNextIrpStackLocation(_Inout_ PIRP Irp)
#define SL_OVERRIDE_VERIFY_VOLUME
#define FO_FILE_FAST_IO_READ
#define FO_SYNCHRONOUS_IO
enum _LOCK_OPERATION LOCK_OPERATION
#define MmGetSystemAddressForMdl(Mdl)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)