Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
b466e893
Commit
b466e893
authored
Oct 16, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Oct 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Explicitly set MappedSystemVa for MDLs.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
9912ef77
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+24
-2
wdm.h
include/ddk/wdm.h
+9
-0
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
b466e893
...
...
@@ -820,6 +820,7 @@ PIRP WINAPI IoBuildDeviceIoControlRequest( ULONG code, PDEVICE_OBJECT device,
{
PIRP
irp
;
PIO_STACK_LOCATION
irpsp
;
MDL
*
mdl
;
TRACE
(
"%x, %p, %p, %u, %p, %u, %u, %p, %p
\n
"
,
code
,
device
,
in_buff
,
in_len
,
out_buff
,
out_len
,
internal
,
event
,
iosb
);
...
...
@@ -847,7 +848,16 @@ PIRP WINAPI IoBuildDeviceIoControlRequest( ULONG code, PDEVICE_OBJECT device,
case
METHOD_IN_DIRECT
:
case
METHOD_OUT_DIRECT
:
irp
->
AssociatedIrp
.
SystemBuffer
=
in_buff
;
IoAllocateMdl
(
out_buff
,
out_len
,
FALSE
,
FALSE
,
irp
);
mdl
=
IoAllocateMdl
(
out_buff
,
out_len
,
FALSE
,
FALSE
,
irp
);
if
(
!
mdl
)
{
IoFreeIrp
(
irp
);
return
NULL
;
}
mdl
->
MdlFlags
|=
MDL_MAPPED_TO_SYSTEM_VA
;
mdl
->
MappedSystemVa
=
out_buff
;
break
;
case
METHOD_NEITHER
:
irpsp
->
Parameters
.
DeviceIoControl
.
Type3InputBuffer
=
in_buff
;
...
...
@@ -882,7 +892,19 @@ PIRP WINAPI IoBuildSynchronousFsdRequest(ULONG majorfunc, PDEVICE_OBJECT device,
irpsp
->
CompletionRoutine
=
NULL
;
irp
->
AssociatedIrp
.
SystemBuffer
=
buffer
;
if
(
device
->
Flags
&
DO_DIRECT_IO
)
IoAllocateMdl
(
buffer
,
length
,
FALSE
,
FALSE
,
irp
);
if
(
device
->
Flags
&
DO_DIRECT_IO
)
{
MDL
*
mdl
=
IoAllocateMdl
(
buffer
,
length
,
FALSE
,
FALSE
,
irp
);
if
(
!
mdl
)
{
IoFreeIrp
(
irp
);
return
NULL
;
}
mdl
->
MdlFlags
|=
MDL_MAPPED_TO_SYSTEM_VA
;
mdl
->
MappedSystemVa
=
buffer
;
}
switch
(
majorfunc
)
{
...
...
include/ddk/wdm.h
View file @
b466e893
...
...
@@ -1306,8 +1306,17 @@ PVOID WINAPI MmAllocateContiguousMemory(SIZE_T,PHYSICAL_ADDRESS);
PVOID
WINAPI
MmAllocateNonCachedMemory
(
SIZE_T
);
PMDL
WINAPI
MmAllocatePagesForMdl
(
PHYSICAL_ADDRESS
,
PHYSICAL_ADDRESS
,
PHYSICAL_ADDRESS
,
SIZE_T
);
void
WINAPI
MmFreeNonCachedMemory
(
PVOID
,
SIZE_T
);
PVOID
WINAPI
MmMapLockedPagesSpecifyCache
(
PMDL
,
KPROCESSOR_MODE
,
MEMORY_CACHING_TYPE
,
PVOID
,
ULONG
,
ULONG
);
MM_SYSTEMSIZE
WINAPI
MmQuerySystemSize
(
void
);
static
inline
void
*
MmGetSystemAddressForMdlSafe
(
MDL
*
mdl
,
ULONG
priority
)
{
if
(
mdl
->
MdlFlags
&
(
MDL_MAPPED_TO_SYSTEM_VA
|
MDL_SOURCE_IS_NONPAGED_POOL
))
return
mdl
->
MappedSystemVa
;
else
return
MmMapLockedPagesSpecifyCache
(
mdl
,
KernelMode
,
MmCached
,
NULL
,
FALSE
,
priority
);
}
void
WINAPI
ObDereferenceObject
(
void
*
);
NTSTATUS
WINAPI
ObReferenceObjectByHandle
(
HANDLE
,
ACCESS_MASK
,
POBJECT_TYPE
,
KPROCESSOR_MODE
,
PVOID
*
,
POBJECT_HANDLE_INFORMATION
);
NTSTATUS
WINAPI
ObReferenceObjectByName
(
UNICODE_STRING
*
,
ULONG
,
ACCESS_STATE
*
,
ACCESS_MASK
,
POBJECT_TYPE
,
KPROCESSOR_MODE
,
void
*
,
void
**
);
...
...
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