Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a28a3876
Commit
a28a3876
authored
Oct 15, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Specify the drive type as a DWORD instead of a string.
parent
f1511803
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
14 deletions
+35
-14
device.c
dlls/mountmgr.sys/device.c
+27
-10
diskarb.c
dlls/mountmgr.sys/diskarb.c
+2
-2
hal.c
dlls/mountmgr.sys/hal.c
+5
-1
mountmgr.h
dlls/mountmgr.sys/mountmgr.h
+1
-1
No files found.
dlls/mountmgr.sys/device.c
View file @
a28a3876
...
...
@@ -35,10 +35,22 @@
#include "wine/library.h"
#include "wine/list.h"
#include "wine/unicode.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mountmgr
);
static
const
WCHAR
drive_types
[][
8
]
=
{
{
0
},
/* DRIVE_UNKNOWN */
{
0
},
/* DRIVE_NO_ROOT_DIR */
{
'f'
,
'l'
,
'o'
,
'p'
,
'p'
,
'y'
,
0
},
/* DRIVE_REMOVABLE */
{
'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 */
};
struct
dos_drive
{
struct
list
entry
;
...
...
@@ -87,7 +99,7 @@ static inline int is_valid_device( struct stat *st )
}
/* find or create a DOS drive for the corresponding device */
static
int
add_drive
(
const
char
*
device
,
const
char
*
type
)
static
int
add_drive
(
const
char
*
device
,
DWORD
type
)
{
char
*
path
,
*
p
;
char
in_use
[
26
];
...
...
@@ -103,7 +115,7 @@ static int add_drive( const char *device, const char *type )
first
=
2
;
last
=
26
;
if
(
type
&&
!
strcmp
(
type
,
"floppy"
)
)
if
(
type
==
DRIVE_REMOVABLE
)
{
first
=
0
;
last
=
2
;
...
...
@@ -186,7 +198,7 @@ static BOOL set_mount_point( struct dos_drive *drive, const char *mount_point )
}
BOOL
add_dos_device
(
const
char
*
udi
,
const
char
*
device
,
const
char
*
mount_point
,
const
char
*
type
)
const
char
*
mount_point
,
DWORD
type
)
{
struct
dos_drive
*
drive
;
...
...
@@ -213,17 +225,22 @@ found:
set_mount_point
(
drive
,
mount_point
);
TRACE
(
"added device %c: udi %s for %s on %s type %
s
\n
"
,
TRACE
(
"added device %c: udi %s for %s on %s type %
u
\n
"
,
'a'
+
drive
->
drive
,
wine_dbgstr_a
(
udi
),
wine_dbgstr_a
(
device
),
wine_dbgstr_a
(
mount_point
),
wine_dbgstr_a
(
type
)
);
wine_dbgstr_a
(
mount_point
),
type
);
/* hack: force the drive type in the registry */
if
(
!
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Drives"
,
&
hkey
))
{
char
name
[
3
]
=
"a:"
;
const
WCHAR
*
type_name
=
drive_types
[
type
];
WCHAR
name
[
3
]
=
{
'a'
,
':'
,
0
};
name
[
0
]
+=
drive
->
drive
;
if
(
!
type
||
strcmp
(
type
,
"cdrom"
))
type
=
"floppy"
;
/* FIXME: default to floppy */
RegSetValueExA
(
hkey
,
name
,
0
,
REG_SZ
,
(
const
BYTE
*
)
type
,
strlen
(
type
)
+
1
);
if
(
type_name
[
0
])
RegSetValueExW
(
hkey
,
name
,
0
,
REG_SZ
,
(
const
BYTE
*
)
type_name
,
(
strlenW
(
type_name
)
+
1
)
*
sizeof
(
WCHAR
)
);
else
RegDeleteValueW
(
hkey
,
name
);
RegCloseKey
(
hkey
);
}
...
...
@@ -248,9 +265,9 @@ BOOL remove_dos_device( const char *udi )
/* clear the registry key too */
if
(
!
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"Software
\\
Wine
\\
Drives"
,
&
hkey
))
{
char
name
[
3
]
=
"a:"
;
WCHAR
name
[
3
]
=
{
'a'
,
':'
,
0
}
;
name
[
0
]
+=
drive
->
drive
;
RegDeleteValue
A
(
hkey
,
name
);
RegDeleteValue
W
(
hkey
,
name
);
RegCloseKey
(
hkey
);
}
...
...
dlls/mountmgr.sys/diskarb.c
View file @
a28a3876
...
...
@@ -47,7 +47,7 @@ static void appeared_callback( DADiskRef disk, void *context )
const
void
*
ref
;
char
device
[
64
];
char
mount_point
[
PATH_MAX
];
const
char
*
type
=
NULL
;
DWORD
type
=
DRIVE_UNKNOWN
;
if
(
!
dict
)
return
;
...
...
@@ -69,7 +69,7 @@ static void appeared_callback( DADiskRef disk, void *context )
{
if
(
!
CFStringCompare
(
ref
,
CFSTR
(
"cd9660"
),
0
)
||
!
CFStringCompare
(
ref
,
CFSTR
(
"udf"
),
0
))
type
=
"cdrom"
;
type
=
DRIVE_CDROM
;
}
TRACE
(
"got mount notification for '%s' on '%s'
\n
"
,
device
,
mount_point
);
...
...
dlls/mountmgr.sys/hal.c
View file @
a28a3876
...
...
@@ -117,6 +117,7 @@ static void new_device( LibHalContext *ctx, const char *udi )
char
*
mount_point
=
NULL
;
char
*
device
=
NULL
;
char
*
type
=
NULL
;
DWORD
drive_type
;
p_dbus_error_init
(
&
error
);
...
...
@@ -135,7 +136,10 @@ static void new_device( LibHalContext *ctx, const char *udi )
if
(
!
(
type
=
p_libhal_device_get_property_string
(
ctx
,
parent
,
"storage.drive_type"
,
&
error
)))
p_dbus_error_free
(
&
error
);
/* ignore error */
add_dos_device
(
udi
,
device
,
mount_point
,
type
);
if
(
type
&&
!
strcmp
(
type
,
"cdrom"
))
drive_type
=
DRIVE_CDROM
;
else
drive_type
=
DRIVE_REMOVABLE
;
/* FIXME: default to removable */
add_dos_device
(
udi
,
device
,
mount_point
,
drive_type
);
/* add property watch for mount point */
p_libhal_device_add_property_watch
(
ctx
,
udi
,
&
error
);
...
...
dlls/mountmgr.sys/mountmgr.h
View file @
a28a3876
...
...
@@ -21,5 +21,5 @@
extern
void
initialize_hal
(
void
);
extern
void
initialize_diskarbitration
(
void
);
extern
BOOL
add_dos_device
(
const
char
*
udi
,
const
char
*
device
,
const
char
*
mount_point
,
const
char
*
type
);
const
char
*
mount_point
,
DWORD
type
);
extern
BOOL
remove_dos_device
(
const
char
*
udi
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment