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
07e92a7d
Commit
07e92a7d
authored
Jan 04, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr.sys: Create a hard disk device for PhysicalDrive0.
parent
6e8b7c4c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
0 deletions
+50
-0
mountmgr.c
dlls/mountmgr.sys/mountmgr.c
+50
-0
No files found.
dlls/mountmgr.sys/mountmgr.c
View file @
07e92a7d
...
...
@@ -58,11 +58,58 @@ static NTSTATUS WINAPI mountmgr_ioctl( DEVICE_OBJECT *device, IRP *irp )
return
irp
->
IoStatus
.
u
.
Status
;
}
/* handler for ioctls on the harddisk device */
static
NTSTATUS
WINAPI
harddisk_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
irp
->
Tail
.
Overlay
.
s
.
u
.
CurrentStackLocation
;
TRACE
(
"ioctl %x insize %u outsize %u
\n
"
,
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
,
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
,
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
);
switch
(
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
)
{
default:
FIXME
(
"unsupported ioctl %x
\n
"
,
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_NOT_SUPPORTED
;
break
;
}
return
irp
->
IoStatus
.
u
.
Status
;
}
/* driver entry point for the harddisk driver */
static
NTSTATUS
WINAPI
harddisk_driver_entry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
{
static
const
WCHAR
harddisk0W
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'H'
,
'a'
,
'r'
,
'd'
,
'd'
,
'i'
,
's'
,
'k'
,
'0'
,
0
};
static
const
WCHAR
physdrive0W
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'P'
,
'h'
,
'y'
,
's'
,
'i'
,
'c'
,
'a'
,
'l'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'0'
,
0
};
UNICODE_STRING
nameW
,
linkW
;
DEVICE_OBJECT
*
device
;
NTSTATUS
status
;
driver
->
MajorFunction
[
IRP_MJ_DEVICE_CONTROL
]
=
harddisk_ioctl
;
RtlInitUnicodeString
(
&
nameW
,
harddisk0W
);
RtlInitUnicodeString
(
&
linkW
,
physdrive0W
);
if
(
!
(
status
=
IoCreateDevice
(
driver
,
0
,
&
nameW
,
0
,
0
,
FALSE
,
&
device
)))
status
=
IoCreateSymbolicLink
(
&
linkW
,
&
nameW
);
if
(
status
)
{
FIXME
(
"failed to create device error %x
\n
"
,
status
);
return
status
;
}
return
status
;
}
/* main entry point for the mount point manager driver */
NTSTATUS
WINAPI
DriverEntry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
{
static
const
WCHAR
device_mountmgrW
[]
=
{
'\\'
,
'D'
,
'e'
,
'v'
,
'i'
,
'c'
,
'e'
,
'\\'
,
'M'
,
'o'
,
'u'
,
'n'
,
't'
,
'P'
,
'o'
,
'i'
,
'n'
,
't'
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
link_mountmgrW
[]
=
{
'\\'
,
'?'
,
'?'
,
'\\'
,
'M'
,
'o'
,
'u'
,
'n'
,
't'
,
'P'
,
'o'
,
'i'
,
'n'
,
't'
,
'M'
,
'a'
,
'n'
,
'a'
,
'g'
,
'e'
,
'r'
,
0
};
static
const
WCHAR
harddiskW
[]
=
{
'\\'
,
'D'
,
'r'
,
'i'
,
'v'
,
'e'
,
'r'
,
'\\'
,
'H'
,
'a'
,
'r'
,
'd'
,
'd'
,
'i'
,
's'
,
'k'
,
0
};
UNICODE_STRING
nameW
,
linkW
;
DEVICE_OBJECT
*
device
;
...
...
@@ -82,5 +129,8 @@ NTSTATUS WINAPI DriverEntry( DRIVER_OBJECT *driver, UNICODE_STRING *path )
return
status
;
}
RtlInitUnicodeString
(
&
nameW
,
harddiskW
);
status
=
IoCreateDriver
(
&
nameW
,
harddisk_driver_entry
);
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