10#ifndef VFD_MOUNT_MANAGER
16#if !defined(__REACTOS__) || defined(_MSC_VER)
18#pragma warning (disable: 4206)
19#pragma message ("Mount Manager support feature is disabled.")
64VfdMountMgrSendRequest(
73#pragma alloc_text(PAGE, VfdMountMgrNotifyVolume)
74#pragma alloc_text(PAGE, VfdMountMgrMountPoint)
75#pragma alloc_text(PAGE, VfdMountMgrSendRequest)
76#pragma alloc_text(PAGE, VfdMountDevUniqueId)
77#pragma alloc_text(PAGE, VfdMountDevDeviceName)
78#pragma alloc_text(PAGE, VfdMountDevSuggestedLink)
79#pragma alloc_text(PAGE, VfdMountDevLinkModified)
146VfdMountMgrNotifyVolume(
154 (
"[VFD] VfdMountMgrNotifyVolume - %ws\n",
155 DeviceExtension->DeviceName.Buffer));
160 DeviceExtension->DeviceName.Length;
164 DeviceExtension->DeviceName.Buffer,
165 DeviceExtension->DeviceName.Length);
167 status = VfdMountMgrSendRequest(
175 (
"[VFD] VfdMountMgrNotifyVolume - %s\n",
185VfdMountMgrMountPoint(
194 VFDTRACE(VFDINFO, (
"[VFD] VfdMountMgrMountPoint - IN\n"));
198 if (DriveLetter >=
'a' && DriveLetter <=
'z') {
199 DriveLetter -= (
'a' -
'A');
202 if (DriveLetter >=
'A' && DriveLetter <=
'Z') {
208 swprintf(link_buf,
L"\\DosDevices\\%wc:", DriveLetter);
213 (
"[VFD] Creating a link: %ws => %ws\n",
214 link_buf, DeviceExtension->DeviceName.Buffer));
219 link_name.
Length + DeviceExtension->DeviceName.Length;
225 VFDTRACE(0, (
"[VFD] Failed to allocate mount point input\n"));
242 (
create->SymbolicLinkNameOffset +
create->SymbolicLinkNameLength);
243 create->DeviceNameLength = DeviceExtension->DeviceName.Length;
247 DeviceExtension->DeviceName.Buffer,
248 DeviceExtension->DeviceName.Length);
252 status = VfdMountMgrSendRequest(
262 else if (DriveLetter == 0) {
269 WCHAR unique_buf[20];
271 swprintf(link_buf,
L"\\DosDevices\\%wc:",
272 DeviceExtension->DriveLetter);
275 (
"[VFD] Deleting link: %ws\n", link_buf));
280 DeviceExtension->DeviceNumber);
289 DeviceExtension->DeviceName.Length;
295 VFDTRACE(0, (
"[VFD] Failed to allocate mount point input\n"));
327 DeviceExtension->DeviceName.Length;
331 DeviceExtension->DeviceName.Buffer,
332 DeviceExtension->DeviceName.Length);
339 status = VfdMountMgrSendRequest(
341 mount, alloc_size,
points, alloc_size * 2);
348 DeviceExtension->DriveLetter = 0;
359 VFDTRACE(VFDINFO, (
"[VFD] VfdMountMgrMountPoint - %s\n",
369VfdMountMgrSendRequest(
398 (
"[VFD] IoGetDeviceObjectPointer - %s\n", GetStatusName(
status)));
419 (
"[VFD] IoBuildDeviceIoControlRequest\n"));
430 (
"[VFD] IoCallDriver - %s\n", GetStatusName(
status)));
444 (
"[VFD] IoCallDriver - %s\n", GetStatusName(
status)));
473 DeviceExtension->DeviceNumber);
500VfdMountDevDeviceName(
510 DeviceName->NameLength = DeviceExtension->DeviceName.Length;
521 DeviceExtension->DeviceName.Buffer,
538VfdMountDevSuggestedLink(
553 if (!DeviceExtension->DriveLetter) {
556 VFDTRACE(VFDINFO, (
"[VFD] suggested link : none\n"));
567 DeviceExtension->DriveLetter);
569 VFDTRACE(VFDINFO, (
"[VFD] suggested link : %ws\n",
buf));
599VfdMountDevLinkModified(
630 LinkName->
Name[0] ==
L'\\' &&
631 LinkName->
Name[1] ==
L'D' &&
632 LinkName->
Name[2] ==
L'o' &&
633 LinkName->
Name[3] ==
L's' &&
634 LinkName->
Name[4] ==
L'D' &&
635 LinkName->
Name[5] ==
L'e' &&
636 LinkName->
Name[6] ==
L'v' &&
637 LinkName->
Name[7] ==
L'i' &&
638 LinkName->
Name[8] ==
L'c' &&
639 LinkName->
Name[9] ==
L'e' &&
640 LinkName->
Name[10] ==
L's' &&
641 LinkName->
Name[11] ==
L'\\' &&
642 LinkName->
Name[12] >=
L'A' &&
643 LinkName->
Name[12] <=
L'Z' &&
644 LinkName->
Name[13] ==
L':') {
650 DeviceExtension->DriveLetter = (
CHAR)LinkName->
Name[12];
654 DeviceExtension->DriveLetter = 0;
#define NT_SUCCESS(StatCode)
#define ExAllocatePoolWithTag(hernya, size, tag)
#define MAXIMUM_FILENAME_LENGTH
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLsizei const GLfloat * points
struct _MOUNTDEV_NAME MOUNTDEV_NAME
struct _MOUNTDEV_UNIQUE_ID MOUNTDEV_UNIQUE_ID
#define IOCTL_MOUNTMGR_DELETE_POINTS
#define IOCTL_MOUNTDEV_LINK_CREATED
struct _MOUNTMGR_MOUNT_POINTS * PMOUNTMGR_MOUNT_POINTS
struct _MOUNTMGR_CREATE_POINT_INPUT MOUNTMGR_CREATE_POINT_INPUT
struct _MOUNTMGR_TARGET_NAME * PMOUNTMGR_TARGET_NAME
#define MOUNTMGR_DEVICE_NAME
struct _MOUNTMGR_MOUNT_POINT MOUNTMGR_MOUNT_POINT
#define IOCTL_MOUNTMGR_CREATE_POINT
#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION
struct _MOUNTDEV_SUGGESTED_LINK_NAME MOUNTDEV_SUGGESTED_LINK_NAME
static HANDLE PIO_APC_ROUTINE void PIO_STATUS_BLOCK io_status
static const struct access_res create[16]
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
#define FILE_READ_ATTRIBUTES
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
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)
#define STATUS_BUFFER_OVERFLOW
BOOLEAN UseOnlyIfThereAreNoOtherLinks
USHORT SymbolicLinkNameLength
ULONG SymbolicLinkNameOffset
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define STATUS_DRIVER_INTERNAL_ERROR
#define STATUS_INVALID_PARAMETER
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
#define VFDTRACE(LEVEL, STRING)
NTSTATUS VfdStoreLink(IN PDEVICE_EXTENSION DeviceExtension)
#define VFD_DEVICE_BASENAME
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_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
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
#define ObDereferenceObject