Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hayden Hestad
wine
Commits
8faceff2
Commit
8faceff2
authored
16 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
mountmgr: Add a Wine-specific ioctl to define a drive for a Unix path.
parent
b2ebab9f
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/mountmgr.sys/mountmgr.c
+49
-0
49 additions, 0 deletions
dlls/mountmgr.sys/mountmgr.c
dlls/mountmgr.sys/mountmgr.h
+1
-0
1 addition, 0 deletions
dlls/mountmgr.sys/mountmgr.h
include/ddk/mountmgr.h
+16
-0
16 additions, 0 deletions
include/ddk/mountmgr.h
with
66 additions
and
0 deletions
dlls/mountmgr.sys/mountmgr.c
+
49
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/mountmgr.sys/mountmgr.h
+
1
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
include/ddk/mountmgr.h
+
16
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment