[MOUNTMGR] Some cleanup

This commit is contained in:
Hermès Bélusca-Maïto 2024-05-26 15:42:45 +02:00
parent e47d08fc5a
commit 0d36818422
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -12,105 +12,105 @@
typedef struct _DEVICE_EXTENSION typedef struct _DEVICE_EXTENSION
{ {
PDEVICE_OBJECT DeviceObject; // 0x0 PDEVICE_OBJECT DeviceObject;
PDRIVER_OBJECT DriverObject; // 0x4 PDRIVER_OBJECT DriverObject;
LIST_ENTRY DeviceListHead; // 0x8 LIST_ENTRY DeviceListHead;
LIST_ENTRY OfflineDeviceListHead; // 0x10 LIST_ENTRY OfflineDeviceListHead;
PVOID NotificationEntry; // 0x18 PVOID NotificationEntry;
KSEMAPHORE DeviceLock; // 0x1C KSEMAPHORE DeviceLock;
KSEMAPHORE RemoteDatabaseLock; // 0x30 KSEMAPHORE RemoteDatabaseLock;
ULONG AutomaticDriveLetter; // 0x44 ULONG AutomaticDriveLetter;
LIST_ENTRY IrpListHead; // 0x48 LIST_ENTRY IrpListHead;
ULONG EpicNumber; // 0x50 ULONG EpicNumber;
LIST_ENTRY SavedLinksListHead; // 0x54 LIST_ENTRY SavedLinksListHead;
BOOLEAN ProcessedSuggestions; // 0x5C BOOLEAN ProcessedSuggestions;
BOOLEAN NoAutoMount; // 0x5D BOOLEAN NoAutoMount;
LIST_ENTRY WorkerQueueListHead; // 0x60 LIST_ENTRY WorkerQueueListHead;
KSEMAPHORE WorkerSemaphore; // 0x68 KSEMAPHORE WorkerSemaphore;
LONG WorkerReferences; // 0x7C LONG WorkerReferences;
KSPIN_LOCK WorkerLock; // 0x80 KSPIN_LOCK WorkerLock;
LIST_ENTRY UniqueIdWorkerItemListHead; // 0x84 LIST_ENTRY UniqueIdWorkerItemListHead;
PMOUNTDEV_UNIQUE_ID DriveLetterData; // 0x8C PMOUNTDEV_UNIQUE_ID DriveLetterData;
UNICODE_STRING RegistryPath; // 0x90 UNICODE_STRING RegistryPath;
LONG WorkerThreadStatus; // 0x98 LONG WorkerThreadStatus;
LIST_ENTRY OnlineNotificationListHead; // 0x9C LIST_ENTRY OnlineNotificationListHead;
ULONG OnlineNotificationWorkerActive; // 0xA4 ULONG OnlineNotificationWorkerActive;
ULONG OnlineNotificationCount; // 0xA8 ULONG OnlineNotificationCount;
KEVENT OnlineNotificationEvent; // 0xAC KEVENT OnlineNotificationEvent;
} DEVICE_EXTENSION, *PDEVICE_EXTENSION; // 0xBC } DEVICE_EXTENSION, *PDEVICE_EXTENSION;
typedef struct _DEVICE_INFORMATION typedef struct _DEVICE_INFORMATION
{ {
LIST_ENTRY DeviceListEntry; // 0x00 LIST_ENTRY DeviceListEntry;
LIST_ENTRY SymbolicLinksListHead; // 0x08 LIST_ENTRY SymbolicLinksListHead;
LIST_ENTRY ReplicatedUniqueIdsListHead; // 0x10 LIST_ENTRY ReplicatedUniqueIdsListHead;
LIST_ENTRY AssociatedDevicesHead; // 0x18 LIST_ENTRY AssociatedDevicesHead;
UNICODE_STRING SymbolicName; // 0x20 UNICODE_STRING SymbolicName;
PMOUNTDEV_UNIQUE_ID UniqueId; // 0x28 PMOUNTDEV_UNIQUE_ID UniqueId;
UNICODE_STRING DeviceName; // 0x2C UNICODE_STRING DeviceName;
BOOLEAN KeepLinks; // 0x34 BOOLEAN KeepLinks;
UCHAR SuggestedDriveLetter; // 0x35 UCHAR SuggestedDriveLetter;
BOOLEAN ManuallyRegistered; // 0x36 BOOLEAN ManuallyRegistered;
BOOLEAN Removable; // 0x37 BOOLEAN Removable;
BOOLEAN LetterAssigned; // 0x38 BOOLEAN LetterAssigned;
BOOLEAN NeedsReconcile; // 0x39 BOOLEAN NeedsReconcile;
BOOLEAN NoDatabase; // 0x3A BOOLEAN NoDatabase;
BOOLEAN SkipNotifications; // 0x3B BOOLEAN SkipNotifications;
ULONG Migrated; // 0x3C ULONG Migrated;
LONG MountState; // 0x40 LONG MountState;
PVOID TargetDeviceNotificationEntry; // 0x44 PVOID TargetDeviceNotificationEntry;
PDEVICE_EXTENSION DeviceExtension; // 0x48 PDEVICE_EXTENSION DeviceExtension;
} DEVICE_INFORMATION, *PDEVICE_INFORMATION; // 0x4C } DEVICE_INFORMATION, *PDEVICE_INFORMATION;
typedef struct _SYMLINK_INFORMATION typedef struct _SYMLINK_INFORMATION
{ {
LIST_ENTRY SymbolicLinksListEntry; // 0x00 LIST_ENTRY SymbolicLinksListEntry;
UNICODE_STRING Name; // 0x08 UNICODE_STRING Name;
BOOLEAN Online; // 0x10 BOOLEAN Online;
} SYMLINK_INFORMATION, *PSYMLINK_INFORMATION; // 0x14 } SYMLINK_INFORMATION, *PSYMLINK_INFORMATION;
typedef struct _SAVED_LINK_INFORMATION typedef struct _SAVED_LINK_INFORMATION
{ {
LIST_ENTRY SavedLinksListEntry; // 0x0 LIST_ENTRY SavedLinksListEntry;
LIST_ENTRY SymbolicLinksListHead; // 0x8 LIST_ENTRY SymbolicLinksListHead;
PMOUNTDEV_UNIQUE_ID UniqueId; // 0x10 PMOUNTDEV_UNIQUE_ID UniqueId;
} SAVED_LINK_INFORMATION, *PSAVED_LINK_INFORMATION; // 0x14 } SAVED_LINK_INFORMATION, *PSAVED_LINK_INFORMATION;
typedef struct _UNIQUE_ID_REPLICATE typedef struct _UNIQUE_ID_REPLICATE
{ {
LIST_ENTRY ReplicatedUniqueIdsListEntry; // 0x0 LIST_ENTRY ReplicatedUniqueIdsListEntry;
PMOUNTDEV_UNIQUE_ID UniqueId; // 0x8 PMOUNTDEV_UNIQUE_ID UniqueId;
} UNIQUE_ID_REPLICATE, *PUNIQUE_ID_REPLICATE; // 0xC } UNIQUE_ID_REPLICATE, *PUNIQUE_ID_REPLICATE;
typedef struct _DATABASE_ENTRY typedef struct _DATABASE_ENTRY
{ {
ULONG EntrySize; // 0x00 ULONG EntrySize;
ULONG EntryReferences; // 0x04 ULONG EntryReferences;
USHORT SymbolicNameOffset; // 0x08 USHORT SymbolicNameOffset;
USHORT SymbolicNameLength; // 0x0A USHORT SymbolicNameLength;
USHORT UniqueIdOffset; // 0x0C USHORT UniqueIdOffset;
USHORT UniqueIdLength; // 0x0E USHORT UniqueIdLength;
} DATABASE_ENTRY, *PDATABASE_ENTRY; // 0x10 } DATABASE_ENTRY, *PDATABASE_ENTRY;
typedef struct _ASSOCIATED_DEVICE_ENTRY typedef struct _ASSOCIATED_DEVICE_ENTRY
{ {
LIST_ENTRY AssociatedDevicesEntry; // 0x00 LIST_ENTRY AssociatedDevicesEntry;
PDEVICE_INFORMATION DeviceInformation; // 0x08 PDEVICE_INFORMATION DeviceInformation;
UNICODE_STRING String; // 0x0C UNICODE_STRING String;
} ASSOCIATED_DEVICE_ENTRY, *PASSOCIATED_DEVICE_ENTRY; // 0x14 } ASSOCIATED_DEVICE_ENTRY, *PASSOCIATED_DEVICE_ENTRY;
typedef struct _DEVICE_INFORMATION_ENTRY typedef struct _DEVICE_INFORMATION_ENTRY
{ {
LIST_ENTRY DeviceInformationEntry; // 0x00 LIST_ENTRY DeviceInformationEntry;
PDEVICE_INFORMATION DeviceInformation; // 0x08 PDEVICE_INFORMATION DeviceInformation;
} DEVICE_INFORMATION_ENTRY, *PDEVICE_INFORMATION_ENTRY; // 0x0C } DEVICE_INFORMATION_ENTRY, *PDEVICE_INFORMATION_ENTRY;
typedef struct _ONLINE_NOTIFICATION_WORK_ITEM typedef struct _ONLINE_NOTIFICATION_WORK_ITEM
{ {
WORK_QUEUE_ITEM WorkItem; // 0x00 WORK_QUEUE_ITEM WorkItem;
PDEVICE_EXTENSION DeviceExtension; // 0x10 PDEVICE_EXTENSION DeviceExtension;
UNICODE_STRING SymbolicName; // 0x14 UNICODE_STRING SymbolicName;
} ONLINE_NOTIFICATION_WORK_ITEM, *PONLINE_NOTIFICATION_WORK_ITEM; // 0x1C } ONLINE_NOTIFICATION_WORK_ITEM, *PONLINE_NOTIFICATION_WORK_ITEM;
typedef struct _RECONCILE_WORK_ITEM_CONTEXT typedef struct _RECONCILE_WORK_ITEM_CONTEXT
{ {
@ -120,34 +120,34 @@ typedef struct _RECONCILE_WORK_ITEM_CONTEXT
typedef struct _RECONCILE_WORK_ITEM typedef struct _RECONCILE_WORK_ITEM
{ {
LIST_ENTRY WorkerQueueListEntry; // 0x00 LIST_ENTRY WorkerQueueListEntry;
PIO_WORKITEM WorkItem; // 0x08 PIO_WORKITEM WorkItem;
PWORKER_THREAD_ROUTINE WorkerRoutine; // 0x0C PWORKER_THREAD_ROUTINE WorkerRoutine;
PVOID Context; // 0x10 PVOID Context;
RECONCILE_WORK_ITEM_CONTEXT; // 0x14 RECONCILE_WORK_ITEM_CONTEXT;
} RECONCILE_WORK_ITEM, *PRECONCILE_WORK_ITEM; // 0x1C } RECONCILE_WORK_ITEM, *PRECONCILE_WORK_ITEM;
typedef struct _MIGRATE_WORK_ITEM typedef struct _MIGRATE_WORK_ITEM
{ {
PIO_WORKITEM WorkItem; // 0x0 PIO_WORKITEM WorkItem;
PDEVICE_INFORMATION DeviceInformation; // 0x4 PDEVICE_INFORMATION DeviceInformation;
PKEVENT Event; // 0x8 PKEVENT Event;
NTSTATUS Status; // 0x0C NTSTATUS Status;
HANDLE Database; // 0x10 HANDLE Database;
} MIGRATE_WORK_ITEM, *PMIGRATE_WORK_ITEM; // 0x14 } MIGRATE_WORK_ITEM, *PMIGRATE_WORK_ITEM;
typedef struct _UNIQUE_ID_WORK_ITEM typedef struct _UNIQUE_ID_WORK_ITEM
{ {
LIST_ENTRY UniqueIdWorkerItemListEntry; // 0x0 LIST_ENTRY UniqueIdWorkerItemListEntry;
PIO_WORKITEM WorkItem; // 0x8 PIO_WORKITEM WorkItem;
PDEVICE_EXTENSION DeviceExtension; // 0xC PDEVICE_EXTENSION DeviceExtension;
PIRP Irp; // 0x10 PIRP Irp;
PVOID IrpBuffer; // 0x14 PVOID IrpBuffer;
PKEVENT Event; // 0x1C PKEVENT Event;
UNICODE_STRING DeviceName; // 0x20 UNICODE_STRING DeviceName;
ULONG IrpBufferLength; // 0x28 ULONG IrpBufferLength;
ULONG StackSize; // 0x2C ULONG StackSize;
} UNIQUE_ID_WORK_ITEM, *PUNIQUE_ID_WORK_ITEM; // 0x30 } UNIQUE_ID_WORK_ITEM, *PUNIQUE_ID_WORK_ITEM;
/* Memory allocation helpers */ /* Memory allocation helpers */
#define AllocatePool(Size) ExAllocatePoolWithTag(PagedPool, Size, 'AtnM') #define AllocatePool(Size) ExAllocatePoolWithTag(PagedPool, Size, 'AtnM')