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
54c68c65
Commit
54c68c65
authored
Oct 07, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 07, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Remove checks if MajorFunction is NULL.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d392a012
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+15
-20
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
54c68c65
...
...
@@ -172,7 +172,7 @@ static HANDLE get_device_manager(void)
return
ret
;
}
static
NTSTATUS
dispatch_irp
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
static
void
dispatch_irp
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
LARGE_INTEGER
count
;
...
...
@@ -183,8 +183,6 @@ static NTSTATUS dispatch_irp( DEVICE_OBJECT *device, IRP *irp )
IoCallDriver
(
device
,
irp
);
device
->
CurrentIrp
=
NULL
;
return
STATUS_SUCCESS
;
}
/* process a create request for a given file */
...
...
@@ -227,10 +225,8 @@ static NTSTATUS dispatch_create( const irp_params_t *params, void *in_buff, ULON
irp
->
UserIosb
=
irp_handle
;
/* note: we abuse UserIosb to store the server irp handle */
irp
->
UserEvent
=
NULL
;
if
(
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_CREATE
])
return
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_SUCCESS
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
return
STATUS_SUCCESS
;
}
...
...
@@ -267,12 +263,7 @@ static NTSTATUS dispatch_close( const irp_params_t *params, void *in_buff, ULONG
irp
->
UserIosb
=
irp_handle
;
/* note: we abuse UserIosb to store the server irp handle */
irp
->
UserEvent
=
NULL
;
if
(
!
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_CLOSE
])
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_SUCCESS
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
}
else
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
HeapFree
(
GetProcessHeap
(),
0
,
file
);
/* FIXME: async close processing not supported */
return
STATUS_SUCCESS
;
...
...
@@ -292,7 +283,6 @@ static NTSTATUS dispatch_read( const irp_params_t *params, void *in_buff, ULONG
if
(
!
file
)
return
STATUS_INVALID_HANDLE
;
device
=
file
->
DeviceObject
;
if
(
!
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_READ
])
return
STATUS_NOT_SUPPORTED
;
TRACE
(
"device %p file %p size %u
\n
"
,
device
,
file
,
out_size
);
...
...
@@ -314,7 +304,9 @@ static NTSTATUS dispatch_read( const irp_params_t *params, void *in_buff, ULONG
irpsp
=
IoGetNextIrpStackLocation
(
irp
);
irpsp
->
Parameters
.
Read
.
Key
=
params
->
read
.
key
;
return
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
return
STATUS_SUCCESS
;
}
/* process a write request for a given device */
...
...
@@ -330,7 +322,6 @@ static NTSTATUS dispatch_write( const irp_params_t *params, void *in_buff, ULONG
if
(
!
file
)
return
STATUS_INVALID_HANDLE
;
device
=
file
->
DeviceObject
;
if
(
!
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_WRITE
])
return
STATUS_NOT_SUPPORTED
;
TRACE
(
"device %p file %p size %u
\n
"
,
device
,
file
,
in_size
);
...
...
@@ -347,7 +338,9 @@ static NTSTATUS dispatch_write( const irp_params_t *params, void *in_buff, ULONG
irpsp
=
IoGetNextIrpStackLocation
(
irp
);
irpsp
->
Parameters
.
Write
.
Key
=
params
->
write
.
key
;
return
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
return
STATUS_SUCCESS
;
}
/* process a flush request for a given device */
...
...
@@ -361,7 +354,6 @@ static NTSTATUS dispatch_flush( const irp_params_t *params, void *in_buff, ULONG
if
(
!
file
)
return
STATUS_INVALID_HANDLE
;
device
=
file
->
DeviceObject
;
if
(
!
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_FLUSH_BUFFERS
])
return
STATUS_NOT_SUPPORTED
;
TRACE
(
"device %p file %p
\n
"
,
device
,
file
);
...
...
@@ -373,7 +365,9 @@ static NTSTATUS dispatch_flush( const irp_params_t *params, void *in_buff, ULONG
irp
->
Tail
.
Overlay
.
OriginalFileObject
=
file
;
irp
->
RequestorMode
=
UserMode
;
return
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
return
STATUS_SUCCESS
;
}
/* process an ioctl request for a given device */
...
...
@@ -388,7 +382,6 @@ static NTSTATUS dispatch_ioctl( const irp_params_t *params, void *in_buff, ULONG
if
(
!
file
)
return
STATUS_INVALID_HANDLE
;
device
=
file
->
DeviceObject
;
if
(
!
device
->
DriverObject
->
MajorFunction
[
IRP_MJ_DEVICE_CONTROL
])
return
STATUS_NOT_SUPPORTED
;
TRACE
(
"ioctl %x device %p file %p in_size %u out_size %u
\n
"
,
params
->
ioctl
.
code
,
device
,
file
,
in_size
,
out_size
);
...
...
@@ -417,7 +410,9 @@ static NTSTATUS dispatch_ioctl( const irp_params_t *params, void *in_buff, ULONG
irp
->
Tail
.
Overlay
.
OriginalFileObject
=
file
;
irp
->
RequestorMode
=
UserMode
;
return
dispatch_irp
(
device
,
irp
);
dispatch_irp
(
device
,
irp
);
return
STATUS_SUCCESS
;
}
typedef
NTSTATUS
(
*
dispatch_func
)(
const
irp_params_t
*
params
,
void
*
in_buff
,
ULONG
in_size
,
...
...
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