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
b13f2e11
Commit
b13f2e11
authored
Feb 04, 2021
by
Erich E. Hoover
Committed by
Alexandre Julliard
Feb 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mountmgr.sys: Have harddisk_ioctl return the same status as the IoStatus.
Signed-off-by:
Erich E. Hoover
<
erich.e.hoover@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3ef9b54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
device.c
dlls/mountmgr.sys/device.c
+19
-17
No files found.
dlls/mountmgr.sys/device.c
View file @
b13f2e11
...
...
@@ -1752,23 +1752,22 @@ NTSTATUS query_unix_device( ULONGLONG unix_dev, enum device_type *type,
return
status
;
}
static
void
query_property
(
struct
disk_device
*
device
,
IRP
*
irp
)
static
NTSTATUS
query_property
(
struct
disk_device
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
STORAGE_PROPERTY_QUERY
*
query
=
irp
->
AssociatedIrp
.
SystemBuffer
;
NTSTATUS
status
;
if
(
!
irp
->
AssociatedIrp
.
SystemBuffer
||
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
<
sizeof
(
STORAGE_PROPERTY_QUERY
))
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_INVALID_PARAMETER
;
return
;
return
STATUS_INVALID_PARAMETER
;
}
/* Try to persuade application not to check property */
if
(
query
->
QueryType
==
PropertyExistsQuery
)
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_NOT_SUPPORTED
;
return
;
return
STATUS_NOT_SUPPORTED
;
}
switch
(
query
->
PropertyId
)
...
...
@@ -1781,14 +1780,14 @@ static void query_property( struct disk_device *device, IRP *irp )
if
(
device
->
serial
)
len
+=
strlen
(
device
->
serial
)
+
1
;
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
sizeof
(
STORAGE_DESCRIPTOR_HEADER
))
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_INVALID_PARAMETER
;
s
tatus
=
STATUS_INVALID_PARAMETER
;
else
if
(
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
<
len
)
{
descriptor
=
irp
->
AssociatedIrp
.
SystemBuffer
;
descriptor
->
Version
=
sizeof
(
STORAGE_DEVICE_DESCRIPTOR
);
descriptor
->
Size
=
len
;
irp
->
IoStatus
.
Information
=
sizeof
(
STORAGE_DESCRIPTOR_HEADER
);
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
}
else
{
...
...
@@ -1814,16 +1813,17 @@ static void query_property( struct disk_device *device, IRP *irp )
strcpy
(
(
char
*
)
descriptor
+
descriptor
->
SerialNumberOffset
,
device
->
serial
);
}
irp
->
IoStatus
.
Information
=
len
;
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
}
break
;
}
default:
FIXME
(
"Unsupported property %#x
\n
"
,
query
->
PropertyId
);
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_NOT_SUPPORTED
;
s
tatus
=
STATUS_NOT_SUPPORTED
;
break
;
}
return
status
;
}
/* handler for ioctls on the harddisk device */
...
...
@@ -1831,6 +1831,7 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
struct
disk_device
*
dev
=
device
->
DeviceExtension
;
NTSTATUS
status
;
TRACE
(
"ioctl %x insize %u outsize %u
\n
"
,
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
,
...
...
@@ -1853,7 +1854,7 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
info
.
BytesPerSector
=
512
;
memcpy
(
irp
->
AssociatedIrp
.
SystemBuffer
,
&
info
,
len
);
irp
->
IoStatus
.
Information
=
len
;
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_DISK_GET_DRIVE_GEOMETRY_EX
:
...
...
@@ -1873,7 +1874,7 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
info
.
Data
[
0
]
=
0
;
memcpy
(
irp
->
AssociatedIrp
.
SystemBuffer
,
&
info
,
len
);
irp
->
IoStatus
.
Information
=
len
;
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_STORAGE_GET_DEVICE_NUMBER
:
...
...
@@ -1882,11 +1883,11 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
memcpy
(
irp
->
AssociatedIrp
.
SystemBuffer
,
&
dev
->
devnum
,
len
);
irp
->
IoStatus
.
Information
=
len
;
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_CDROM_READ_TOC
:
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_INVALID_DEVICE_REQUEST
;
s
tatus
=
STATUS_INVALID_DEVICE_REQUEST
;
break
;
case
IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
:
{
...
...
@@ -1895,25 +1896,26 @@ static NTSTATUS WINAPI harddisk_ioctl( DEVICE_OBJECT *device, IRP *irp )
FIXME
(
"returning zero-filled buffer for IOCTL_VOLUME_GET_VOLUME_DISK_EXTENTS
\n
"
);
memset
(
irp
->
AssociatedIrp
.
SystemBuffer
,
0
,
len
);
irp
->
IoStatus
.
Information
=
len
;
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_SUCCESS
;
s
tatus
=
STATUS_SUCCESS
;
break
;
}
case
IOCTL_STORAGE_QUERY_PROPERTY
:
query_property
(
dev
,
irp
);
status
=
query_property
(
dev
,
irp
);
break
;
default:
{
ULONG
code
=
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
;
FIXME
(
"Unsupported ioctl %x (device=%x access=%x func=%x method=%x)
\n
"
,
code
,
code
>>
16
,
(
code
>>
14
)
&
3
,
(
code
>>
2
)
&
0xfff
,
code
&
3
);
irp
->
IoStatus
.
u
.
S
tatus
=
STATUS_NOT_SUPPORTED
;
s
tatus
=
STATUS_NOT_SUPPORTED
;
break
;
}
}
irp
->
IoStatus
.
u
.
Status
=
status
;
LeaveCriticalSection
(
&
device_section
);
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
return
STATUS_SUCCESS
;
return
status
;
}
/* driver entry point for the harddisk driver */
...
...
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