2022-11-30 16:07:36 -08:00
|
|
|
From 281a1753e7a075b7b3bdbba2692a1da5bec081f3 Mon Sep 17 00:00:00 2001
|
2015-03-29 19:28:05 -07:00
|
|
|
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
|
|
|
Date: Mon, 30 Mar 2015 04:01:51 +0200
|
2019-11-19 15:28:28 -08:00
|
|
|
Subject: [PATCH] mountmgr.sys: Write usable device paths into
|
2015-03-29 19:28:05 -07:00
|
|
|
HKLM\SYSTEM\MountedDevices.
|
|
|
|
MIME-Version: 1.0
|
|
|
|
Content-Type: text/plain; charset=UTF-8
|
|
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
|
|
|
|
Based on a patch by Bernhard Übelacker.
|
|
|
|
---
|
|
|
|
dlls/mountmgr.sys/device.c | 4 ++--
|
|
|
|
dlls/mountmgr.sys/mountmgr.c | 11 +++++++++--
|
2021-07-07 18:16:34 -07:00
|
|
|
dlls/mountmgr.sys/mountmgr.h | 3 ++-
|
|
|
|
3 files changed, 13 insertions(+), 5 deletions(-)
|
2015-03-29 19:28:05 -07:00
|
|
|
|
|
|
|
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
|
2022-11-30 16:07:36 -08:00
|
|
|
index 8fd9dc0757e..f40f70b06d7 100644
|
2015-03-29 19:28:05 -07:00
|
|
|
--- a/dlls/mountmgr.sys/device.c
|
|
|
|
+++ b/dlls/mountmgr.sys/device.c
|
2022-11-30 16:07:36 -08:00
|
|
|
@@ -1045,8 +1045,8 @@ static NTSTATUS set_volume_info( struct volume *volume, struct dos_drive *drive,
|
2015-03-29 19:28:05 -07:00
|
|
|
id = disk_device->unix_mount;
|
|
|
|
id_len = strlen( disk_device->unix_mount ) + 1;
|
|
|
|
}
|
|
|
|
- if (volume->mount) set_mount_point_id( volume->mount, id, id_len );
|
|
|
|
- if (drive && drive->mount) set_mount_point_id( drive->mount, id, id_len );
|
|
|
|
+ if (volume->mount) set_mount_point_id( volume->mount, id, id_len, -1 );
|
|
|
|
+ if (drive && drive->mount) set_mount_point_id( drive->mount, id, id_len, drive->drive );
|
|
|
|
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
|
|
|
diff --git a/dlls/mountmgr.sys/mountmgr.c b/dlls/mountmgr.sys/mountmgr.c
|
2022-11-30 16:07:36 -08:00
|
|
|
index 9f72eedb33b..19cb71b4eb6 100644
|
2015-03-29 19:28:05 -07:00
|
|
|
--- a/dlls/mountmgr.sys/mountmgr.c
|
|
|
|
+++ b/dlls/mountmgr.sys/mountmgr.c
|
2022-11-24 15:43:01 -08:00
|
|
|
@@ -46,14 +46,21 @@ struct mount_point
|
|
|
|
static struct list mount_points_list = LIST_INIT(mount_points_list);
|
|
|
|
static HKEY mount_key;
|
2015-03-29 19:28:05 -07:00
|
|
|
|
|
|
|
-void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len )
|
|
|
|
+void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len, int drive )
|
|
|
|
{
|
|
|
|
+ WCHAR logicalW[] = {'\\','\\','.','\\','a',':',0};
|
2022-11-30 16:07:36 -08:00
|
|
|
free( mount->id );
|
2015-03-29 19:28:05 -07:00
|
|
|
mount->id_len = max( MIN_ID_LEN, id_len );
|
2022-11-30 16:07:36 -08:00
|
|
|
if ((mount->id = calloc( mount->id_len, 1 )))
|
2015-03-29 19:28:05 -07:00
|
|
|
{
|
|
|
|
memcpy( mount->id, id, id_len );
|
|
|
|
- RegSetValueExW( mount_key, mount->link.Buffer, 0, REG_BINARY, mount->id, mount->id_len );
|
|
|
|
+ if (drive < 0)
|
|
|
|
+ RegSetValueExW( mount_key, mount->link.Buffer, 0, REG_BINARY, mount->id, mount->id_len );
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ logicalW[4] = 'a' + drive;
|
|
|
|
+ RegSetValueExW( mount_key, mount->link.Buffer, 0, REG_BINARY, (BYTE*)logicalW, sizeof(logicalW) );
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
else mount->id_len = 0;
|
|
|
|
}
|
|
|
|
diff --git a/dlls/mountmgr.sys/mountmgr.h b/dlls/mountmgr.sys/mountmgr.h
|
2022-11-24 15:43:01 -08:00
|
|
|
index 143401e3b9b..bad875dd9bc 100644
|
2015-03-29 19:28:05 -07:00
|
|
|
--- a/dlls/mountmgr.sys/mountmgr.h
|
|
|
|
+++ b/dlls/mountmgr.sys/mountmgr.h
|
2022-11-24 15:43:01 -08:00
|
|
|
@@ -108,6 +108,7 @@ extern struct mount_point *add_dosdev_mount_point( DEVICE_OBJECT *device, UNICOD
|
2015-03-29 19:28:05 -07:00
|
|
|
extern struct mount_point *add_volume_mount_point( DEVICE_OBJECT *device, UNICODE_STRING *device_name,
|
|
|
|
const GUID *guid ) DECLSPEC_HIDDEN;
|
|
|
|
extern void delete_mount_point( struct mount_point *mount ) DECLSPEC_HIDDEN;
|
|
|
|
-extern void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len ) DECLSPEC_HIDDEN;
|
2021-07-07 18:16:34 -07:00
|
|
|
+
|
2015-03-29 19:28:05 -07:00
|
|
|
+extern void set_mount_point_id( struct mount_point *mount, const void *id, unsigned int id_len, int drive ) DECLSPEC_HIDDEN;
|
2021-07-07 18:16:34 -07:00
|
|
|
|
2021-11-26 22:36:06 -08:00
|
|
|
#endif /* __WINE_MOUNTMGR_H */
|
2015-03-29 19:28:05 -07:00
|
|
|
--
|
2022-11-24 15:43:01 -08:00
|
|
|
2.38.1
|
2015-03-29 19:28:05 -07:00
|
|
|
|