Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e33a6d61
Commit
e33a6d61
authored
Nov 19, 2006
by
Detlef Riekenberg
Committed by
Alexandre Julliard
Nov 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Load tests on Win9x again (VirtualAllocEx+VirtualFreeEx).
parent
454d5cd1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
process.c
dlls/kernel32/tests/process.c
+16
-4
No files found.
dlls/kernel32/tests/process.c
View file @
e33a6d61
...
@@ -31,6 +31,10 @@
...
@@ -31,6 +31,10 @@
#include "wincon.h"
#include "wincon.h"
#include "winnls.h"
#include "winnls.h"
static
HINSTANCE
hkernel32
;
static
LPVOID
(
WINAPI
*
pVirtualAllocEx
)(
HANDLE
,
LPVOID
,
SIZE_T
,
DWORD
,
DWORD
);
static
LPVOID
(
WINAPI
*
pVirtualFreeEx
)(
HANDLE
,
LPVOID
,
SIZE_T
,
DWORD
);
static
char
base
[
MAX_PATH
];
static
char
base
[
MAX_PATH
];
static
char
selfname
[
MAX_PATH
];
static
char
selfname
[
MAX_PATH
];
static
char
resfile
[
MAX_PATH
];
static
char
resfile
[
MAX_PATH
];
...
@@ -147,12 +151,17 @@ static WCHAR* decodeW(const char* str)
...
@@ -147,12 +151,17 @@ static WCHAR* decodeW(const char* str)
* generates basic information like:
* generates basic information like:
* base: absolute path to curr dir
* base: absolute path to curr dir
* selfname: the way to reinvoke ourselves
* selfname: the way to reinvoke ourselves
* function-pointers, which are not implemented in all windows versions
*/
*/
static
int
init
(
void
)
static
int
init
(
void
)
{
{
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
myARGC
=
winetest_get_mainargs
(
&
myARGV
);
if
(
!
GetCurrentDirectoryA
(
sizeof
(
base
),
base
))
return
0
;
if
(
!
GetCurrentDirectoryA
(
sizeof
(
base
),
base
))
return
0
;
strcpy
(
selfname
,
myARGV
[
0
]);
strcpy
(
selfname
,
myARGV
[
0
]);
hkernel32
=
GetModuleHandleA
(
"kernel32"
);
pVirtualAllocEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"VirtualAllocEx"
);
pVirtualFreeEx
=
(
void
*
)
GetProcAddress
(
hkernel32
,
"VirtualFreeEx"
);
return
1
;
return
1
;
}
}
...
@@ -1273,12 +1282,15 @@ static void test_OpenProcess(void)
...
@@ -1273,12 +1282,15 @@ static void test_OpenProcess(void)
MEMORY_BASIC_INFORMATION
info
;
MEMORY_BASIC_INFORMATION
info
;
SIZE_T
dummy
,
read_bytes
;
SIZE_T
dummy
,
read_bytes
;
/* Not implemented in all windows versions */
if
((
!
pVirtualAllocEx
)
||
(
!
pVirtualFreeEx
))
return
;
/* without PROCESS_VM_OPERATION */
/* without PROCESS_VM_OPERATION */
hproc
=
OpenProcess
(
PROCESS_ALL_ACCESS
&
~
PROCESS_VM_OPERATION
,
FALSE
,
GetCurrentProcessId
());
hproc
=
OpenProcess
(
PROCESS_ALL_ACCESS
&
~
PROCESS_VM_OPERATION
,
FALSE
,
GetCurrentProcessId
());
ok
(
hproc
!=
NULL
,
"OpenProcess error %d
\n
"
,
GetLastError
());
ok
(
hproc
!=
NULL
,
"OpenProcess error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
addr1
=
VirtualAllocEx
(
hproc
,
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
addr1
=
p
VirtualAllocEx
(
hproc
,
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
todo_wine
{
todo_wine
{
ok
(
!
addr1
,
"VirtualAllocEx should fail
\n
"
);
ok
(
!
addr1
,
"VirtualAllocEx should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %d
\n
"
,
GetLastError
());
...
@@ -1295,12 +1307,12 @@ todo_wine {
...
@@ -1295,12 +1307,12 @@ todo_wine {
hproc
=
OpenProcess
(
PROCESS_VM_OPERATION
,
FALSE
,
GetCurrentProcessId
());
hproc
=
OpenProcess
(
PROCESS_VM_OPERATION
,
FALSE
,
GetCurrentProcessId
());
ok
(
hproc
!=
NULL
,
"OpenProcess error %d
\n
"
,
GetLastError
());
ok
(
hproc
!=
NULL
,
"OpenProcess error %d
\n
"
,
GetLastError
());
addr1
=
VirtualAllocEx
(
hproc
,
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
addr1
=
p
VirtualAllocEx
(
hproc
,
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
todo_wine
{
todo_wine
{
ok
(
addr1
!=
NULL
,
"VirtualAllocEx error %d
\n
"
,
GetLastError
());
ok
(
addr1
!=
NULL
,
"VirtualAllocEx error %d
\n
"
,
GetLastError
());
}
}
if
(
addr1
==
NULL
)
/* FIXME: remove once Wine is fixed */
if
(
addr1
==
NULL
)
/* FIXME: remove once Wine is fixed */
addr1
=
VirtualAllocEx
(
GetCurrentProcess
(),
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
addr1
=
p
VirtualAllocEx
(
GetCurrentProcess
(),
0
,
0xFFFC
,
MEM_RESERVE
,
PAGE_NOACCESS
);
/* without PROCESS_QUERY_INFORMATION */
/* without PROCESS_QUERY_INFORMATION */
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
...
@@ -1337,7 +1349,7 @@ todo_wine {
...
@@ -1337,7 +1349,7 @@ todo_wine {
SetLastError
(
0xdeadbeef
);
SetLastError
(
0xdeadbeef
);
todo_wine
{
todo_wine
{
ok
(
!
VirtualFreeEx
(
hproc
,
addr1
,
0
,
MEM_RELEASE
),
ok
(
!
p
VirtualFreeEx
(
hproc
,
addr1
,
0
,
MEM_RELEASE
),
"VirtualFreeEx without PROCESS_VM_OPERATION rights should fail
\n
"
);
"VirtualFreeEx without PROCESS_VM_OPERATION rights should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong error %d
\n
"
,
GetLastError
());
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"wrong 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