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
e317b606
Commit
e317b606
authored
Sep 15, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Fix the image protection test on Mac OS where the image limits are only approximative.
parent
665ede75
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
3 deletions
+13
-3
info.c
dlls/ntdll/tests/info.c
+13
-3
No files found.
dlls/ntdll/tests/info.c
View file @
e317b606
...
...
@@ -1077,11 +1077,14 @@ static void test_queryvirtualmemory(void)
static
char
rwtestbuf
[
42
];
MEMORY_BASIC_INFORMATION
mbi
;
char
stackbuf
[
42
];
HMODULE
module
;
trace
(
"Check flags of a function entry in NTDLL.DLL at %p
\n
"
,
pNtQueryVirtualMemory
);
module
=
GetModuleHandle
(
"ntdll.dll"
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
pNtQueryVirtualMemory
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
readcount
==
sizeof
(
MEMORY_BASIC_INFORMATION
),
"Expected to read %d bytes, got %ld
\n
"
,(
int
)
sizeof
(
MEMORY_BASIC_INFORMATION
),
readcount
);
ok
(
mbi
.
AllocationBase
==
module
,
"mbi.AllocationBase is 0x%p, expected 0x%p
\n
"
,
mbi
.
AllocationBase
,
module
);
ok
(
mbi
.
AllocationProtect
==
PAGE_EXECUTE_WRITECOPY
,
"mbi.AllocationProtect is 0x%x, expected 0x%x
\n
"
,
mbi
.
AllocationProtect
,
PAGE_EXECUTE_WRITECOPY
);
ok
(
mbi
.
State
==
MEM_COMMIT
,
"mbi.State is 0x%x, expected 0x%x
\n
"
,
mbi
.
State
,
MEM_COMMIT
);
ok
(
mbi
.
Protect
==
PAGE_EXECUTE_READ
,
"mbi.Protect is 0x%x, expected 0x%x
\n
"
,
mbi
.
Protect
,
PAGE_EXECUTE_READ
);
...
...
@@ -1105,9 +1108,11 @@ static void test_queryvirtualmemory(void)
ok
(
mbi
.
Protect
==
PAGE_READWRITE
,
"mbi.Protect is 0x%x, expected 0x%x
\n
"
,
mbi
.
Protect
,
PAGE_READWRITE
);
trace
(
"Check flags of read-only data at %p
\n
"
,
teststring
);
module
=
GetModuleHandle
(
NULL
);
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
teststring
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
readcount
==
sizeof
(
MEMORY_BASIC_INFORMATION
),
"Expected to read %d bytes, got %ld
\n
"
,(
int
)
sizeof
(
MEMORY_BASIC_INFORMATION
),
readcount
);
ok
(
mbi
.
AllocationBase
==
module
,
"mbi.AllocationBase is 0x%p, expected 0x%p
\n
"
,
mbi
.
AllocationBase
,
module
);
ok
(
mbi
.
AllocationProtect
==
PAGE_EXECUTE_WRITECOPY
,
"mbi.AllocationProtect is 0x%x, expected 0x%x
\n
"
,
mbi
.
AllocationProtect
,
PAGE_EXECUTE_WRITECOPY
);
ok
(
mbi
.
State
==
MEM_COMMIT
,
"mbi.State is 0x%x, expected 0x%X
\n
"
,
mbi
.
State
,
MEM_COMMIT
);
if
(
mbi
.
Protect
!=
PAGE_READONLY
)
...
...
@@ -1117,6 +1122,7 @@ static void test_queryvirtualmemory(void)
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
datatestbuf
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
readcount
==
sizeof
(
MEMORY_BASIC_INFORMATION
),
"Expected to read %d bytes, got %ld
\n
"
,(
int
)
sizeof
(
MEMORY_BASIC_INFORMATION
),
readcount
);
ok
(
mbi
.
AllocationBase
==
module
,
"mbi.AllocationBase is 0x%p, expected 0x%p
\n
"
,
mbi
.
AllocationBase
,
module
);
ok
(
mbi
.
AllocationProtect
==
PAGE_EXECUTE_WRITECOPY
,
"mbi.AllocationProtect is 0x%x, expected 0x%x
\n
"
,
mbi
.
AllocationProtect
,
PAGE_EXECUTE_WRITECOPY
);
ok
(
mbi
.
State
==
MEM_COMMIT
,
"mbi.State is 0x%x, expected 0x%X
\n
"
,
mbi
.
State
,
MEM_COMMIT
);
ok
(
mbi
.
Protect
==
PAGE_READWRITE
,
"mbi.Protect is 0x%x, expected 0x%X
\n
"
,
mbi
.
Protect
,
PAGE_READWRITE
);
...
...
@@ -1125,9 +1131,13 @@ static void test_queryvirtualmemory(void)
status
=
pNtQueryVirtualMemory
(
NtCurrentProcess
(),
rwtestbuf
,
MemoryBasicInformation
,
&
mbi
,
sizeof
(
MEMORY_BASIC_INFORMATION
),
&
readcount
);
ok
(
status
==
STATUS_SUCCESS
,
"Expected STATUS_SUCCESS, got %08x
\n
"
,
status
);
ok
(
readcount
==
sizeof
(
MEMORY_BASIC_INFORMATION
),
"Expected to read %d bytes, got %ld
\n
"
,(
int
)
sizeof
(
MEMORY_BASIC_INFORMATION
),
readcount
);
ok
(
mbi
.
AllocationProtect
==
PAGE_EXECUTE_WRITECOPY
,
"mbi.AllocationProtect is 0x%x, expected 0x%x
\n
"
,
mbi
.
AllocationProtect
,
PAGE_EXECUTE_WRITECOPY
);
ok
(
mbi
.
State
==
MEM_COMMIT
,
"mbi.State is 0x%x, expected 0x%X
\n
"
,
mbi
.
State
,
MEM_COMMIT
);
ok
(
mbi
.
Protect
==
PAGE_READWRITE
,
"mbi.Protect is 0x%x, expected 0x%X
\n
"
,
mbi
.
Protect
,
PAGE_READWRITE
);
if
(
mbi
.
AllocationBase
==
module
)
{
ok
(
mbi
.
AllocationProtect
==
PAGE_EXECUTE_WRITECOPY
,
"mbi.AllocationProtect is 0x%x, expected 0x%x
\n
"
,
mbi
.
AllocationProtect
,
PAGE_EXECUTE_WRITECOPY
);
ok
(
mbi
.
State
==
MEM_COMMIT
,
"mbi.State is 0x%x, expected 0x%X
\n
"
,
mbi
.
State
,
MEM_COMMIT
);
ok
(
mbi
.
Protect
==
PAGE_READWRITE
,
"mbi.Protect is 0x%x, expected 0x%X
\n
"
,
mbi
.
Protect
,
PAGE_READWRITE
);
}
else
skip
(
"bss is outside of module
\n
"
);
/* this can happen on Mac OS */
}
static
void
test_affinity
(
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