[Wine-patches] [1/5] Use DRIVE_REMOVABLE_DISK for removable devices which are not floppies.
Alexander Morozov
=?iso-8859-1?q?amorozov_=CE=C1_etersoft=2Eru?=
Ср Ноя 12 12:45:04 MSK 2008
Ветка eterhack, баг 2790
----------- следующая часть -----------
From 3fbe213c5ad173ac575226ce84a135c9f32874cd Mon Sep 17 00:00:00 2001
From: Alexander Morozov <amorozov на etersoft.ru>
Date: Fri, 7 Nov 2008 18:18:24 +0300
Subject: [PATCH] Use DRIVE_REMOVABLE_DISK for removable devices which are not floppies.
---
dlls/kernel32/volume.c | 8 ++++++--
dlls/mountmgr.sys/device.c | 3 ++-
dlls/mountmgr.sys/hal.c | 3 ++-
include/ddk/mountmgr.h | 2 ++
4 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/dlls/kernel32/volume.c b/dlls/kernel32/volume.c
index 7dc046f..18749a4 100644
--- a/dlls/kernel32/volume.c
+++ b/dlls/kernel32/volume.c
@@ -73,7 +73,8 @@ static const WCHAR drive_types[][8] =
{'h','d',0}, /* DRIVE_FIXED */
{'n','e','t','w','o','r','k',0}, /* DRIVE_REMOTE */
{'c','d','r','o','m',0}, /* DRIVE_CDROM */
- {'r','a','m','d','i','s','k',0} /* DRIVE_RAMDISK */
+ {'r','a','m','d','i','s','k',0}, /* DRIVE_RAMDISK */
+ {'r','e','m',0} /* DRIVE_REMOVABLE_DISK */
};
/* read a Unix symlink; returned buffer must be freed by caller */
@@ -280,7 +281,10 @@ static UINT get_registry_drive_type( const WCHAR *root )
{
if (!strcmpiW( data, drive_types[i] ))
{
- ret = i;
+ if (i <= DRIVE_RAMDISK)
+ ret = i;
+ else
+ ret = DRIVE_REMOVABLE;
break;
}
}
diff --git a/dlls/mountmgr.sys/device.c b/dlls/mountmgr.sys/device.c
index a0e7cf0..a448f56 100644
--- a/dlls/mountmgr.sys/device.c
+++ b/dlls/mountmgr.sys/device.c
@@ -51,7 +51,8 @@ static const WCHAR drive_types[][8] =
{'h','d',0}, /* DRIVE_FIXED */
{'n','e','t','w','o','r','k',0}, /* DRIVE_REMOTE */
{'c','d','r','o','m',0}, /* DRIVE_CDROM */
- {'r','a','m','d','i','s','k',0} /* DRIVE_RAMDISK */
+ {'r','a','m','d','i','s','k',0}, /* DRIVE_RAMDISK */
+ {'r','e','m',0} /* DRIVE_REMOVABLE_DISK */
};
static const WCHAR drives_keyW[] = {'S','o','f','t','w','a','r','e','\\',
diff --git a/dlls/mountmgr.sys/hal.c b/dlls/mountmgr.sys/hal.c
index e1d3da1..d26f52d 100644
--- a/dlls/mountmgr.sys/hal.c
+++ b/dlls/mountmgr.sys/hal.c
@@ -133,7 +133,8 @@ static void new_device( LibHalContext *ctx, const char *udi )
p_dbus_error_free( &error ); /* ignore error */
if (type && !strcmp( type, "cdrom" )) drive_type = DRIVE_CDROM;
- else drive_type = DRIVE_REMOVABLE; /* FIXME: default to removable */
+ else if (!strcmp( type, "floppy" )) drive_type = DRIVE_REMOVABLE;
+ else drive_type = DRIVE_REMOVABLE_DISK; /* FIXME: default to removable */
add_dos_device( -1, udi, device, mount_point, drive_type );
diff --git a/include/ddk/mountmgr.h b/include/ddk/mountmgr.h
index f0e836f..b9eaaec 100644
--- a/include/ddk/mountmgr.h
+++ b/include/ddk/mountmgr.h
@@ -52,6 +52,8 @@ static const WCHAR MOUNTMGR_DOS_DEVICE_NAME[] = {'\\','\\','.','\\','M','o','u',
/* Wine extensions */
#ifdef WINE_MOUNTMGR_EXTENSIONS
+#define DRIVE_REMOVABLE_DISK 7
+
#define IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 32, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
#define IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 33, METHOD_BUFFERED, FILE_READ_ACCESS)
--
1.5.6.5.GIT
Подробная информация о списке рассылки Wine-patches