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
bc32b857
Commit
bc32b857
authored
Oct 23, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Add a Wine-specific ioctl to query the Unix information about a drive.
parent
8faceff2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
82 additions
and
0 deletions
+82
-0
device.c
dlls/mountmgr.sys/device.c
+16
-0
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+64
-0
mountmgr.h
dlls/mountmgr.sys/mountmgr.h
+1
-0
mountmgr.h
include/ddk/mountmgr.h
+1
-0
No files found.
dlls/mountmgr.sys/device.c
View file @
bc32b857
...
...
@@ -568,6 +568,22 @@ NTSTATUS remove_dos_device( int letter, const char *udi )
return
STATUS_NO_SUCH_DEVICE
;
}
/* query information about an existing dos drive, by letter or udi */
NTSTATUS
query_dos_device
(
int
letter
,
DWORD
*
type
,
const
char
**
device
,
const
char
**
mount_point
)
{
struct
dos_drive
*
drive
;
LIST_FOR_EACH_ENTRY
(
drive
,
&
drives_list
,
struct
dos_drive
,
entry
)
{
if
(
drive
->
drive
!=
letter
)
continue
;
if
(
type
)
*
type
=
drive
->
type
;
if
(
device
)
*
device
=
drive
->
unix_device
;
if
(
mount_point
)
*
mount_point
=
drive
->
unix_mount
;
return
STATUS_SUCCESS
;
}
return
STATUS_NO_SUCH_DEVICE
;
}
/* handler for ioctls on the harddisk device */
static
NTSTATUS
WINAPI
harddisk_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
...
...
dlls/mountmgr.sys/mountmgr.c
View file @
bc32b857
...
...
@@ -265,6 +265,61 @@ static NTSTATUS define_unix_drive( const void *in_buff, SIZE_T insize )
}
}
/* implementation of IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE */
static
NTSTATUS
query_unix_drive
(
const
void
*
in_buff
,
SIZE_T
insize
,
void
*
out_buff
,
SIZE_T
outsize
,
IO_STATUS_BLOCK
*
iosb
)
{
const
struct
mountmgr_unix_drive
*
input
=
in_buff
;
struct
mountmgr_unix_drive
*
output
=
out_buff
;
const
char
*
device
,
*
mount_point
;
int
letter
=
tolowerW
(
input
->
letter
);
NTSTATUS
status
;
DWORD
size
,
type
;
char
*
ptr
;
if
(
letter
<
'a'
||
letter
>
'z'
)
return
STATUS_INVALID_PARAMETER
;
if
((
status
=
query_dos_device
(
letter
-
'a'
,
&
type
,
&
device
,
&
mount_point
)))
return
status
;
size
=
sizeof
(
*
output
);
if
(
device
)
size
+=
strlen
(
device
)
+
1
;
if
(
mount_point
)
size
+=
strlen
(
mount_point
)
+
1
;
if
(
size
>
outsize
)
{
if
(
size
>=
FIELD_OFFSET
(
struct
mountmgr_unix_drive
,
size
)
+
sizeof
(
output
->
size
))
output
->
size
=
size
;
iosb
->
Information
=
FIELD_OFFSET
(
struct
mountmgr_unix_drive
,
size
)
+
sizeof
(
output
->
size
);
return
STATUS_MORE_ENTRIES
;
}
output
->
size
=
size
;
output
->
letter
=
letter
;
output
->
type
=
type
;
ptr
=
(
char
*
)(
output
+
1
);
if
(
mount_point
)
{
output
->
mount_point_offset
=
ptr
-
(
char
*
)
output
;
strcpy
(
ptr
,
mount_point
);
ptr
+=
strlen
(
ptr
)
+
1
;
}
else
output
->
mount_point_offset
=
0
;
if
(
device
)
{
output
->
device_offset
=
ptr
-
(
char
*
)
output
;
strcpy
(
ptr
,
device
);
ptr
+=
strlen
(
ptr
)
+
1
;
}
else
output
->
device_offset
=
0
;
TRACE
(
"returning %c: dev %s mount %s type %u
\n
"
,
letter
,
debugstr_a
(
device
),
debugstr_a
(
mount_point
),
type
);
iosb
->
Information
=
ptr
-
(
char
*
)
output
;
return
STATUS_SUCCESS
;
}
/* handler for ioctls on the mount manager device */
static
NTSTATUS
WINAPI
mountmgr_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
...
...
@@ -293,6 +348,15 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
irp
->
IoStatus
.
u
.
Status
=
define_unix_drive
(
irpsp
->
Parameters
.
DeviceIoControl
.
Type3InputBuffer
,
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
);
break
;
case
IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE
:
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
<
sizeof
(
struct
mountmgr_unix_drive
))
return
STATUS_INVALID_PARAMETER
;
irp
->
IoStatus
.
u
.
Status
=
query_unix_drive
(
irpsp
->
Parameters
.
DeviceIoControl
.
Type3InputBuffer
,
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
,
irp
->
MdlAddress
->
StartVa
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
&
irp
->
IoStatus
);
break
;
default:
FIXME
(
"ioctl %x not supported
\n
"
,
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_NOT_SUPPORTED
;
...
...
dlls/mountmgr.sys/mountmgr.h
View file @
bc32b857
...
...
@@ -43,6 +43,7 @@ extern void initialize_diskarbitration(void);
extern
NTSTATUS
add_dos_device
(
int
letter
,
const
char
*
udi
,
const
char
*
device
,
const
char
*
mount_point
,
DWORD
type
);
extern
NTSTATUS
remove_dos_device
(
int
letter
,
const
char
*
udi
);
extern
NTSTATUS
query_dos_device
(
int
letter
,
DWORD
*
type
,
const
char
**
device
,
const
char
**
mount_point
);
extern
NTSTATUS
WINAPI
harddisk_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
);
/* mount point functions */
...
...
include/ddk/mountmgr.h
View file @
bc32b857
...
...
@@ -53,6 +53,7 @@ static const WCHAR MOUNTMGR_DOS_DEVICE_NAME[] = {'\\','\\','.','\\','M','o','u',
#ifdef WINE_MOUNTMGR_EXTENSIONS
#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)
struct
mountmgr_unix_drive
{
...
...
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