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
33255ee6
Commit
33255ee6
authored
Oct 31, 2011
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Nov 03, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Make the VirtualProtect tests pass under Wine.
parent
df9a0868
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
16 deletions
+1
-16
virtual.c
dlls/kernel32/tests/virtual.c
+0
-16
virtual.c
dlls/ntdll/virtual.c
+1
-0
No files found.
dlls/kernel32/tests/virtual.c
View file @
33255ee6
...
...
@@ -1472,16 +1472,8 @@ static void test_VirtualProtect(void)
}
else
{
/* FIXME: remove the condition below once Wine is fixed */
if
((
td
[
i
].
prot_set
==
PAGE_WRITECOPY
)
||
(
td
[
i
].
prot_set
==
PAGE_EXECUTE_WRITECOPY
))
todo_wine
{
ok
(
!
ret
,
"%d: VirtualProtect should fail
\n
"
,
i
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
i
,
GetLastError
());
}
else
{
ok
(
!
ret
,
"%d: VirtualProtect should fail
\n
"
,
i
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"%d: expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
i
,
GetLastError
());
}
}
old_prot
=
0xdeadbeef
;
...
...
@@ -1491,13 +1483,7 @@ static void test_VirtualProtect(void)
if
(
td
[
i
].
prot_get
)
ok
(
old_prot
==
td
[
i
].
prot_get
,
"%d: got %#x != expected %#x
\n
"
,
i
,
old_prot
,
td
[
i
].
prot_get
);
else
{
/* FIXME: remove the condition below once Wine is fixed */
if
((
td
[
i
].
prot_set
==
PAGE_WRITECOPY
)
||
(
td
[
i
].
prot_set
==
PAGE_EXECUTE_WRITECOPY
))
todo_wine
ok
(
old_prot
==
PAGE_NOACCESS
,
"%d: got %#x != expected PAGE_NOACCESS
\n
"
,
i
,
old_prot
);
else
ok
(
old_prot
==
PAGE_NOACCESS
,
"%d: got %#x != expected PAGE_NOACCESS
\n
"
,
i
,
old_prot
);
}
}
exec_prot
=
0
;
...
...
@@ -1521,10 +1507,8 @@ static void test_VirtualProtect(void)
{
if
(
prot
&
(
PAGE_WRITECOPY
|
PAGE_EXECUTE_WRITECOPY
))
{
todo_wine
{
ok
(
!
ret
,
"VirtualProtect(%02x) should fail
\n
"
,
prot
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"expected ERROR_INVALID_PARAMETER, got %d
\n
"
,
GetLastError
());
}
}
else
ok
(
ret
,
"VirtualProtect(%02x) error %d
\n
"
,
prot
,
GetLastError
());
...
...
dlls/ntdll/virtual.c
View file @
33255ee6
...
...
@@ -2088,6 +2088,7 @@ NTSTATUS WINAPI NtProtectVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T
size
=
ROUND_SIZE
(
addr
,
size
);
base
=
ROUND_ADDR
(
addr
,
page_mask
);
if
((
status
=
get_vprot_flags
(
new_prot
,
&
new_vprot
)))
return
status
;
if
(
new_vprot
&
VPROT_WRITECOPY
)
return
STATUS_INVALID_PAGE_PROTECTION
;
new_vprot
|=
VPROT_COMMITTED
;
server_enter_uninterrupted_section
(
&
csVirtual
,
&
sigset
);
...
...
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