19#define IO_READ_OFF(p) (p)->Parameters.Read.ByteOffset.QuadPart
20#define IO_READ_LEN(p) (p)->Parameters.Read.Length
40 VFDTRACE(VFDINFO, (
"[VFD] %-40s %ws\n",
45 VFDTRACE(VFDINFO, (
"[VFD] %-40s %p\n",
58 VFDTRACE(VFDWARN, (
"[VFD] Device not ready\n"));
61 goto complete_request;
67 VFDTRACE(0, (
"[VFD] Acquire RemoveLock failed: %s\n", GetStatusName(
status)));
69 goto complete_request;
91 goto complete_request;
101 goto complete_request;
116 (
"[VFD] Offset:%I64u + Length:%u goes past the media size %lu\n",
121 goto complete_request;
128 (
"[VFD] Invalid Alignment Offset:%I64u Length:%u\n",
132 goto complete_request;
139 goto complete_request;
150 &
Irp->Tail.Overlay.ListEntry,
158 VFDTRACE(VFDINFO,(
"[VFD] %-40s - STATUS_PENDING\n",
168 Irp->IoStatus.Information = 0;
171 VFDTRACE(VFDWARN,(
"[VFD] %-40s - %s\n",
188#if (VER_PRODUCTBUILD >= 2195)
195 PVOID MappedSystemVa;
203 if (!MdlMappingCanFail) {
204 Mdl->MdlFlags &= ~MDL_MAPPING_CAN_FAIL;
207 return MappedSystemVa;
208#if (VER_PRODUCTBUILD >= 2195)
225 VFDTRACE(VFDINFO,(
"[VFD] VfdReadData - IN\n"));
232 (
"[VFD] MmGetSystemAddressForMdlPrettySafe\n"));
238 if (DeviceExtension->FileHandle) {
241 Irp->IoStatus.Status = ZwReadFile(
242 DeviceExtension->FileHandle,
257 (
"[VFD] ZwReadFile - %s\n",
258 GetStatusName(
Irp->IoStatus.Status)));
261 else if (DeviceExtension->FileBuffer) {
266 DeviceExtension->FileBuffer +
Offset->QuadPart,
277 VFDTRACE(VFDINFO,(
"[VFD] VfdReadData - %s\n",
278 GetStatusName(
Irp->IoStatus.Status)));
295 VFDTRACE(VFDINFO,(
"[VFD] VfdWriteData - IN\n"));
302 (
"[VFD] MmGetSystemAddressForMdlPrettySafe\n"));
308 if (DeviceExtension->FileHandle) {
311 Irp->IoStatus.Status = ZwWriteFile(
312 DeviceExtension->FileHandle,
327 (
"[VFD] ZwWriteFile - %s\n",
328 GetStatusName(
Irp->IoStatus.Status)));
331 else if (DeviceExtension->FileBuffer) {
335 DeviceExtension->FileBuffer +
Offset->QuadPart,
342 DeviceExtension->FileBuffer +
Offset->QuadPart,
353 VFDTRACE(VFDINFO,(
"[VFD] VfdWriteData - %s\n",
354 GetStatusName(
Irp->IoStatus.Status)));
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _device_extension device_extension
#define NT_SUCCESS(StatCode)
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION
#define RtlCompareMemory(s1, s2, l)
#define KeSetEvent(pEvt, foo, foo2)
GLenum GLuint GLenum GLsizei const GLchar * buf
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
enum _MM_PAGE_PRIORITY MM_PAGE_PRIORITY
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
#define IoCompleteRequest
#define RtlMoveMemory(Destination, Source, Length)
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_MEDIA_IN_DEVICE
#define STATUS_INVALID_DEVICE_STATE
#define STATUS_INSUFFICIENT_RESOURCES
#define VFDTRACE(LEVEL, STRING)
#define VFD_SECTOR_ALIGNED(b)
#define VFD_SECTOR_TO_BYTE(s)
VOID VfdReadData(IN PDEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp, IN ULONG Length, IN PLARGE_INTEGER Offset)
NTSTATUS NTAPI VfdReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID VfdWriteData(IN PDEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp, IN ULONG Length, IN PLARGE_INTEGER Offset)
static PVOID MmGetSystemAddressForMdlPrettySafe(IN PMDL Mdl, IN MM_PAGE_PRIORITY Priority)
#define VFD_FLAG_DATA_MODIFIED
#define VFD_FLAG_WRITE_PROTECTED
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFDEVICE _In_ PVOID _In_opt_ PMDL Mdl
_In_ WDFINTERRUPT _In_ WDF_INTERRUPT_POLICY _In_ WDF_INTERRUPT_PRIORITY Priority
#define IoAcquireRemoveLock(RemoveLock, Tag)
#define MmGetSystemAddressForMdl(Mdl)
#define MmGetSystemAddressForMdlSafe(_Mdl, _Priority)
#define MDL_MAPPING_CAN_FAIL