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
858a7efd
Commit
858a7efd
authored
Jan 14, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Check buffer for access in NtRead/WriteVirtualMemory.
This also triggers page faults needed for DIB section access and write watches.
parent
e016d2ec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
12 deletions
+28
-12
virtual.c
dlls/ntdll/virtual.c
+28
-12
No files found.
dlls/ntdll/virtual.c
View file @
858a7efd
...
...
@@ -2615,14 +2615,22 @@ NTSTATUS WINAPI NtReadVirtualMemory( HANDLE process, const void *addr, void *buf
{
NTSTATUS
status
;
SERVER_START_REQ
(
read_process_memory
)
if
(
virtual_check_buffer_for_write
(
buffer
,
size
)
)
{
req
->
handle
=
wine_server_obj_handle
(
process
);
req
->
addr
=
wine_server_client_ptr
(
addr
);
wine_server_set_reply
(
req
,
buffer
,
size
);
if
((
status
=
wine_server_call
(
req
)))
size
=
0
;
SERVER_START_REQ
(
read_process_memory
)
{
req
->
handle
=
wine_server_obj_handle
(
process
);
req
->
addr
=
wine_server_client_ptr
(
addr
);
wine_server_set_reply
(
req
,
buffer
,
size
);
if
((
status
=
wine_server_call
(
req
)))
size
=
0
;
}
SERVER_END_REQ
;
}
else
{
status
=
STATUS_ACCESS_VIOLATION
;
size
=
0
;
}
SERVER_END_REQ
;
if
(
bytes_read
)
*
bytes_read
=
size
;
return
status
;
}
...
...
@@ -2637,14 +2645,22 @@ NTSTATUS WINAPI NtWriteVirtualMemory( HANDLE process, void *addr, const void *bu
{
NTSTATUS
status
;
SERVER_START_REQ
(
write_process_memory
)
if
(
virtual_check_buffer_for_read
(
buffer
,
size
)
)
{
req
->
handle
=
wine_server_obj_handle
(
process
);
req
->
addr
=
wine_server_client_ptr
(
addr
);
wine_server_add_data
(
req
,
buffer
,
size
);
if
((
status
=
wine_server_call
(
req
)))
size
=
0
;
SERVER_START_REQ
(
write_process_memory
)
{
req
->
handle
=
wine_server_obj_handle
(
process
);
req
->
addr
=
wine_server_client_ptr
(
addr
);
wine_server_add_data
(
req
,
buffer
,
size
);
if
((
status
=
wine_server_call
(
req
)))
size
=
0
;
}
SERVER_END_REQ
;
}
else
{
status
=
STATUS_PARTIAL_COPY
;
size
=
0
;
}
SERVER_END_REQ
;
if
(
bytes_written
)
*
bytes_written
=
size
;
return
status
;
}
...
...
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