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
7749b6e2
Commit
7749b6e2
authored
Dec 08, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Added some tests for behavior of 64-bit kernel handles.
parent
5ad3bbab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
process.c
dlls/kernel32/tests/process.c
+31
-0
No files found.
dlls/kernel32/tests/process.c
View file @
7749b6e2
...
...
@@ -1520,6 +1520,36 @@ static void test_GetProcessVersion(void)
CloseHandle
(
pi
.
hThread
);
}
static
void
test_Handles
(
void
)
{
HANDLE
handle
=
GetCurrentProcess
();
BOOL
ret
;
DWORD
code
;
ok
(
handle
==
(
HANDLE
)
~
(
ULONG_PTR
)
0
,
"invalid current process handle %p
\n
"
,
handle
);
ret
=
GetExitCodeProcess
(
handle
,
&
code
);
ok
(
ret
,
"GetExitCodeProcess failed err %u
\n
"
,
GetLastError
()
);
#ifdef _WIN64
/* truncated handle */
SetLastError
(
0xdeadbeef
);
handle
=
(
HANDLE
)((
ULONG_PTR
)
handle
&
~
0u
);
ret
=
GetExitCodeProcess
(
handle
,
&
code
);
ok
(
!
ret
,
"GetExitCodeProcess succeeded for %p
\n
"
,
handle
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
/* sign-extended handle */
SetLastError
(
0xdeadbeef
);
handle
=
(
HANDLE
)((
LONG_PTR
)(
int
)(
ULONG_PTR
)
handle
);
ret
=
GetExitCodeProcess
(
handle
,
&
code
);
ok
(
ret
,
"GetExitCodeProcess failed err %u
\n
"
,
GetLastError
()
);
/* invalid high-word */
SetLastError
(
0xdeadbeef
);
handle
=
(
HANDLE
)(((
ULONG_PTR
)
handle
&
~
0u
)
+
((
ULONG_PTR
)
1
<<
32
));
ret
=
GetExitCodeProcess
(
handle
,
&
code
);
ok
(
!
ret
,
"GetExitCodeProcess succeeded for %p
\n
"
,
handle
);
ok
(
GetLastError
()
==
ERROR_INVALID_HANDLE
,
"wrong error %u
\n
"
,
GetLastError
()
);
#endif
}
START_TEST
(
process
)
{
int
b
=
init
();
...
...
@@ -1541,6 +1571,7 @@ START_TEST(process)
test_ExitCode
();
test_OpenProcess
();
test_GetProcessVersion
();
test_Handles
();
/* things that can be tested:
* lookup: check the way program to be executed is searched
* handles: check the handle inheritance stuff (+sec options)
...
...
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