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
5c654716
Commit
5c654716
authored
Oct 02, 2012
by
Christian Costa
Committed by
Alexandre Julliard
Oct 02, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntoskrnl.exe: Implement IoAllocateMdl.
parent
ce44d1e5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
2 deletions
+23
-2
ntoskrnl.c
dlls/ntoskrnl.exe/ntoskrnl.c
+23
-2
No files found.
dlls/ntoskrnl.exe/ntoskrnl.c
View file @
5c654716
...
...
@@ -415,13 +415,34 @@ PVOID WINAPI IoAllocateErrorLogEntry( PVOID IoObject, UCHAR EntrySize )
PMDL
WINAPI
IoAllocateMdl
(
PVOID
VirtualAddress
,
ULONG
Length
,
BOOLEAN
SecondaryBuffer
,
BOOLEAN
ChargeQuota
,
PIRP
Irp
)
{
PMDL
mdl
;
ULONG_PTR
address
=
(
ULONG_PTR
)
VirtualAddress
;
ULONG_PTR
page_address
;
SIZE_T
nb_pages
,
mdl_size
;
FIXME
(
"partial stub: %p, %u, %i, %i, %p
\n
"
,
VirtualAddress
,
Length
,
SecondaryBuffer
,
ChargeQuota
,
Irp
);
TRACE
(
"(%p, %u, %i, %i, %p)
\n
"
,
VirtualAddress
,
Length
,
SecondaryBuffer
,
ChargeQuota
,
Irp
);
mdl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
MDL
));
if
(
Irp
)
FIXME
(
"Attaching the MDL to an IRP is not yet supported
\n
"
);
if
(
ChargeQuota
)
FIXME
(
"Charge quota is not yet supported
\n
"
);
/* FIXME: We suppose that page size is 4096 */
page_address
=
address
&
~
(
4096
-
1
);
nb_pages
=
(((
address
+
Length
-
1
)
&
~
(
4096
-
1
))
-
page_address
)
/
4096
+
1
;
mdl_size
=
sizeof
(
MDL
)
+
nb_pages
*
sizeof
(
PVOID
);
mdl
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
mdl_size
);
if
(
!
mdl
)
return
NULL
;
mdl
->
Size
=
mdl_size
;
mdl
->
Process
=
IoGetCurrentProcess
();
mdl
->
StartVa
=
(
PVOID
)
page_address
;
mdl
->
ByteCount
=
Length
;
mdl
->
ByteOffset
=
address
-
page_address
;
return
mdl
;
}
...
...
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