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
ee6a477c
Commit
ee6a477c
authored
May 02, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
May 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Return failure in NtProtectVirtualMemory when last argument is omitted.
parent
38775875
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
5 deletions
+3
-5
virtual.c
dlls/kernel32/tests/virtual.c
+0
-5
virtual.c
dlls/ntdll/virtual.c
+3
-0
No files found.
dlls/kernel32/tests/virtual.c
View file @
ee6a477c
...
...
@@ -2492,27 +2492,22 @@ static void test_VirtualProtect(void)
SetLastError
(
0xdeadbeef
);
ret
=
VirtualProtect
(
base
,
si
.
dwPageSize
,
PAGE_READONLY
,
NULL
);
todo_wine
ok
(
!
ret
,
"VirtualProtect should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_NOACCESS
,
"expected ERROR_NOACCESS, got %d
\n
"
,
GetLastError
());
old_prot
=
0xdeadbeef
;
ret
=
VirtualProtect
(
base
,
si
.
dwPageSize
,
PAGE_NOACCESS
,
&
old_prot
);
ok
(
ret
,
"VirtualProtect failed %d
\n
"
,
GetLastError
());
todo_wine
ok
(
old_prot
==
PAGE_NOACCESS
,
"got %#x != expected PAGE_NOACCESS
\n
"
,
old_prot
);
addr
=
base
;
size
=
si
.
dwPageSize
;
status
=
pNtProtectVirtualMemory
(
GetCurrentProcess
(),
&
addr
,
&
size
,
PAGE_READONLY
,
NULL
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"NtProtectVirtualMemory should fail, got %08x
\n
"
,
status
);
addr
=
base
;
size
=
si
.
dwPageSize
;
old_prot
=
0xdeadbeef
;
status
=
pNtProtectVirtualMemory
(
GetCurrentProcess
(),
&
addr
,
&
size
,
PAGE_NOACCESS
,
&
old_prot
);
ok
(
status
==
STATUS_SUCCESS
,
"NtProtectVirtualMemory should succeed, got %08x
\n
"
,
status
);
todo_wine
ok
(
old_prot
==
PAGE_NOACCESS
,
"got %#x != expected PAGE_NOACCESS
\n
"
,
old_prot
);
for
(
i
=
0
;
i
<
sizeof
(
td
)
/
sizeof
(
td
[
0
]);
i
++
)
...
...
dlls/ntdll/virtual.c
View file @
ee6a477c
...
...
@@ -2164,6 +2164,9 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
TRACE
(
"%p %p %08lx %08x
\n
"
,
process
,
addr
,
size
,
new_prot
);
if
(
!
old_prot
)
return
STATUS_ACCESS_VIOLATION
;
if
(
process
!=
NtCurrentProcess
())
{
apc_call_t
call
;
...
...
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