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
54f93b9b
Commit
54f93b9b
authored
Mar 27, 2020
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 06, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Allow querying a Unix device by device ID.
Signed-off-by:
Zebediah Figura
<
zfigura@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
cf174edf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
20 deletions
+64
-20
device.c
dlls/mountmgr.sys/device.c
+43
-12
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+12
-2
mountmgr.h
dlls/mountmgr.sys/mountmgr.h
+2
-0
mountmgr.h
include/ddk/mountmgr.h
+7
-6
No files found.
dlls/mountmgr.sys/device.c
View file @
54f93b9b
...
...
@@ -1617,6 +1617,18 @@ NTSTATUS remove_dos_device( int letter, const char *udi )
return
status
;
}
enum
mountmgr_fs_type
get_mountmgr_fs_type
(
enum
fs_type
fs_type
)
{
switch
(
fs_type
)
{
case
FS_ISO9660
:
return
MOUNTMGR_FS_TYPE_ISO9660
;
case
FS_UDF
:
return
MOUNTMGR_FS_TYPE_UDF
;
case
FS_FAT1216
:
return
MOUNTMGR_FS_TYPE_FAT
;
case
FS_FAT32
:
return
MOUNTMGR_FS_TYPE_FAT32
;
default:
return
MOUNTMGR_FS_TYPE_NTFS
;
}
}
/* query information about an existing dos drive, by letter or udi */
NTSTATUS
query_dos_device
(
int
letter
,
enum
device_type
*
type
,
enum
mountmgr_fs_type
*
fs_type
,
char
**
device
,
char
**
mount_point
)
...
...
@@ -1631,18 +1643,37 @@ NTSTATUS query_dos_device( int letter, enum device_type *type, enum mountmgr_fs_
if
(
drive
->
drive
!=
letter
)
continue
;
disk_device
=
drive
->
volume
->
device
;
if
(
type
)
*
type
=
disk_device
->
type
;
if
(
fs_type
)
{
switch
(
drive
->
volume
->
fs_type
)
{
case
FS_ISO9660
:
*
fs_type
=
MOUNTMGR_FS_TYPE_ISO9660
;
break
;
case
FS_UDF
:
*
fs_type
=
MOUNTMGR_FS_TYPE_UDF
;
break
;
case
FS_FAT1216
:
*
fs_type
=
MOUNTMGR_FS_TYPE_FAT
;
break
;
case
FS_FAT32
:
*
fs_type
=
MOUNTMGR_FS_TYPE_FAT32
;
break
;
default:
*
fs_type
=
MOUNTMGR_FS_TYPE_NTFS
;
break
;
}
*
fs_type
=
drive
->
volume
->
fs_type
;
}
if
(
fs_type
)
*
fs_type
=
get_mountmgr_fs_type
(
drive
->
volume
->
fs_type
);
if
(
device
)
*
device
=
strdupA
(
disk_device
->
unix_device
);
if
(
mount_point
)
*
mount_point
=
strdupA
(
disk_device
->
unix_mount
);
status
=
STATUS_SUCCESS
;
break
;
}
LeaveCriticalSection
(
&
device_section
);
return
status
;
}
/* query information about an existing unix device, by dev_t */
NTSTATUS
query_unix_device
(
ULONGLONG
unix_dev
,
enum
device_type
*
type
,
enum
mountmgr_fs_type
*
fs_type
,
char
**
device
,
char
**
mount_point
)
{
NTSTATUS
status
=
STATUS_NO_SUCH_DEVICE
;
struct
volume
*
volume
;
struct
disk_device
*
disk_device
;
struct
stat
st
;
EnterCriticalSection
(
&
device_section
);
LIST_FOR_EACH_ENTRY
(
volume
,
&
volumes_list
,
struct
volume
,
entry
)
{
disk_device
=
volume
->
device
;
if
(
!
disk_device
->
unix_device
||
stat
(
disk_device
->
unix_device
,
&
st
)
<
0
||
st
.
st_rdev
!=
unix_dev
)
continue
;
if
(
type
)
*
type
=
disk_device
->
type
;
if
(
fs_type
)
*
fs_type
=
get_mountmgr_fs_type
(
volume
->
fs_type
);
if
(
device
)
*
device
=
strdupA
(
disk_device
->
unix_device
);
if
(
mount_point
)
*
mount_point
=
strdupA
(
disk_device
->
unix_mount
);
status
=
STATUS_SUCCESS
;
...
...
dlls/mountmgr.sys/mountmgr.c
View file @
54f93b9b
...
...
@@ -299,9 +299,19 @@ static NTSTATUS query_unix_drive( void *buff, SIZE_T insize,
enum
device_type
device_type
;
char
*
ptr
;
if
(
letter
<
'a'
||
letter
>
'z'
)
return
STATUS_INVALID_PARAMETER
;
if
(
!
letter
)
{
if
((
status
=
query_unix_device
(
input
->
unix_dev
,
&
device_type
,
&
fs_type
,
&
device
,
&
mount_point
)))
return
status
;
}
else
{
if
(
letter
<
'a'
||
letter
>
'z'
)
return
STATUS_INVALID_PARAMETER
;
if
((
status
=
query_dos_device
(
letter
-
'a'
,
&
device_type
,
&
fs_type
,
&
device
,
&
mount_point
)))
return
status
;
}
if
((
status
=
query_dos_device
(
letter
-
'a'
,
&
device_type
,
&
fs_type
,
&
device
,
&
mount_point
)))
return
status
;
switch
(
device_type
)
{
case
DEVICE_UNKNOWN
:
type
=
DRIVE_UNKNOWN
;
break
;
...
...
dlls/mountmgr.sys/mountmgr.h
View file @
54f93b9b
...
...
@@ -59,6 +59,8 @@ extern NTSTATUS add_dos_device( int letter, const char *udi, const char *device,
extern
NTSTATUS
remove_dos_device
(
int
letter
,
const
char
*
udi
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
query_dos_device
(
int
letter
,
enum
device_type
*
type
,
enum
mountmgr_fs_type
*
fs_type
,
char
**
device
,
char
**
mount_point
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
query_unix_device
(
ULONGLONG
unix_dev
,
enum
device_type
*
type
,
enum
mountmgr_fs_type
*
fs_type
,
char
**
device
,
char
**
mount_point
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
WINAPI
harddisk_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
WINAPI
serial_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
DECLSPEC_HIDDEN
;
extern
NTSTATUS
WINAPI
parallel_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
DECLSPEC_HIDDEN
;
...
...
include/ddk/mountmgr.h
View file @
54f93b9b
...
...
@@ -63,12 +63,13 @@ enum mountmgr_fs_type
struct
mountmgr_unix_drive
{
ULONG
size
;
ULONG
type
;
ULONG
fs_type
;
WCHAR
letter
;
USHORT
mount_point_offset
;
USHORT
device_offset
;
ULONG
size
;
ULONG
type
;
ULONG
fs_type
;
ULONGLONG
unix_dev
;
WCHAR
letter
;
USHORT
mount_point_offset
;
USHORT
device_offset
;
};
#define IOCTL_MOUNTMGR_QUERY_DHCP_REQUEST_PARAMS CTL_CODE(MOUNTMGRCONTROLTYPE, 64, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
...
...
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