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
eb7f7847
Commit
eb7f7847
authored
May 29, 2020
by
Paul Gofman
Committed by
Alexandre Julliard
May 29, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement IoReuseIrp() function.
Signed-off-by:
Paul Gofman
<
pgofman@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9effc3f9
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
1 deletion
+50
-1
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+11
-0
ntoskrnl.exe.spec
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
+1
-1
driver.c
dlls/ntoskrnl.exe/tests/driver.c
+37
-0
wdm.h
include/ddk/wdm.h
+1
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
eb7f7847
...
...
@@ -975,6 +975,17 @@ void WINAPI IoInitializeIrp( IRP *irp, USHORT size, CCHAR stack_size )
(
PIO_STACK_LOCATION
)(
irp
+
1
)
+
stack_size
;
}
void
WINAPI
IoReuseIrp
(
IRP
*
irp
,
NTSTATUS
iostatus
)
{
UCHAR
AllocationFlags
;
TRACE
(
"irp %p, iostatus %#x.
\n
"
,
irp
,
iostatus
);
AllocationFlags
=
irp
->
AllocationFlags
;
IoInitializeIrp
(
irp
,
irp
->
Size
,
irp
->
StackCount
);
irp
->
AllocationFlags
=
AllocationFlags
;
irp
->
IoStatus
.
u
.
Status
=
iostatus
;
}
/***********************************************************************
* IoInitializeTimer (NTOSKRNL.EXE.@)
...
...
dlls/ntoskrnl.exe/ntoskrnl.exe.spec
View file @
eb7f7847
...
...
@@ -462,7 +462,7 @@
@ stub IoReportTargetDeviceChange
@ stub IoReportTargetDeviceChangeAsynchronous
@ stub IoRequestDeviceEject
@ st
ub IoReuseIrp
@ st
dcall IoReuseIrp(ptr long)
@ stub IoSetCompletionRoutineEx
@ stdcall IoSetDeviceInterfaceState(ptr long)
@ stub IoSetDeviceToVerify
...
...
dlls/ntoskrnl.exe/tests/driver.c
View file @
eb7f7847
...
...
@@ -211,9 +211,18 @@ static void *get_proc_address(const char *name)
static
FILE_OBJECT
*
last_created_file
;
static
unsigned
int
create_count
,
close_count
;
static
NTSTATUS
WINAPI
test_irp_struct_completion_routine
(
DEVICE_OBJECT
*
reserved
,
IRP
*
irp
,
void
*
context
)
{
unsigned
int
*
result
=
context
;
*
result
=
1
;
return
STATUS_MORE_PROCESSING_REQUIRED
;
}
static
void
test_irp_struct
(
IRP
*
irp
,
DEVICE_OBJECT
*
device
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
unsigned
int
irp_completion_result
;
ok
(
device
==
upper_device
,
"Expected device %p, got %p.
\n
"
,
upper_device
,
device
);
ok
(
last_created_file
!=
NULL
,
"last_created_file = NULL
\n
"
);
...
...
@@ -225,6 +234,34 @@ static void test_irp_struct(IRP *irp, DEVICE_OBJECT *device)
"IRP thread is not the current thread
\n
"
);
ok
(
IoGetRequestorProcess
(
irp
)
==
IoGetCurrentProcess
(),
"processes didn't match
\n
"
);
irp
=
IoAllocateIrp
(
1
,
FALSE
);
ok
(
irp
->
AllocationFlags
==
IRP_ALLOCATED_FIXED_SIZE
,
"Got unexpected irp->AllocationFlags %#x.
\n
"
,
irp
->
AllocationFlags
);
ok
(
irp
->
CurrentLocation
==
2
,
"Got unexpected irp->CurrentLocation %u.
\n
"
,
irp
->
CurrentLocation
);
IoSetCompletionRoutine
(
irp
,
test_irp_struct_completion_routine
,
&
irp_completion_result
,
TRUE
,
TRUE
,
TRUE
);
irp_completion_result
=
0
;
irp
->
IoStatus
.
Status
=
STATUS_SUCCESS
;
--
irp
->
CurrentLocation
;
--
irp
->
Tail
.
Overlay
.
CurrentStackLocation
;
IoCompleteRequest
(
irp
,
IO_NO_INCREMENT
);
ok
(
irp
->
CurrentLocation
==
2
,
"Got unexpected irp->CurrentLocation %u.
\n
"
,
irp
->
CurrentLocation
);
ok
(
irp_completion_result
,
"IRP completion was not called.
\n
"
);
--
irp
->
CurrentLocation
;
--
irp
->
Tail
.
Overlay
.
CurrentStackLocation
;
IoReuseIrp
(
irp
,
STATUS_UNSUCCESSFUL
);
ok
(
irp
->
CurrentLocation
==
2
,
"Got unexpected irp->CurrentLocation %u.
\n
"
,
irp
->
CurrentLocation
);
ok
(
irp
->
AllocationFlags
==
IRP_ALLOCATED_FIXED_SIZE
,
"Got unexpected irp->AllocationFlags %#x.
\n
"
,
irp
->
AllocationFlags
);
IoFreeIrp
(
irp
);
}
static
void
test_mdl_map
(
void
)
...
...
include/ddk/wdm.h
View file @
eb7f7847
...
...
@@ -1679,6 +1679,7 @@ NTSTATUS WINAPI IoRegisterDeviceInterface(PDEVICE_OBJECT,const GUID*,PUNICODE_S
void
WINAPI
IoReleaseCancelSpinLock
(
KIRQL
);
void
WINAPI
IoReleaseRemoveLockAndWaitEx
(
IO_REMOVE_LOCK
*
,
void
*
,
ULONG
);
void
WINAPI
IoReleaseRemoveLockEx
(
IO_REMOVE_LOCK
*
,
void
*
,
ULONG
);
void
WINAPI
IoReuseIrp
(
IRP
*
,
NTSTATUS
);
NTSTATUS
WINAPI
IoSetDeviceInterfaceState
(
UNICODE_STRING
*
,
BOOLEAN
);
NTSTATUS
WINAPI
IoWMIRegistrationControl
(
PDEVICE_OBJECT
,
ULONG
);
...
...
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