153#define AllocatePool(Size) ExAllocatePoolWithTag(PagedPool, Size, 'AtnM')
154#define FreePool(P) ExFreePoolWithTag(P, 'AtnM')
157#define MAX(a, b) ((a > b) ? a : b)
159#define LETTER_POSITION 0xC
160#define COLON_POSITION 0xD
161#define DRIVE_LETTER_LENGTH 0x1C
184MountMgrSendSyncDeviceIoCtl(
471 IN BOOLEAN UseOnlyIfThereAreNoOtherLinks,
_In_ PFCB _In_ LONGLONG StartingOffset
static const WCHAR SymbolicLink[]
#define _IRQL_requires_(irql)
_Must_inspect_result_ _Inout_opt_ PUNICODE_STRING VolumeName
_Inout_opt_ PUNICODE_STRING Extension
NTSTATUS QuerySymbolicLinkNamesFromStorage(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation, IN PUNICODE_STRING SuggestedLinkName, IN BOOLEAN UseOnlyIfThereAreNoOtherLinks, OUT PUNICODE_STRING *SymLinks, OUT PULONG SymLinkCount, IN BOOLEAN HasGuid, IN LPGUID Guid)
NTSTATUS CloseRemoteDatabase(IN HANDLE Database)
struct _RECONCILE_WORK_ITEM_CONTEXT * PRECONCILE_WORK_ITEM_CONTEXT
struct _RECONCILE_WORK_ITEM * PRECONCILE_WORK_ITEM
VOID SendLinkCreated(IN PUNICODE_STRING SymbolicName)
struct _DEVICE_INFORMATION DEVICE_INFORMATION
NTSTATUS DeleteRemoteDatabaseEntry(IN HANDLE Database, IN LONG StartingOffset)
VOID SendOnlineNotification(IN PUNICODE_STRING SymbolicName)
NTSTATUS GlobalCreateSymbolicLink(IN PUNICODE_STRING DosName, IN PUNICODE_STRING DeviceName)
struct _SAVED_LINK_INFORMATION SAVED_LINK_INFORMATION
UNICODE_STRING SafeVolumes
NTSTATUS GlobalDeleteSymbolicLink(IN PUNICODE_STRING DosName)
NTSTATUS WaitForRemoteDatabaseSemaphore(IN PDEVICE_EXTENSION DeviceExtension)
struct _UNIQUE_ID_REPLICATE * PUNIQUE_ID_REPLICATE
NTSTATUS MountMgrQuerySymbolicLink(IN PUNICODE_STRING SymbolicName, IN OUT PUNICODE_STRING LinkTarget)
struct _DEVICE_EXTENSION DEVICE_EXTENSION
NTSTATUS QueryDeviceInformation(_In_ PUNICODE_STRING SymbolicName, _Out_opt_ PUNICODE_STRING DeviceName, _Out_opt_ PMOUNTDEV_UNIQUE_ID *UniqueId, _Out_opt_ PBOOLEAN Removable, _Out_opt_ PBOOLEAN GptDriveLetter, _Out_opt_ PBOOLEAN HasGuid, _Inout_opt_ LPGUID StableGuid, _Out_opt_ PBOOLEAN IsFT)
VOID ReconcileThisDatabaseWithMaster(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation)
VOID DeleteRegistryDriveLetter(IN PMOUNTDEV_UNIQUE_ID UniqueId)
VOID MountMgrMountedDeviceRemoval(IN PDEVICE_EXTENSION Extension, IN PUNICODE_STRING DeviceName)
struct _RECONCILE_WORK_ITEM_CONTEXT RECONCILE_WORK_ITEM_CONTEXT
DRIVER_DISPATCH MountMgrDeviceControl
UNICODE_STRING DeviceFloppy
UNICODE_STRING DosDevicesMount
UNICODE_STRING ReparseIndex
DRIVER_INITIALIZE DriverEntry
struct _MIGRATE_WORK_ITEM * PMIGRATE_WORK_ITEM
struct _SYMLINK_INFORMATION * PSYMLINK_INFORMATION
struct _DATABASE_ENTRY DATABASE_ENTRY
VOID NTAPI ReconcileThisDatabaseWithMasterWorker(IN PVOID Parameter)
struct _DATABASE_ENTRY * PDATABASE_ENTRY
struct _UNIQUE_ID_WORK_ITEM * PUNIQUE_ID_WORK_ITEM
NTSTATUS FindDeviceInfo(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName, IN BOOLEAN DeviceNameGiven, OUT PDEVICE_INFORMATION *DeviceInformation)
struct _UNIQUE_ID_WORK_ITEM UNIQUE_ID_WORK_ITEM
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)
struct _UNIQUE_ID_REPLICATE UNIQUE_ID_REPLICATE
VOID UpdateReplicatedUniqueIds(IN PDEVICE_INFORMATION DeviceInformation, IN PDATABASE_ENTRY DatabaseEntry)
VOID DeleteNoDriveLetterEntry(IN PMOUNTDEV_UNIQUE_ID UniqueId)
VOID ReleaseRemoteDatabaseSemaphore(IN PDEVICE_EXTENSION DeviceExtension)
NTSTATUS AddRemoteDatabaseEntry(IN HANDLE Database, IN PDATABASE_ENTRY Entry)
UNICODE_STRING DeviceMount
PDEVICE_OBJECT gdeviceObject
NTSTATUS CreateNewVolumeName(OUT PUNICODE_STRING VolumeName, IN PGUID VolumeGuid OPTIONAL)
UNICODE_STRING DeviceCdRom
struct _DEVICE_INFORMATION_ENTRY * PDEVICE_INFORMATION_ENTRY
VOID RegisterForTargetDeviceNotification(IN PDEVICE_EXTENSION DeviceExtension, IN PDEVICE_INFORMATION DeviceInformation)
NTSTATUS QueryPointsFromSymbolicLinkName(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicName, IN PIRP Irp)
VOID NTAPI MountMgrCancel(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
struct _MIGRATE_WORK_ITEM MIGRATE_WORK_ITEM
struct _DEVICE_INFORMATION * PDEVICE_INFORMATION
VOID IssueUniqueIdChangeNotify(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING DeviceName, IN PMOUNTDEV_UNIQUE_ID UniqueId)
NTSTATUS WriteRemoteDatabaseEntry(IN HANDLE Database, IN LONG Offset, IN PDATABASE_ENTRY Entry)
NTSTATUS QuerySuggestedLinkName(IN PUNICODE_STRING SymbolicName, OUT PUNICODE_STRING SuggestedLinkName, OUT PBOOLEAN UseOnlyIfThereAreNoOtherLinks)
VOID MountMgrNotify(IN PDEVICE_EXTENSION DeviceExtension)
BOOLEAN IsUniqueIdPresent(IN PDEVICE_EXTENSION DeviceExtension, IN PDATABASE_ENTRY DatabaseEntry)
struct _DEVICE_INFORMATION_ENTRY DEVICE_INFORMATION_ENTRY
VOID ReconcileAllDatabasesWithMaster(IN PDEVICE_EXTENSION DeviceExtension)
VOID IssueUniqueIdChangeNotifyWorker(IN PUNIQUE_ID_WORK_ITEM WorkItem, IN PMOUNTDEV_UNIQUE_ID UniqueId)
VOID WaitForOnlinesToComplete(IN PDEVICE_EXTENSION DeviceExtension)
struct _ONLINE_NOTIFICATION_WORK_ITEM ONLINE_NOTIFICATION_WORK_ITEM
struct _DEVICE_EXTENSION * PDEVICE_EXTENSION
HANDLE OpenRemoteDatabase(IN PDEVICE_INFORMATION DeviceInformation, IN BOOLEAN MigrateDatabase)
VOID MountMgrFreeDeadDeviceInfo(IN PDEVICE_INFORMATION DeviceInformation)
PSAVED_LINK_INFORMATION RemoveSavedLinks(IN PDEVICE_EXTENSION DeviceExtension, IN PMOUNTDEV_UNIQUE_ID UniqueId)
struct _SAVED_LINK_INFORMATION * PSAVED_LINK_INFORMATION
PDATABASE_ENTRY GetRemoteDatabaseEntry(IN HANDLE Database, IN LONG StartingOffset)
VOID ChangeRemoteDatabaseUniqueId(IN PDEVICE_INFORMATION DeviceInformation, IN PMOUNTDEV_UNIQUE_ID OldUniqueId, IN PMOUNTDEV_UNIQUE_ID NewUniqueId)
VOID DeleteSymbolicLinkNameFromMemory(IN PDEVICE_EXTENSION DeviceExtension, IN PUNICODE_STRING SymbolicLink, IN BOOLEAN MarkOffline)
VOID MountMgrUniqueIdChangeRoutine(IN PDEVICE_EXTENSION DeviceExtension, IN PMOUNTDEV_UNIQUE_ID OldUniqueId, IN PMOUNTDEV_UNIQUE_ID NewUniqueId)
struct _ASSOCIATED_DEVICE_ENTRY ASSOCIATED_DEVICE_ENTRY
VOID DeleteFromLocalDatabase(IN PUNICODE_STRING SymbolicLink, IN PMOUNTDEV_UNIQUE_ID UniqueId)
NTSTATUS QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension, IN PIRP Irp, IN PMOUNTDEV_UNIQUE_ID UniqueId OPTIONAL, IN PUNICODE_STRING SymbolicName OPTIONAL)
struct _ASSOCIATED_DEVICE_ENTRY * PASSOCIATED_DEVICE_ENTRY
BOOLEAN HasDriveLetter(IN PDEVICE_INFORMATION DeviceInformation)
struct _ONLINE_NOTIFICATION_WORK_ITEM * PONLINE_NOTIFICATION_WORK_ITEM
UNICODE_STRING DosDevices
struct _RECONCILE_WORK_ITEM RECONCILE_WORK_ITEM
NTSTATUS QueryVolumeName(IN HANDLE RootDirectory, IN PFILE_REPARSE_POINT_INFORMATION ReparsePointInformation, IN PUNICODE_STRING FileName OPTIONAL, OUT PUNICODE_STRING SymbolicName, OUT PUNICODE_STRING VolumeName)
struct _SYMLINK_INFORMATION SYMLINK_INFORMATION
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)
BOOLEAN RedirectSavedLink(IN PSAVED_LINK_INFORMATION SavedLinkInformation, IN PUNICODE_STRING DosName, IN PUNICODE_STRING NewLink)
#define _In_reads_bytes_opt_(size)
#define _Out_writes_bytes_opt_(size)
_In_ PNDIS_STRING _In_ PNDIS_STRING SymbolicName
DRIVER_DISPATCH(nfs41_FsdDispatch)
_In_ ULONG _In_ ULONG Offset
PULONG MinorVersion OPTIONAL
base of all file and directory entries
LIST_ENTRY AssociatedDevicesEntry
PDEVICE_INFORMATION DeviceInformation
USHORT SymbolicNameLength
USHORT SymbolicNameOffset
KSEMAPHORE WorkerSemaphore
ULONG OnlineNotificationCount
PDEVICE_OBJECT DeviceObject
PDRIVER_OBJECT DriverObject
KSEMAPHORE RemoteDatabaseLock
LIST_ENTRY OfflineDeviceListHead
PMOUNTDEV_UNIQUE_ID DriveLetterData
ULONG OnlineNotificationWorkerActive
BOOLEAN AutomaticDriveLetter
LIST_ENTRY OnlineNotificationListHead
UNICODE_STRING RegistryPath
KEVENT OnlineNotificationEvent
LIST_ENTRY UniqueIdWorkerItemListHead
LIST_ENTRY WorkerQueueListHead
BOOLEAN ProcessedSuggestions
LIST_ENTRY DeviceListHead
LIST_ENTRY SavedLinksListHead
PDEVICE_INFORMATION DeviceInformation
LIST_ENTRY DeviceInformationEntry
PDEVICE_INFORMATION DeviceInformation
PDEVICE_EXTENSION DeviceExtension
UNICODE_STRING SymbolicName
PDEVICE_INFORMATION DeviceInformation
PDEVICE_EXTENSION DeviceExtension
RECONCILE_WORK_ITEM_CONTEXT
PWORKER_THREAD_ROUTINE WorkerRoutine
LIST_ENTRY WorkerQueueListEntry
PMOUNTDEV_UNIQUE_ID UniqueId
LIST_ENTRY ReplicatedUniqueIdsListEntry
LIST_ENTRY UniqueIdWorkerItemListEntry
UNICODE_STRING DeviceName
PDEVICE_EXTENSION DeviceExtension
_In_ PDEVICE_OBJECT DeviceObject
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING SymbolicLinkName
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_opt_ PCUNICODE_STRING DeviceName
_In_ WDFREQUEST _In_ size_t _In_ size_t _In_ ULONG IoControlCode
_In_ WDFREQUEST _In_ size_t OutputBufferLength
_In_ WDFREQUEST _In_ size_t _In_ size_t InputBufferLength
_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
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
_Must_inspect_result_ _In_ PWDF_WORKITEM_CONFIG _In_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWORKITEM * WorkItem
WORKER_THREAD_ROUTINE * PWORKER_THREAD_ROUTINE
_Out_ PUNICODE_STRING DosName
_Inout_opt_ PVOID Parameter
_Inout_ PUNICODE_STRING LinkTarget