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
25e1fcc5
Commit
25e1fcc5
authored
Dec 28, 2021
by
André Zwing
Committed by
Alexandre Julliard
Dec 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernelbase/tests: Don't test functions directly when reporting GetLastError().
Signed-off-by:
André Zwing
<
nerv@dawncrow.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a6bf1a5f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
17 deletions
+19
-17
process.c
dlls/kernelbase/tests/process.c
+19
-17
No files found.
dlls/kernelbase/tests/process.c
View file @
25e1fcc5
...
...
@@ -35,6 +35,7 @@ static BOOL (WINAPI *pCompareObjectHandles)(HANDLE, HANDLE);
static
void
test_CompareObjectHandles
(
void
)
{
HANDLE
h1
,
h2
;
BOOL
ret
;
if
(
!
pCompareObjectHandles
)
{
...
...
@@ -42,24 +43,24 @@ static void test_CompareObjectHandles(void)
return
;
}
ok
(
pCompareObjectHandles
(
GetCurrentProcess
(),
GetCurrentProcess
()
),
"comparing GetCurrentProcess() to self failed with %u
\n
"
,
GetLastError
()
);
ret
=
pCompareObjectHandles
(
GetCurrentProcess
(),
GetCurrentProcess
()
);
ok
(
ret
,
"comparing GetCurrentProcess() to self failed with %u
\n
"
,
GetLastError
()
);
ok
(
pCompareObjectHandles
(
GetCurrentThread
(),
GetCurrentThread
()
),
"comparing GetCurrentThread() to self failed with %u
\n
"
,
GetLastError
()
);
ret
=
pCompareObjectHandles
(
GetCurrentThread
(),
GetCurrentThread
()
);
ok
(
ret
,
"comparing GetCurrentThread() to self failed with %u
\n
"
,
GetLastError
()
);
SetLastError
(
0
);
ok
(
!
pCompareObjectHandles
(
GetCurrentProcess
(),
GetCurrentThread
()
)
&&
GetLastError
()
==
ERROR_NOT_SAME_OBJECT
,
ret
=
pCompareObjectHandles
(
GetCurrentProcess
(),
GetCurrentThread
()
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NOT_SAME_OBJECT
,
"comparing GetCurrentProcess() to GetCurrentThread() returned %u
\n
"
,
GetLastError
()
);
h1
=
NULL
;
ok
(
DuplicateHandle
(
GetCurrentProcess
(),
GetCurrentProcess
(),
GetCurrentProcess
(),
&
h1
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
),
"failed to duplicate current process handle: %u
\n
"
,
GetLastError
()
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
GetCurrentProcess
(),
GetCurrentProcess
(),
&
h1
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
ok
(
ret
,
"failed to duplicate current process handle: %u
\n
"
,
GetLastError
()
);
ok
(
pCompareObjectHandles
(
GetCurrentProcess
(),
h1
),
"comparing GetCurrentProcess() with %p failed with %u
\n
"
,
h1
,
GetLastError
()
);
ret
=
pCompareObjectHandles
(
GetCurrentProcess
(),
h1
);
ok
(
ret
,
"comparing GetCurrentProcess() with %p failed with %u
\n
"
,
h1
,
GetLastError
()
);
CloseHandle
(
h1
);
...
...
@@ -67,12 +68,12 @@ static void test_CompareObjectHandles(void)
ok
(
h1
!=
INVALID_HANDLE_VALUE
,
"CreateFile failed (%d)
\n
"
,
GetLastError
()
);
h2
=
NULL
;
ok
(
DuplicateHandle
(
GetCurrentProcess
(),
h1
,
GetCurrentProcess
(),
&
h2
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
),
"failed to duplicate handle %p: %u
\n
"
,
h1
,
GetLastError
()
);
ret
=
DuplicateHandle
(
GetCurrentProcess
(),
h1
,
GetCurrentProcess
(),
&
h2
,
0
,
FALSE
,
DUPLICATE_SAME_ACCESS
);
ok
(
ret
,
"failed to duplicate handle %p: %u
\n
"
,
h1
,
GetLastError
()
);
ok
(
pCompareObjectHandles
(
h1
,
h2
),
"comparing %p with %p failed with %u
\n
"
,
h1
,
h2
,
GetLastError
()
);
ret
=
pCompareObjectHandles
(
h1
,
h2
);
ok
(
ret
,
"comparing %p with %p failed with %u
\n
"
,
h1
,
h2
,
GetLastError
()
);
CloseHandle
(
h2
);
...
...
@@ -80,7 +81,8 @@ static void test_CompareObjectHandles(void)
ok
(
h2
!=
INVALID_HANDLE_VALUE
,
"CreateFile failed (%d)
\n
"
,
GetLastError
()
);
SetLastError
(
0
);
ok
(
!
pCompareObjectHandles
(
h1
,
h2
)
&&
GetLastError
()
==
ERROR_NOT_SAME_OBJECT
,
ret
=
pCompareObjectHandles
(
h1
,
h2
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NOT_SAME_OBJECT
,
"comparing %p with %p returned %u
\n
"
,
h1
,
h2
,
GetLastError
()
);
CloseHandle
(
h2
);
...
...
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