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
8faceff2
Commit
8faceff2
authored
Oct 23, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr: Add a Wine-specific ioctl to define a drive for a Unix path.
parent
b2ebab9f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
66 additions
and
0 deletions
+66
-0
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+49
-0
mountmgr.h
dlls/mountmgr.sys/mountmgr.h
+1
-0
mountmgr.h
include/ddk/mountmgr.h
+16
-0
No files found.
dlls/mountmgr.sys/mountmgr.c
View file @
8faceff2
...
...
@@ -223,6 +223,48 @@ static NTSTATUS query_mount_points( const void *in_buff, SIZE_T insize,
return
STATUS_SUCCESS
;
}
/* implementation of IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE */
static
NTSTATUS
define_unix_drive
(
const
void
*
in_buff
,
SIZE_T
insize
)
{
const
struct
mountmgr_unix_drive
*
input
=
in_buff
;
const
char
*
mount_point
=
NULL
,
*
device
=
NULL
;
unsigned
int
i
;
WCHAR
letter
=
tolowerW
(
input
->
letter
);
if
(
letter
<
'a'
||
letter
>
'z'
)
return
STATUS_INVALID_PARAMETER
;
if
(
input
->
type
>
DRIVE_RAMDISK
)
return
STATUS_INVALID_PARAMETER
;
if
(
input
->
mount_point_offset
>
insize
||
input
->
device_offset
>
insize
)
return
STATUS_INVALID_PARAMETER
;
/* make sure string are null-terminated */
if
(
input
->
mount_point_offset
)
{
mount_point
=
(
const
char
*
)
in_buff
+
input
->
mount_point_offset
;
for
(
i
=
input
->
mount_point_offset
;
i
<
insize
;
i
++
)
if
(
!*
((
const
char
*
)
in_buff
+
i
))
break
;
if
(
i
>=
insize
)
return
STATUS_INVALID_PARAMETER
;
}
if
(
input
->
device_offset
)
{
device
=
(
const
char
*
)
in_buff
+
input
->
device_offset
;
for
(
i
=
input
->
device_offset
;
i
<
insize
;
i
++
)
if
(
!*
((
const
char
*
)
in_buff
+
i
))
break
;
if
(
i
>=
insize
)
return
STATUS_INVALID_PARAMETER
;
}
if
(
input
->
type
!=
DRIVE_NO_ROOT_DIR
)
{
TRACE
(
"defining %c: dev %s mount %s type %u
\n
"
,
letter
,
debugstr_a
(
device
),
debugstr_a
(
mount_point
),
input
->
type
);
return
add_dos_device
(
letter
-
'a'
,
NULL
,
device
,
mount_point
,
input
->
type
);
}
else
{
TRACE
(
"removing %c:
\n
"
,
letter
);
return
remove_dos_device
(
letter
-
'a'
,
NULL
);
}
}
/* handler for ioctls on the mount manager device */
static
NTSTATUS
WINAPI
mountmgr_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
...
...
@@ -244,6 +286,13 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
,
&
irp
->
IoStatus
);
break
;
case
IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE
:
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
<
sizeof
(
struct
mountmgr_unix_drive
))
return
STATUS_INVALID_PARAMETER
;
irp
->
IoStatus
.
Information
=
0
;
irp
->
IoStatus
.
u
.
Status
=
define_unix_drive
(
irpsp
->
Parameters
.
DeviceIoControl
.
Type3InputBuffer
,
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
);
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 @
8faceff2
...
...
@@ -32,6 +32,7 @@
#include "ntddstor.h"
#include "ntddcdrm.h"
#include "ddk/wdm.h"
#define WINE_MOUNTMGR_EXTENSIONS
#include "ddk/mountmgr.h"
extern
void
initialize_hal
(
void
);
...
...
include/ddk/mountmgr.h
View file @
8faceff2
...
...
@@ -49,6 +49,22 @@ static const WCHAR MOUNTMGR_DOS_DEVICE_NAME[] = {'\\','\\','.','\\','M','o','u',
#define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
#define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS)
/* Wine extensions */
#ifdef WINE_MOUNTMGR_EXTENSIONS
#define IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 32, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
struct
mountmgr_unix_drive
{
ULONG
size
;
ULONG
type
;
WCHAR
letter
;
USHORT
mount_point_offset
;
USHORT
device_offset
;
};
#endif
typedef
struct
_MOUNTMGR_CREATE_POINT_INPUT
{
USHORT
SymbolicLinkNameOffset
;
...
...
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