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
cc49f6ba
Commit
cc49f6ba
authored
Nov 06, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Fix a few more errors on Win9x.
parent
9a2fdfd6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
65 additions
and
25 deletions
+65
-25
virtual.c
dlls/kernel32/tests/virtual.c
+65
-25
No files found.
dlls/kernel32/tests/virtual.c
View file @
cc49f6ba
...
...
@@ -529,21 +529,42 @@ static void test_MapViewOfFile(void)
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
MAPPING_SIZE
,
"RegionSize should have been 0x%x but was 0x%x
\n
"
,
MAPPING_SIZE
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_RESERVE
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
if
(
info
.
Type
==
MEM_PRIVATE
)
/* win9x is different for uncommitted mappings */
{
ok
(
info
.
AllocationProtect
==
PAGE_NOACCESS
,
"AllocationProtect should have been PAGE_NOACCESS but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
Protect
==
PAGE_NOACCESS
,
"Protect should have been PAGE_NOACCESS instead of 0x%x
\n
"
,
info
.
Protect
);
}
else
{
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
}
ret
=
VirtualQuery
(
ptr2
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr2
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
MAPPING_SIZE
,
"RegionSize should have been 0x%x but was 0x%x
\n
"
,
MAPPING_SIZE
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_RESERVE
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
if
(
ptr
!=
ptr2
)
{
ret
=
VirtualQuery
(
ptr2
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr2
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
MAPPING_SIZE
,
"RegionSize should have been 0x%x but was 0x%x
\n
"
,
MAPPING_SIZE
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_RESERVE
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
0
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
}
ptr
=
VirtualAlloc
(
ptr
,
0x10000
,
MEM_COMMIT
,
PAGE_READONLY
);
ok
(
ptr
!=
NULL
,
"VirtualAlloc failed with error %d
\n
"
,
GetLastError
());
...
...
@@ -552,28 +573,47 @@ static void test_MapViewOfFile(void)
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
0x10000
,
"RegionSize should have been 0x10000 but was 0x%x
\n
"
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_COMMIT
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
PAGE_READONLY
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
if
(
info
.
Type
==
MEM_PRIVATE
)
/* win9x is different for uncommitted mappings */
{
ok
(
info
.
AllocationProtect
==
PAGE_NOACCESS
,
"AllocationProtect should have been PAGE_NOACCESS but was 0x%x
\n
"
,
info
.
AllocationProtect
);
}
else
{
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
}
/* shows that the VirtualAlloc above affects the mapping, not just the
* virtual memory in this process - it also affects all other processes
* with a view of the mapping, but that isn't tested here */
ret
=
VirtualQuery
(
ptr2
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr2
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
0x10000
,
"RegionSize should have been 0x10000 but was 0x%x
\n
"
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_COMMIT
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
PAGE_READWRITE
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
if
(
ptr
!=
ptr2
)
{
ret
=
VirtualQuery
(
ptr2
,
&
info
,
sizeof
(
info
));
ok
(
ret
,
"VirtualQuery failed with error %d
\n
"
,
GetLastError
());
ok
(
info
.
BaseAddress
==
ptr2
,
"BaseAddress should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
BaseAddress
);
ok
(
info
.
AllocationBase
==
ptr2
,
"AllocationBase should have been %p but was %p instead
\n
"
,
ptr2
,
info
.
AllocationBase
);
ok
(
info
.
AllocationProtect
==
PAGE_READWRITE
,
"AllocationProtect should have been PAGE_READWRITE but was 0x%x
\n
"
,
info
.
AllocationProtect
);
ok
(
info
.
RegionSize
==
0x10000
,
"RegionSize should have been 0x10000 but was 0x%x
\n
"
,
(
unsigned
int
)
info
.
RegionSize
);
ok
(
info
.
State
==
MEM_COMMIT
,
"State should have been MEM_RESERVE instead of 0x%x
\n
"
,
info
.
State
);
ok
(
info
.
Protect
==
PAGE_READWRITE
,
"Protect should have been 0 instead of 0x%x
\n
"
,
info
.
Protect
);
ok
(
info
.
Type
==
MEM_MAPPED
,
"Type should have been MEM_MAPPED instead of 0x%x
\n
"
,
info
.
Type
);
}
ret
=
VirtualFree
(
ptr
,
0x10000
,
MEM_DECOMMIT
);
ok
(
!
ret
,
"VirtualFree succeeded
\n
"
);
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"VirtualFree failed with %u
\n
"
,
GetLastError
()
);
ok
(
!
ret
||
broken
(
ret
)
/* win9x */
,
"VirtualFree succeeded
\n
"
);
if
(
!
ret
)
ok
(
GetLastError
()
==
ERROR_INVALID_PARAMETER
,
"VirtualFree failed with %u
\n
"
,
GetLastError
()
);
ret
=
UnmapViewOfFile
(
ptr2
);
ok
(
ret
,
"UnmapViewOfFile failed with error %d
\n
"
,
GetLastError
());
...
...
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