28#define MAX_DEVICES 0x3E8
57 if (DeviceExtension->EpicNumber != ChangeNotify->
EpicNumber)
59 ChangeNotify->
EpicNumber = DeviceExtension->EpicNumber;
92 DeviceExtension->RegistryPath.Buffer,
113 Irp->IoStatus.Information = 0;
122 Irp->IoStatus.Information = 0;
128 Irp->IoStatus.Information = 0;
146 Irp->IoStatus.Information = 0;
151 QueryState->
CurrentState = !DeviceExtension->NoAutoMount;
181 if (!
IsListEmpty(&(DeviceExtension->DeviceListHead)))
183 for (NextEntry = DeviceExtension->DeviceListHead.Flink;
184 NextEntry != &(DeviceExtension->DeviceListHead);
185 NextEntry = NextEntry->
Flink)
266 MaxLength =
MAX((
Point->DeviceNameOffset +
Point->DeviceNameLength),
267 (
Point->SymbolicLinkNameLength +
Point->SymbolicLinkNameOffset));
268 if (MaxLength >
Stack->Parameters.DeviceIoControl.InputBufferLength)
298 if (
IsListEmpty(&(DeviceExtension->OfflineDeviceListHead)))
307 while (!
IsListEmpty(&(DeviceExtension->OfflineDeviceListHead)))
309 NextEntry =
RemoveHeadList(&(DeviceExtension->OfflineDeviceListHead));
389 if (
IsListEmpty(&(DeviceExtension->DeviceListHead)))
395 for (NextEntry = DeviceExtension->DeviceListHead.Flink;
396 NextEntry != &(DeviceExtension->DeviceListHead);
397 NextEntry = NextEntry->Flink)
450 if (!DeviceExtension->ProcessedSuggestions)
453 DeviceExtension->ProcessedSuggestions =
TRUE;
464 NextEntry = DeviceExtension->DeviceListHead.
Flink;
465 while (NextEntry != &(DeviceExtension->DeviceListHead))
474 NextEntry = NextEntry->
Flink;
477 if (NextEntry == &(DeviceExtension->DeviceListHead))
485 DriveLetterInfo->DriveLetterWasAssigned =
TRUE;
496 DriveLetterInfo->DriveLetterWasAssigned =
FALSE;
501 NextEntry = NextEntry->
Flink;
510 DriveLetterInfo->DriveLetterWasAssigned =
FALSE;
511 DriveLetterInfo->CurrentDriveLetter = 0;
518 if (DeviceExtension->NoAutoMount && !
Removable)
520 if (DriveLetterInfo->DriveLetterWasAssigned)
522 DriveLetterInfo->DriveLetterWasAssigned =
FALSE;
523 DriveLetterInfo->CurrentDriveLetter = 0;
529 if (!DriveLetterInfo->DriveLetterWasAssigned)
556 DriveLetterInfo->DriveLetterWasAssigned =
FALSE;
557 DriveLetterInfo->CurrentDriveLetter = 0;
582 for (DriveLetterInfo->CurrentDriveLetter = DriveLetter;
583 DriveLetterInfo->CurrentDriveLetter <=
L'Z';
584 DriveLetterInfo->CurrentDriveLetter++)
596 if (DriveLetterInfo->CurrentDriveLetter >
L'Z')
598 DriveLetterInfo->DriveLetterWasAssigned =
FALSE;
599 DriveLetterInfo->CurrentDriveLetter = 0;
651 &DriveLetterInformation);
655 DriveLetterInformation;
693 if (SystemVolumeName->
Buffer)
716 SystemVolumeName->Buffer =
NULL;
719 L"\\Registry\\Machine\\System\\Setup",
724 if (SystemVolumeName->Buffer)
748 if (
IsListEmpty(&(DeviceExtension->DeviceListHead)))
759 for (NextEntry = DeviceExtension->DeviceListHead.
Flink;
760 NextEntry != &(DeviceExtension->DeviceListHead);
761 NextEntry = NextEntry->
Flink)
770 &DriveLetterInformation);
779 if (DeviceExtension->DriveLetterData)
787 if (DeviceExtension->NoAutoMount)
791 DeviceExtension->NoAutoMount =
FALSE;
795 &DriveLetterInformation);
798 DeviceExtension->NoAutoMount =
TRUE;
822 PWSTR DeviceString, OldBuffer;
823 USHORT DeviceLength, OldLength;
845 Stack->Parameters.DeviceIoControl.InputBufferLength)
851 if (
Stack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(
ULONG))
877 SymlinksEntry = SymlinksEntry->
Flink)
897 goto TryWithVolumeName;
902 OldLength = DeviceLength;
903 OldBuffer = DeviceString;
931 goto TryWithVolumeName;
936 OldBuffer = DeviceString;
937 OldLength = DeviceLength;
938 DeviceLength += 2 *
sizeof(
WCHAR);
952 DeviceString[1] =
L':';
963 if (DeviceLength < 2 *
sizeof(
WCHAR) || DeviceString[1] !=
L':')
974 SymlinksEntry = SymlinksEntry->
Flink)
987 DeviceLength = SymlinkInformation->
Name.
Length;
996 DeviceString[1] =
L'\\';
1006 Irp->IoStatus.Information = DeviceLength +
sizeof(
ULONG);
1009 if (
sizeof(
ULONG) + DeviceLength <=
Stack->Parameters.DeviceIoControl.OutputBufferLength)
1028 Irp->IoStatus.Information =
sizeof(
ULONG);
1057 + AssociatedDeviceEntry->DeviceInformation->DeviceName.Length
1093 if (ReparseData ==
NULL)
1123 if (SubstituteName.
Length == 98 && SubstituteName.
Buffer[1] ==
L'?')
1125 for (SymlinksEntry = DeviceInformation->SymbolicLinksListHead.
Flink;
1126 SymlinksEntry != &(DeviceInformation->SymbolicLinksListHead);
1127 SymlinksEntry = SymlinksEntry->
Flink)
1162 ULONG OutputPathLength, NumberOfPaths, ReturnedPaths;
1167 for (
Entry = DeviceInformation->SymbolicLinksListHead.Flink;
1168 Entry != &(DeviceInformation->SymbolicLinksListHead);
1177 OutputPathLength = 4 *
sizeof(
WCHAR);
1183 if (
Entry == &(DeviceInformation->SymbolicLinksListHead))
1185 SymlinkInformation =
NULL;
1198 if (*VolumePaths ==
NULL)
1204 (*VolumePaths)->MultiSzLength = OutputPathLength;
1206 if (SymlinkInformation !=
NULL)
1209 (*VolumePaths)->MultiSz[1] =
L':';
1224 if (DeviceInfoEntry ==
NULL)
1235 if (!
IsListEmpty(&DeviceInformation->AssociatedDevicesHead))
1237 for (
Entry = DeviceInformation->AssociatedDevicesHead.Flink;
1238 Entry != &DeviceInformation->AssociatedDevicesHead;
1244 ASSERT(NumberOfPaths != 0);
1257 CurrentPath = Paths;
1258 for (
Entry = DeviceInformation->AssociatedDevicesHead.Flink;
1259 Entry != &DeviceInformation->AssociatedDevicesHead;
1282 for (
i = 0;
i < ReturnedPaths; ++
i)
1306 for (
i = 0;
i < ReturnedPaths; ++
i)
1322 if ((*CurrentPath)->MultiSzLength !=
sizeof(
UNICODE_NULL))
1325 PWSTR MultiSz = (*CurrentPath)->MultiSz;
1327 for (
i = 0;
i < (*CurrentPath)->MultiSzLength /
sizeof(
WCHAR); ++
i, ++MultiSz)
1341 OutputPathLength += (*CurrentPath)->MultiSzLength + InnerStrings * AssociatedDeviceEntry->
String.
Length -
sizeof(
UNICODE_NULL);
1346 if (*VolumePaths ==
NULL)
1350 for (
i = 0;
i < ReturnedPaths; ++
i)
1366 (*VolumePaths)->MultiSzLength = OutputPathLength;
1367 if (SymlinkInformation !=
NULL)
1370 (*VolumePaths)->MultiSz[1] =
L':';
1376 CurrentPath = Paths;
1377 for (
Entry = DeviceInformation->AssociatedDevicesHead.Flink;
1378 Entry != &DeviceInformation->AssociatedDevicesHead;
1384 if ((*CurrentPath)->MultiSzLength !=
sizeof(
UNICODE_NULL))
1392 for (
i = 0;
i < (*CurrentPath)->MultiSzLength /
sizeof(
WCHAR) - 1; ++
i)
1399 (*VolumePaths)->MultiSz[Written] = *MultiSz;
1448 ULONG Attempts, OutputLength;
1476 if (
Stack->Parameters.DeviceIoControl.OutputBufferLength <
sizeof(
ULONG))
1493 NeedNotification =
FALSE;
1497 FailedDevice =
NULL;
1508 if (FailedDevice ==
NULL)
1516 NeedNotification =
TRUE;
1527 for (
Entry = DeviceExtension->DeviceListHead.Flink;
1528 Entry != &DeviceExtension->DeviceListHead;
1533 if (ListDeviceInfo == DeviceInformation)
1540 if (
Entry == &DeviceExtension->DeviceListHead)
1548 if (Attempts >= 1000)
1555 if (NeedNotification)
1567 OutputLength =
Output->MultiSzLength +
sizeof(
ULONG);
1570 if (OutputLength >
Stack->Parameters.DeviceIoControl.OutputBufferLength)
1572 Irp->IoStatus.Information =
sizeof(
ULONG);
1578 Irp->IoStatus.Information = OutputLength;
1606 if (
Target->DeviceNameLength +
sizeof(
USHORT) >
Stack->Parameters.DeviceIoControl.InputBufferLength)
1650 if (
Target->DeviceNameLength +
sizeof(
USHORT) >
Stack->Parameters.DeviceIoControl.InputBufferLength)
1884 if (
Link == 0 && !CreateNoDrive)
2022 Stack->Parameters.DeviceIoControl.InputBufferLength)
2028 SourceVolumeName.
Length =
2056 sizeof(FsDeviceInfo),
2079 FOReferenced =
TRUE;
2117 ObjectNameInfoPtr = &ObjectNameInfo;
2124 if (!ObjectNameInfoPtr)
2148 TargetVolumeName->Length =
2161 SourceSymbolicName->Length =
2163 SourceSymbolicName->Buffer = (
PWSTR)FileNameInfo;
2166 FileNameInfo =
NULL;
2187 if (TargetDeviceName.
Buffer)
2192 if (ObjectNameInfoPtr && ObjectNameInfoPtr != &ObjectNameInfo)
2324 if (DatabaseEntry ==
NULL)
2365 if (DatabaseEntry ==
NULL)
2396 if (UniqueIdReplicate ==
NULL)
2405 UniqueIdReplicate->
UniqueId = UniqueId;
2421 if (AssociatedEntry ==
NULL)
2556 if (DatabaseEntry ==
NULL)
2678 switch (
Stack->Parameters.DeviceIoControl.IoControlCode)
2702 DeviceExtension->AutomaticDriveLetter =
TRUE;
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
#define NT_SUCCESS(StatCode)
BOOL NTAPI QueryDeviceInformation(_In_ PWCHAR DriveRoot, _Out_ PVOID DeviceInformation, _In_ ULONG BufferSize)
Retrieves disk device information.
static const WCHAR Cleanup[]
NTSTATUS CloseRemoteDatabase(IN HANDLE Database)
NTSTATUS DeleteRemoteDatabaseEntry(IN HANDLE Database, IN LONG StartingOffset)
NTSTATUS WaitForRemoteDatabaseSemaphore(IN PDEVICE_EXTENSION DeviceExtension)
VOID ReconcileThisDatabaseWithMaster(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation)
VOID NTAPI ReconcileThisDatabaseWithMasterWorker(IN PVOID Parameter)
VOID DeleteNoDriveLetterEntry(IN PMOUNTDEV_UNIQUE_ID UniqueId)
VOID ReleaseRemoteDatabaseSemaphore(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS AddRemoteDatabaseEntry(IN HANDLE Database, IN PDATABASE_ENTRY Entry)
NTSTATUS WriteRemoteDatabaseEntry(IN HANDLE Database, IN LONG Offset, IN PDATABASE_ENTRY Entry)
VOID ReconcileAllDatabasesWithMaster(IN PDEVICE_EXTENSION DeviceExtension)
HANDLE OpenRemoteDatabase(IN PDEVICE_INFORMATION DeviceInformation, IN BOOLEAN MigrateDatabase)
PDATABASE_ENTRY GetRemoteDatabaseEntry(IN HANDLE Database, IN LONG StartingOffset)
UNICODE_STRING RemoteDatabase
NTSTATUS QueryVolumeName(IN HANDLE RootDirectory, IN PFILE_REPARSE_POINT_INFORMATION ReparsePointInformation, IN PUNICODE_STRING FileName OPTIONAL, OUT PUNICODE_STRING SymbolicName, OUT PUNICODE_STRING VolumeName)
NTSTATUS MountMgrVolumeMountPointDeleted(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN NTSTATUS LockStatus)
BOOLEAN IsFtVolume(IN PUNICODE_STRING SymbolicName)
NTSTATUS MountMgrQueryPoints(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrVolumeArrivalNotification(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrDeletePoints(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrKeepLinksWhenOffline(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrVolumeMountPointCreated(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN NTSTATUS LockStatus)
NTSTATUS MountMgrQuerySystemVolumeName(OUT PUNICODE_STRING SystemVolumeName)
NTSTATUS MountMgrScrubRegistry(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS MountMgrQueryDosVolumePaths(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS NTAPI ScrubRegistryRoutine(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
NTSTATUS MountMgrChangeNotify(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrQueryVolumePaths(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation, IN PLIST_ENTRY DeviceInfoList, OUT PMOUNTMGR_VOLUME_PATHS *VolumePaths, OUT PDEVICE_INFORMATION *FailedDevice)
NTSTATUS NTAPI MountMgrQuerySystemVolumeNameQueryRoutine(IN PWSTR ValueName, IN ULONG ValueType, IN PVOID ValueData, IN ULONG ValueLength, IN PVOID Context, IN PVOID EntryContext)
NTSTATUS MountMgrQueryAutoMount(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrValidateBackPointer(IN PASSOCIATED_DEVICE_ENTRY AssociatedDeviceEntry, IN PDEVICE_INFORMATION DeviceInformation, OUT PBOOLEAN Invalid)
NTSTATUS MountMgrDeletePointsDbOnly(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrCheckUnprocessedVolumes(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrNextDriveLetter(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
VOID MountMgrAssignDriveLetters(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS MountmgrWriteNoAutoMount(IN PDEVICE_EXTENSION DeviceExtension)
VOID ProcessSuggestedDriveLetters(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS MountMgrVolumeMountPointChanged(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN NTSTATUS LockStatus, OUT PUNICODE_STRING SourceDeviceName, OUT PUNICODE_STRING SourceSymbolicName, OUT PUNICODE_STRING TargetVolumeName)
NTSTATUS MountMgrCreatePoint(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrQueryDosVolumePath(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrSetAutoMount(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp)
NTSTATUS MountMgrNextDriveLetterWorker(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING DeviceName, OUT PMOUNTMGR_DRIVE_LETTER_INFORMATION DriveLetterInfo)
#define RemoveEntryList(Entry)
#define InsertTailList(ListHead, Entry)
#define IsListEmpty(ListHead)
#define PsGetCurrentThread()
ULONG RtlCompareUnicodeString(PUNICODE_STRING s1, PUNICODE_STRING s2, BOOLEAN UpCase)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define RtlCompareMemory(s1, s2, l)
#define RemoveHeadList(ListHead)
#define InitializeListHead(ListHead)
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
#define FILE_OPEN_REPARSE_POINT
#define FILE_SYNCHRONOUS_IO_NONALERT
@ FileFsDeviceInformation
pRequest Complete(RequestStatus)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
_In_ GUID _In_ PVOID ValueData
#define OBJ_KERNEL_HANDLE
#define OBJ_CASE_INSENSITIVE
NTSYSAPI NTSTATUS WINAPI RtlDeleteRegistryValue(ULONG, PCWSTR, PCWSTR)
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
NTSYSAPI NTSTATUS WINAPI RtlQueryRegistryValues(ULONG, PCWSTR, PRTL_QUERY_REGISTRY_TABLE, PVOID, PVOID)
POBJECT_TYPE IoFileObjectType
IoSetCancelRoutine(Irp, CancelRoutine)
NTSTATUS GlobalDeleteSymbolicLink(IN PUNICODE_STRING DosName)
NTSTATUS MountMgrQuerySymbolicLink(IN PUNICODE_STRING SymbolicName, IN OUT PUNICODE_STRING LinkTarget)
DRIVER_DISPATCH MountMgrDeviceControl
UNICODE_STRING DeviceFloppy
struct _DATABASE_ENTRY DATABASE_ENTRY
NTSTATUS FindDeviceInfo(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName, IN BOOLEAN DeviceNameGiven, OUT PDEVICE_INFORMATION *DeviceInformation)
VOID MountMgrNotifyNameChange(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING DeviceName, IN BOOLEAN ValidateVolume)
NTSTATUS MountMgrCreatePointWorker(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicLinkName, IN PUNICODE_STRING DeviceName)
VOID PostOnlineNotification(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName)
BOOLEAN IsDriveLetter(PUNICODE_STRING SymbolicName)
UNICODE_STRING DeviceCdRom
#define DRIVE_LETTER_LENGTH
NTSTATUS QueryPointsFromSymbolicLinkName(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName, IN PIRP Irp)
VOID NTAPI MountMgrCancel(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
VOID MountMgrNotify(IN PDEVICE_EXTENSION DeviceExtension)
VOID WaitForOnlinesToComplete(IN PDEVICE_EXTENSION DeviceExtension)
VOID MountMgrFreeDeadDeviceInfo(IN PDEVICE_INFORMATION DeviceInformation)
VOID DeleteSymbolicLinkNameFromMemory(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicLink, IN BOOLEAN MarkOffline)
NTSTATUS QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN PMOUNTDEV_UNIQUE_ID UniqueId OPTIONAL, IN PUNICODE_STRING SymbolicName OPTIONAL)
BOOLEAN HasDriveLetter(IN PDEVICE_INFORMATION DeviceInformation)
#define AllocatePool(Size)
UNICODE_STRING DosDevices
VOID CreateNoDriveLetterEntry(IN PMOUNTDEV_UNIQUE_ID UniqueId)
BOOLEAN HasNoDriveLetterEntry(IN PMOUNTDEV_UNIQUE_ID UniqueId)
NTSTATUS MountMgrMountedDeviceArrival(IN PDEVICE_EXTENSION Extension, IN PUNICODE_STRING SymbolicName, IN BOOLEAN FromVolume)
struct _MOUNTMGR_MOUNT_POINT * PMOUNTMGR_MOUNT_POINT
#define IOCTL_MOUNTMGR_DELETE_POINTS
struct _MOUNTMGR_MOUNT_POINTS * PMOUNTMGR_MOUNT_POINTS
struct _MOUNTMGR_TARGET_NAME * PMOUNTMGR_TARGET_NAME
#define IOCTL_MOUNTMGR_CREATE_POINT
#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION
struct _MOUNTMGR_CREATE_POINT_INPUT * PMOUNTMGR_CREATE_POINT_INPUT
static OUT PIO_STATUS_BLOCK IoStatusBlock
#define InitializeObjectAttributes(p, n, a, r, s)
#define MOUNTMGR_IS_VOLUME_NAME(s)
#define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH
#define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS
struct _MOUNTMGR_CHANGE_NOTIFY_INFO * PMOUNTMGR_CHANGE_NOTIFY_INFO
#define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS
#define IOCTL_MOUNTMGR_QUERY_POINTS
struct _MOUNTMGR_QUERY_AUTO_MOUNT * PMOUNTMGR_QUERY_AUTO_MOUNT
struct _MOUNTMGR_VOLUME_PATHS * PMOUNTMGR_VOLUME_PATHS
#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED
struct _MOUNTMGR_VOLUME_MOUNT_POINT * PMOUNTMGR_VOLUME_MOUNT_POINT
#define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES
struct _MOUNTMGR_DRIVE_LETTER_INFORMATION * PMOUNTMGR_DRIVE_LETTER_INFORMATION
struct _MOUNTMGR_SET_AUTO_MOUNT * PMOUNTMGR_SET_AUTO_MOUNT
#define MOUNTMGR_IS_DRIVE_LETTER(s)
#define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER
#define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY
#define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE
struct _MOUNTMGR_DRIVE_LETTER_TARGET * PMOUNTMGR_DRIVE_LETTER_TARGET
#define IOCTL_MOUNTMGR_SCRUB_REGISTRY
#define IOCTL_MOUNTMGR_CHANGE_NOTIFY
#define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED
#define IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT
#define IOCTL_MOUNTMGR_SET_AUTO_MOUNT
struct _MOUNTMGR_CHANGE_NOTIFY_INFO MOUNTMGR_CHANGE_NOTIFY_INFO
_In_ PNDIS_STRING _In_ PNDIS_STRING SymbolicName
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
_In_ PCWSTR _Inout_ _At_ QueryTable _Pre_unknown_ PRTL_QUERY_REGISTRY_TABLE QueryTable
#define FILE_REMOTE_DEVICE
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define FILE_READ_ATTRIBUTES
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
#define RTL_REGISTRY_ABSOLUTE
struct _OBJECT_NAME_INFORMATION OBJECT_NAME_INFORMATION
#define FILE_SHARE_DELETE
#define RTL_QUERY_REGISTRY_REQUIRED
NTSYSAPI BOOLEAN NTAPI RtlPrefixUnicodeString(IN PUNICODE_STRING String1, IN PUNICODE_STRING String2, IN BOOLEAN CaseInSensitive)
#define FILE_REMOVABLE_MEDIA
#define UNREFERENCED_PARAMETER(P)
#define IsFTPartition(PartitionType)
#define IOCTL_DISK_GET_PARTITION_INFO
_In_ ULONG _In_ ULONG Offset
_In_ ULONG _In_ ULONG _In_ ULONG Length
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile(IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile(IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
NTSTATUS NTAPI IoGetDeviceObjectPointer(IN PUNICODE_STRING ObjectName, IN ACCESS_MASK DesiredAccess, OUT PFILE_OBJECT *FileObject, OUT PDEVICE_OBJECT *DeviceObject)
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
#define IoCompleteRequest
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
VOID NTAPI IoAcquireCancelSpinLock(OUT PKIRQL Irql)
VOID NTAPI PsSetThreadHardErrorsAreDisabled(IN PETHREAD Thread, IN BOOLEAN HardErrorsAreDisabled)
BOOLEAN NTAPI PsGetThreadHardErrorsAreDisabled(IN PETHREAD Thread)
NTSTATUS NTAPI ObQueryNameString(IN PVOID Object, OUT POBJECT_NAME_INFORMATION ObjectNameInfo, IN ULONG Length, OUT PULONG ReturnLength)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
#define FSCTL_GET_REPARSE_POINT
#define FILE_DEVICE_VIRTUAL_DISK
LONG NTAPI KeReleaseSemaphore(IN PKSEMAPHORE Semaphore, IN KPRIORITY Increment, IN LONG Adjustment, IN BOOLEAN Wait)
#define STATUS_BUFFER_OVERFLOW
base of all file and directory entries
LIST_ENTRY AssociatedDevicesEntry
PDEVICE_INFORMATION DeviceInformation
USHORT SymbolicNameLength
USHORT SymbolicNameOffset
PDEVICE_INFORMATION DeviceInformation
LIST_ENTRY DeviceInformationEntry
struct _LIST_ENTRY * Flink
MOUNTMGR_MOUNT_POINT MountPoints[1]
ULONG NumberOfMountPoints
USHORT SymbolicLinkNameLength
ULONG SymbolicLinkNameOffset
MOUNTMGR_AUTO_MOUNT_STATE CurrentState
MOUNTMGR_AUTO_MOUNT_STATE NewState
USHORT SourceVolumeNameOffset
USHORT TargetVolumeNameLength
USHORT TargetVolumeNameOffset
USHORT SourceVolumeNameLength
PDEVICE_INFORMATION DeviceInformation
PDEVICE_EXTENSION DeviceExtension
struct _REPARSE_DATA_BUFFER::@312::@314 SymbolicLinkReparseBuffer
PRTL_QUERY_REGISTRY_ROUTINE QueryRoutine
unsigned short MaximumLength
PMOUNTDEV_UNIQUE_ID UniqueId
LIST_ENTRY ReplicatedUniqueIdsListEntry
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
#define RtlMoveMemory(Destination, Source, Length)
#define CONTAINING_RECORD(address, type, field)
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define STATUS_UNSUCCESSFUL
#define STATUS_INFO_LENGTH_MISMATCH
#define STATUS_INSUFFICIENT_RESOURCES
#define STATUS_OBJECT_NAME_NOT_FOUND
static int Link(const char **args)
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ WDFDEVICE AssociatedDevice
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
_In_ ULONG _In_ struct _SET_PARTITION_INFORMATION_EX * PartitionInfo
#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
#define ObDereferenceObject
_Inout_ PUNICODE_STRING LinkTarget