32 DPRINT(
"VfatReadWritePartialCompletion() called\n");
36 while ((
Mdl =
Irp->MdlAddress))
38 Irp->MdlAddress =
Mdl->Next;
42 if (
Irp->PendingReturned)
48 IrpContext->
Flags &= ~IRPCONTEXT_PENDINGRETURNED;
64 DPRINT(
"VfatReadWritePartialCompletion() done\n");
86 DPRINT(
"VfatReadDisk(pDeviceObject %p, Offset %I64x, Length %u, Buffer %p)\n",
89 DPRINT (
"Building synchronous FSD Request...\n");
99 DPRINT(
"IoBuildSynchronousFsdRequest failed\n");
109 DPRINT(
"Calling IO Driver... with irp %p\n",
Irp);
112 DPRINT(
"Waiting for IO Operation for %p\n",
Irp);
115 DPRINT(
"Operation pending\n");
117 DPRINT(
"Getting IO Status... for %p\n",
Irp);
125 DPRINT1 (
"Media change detected!\n");
134 DPRINT1(
"Volume verification successful; Reissuing read request\n");
141 DPRINT(
"IO failed!!! VfatReadDisk : Error code: %x\n",
Status);
142 DPRINT(
"(pDeviceObject %p, Offset %I64x, Size %u, Buffer %p\n",
146 DPRINT(
"Block request succeeded for %p\n",
Irp);
163 DPRINT(
"VfatReadDiskPartial(IrpContext %p, ReadOffset %I64x, ReadLength %u, BufferOffset %u, Wait %u)\n",
166 DPRINT(
"Building asynchronous FSD Request...\n");
174 DPRINT(
"IoAllocateIrp failed\n");
186 StackPtr->
DeviceObject = IrpContext->DeviceExt->StorageDevice;
194 DPRINT(
"IoAllocateMdl failed\n");
211 IrpContext->RefCount = 1;
218 DPRINT(
"Calling IO Driver... with irp %p\n",
Irp);
224 Status = IrpContext->Irp->IoStatus.Status;
231 DPRINT1(
"Media change detected!\n");
240 DPRINT1(
"Volume verification successful; Reissuing read request\n");
269 DPRINT(
"VfatWriteDisk(pDeviceObject %p, Offset %I64x, Length %u, Buffer %p)\n",
272 DPRINT (
"Building synchronous FSD Request...\n");
282 DPRINT(
"IoBuildSynchronousFsdRequest failed\n");
292 DPRINT(
"Calling IO Driver... with irp %p\n",
Irp);
295 DPRINT(
"Waiting for IO Operation for %p\n",
Irp);
298 DPRINT(
"Operation pending\n");
300 DPRINT(
"Getting IO Status... for %p\n",
Irp);
308 DPRINT1 (
"Media change detected!\n");
317 DPRINT1(
"Volume verification successful; Reissuing write request\n");
324 DPRINT(
"IO failed!!! VfatWriteDisk : Error code: %x\n",
Status);
325 DPRINT(
"(pDeviceObject %p, Offset %I64x, Size %u, Buffer %p\n",
329 DPRINT(
"Block request succeeded for %p\n",
Irp);
346 DPRINT(
"VfatWriteDiskPartial(IrpContext %p, WriteOffset %I64x, WriteLength %u, BufferOffset %x, Wait %u)\n",
352 DPRINT(
"Building asynchronous FSD Request...\n");
356 DPRINT(
"IoAllocateIrp failed\n");
368 StackPtr->
DeviceObject = IrpContext->DeviceExt->StorageDevice;
376 DPRINT(
"IoAllocateMdl failed\n");
393 IrpContext->RefCount = 1;
400 DPRINT(
"Calling IO Driver...\n");
405 Status = IrpContext->Irp->IoStatus.Status;
412 DPRINT1(
"Media change detected!\n");
421 DPRINT1(
"Volume verification successful; Reissuing write request\n");
445 DPRINT(
"VfatBlockDeviceIoControl(DeviceObject %p, CtlCode %x, "
446 "InputBuffer %p, InputBufferSize %x, OutputBuffer %p, "
449 OutputBufferSize ? *OutputBufferSize : 0);
454 DPRINT(
"Building device I/O control request ...\n");
460 (OutputBufferSize) ? *OutputBufferSize : 0,
466 DPRINT(
"IoBuildDeviceIoControlRequest failed\n");
476 DPRINT(
"Calling IO Driver... with irp %p\n",
Irp);
479 DPRINT(
"Waiting for IO Operation for %p\n",
Irp);
482 DPRINT(
"Operation pending\n");
484 DPRINT(
"Getting IO Status... for %p\n",
Irp);
493 DPRINT1(
"Media change detected!\n");
503 DPRINT1(
"Volume verification successful; Reissuing IOCTL request\n");
508 if (OutputBufferSize)
510 *OutputBufferSize =
IoStatus.Information;
#define InterlockedIncrement
#define InterlockedDecrement
_Inout_ PIRP _In_ PDEVICE_OBJECT DeviceToVerify
#define NT_SUCCESS(StatCode)
#define PsGetCurrentThread()
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
#define KeSetEvent(pEvt, foo, foo2)
#define BooleanFlagOn(F, SF)
VOID NTAPI IoBuildPartialMdl(IN PMDL SourceMdl, IN PMDL TargetMdl, IN PVOID VirtualAddress, IN ULONG Length)
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
_In_ PNDIS_STRING _In_ PNDIS_STRING _Out_ PDEVICE_OBJECT * pDeviceObject
#define UNREFERENCED_PARAMETER(P)
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 IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
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)
VOID NTAPI IoSetDeviceToVerify(IN PETHREAD Thread, IN PDEVICE_OBJECT DeviceObject)
PDEVICE_OBJECT NTAPI IoGetDeviceToVerify(IN PETHREAD Thread)
NTSTATUS NTAPI IoVerifyVolume(IN PDEVICE_OBJECT DeviceObject, IN BOOLEAN AllowRawMount)
#define STATUS_MORE_PROCESSING_REQUIRED
PULONG MinorVersion OPTIONAL
PDEVICE_OBJECT DeviceObject
struct _IO_STACK_LOCATION::@3974::@3978 Read
PIO_COMPLETION_ROUTINE CompletionRoutine
union _IO_STACK_LOCATION::@1575 Parameters
#define STATUS_UNSUCCESSFUL
#define STATUS_VERIFY_REQUIRED
#define STATUS_INSUFFICIENT_RESOURCES
struct VFAT_IRP_CONTEXT * PVFAT_IRP_CONTEXT
#define IRPCONTEXT_PENDINGRETURNED
NTSTATUS VfatReadDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, ULONG BufferOffset, IN BOOLEAN Wait)
NTSTATUS VfatWriteDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN OUT PUCHAR Buffer, IN BOOLEAN Override)
NTSTATUS VfatWriteDiskPartial(IN PVFAT_IRP_CONTEXT IrpContext, IN PLARGE_INTEGER WriteOffset, IN ULONG WriteLength, IN ULONG BufferOffset, IN BOOLEAN Wait)
NTSTATUS VfatReadDisk(IN PDEVICE_OBJECT pDeviceObject, IN PLARGE_INTEGER ReadOffset, IN ULONG ReadLength, IN OUT PUCHAR Buffer, IN BOOLEAN Override)
NTSTATUS VfatBlockDeviceIoControl(IN PDEVICE_OBJECT DeviceObject, IN ULONG CtlCode, IN PVOID InputBuffer OPTIONAL, IN ULONG InputBufferSize, IN OUT PVOID OutputBuffer OPTIONAL, IN OUT PULONG OutputBufferSize, IN BOOLEAN Override)
static IO_COMPLETION_ROUTINE VfatReadWritePartialCompletion
_In_ PDEVICE_OBJECT DeviceObject
_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_opt_ PWDF_MEMORY_DESCRIPTOR InputBuffer
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET ReadOffset
_Must_inspect_result_ _In_ WDFUSBPIPE _In_ WDFREQUEST _In_opt_ WDFMEMORY _In_opt_ PWDFMEMORY_OFFSET WriteOffset
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
#define SL_OVERRIDE_VERIFY_VOLUME
#define MmGetMdlVirtualAddress(_Mdl)