32#pragma alloc_text(INIT, DriverEntry)
33#pragma alloc_text(PAGE, VfdReinitialize)
34#pragma alloc_text(PAGE, VfdUnloadDriver)
35#pragma alloc_text(PAGE, VfdCreateClose)
36#pragma alloc_text(PAGE, VfdCopyUnicode)
37#pragma alloc_text(PAGE, VfdFreeUnicode)
84#define VFD_PNP_TAG "(Plug & Play version)"
93 (
"[VFD] Running on Windows NT %lu.%lu build %lu\n",
107 VFD_DRIVER_EXTENSION_ID,
112 VFDTRACE(0, (
"[VFD] IoAllocateDriverObjectExtension - %s\n",
126 if (!driver_extension) {
127 VFDTRACE(0, (
"[VFD] failed to allocate the driver extension.\n"));
151 VFDTRACE(0, (
"[VFD] Registry Path: %ws\n",
156 params[0].EntryContext = &number_of_devices;
158 params[0].DefaultData = &default_devs;
164 params[1].EntryContext = &TraceFlags;
166 params[1].DefaultData = &default_trace;
176 number_of_devices == 0 ||
181 VFDTRACE(0,(
"[VFD] NumberOfDevices = %lu\n", number_of_devices));
182 VFDTRACE(0,(
"[VFD] TraceFlags = 0x%08x\n", TraceFlags));
185 VFDTRACE(0, (
"[VFD] failed to allocate the registry path buffer.\n"));
226 DriverObject->DriverExtension->AddDevice = VfdAddDevice;
238 (
"[VFD] driver initialized with %lu devices.\n",
256 VFDTRACE(VFDINFO, (
"[VFD] VfdUnloadDriver - IN\n"));
269 driver_extension =
NULL;
276 while (device_object) {
282 device_object = next_device;
288 if (driver_extension) {
291 VFDTRACE(0, (
"[VFD] Releasing the registry path buffer\n"));
298 VFDTRACE(0, (
"[VFD] Releasing the driver extension\n"));
303 VFDTRACE(VFDINFO, (
"[VFD] VfdUnloadDriver - OUT\n"));
320 VFDTRACE(VFDINFO, (
"[VFD] %-40s %ws\n",
325 VFDTRACE(VFDINFO, (
"[VFD] %-40s %p\n",
356 VFDTRACE(VFDINFO, (
"[VFD] VfdReinitialize - IN\n"));
360 while (device_object) {
363#ifdef VFD_MOUNT_MANAGER
374 VfdMountMgrMountPoint(
391 device_object = device_object->NextDevice;
394 VFDTRACE(VFDINFO, (
"[VFD] VfdReinitialize - OUT\n"));
432 VFDTRACE(0, (
"[VFD] Exitting the I/O thread\n"));
446 irp->IoStatus.Information = 0;
469 (
"[VFD] %s passed to the I/O thread\n",
502 dst->Length =
src->Length;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
struct _device_extension device_extension
#define NT_SUCCESS(StatCode)
struct _BEEP_DEVICE_EXTENSION * PDEVICE_EXTENSION
DRIVER_INITIALIZE DriverEntry
#define PsGetVersion(a, b, c, d)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
struct _DEVICE_OBJECT * PDEVICE_OBJECT
GLenum const GLfloat * params
#define KeGetCurrentThread
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
#define LOW_REALTIME_PRIORITY
PLIST_ENTRY NTAPI ExInterlockedRemoveHeadList(IN OUT PLIST_ENTRY ListHead, IN OUT PKSPIN_LOCK Lock)
#define RTL_REGISTRY_ABSOLUTE
#define RTL_QUERY_REGISTRY_DIRECT
#define RTL_REGISTRY_OPTIONAL
#define UNREFERENCED_PARAMETER(P)
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
VOID NTAPI IoRegisterDriverReinitialization(IN PDRIVER_OBJECT DriverObject, IN PDRIVER_REINITIALIZE ReinitRoutine, IN PVOID Context)
NTSTATUS NTAPI IoAllocateDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress, IN ULONG DriverObjectExtensionSize, OUT PVOID *DriverObjectExtension)
#define IoCompleteRequest
NTSTATUS NTAPI PsTerminateSystemThread(IN NTSTATUS ExitStatus)
PPCI_DRIVER_EXTENSION DriverExtension
#define IRP_MJ_DEVICE_CONTROL
struct _IO_STACK_LOCATION::@1579::@1580 DeviceIoControl
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@3983 Write
struct _IO_STACK_LOCATION::@3978::@3982 Read
UNICODE_STRING RegistryPath
KPRIORITY NTAPI KeSetPriorityThread(IN PKTHREAD Thread, IN KPRIORITY Priority)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_DRIVER_INTERNAL_ERROR
#define STATUS_INSUFFICIENT_RESOURCES
#define VFDTRACE(LEVEL, STRING)
VOID VfdDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
NTSTATUS VfdCreateDevice(IN PDRIVER_OBJECT DriverObject, OUT PVOID Parameter)
VOID NTAPI VfdDeviceThread(IN PVOID ThreadContext)
VOID NTAPI VfdUnloadDriver(IN PDRIVER_OBJECT DriverObject)
VOID VfdFreeUnicode(PUNICODE_STRING str)
NTSTATUS NTAPI VfdCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
PWSTR VfdCopyUnicode(PUNICODE_STRING dst, PUNICODE_STRING src)
static VOID NTAPI VfdReinitialize(IN PDRIVER_OBJECT DriverObject, IN PVOID Context, IN ULONG Count)
struct _VFD_DRIVER_EXTENSION * PVFD_DRIVER_EXTENSION
NTSTATUS NTAPI VfdDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
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)
NTSTATUS VfdSetLink(IN PDEVICE_EXTENSION DeviceExtension, IN CHAR DriveLetter)
VOID VfdIoCtlThread(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN ULONG ControlCode)
VOID VfdWriteData(IN PDEVICE_EXTENSION DeviceExtension, IN OUT PIRP Irp, IN ULONG Length, IN PLARGE_INTEGER Offset)
#define VFD_REG_TRACE_FLAGS
#define VFD_REG_DEVICE_NUMBER
#define VFD_MAXIMUM_DEVICES
#define VFD_DEFAULT_DEVICES
#define VFD_DRIVER_VERSION_STR
_In_ PDEVICE_OBJECT DeviceObject
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
#define IoReleaseRemoveLock(_RemoveLock, _Tag)
#define IRP_MJ_SYSTEM_CONTROL
#define IO_DISK_INCREMENT