20#define IO_INPUTLEN(p) (p)->Parameters.DeviceIoControl.InputBufferLength
21#define IO_OUTPUTLEN(p) (p)->Parameters.DeviceIoControl.OutputBufferLength
22#define IO_CTRLCODE(p) (p)->Parameters.DeviceIoControl.IoControlCode
40 Irp->IoStatus.Information = 0;
42 VFDTRACE(VFDINFO, (
"[VFD] %-40s %ws\n",
51 (
"Acquire RemoveLock failed %s\n", NtStatusToStr(
status)));
121 &
Irp->IoStatus.Information);
134#ifdef VFD_MOUNT_MANAGER
140 *(
PCHAR)
Irp->AssociatedIrp.SystemBuffer);
153 *(
PCHAR)
Irp->AssociatedIrp.SystemBuffer);
171 *(
PCHAR)
Irp->AssociatedIrp.SystemBuffer =
174 Irp->IoStatus.Information =
sizeof(
CHAR);
225 *(
PULONG)
Irp->AssociatedIrp.SystemBuffer=
228 Irp->IoStatus.Information =
sizeof(
ULONG);
248 Irp->IoStatus.Information =
sizeof(
USHORT);
255 Irp->IoStatus.Information =
sizeof(
USHORT) + *
p;
269 *(
PULONG)
Irp->AssociatedIrp.SystemBuffer =
272 Irp->IoStatus.Information =
sizeof(
ULONG);
286 *(
PULONG)
Irp->AssociatedIrp.SystemBuffer =
289 Irp->IoStatus.Information =
sizeof(
ULONG);
339 Irp->AssociatedIrp.SystemBuffer,
346 Irp->AssociatedIrp.SystemBuffer,
424#ifdef VFD_MOUNT_MANAGER
432 status = VfdMountDevUniqueId(
434 Irp->AssociatedIrp.SystemBuffer,
443 status = VfdMountDevDeviceName(
445 Irp->AssociatedIrp.SystemBuffer,
455 status = VfdMountDevSuggestedLink(
457 Irp->AssociatedIrp.SystemBuffer,
465 status = VfdMountDevLinkModified(
467 Irp->AssociatedIrp.SystemBuffer,
502 (TraceFlags & VFDWARN) == VFDWARN) {
516 &
Irp->Tail.Overlay.ListEntry,
551 if (DeviceExtension->SecurityContext) {
577 (
"[VFD] %s passed to the device thread\n",
584 if ((
NT_SUCCESS(
Irp->IoStatus.Status) && (TraceFlags & VFDINFO) == VFDINFO) ||
585 (TraceFlags & VFDWARN) == VFDWARN) {
588 GetStatusName(
Irp->IoStatus.Status)));
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _device_extension device_extension
#define IOCTL_DISK_CHECK_VERIFY
#define IOCTL_DISK_GET_DRIVE_GEOMETRY
#define IOCTL_DISK_FORMAT_TRACKS_EX
#define IOCTL_DISK_EJECT_MEDIA
#define IOCTL_DISK_GET_MEDIA_TYPES
#define IOCTL_DISK_IS_WRITABLE
#define IOCTL_DISK_FORMAT_TRACKS
#define NT_SUCCESS(StatCode)
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION
#define KeSetEvent(pEvt, foo, foo2)
#define IOCTL_STORAGE_CHECK_VERIFY2
PLIST_ENTRY NTAPI ExInterlockedInsertTailList(IN OUT PLIST_ENTRY ListHead, IN OUT PLIST_ENTRY ListEntry, IN OUT PKSPIN_LOCK Lock)
struct _GET_LENGTH_INFORMATION * PGET_LENGTH_INFORMATION
#define IOCTL_MOUNTDEV_LINK_CREATED
#define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME
struct _GET_LENGTH_INFORMATION GET_LENGTH_INFORMATION
#define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME
NTKERNELAPI VOID NTAPI PsRevertToSelf(VOID)
#define IOCTL_DISK_GET_LENGTH_INFO
NTKERNELAPI VOID NTAPI SeImpersonateClient(IN PSECURITY_CLIENT_CONTEXT ClientContext, IN PETHREAD ServerThread OPTIONAL)
#define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID
#define IOCTL_MOUNTDEV_LINK_DELETED
struct _DISK_GEOMETRY DISK_GEOMETRY
#define IOCTL_STORAGE_CHECK_VERIFY
#define IOCTL_STORAGE_GET_MEDIA_TYPES
#define IOCTL_STORAGE_EJECT_MEDIA
#define IoCompleteRequest
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_BUFFER_OVERFLOW
#define RtlCopyMemory(Destination, Source, Length)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_DRIVER_INTERNAL_ERROR
#define STATUS_MEDIA_WRITE_PROTECTED
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_MEDIA_IN_DEVICE
#define VFDTRACE(LEVEL, STRING)
NTSTATUS VfdFormatTrack(IN PDEVICE_EXTENSION DeviceExtension, IN PFORMAT_PARAMETERS FormatParams)
NTSTATUS VfdFormatCheck(IN PDEVICE_EXTENSION DeviceExtension, IN PFORMAT_PARAMETERS FormatParams, IN ULONG InputLength, IN ULONG ControlCode)
NTSTATUS VfdQueryImage(IN PDEVICE_EXTENSION DeviceExtension, OUT PVFD_IMAGE_INFO ImageInfo, IN ULONG BufferLength, OUT PULONG ReturnLength)
VOID VfdCloseImage(IN PDEVICE_EXTENSION DeviceExtension)
const DISK_GEOMETRY geom_tbl[VFD_MEDIA_MAX]
NTSTATUS VfdStoreLink(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS VfdSetLink(IN PDEVICE_EXTENSION DeviceExtension, IN CHAR DriveLetter)
NTSTATUS VfdOpenImage(IN PDEVICE_EXTENSION DeviceExtension, IN PVFD_IMAGE_INFO ImageInfo)
NTSTATUS VfdOpenCheck(IN PDEVICE_EXTENSION DeviceExtension, IN PVFD_IMAGE_INFO ImageInfo, IN ULONG InputLength)
#define IOCTL_VFD_RESET_MODIFY
#define IOCTL_VFD_QUERY_IMAGE
#define IOCTL_VFD_SET_LINK
#define IOCTL_VFD_CLOSE_IMAGE
#define IOCTL_VFD_SET_PROTECT
#define IOCTL_VFD_QUERY_LINK
#define IOCTL_VFD_QUERY_VERSION
#define IOCTL_VFD_CLEAR_PROTECT
#define IOCTL_VFD_QUERY_NAME
#define IOCTL_VFD_QUERY_NUMBER
#define VFD_SECTOR_TO_BYTE(s)
#define IOCTL_VFD_OPEN_IMAGE
NTSTATUS NTAPI VfdDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID VfdIoCtlThread(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN ULONG ControlCode)
#define VFD_FLAG_WRITE_PROTECTED
_In_ PDEVICE_OBJECT DeviceObject
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
#define IoAcquireRemoveLock(RemoveLock, Tag)
#define IoReleaseRemoveLock(_RemoveLock, _Tag)