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
c79a514f
Commit
c79a514f
authored
May 08, 2013
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 08, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32: Add more remote process tests.
parent
c012b1a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
loader.c
dlls/kernel32/tests/loader.c
+37
-1
No files found.
dlls/kernel32/tests/loader.c
View file @
c79a514f
...
...
@@ -1675,7 +1675,7 @@ static void test_ExitProcess(void)
#include "poppack.h"
static
const
char
filler
[
0x1000
];
DWORD
dummy
,
file_align
;
HANDLE
file
,
thread
,
hma
p
;
HANDLE
file
,
thread
,
process
,
hmap
,
hmap_du
p
;
char
temp_path
[
MAX_PATH
],
dll_name
[
MAX_PATH
],
cmdline
[
MAX_PATH
*
2
];
DWORD
ret
,
target_offset
,
old_prot
;
char
**
argv
,
buf
[
256
];
...
...
@@ -1683,6 +1683,7 @@ static void test_ExitProcess(void)
STARTUPINFO
si
=
{
sizeof
(
si
)
};
CONTEXT
ctx
;
struct
PROCESS_BASIC_INFORMATION_PRIVATE
pbi
;
MEMORY_BASIC_INFORMATION
mbi
;
DWORD_PTR
affinity
;
void
*
addr
;
LARGE_INTEGER
offset
;
...
...
@@ -1906,6 +1907,10 @@ static void test_ExitProcess(void)
ok
(
ret
,
"VirtualProtectEx error %d
\n
"
,
GetLastError
());
ok
(
old_prot
==
PAGE_READWRITE
,
"expected PAGE_READWRITE, got %#x
\n
"
,
old_prot
);
SetLastError
(
0xdeadbeef
);
size
=
VirtualQueryEx
(
pi
.
hProcess
,
NULL
,
&
mbi
,
sizeof
(
mbi
));
ok
(
size
==
sizeof
(
mbi
),
"VirtualQueryEx error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
ReadProcessMemory
(
pi
.
hProcess
,
addr
,
buf
,
4
,
&
size
);
ok
(
ret
,
"ReadProcessMemory error %d
\n
"
,
GetLastError
());
ok
(
size
==
4
,
"expected 4, got %lu
\n
"
,
size
);
...
...
@@ -1914,6 +1919,11 @@ static void test_ExitProcess(void)
hmap
=
CreateFileMapping
(
INVALID_HANDLE_VALUE
,
NULL
,
PAGE_READWRITE
,
0
,
4096
,
NULL
);
ok
(
hmap
!=
0
,
"CreateFileMapping error %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
hmap
,
pi
.
hProcess
,
&
hmap_dup
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
ok
(
ret
,
"DuplicateHandle error %d
\n
"
,
GetLastError
());
offset
.
u
.
LowPart
=
0
;
offset
.
u
.
HighPart
=
0
;
addr
=
NULL
;
...
...
@@ -1959,6 +1969,11 @@ static void test_ExitProcess(void)
ret
=
WaitForSingleObject
(
pi
.
hProcess
,
1000
);
ok
(
ret
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed: %x
\n
"
,
ret
);
SetLastError
(
0xdeadbeef
);
process
=
OpenProcess
(
PROCESS_ALL_ACCESS
,
FALSE
,
pi
.
dwProcessId
);
ok
(
process
!=
NULL
,
"OpenProcess error %d
\n
"
,
GetLastError
());
CloseHandle
(
process
);
memset
(
&
pbi
,
0
,
sizeof
(
pbi
));
ret
=
pNtQueryInformationProcess
(
pi
.
hProcess
,
ProcessBasicInformation
,
&
pbi
,
sizeof
(
pbi
),
NULL
);
ok
(
!
ret
,
"NtQueryInformationProcess error %#x
\n
"
,
ret
);
...
...
@@ -2027,6 +2042,27 @@ static void test_ExitProcess(void)
addr
=
VirtualAllocEx
(
pi
.
hProcess
,
NULL
,
4096
,
MEM_COMMIT
,
PAGE_READWRITE
);
ok
(
!
addr
,
"VirtualAllocEx should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
SetLastError
(
0xdeadbeef
);
size
=
VirtualQueryEx
(
pi
.
hProcess
,
NULL
,
&
mbi
,
sizeof
(
mbi
));
ok
(
!
size
,
"VirtualQueryEx should fail
\n
"
);
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
/* CloseHandle() call below leads to premature process termination
* under some Windows versions.
*/
if
(
0
)
{
SetLastError
(
0xdeadbeef
);
ret
=
CloseHandle
(
hmap_dup
);
ok
(
ret
,
"CloseHandle should not fail
\n
"
);
}
SetLastError
(
0xdeadbeef
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
hmap
,
pi
.
hProcess
,
&
hmap_dup
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
ok
(
!
ret
,
"DuplicateHandle should fail
\n
"
);
todo_wine
ok
(
GetLastError
()
==
ERROR_ACCESS_DENIED
,
"expected ERROR_ACCESS_DENIED, got %d
\n
"
,
GetLastError
());
offset
.
u
.
LowPart
=
0
;
offset
.
u
.
HighPart
=
0
;
...
...
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