Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
968161e1
Commit
968161e1
authored
Jul 22, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Set the drive letter at creation time.
parent
6880b4d1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
28 deletions
+25
-28
device.c
dlls/mountmgr.sys/device.c
+25
-28
No files found.
dlls/mountmgr.sys/device.c
View file @
968161e1
...
@@ -337,13 +337,14 @@ static void delete_volume( struct volume *volume )
...
@@ -337,13 +337,14 @@ static void delete_volume( struct volume *volume )
}
}
/* create the disk device for a given volume */
/* create the disk device for a given volume */
static
NTSTATUS
create_dos_device
(
const
char
*
udi
,
enum
device_type
type
,
struct
dos_drive
**
drive_ret
)
static
NTSTATUS
create_dos_device
(
const
char
*
udi
,
int
letter
,
enum
device_type
type
,
struct
dos_drive
**
drive_ret
)
{
{
struct
dos_drive
*
drive
;
struct
dos_drive
*
drive
;
NTSTATUS
status
;
NTSTATUS
status
;
if
(
!
(
drive
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
drive
)
)))
return
STATUS_NO_MEMORY
;
if
(
!
(
drive
=
RtlAllocateHeap
(
GetProcessHeap
(),
0
,
sizeof
(
*
drive
)
)))
return
STATUS_NO_MEMORY
;
drive
->
drive
=
-
1
;
drive
->
drive
=
letter
;
drive
->
mount
=
NULL
;
drive
->
mount
=
NULL
;
if
(
!
(
status
=
create_volume
(
udi
,
type
,
&
drive
->
volume
)))
if
(
!
(
status
=
create_volume
(
udi
,
type
,
&
drive
->
volume
)))
...
@@ -562,9 +563,8 @@ static void create_drive_devices(void)
...
@@ -562,9 +563,8 @@ static void create_drive_devices(void)
}
}
}
}
if
(
!
create_dos_device
(
NULL
,
drive_type
,
&
drive
))
if
(
!
create_dos_device
(
NULL
,
i
,
drive_type
,
&
drive
))
{
{
drive
->
drive
=
i
;
set_volume_info
(
drive
->
volume
,
drive
,
device
,
link
,
drive_type
,
get_default_uuid
(
i
)
);
set_volume_info
(
drive
->
volume
,
drive
,
device
,
link
,
drive_type
,
get_default_uuid
(
i
)
);
}
}
else
else
...
@@ -616,6 +616,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
...
@@ -616,6 +616,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
const
char
*
mount_point
,
enum
device_type
type
,
const
GUID
*
guid
)
const
char
*
mount_point
,
enum
device_type
type
,
const
GUID
*
guid
)
{
{
char
*
path
,
*
p
;
char
*
path
,
*
p
;
HKEY
hkey
;
NTSTATUS
status
=
STATUS_SUCCESS
;
NTSTATUS
status
=
STATUS_SUCCESS
;
struct
dos_drive
*
drive
,
*
next
;
struct
dos_drive
*
drive
,
*
next
;
...
@@ -647,7 +648,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
...
@@ -647,7 +648,7 @@ NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
if
(
drive
->
drive
==
letter
)
delete_dos_device
(
drive
);
if
(
drive
->
drive
==
letter
)
delete_dos_device
(
drive
);
}
}
if
((
status
=
create_dos_device
(
udi
,
type
,
&
drive
)))
goto
done
;
if
((
status
=
create_dos_device
(
udi
,
letter
,
type
,
&
drive
)))
goto
done
;
found:
found:
if
(
!
guid
)
guid
=
get_default_uuid
(
letter
);
if
(
!
guid
)
guid
=
get_default_uuid
(
letter
);
...
@@ -657,32 +658,28 @@ found:
...
@@ -657,32 +658,28 @@ found:
set_drive_letter
(
drive
,
letter
);
set_drive_letter
(
drive
,
letter
);
set_volume_info
(
drive
->
volume
,
drive
,
device
,
mount_point
,
type
,
guid
);
set_volume_info
(
drive
->
volume
,
drive
,
device
,
mount_point
,
type
,
guid
);
if
(
drive
->
drive
!=
-
1
)
TRACE
(
"added device %c: udi %s for %s on %s type %u
\n
"
,
{
'a'
+
drive
->
drive
,
wine_dbgstr_a
(
udi
),
wine_dbgstr_a
(
device
),
HKEY
hkey
;
wine_dbgstr_a
(
mount_point
),
type
);
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
),
type
);
/* hack: force the drive type in the registry */
/* hack: force the drive type in the registry */
if
(
!
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
drives_keyW
,
&
hkey
))
if
(
!
RegCreateKeyW
(
HKEY_LOCAL_MACHINE
,
drives_keyW
,
&
hkey
))
{
{
const
WCHAR
*
type_name
=
drive_types
[
type
];
const
WCHAR
*
type_name
=
drive_types
[
type
];
WCHAR
name
[
3
]
=
{
'a'
,
':'
,
0
};
WCHAR
name
[
3
]
=
{
'a'
,
':'
,
0
};
name
[
0
]
+=
drive
->
drive
;
if
(
!
type_name
[
0
]
&&
type
==
DEVICE_HARDDISK
)
type_name
=
drive_types
[
DEVICE_FLOPPY
];
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
);
}
name
[
0
]
+=
drive
->
drive
;
if
(
udi
)
send_notify
(
drive
->
drive
,
DBT_DEVICEARRIVAL
);
if
(
!
type_name
[
0
]
&&
type
==
DEVICE_HARDDISK
)
type_name
=
drive_types
[
DEVICE_FLOPPY
];
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
);
}
if
(
udi
)
send_notify
(
drive
->
drive
,
DBT_DEVICEARRIVAL
);
}
done:
done:
RtlFreeHeap
(
GetProcessHeap
(),
0
,
path
);
RtlFreeHeap
(
GetProcessHeap
(),
0
,
path
);
return
status
;
return
status
;
...
...
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