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
3326c578
Commit
3326c578
authored
Nov 26, 2020
by
Rémi Bernon
Committed by
Alexandre Julliard
Nov 26, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll/tests: Add tests for NtOpenProcess return status.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c4a9a296
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
0 deletions
+53
-0
om.c
dlls/ntdll/tests/om.c
+53
-0
No files found.
dlls/ntdll/tests/om.c
View file @
3326c578
...
...
@@ -73,6 +73,7 @@ static NTSTATUS (WINAPI *pNtQuerySystemTime)( LARGE_INTEGER * );
static
NTSTATUS
(
WINAPI
*
pRtlWaitOnAddress
)(
const
void
*
,
const
void
*
,
SIZE_T
,
const
LARGE_INTEGER
*
);
static
void
(
WINAPI
*
pRtlWakeAddressAll
)(
const
void
*
);
static
void
(
WINAPI
*
pRtlWakeAddressSingle
)(
const
void
*
);
static
NTSTATUS
(
WINAPI
*
pNtOpenProcess
)(
HANDLE
*
,
ACCESS_MASK
,
const
OBJECT_ATTRIBUTES
*
,
const
CLIENT_ID
*
);
#define KEYEDEVENT_WAIT 0x0001
#define KEYEDEVENT_WAKE 0x0002
...
...
@@ -2034,6 +2035,56 @@ static void test_wait_on_address(void)
ok
(
address
==
0
,
"got %s
\n
"
,
wine_dbgstr_longlong
(
address
));
}
static
void
test_process
(
void
)
{
OBJECT_ATTRIBUTES
attr
;
CLIENT_ID
cid
;
NTSTATUS
status
;
HANDLE
process
;
if
(
!
pNtOpenProcess
)
{
win_skip
(
"NtOpenProcess not supported, skipping test
\n
"
);
return
;
}
InitializeObjectAttributes
(
&
attr
,
NULL
,
0
,
0
,
NULL
);
cid
.
UniqueProcess
=
0
;
cid
.
UniqueThread
=
0
;
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
NULL
,
&
cid
);
todo_wine
ok
(
status
==
STATUS_ACCESS_VIOLATION
,
"NtOpenProcess returned %x
\n
"
,
status
);
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
NULL
);
todo_wine
ok
(
status
==
STATUS_INVALID_PARAMETER_MIX
,
"NtOpenProcess returned %x
\n
"
,
status
);
cid
.
UniqueProcess
=
0
;
cid
.
UniqueThread
=
0
;
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
&
cid
);
todo_wine
ok
(
status
==
STATUS_INVALID_CID
,
"NtOpenProcess returned %x
\n
"
,
status
);
cid
.
UniqueProcess
=
ULongToHandle
(
0xdeadbeef
);
cid
.
UniqueThread
=
ULongToHandle
(
0xdeadbeef
);
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
&
cid
);
todo_wine
ok
(
status
==
STATUS_INVALID_CID
,
"NtOpenProcess returned %x
\n
"
,
status
);
cid
.
UniqueProcess
=
ULongToHandle
(
GetCurrentThreadId
()
);
cid
.
UniqueThread
=
0
;
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
&
cid
);
todo_wine
ok
(
status
==
STATUS_INVALID_CID
,
"NtOpenProcess returned %x
\n
"
,
status
);
cid
.
UniqueProcess
=
ULongToHandle
(
GetCurrentProcessId
()
);
cid
.
UniqueThread
=
0
;
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
&
cid
);
ok
(
!
status
,
"NtOpenProcess returned %x
\n
"
,
status
);
pNtClose
(
process
);
cid
.
UniqueProcess
=
ULongToHandle
(
GetCurrentProcessId
()
);
cid
.
UniqueThread
=
ULongToHandle
(
GetCurrentThreadId
()
);
status
=
pNtOpenProcess
(
&
process
,
PROCESS_QUERY_LIMITED_INFORMATION
,
&
attr
,
&
cid
);
ok
(
!
status
,
"NtOpenProcess returned %x
\n
"
,
status
);
pNtClose
(
process
);
}
START_TEST
(
om
)
{
HMODULE
hntdll
=
GetModuleHandleA
(
"ntdll.dll"
);
...
...
@@ -2082,6 +2133,7 @@ START_TEST(om)
pRtlWaitOnAddress
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlWaitOnAddress"
);
pRtlWakeAddressAll
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlWakeAddressAll"
);
pRtlWakeAddressSingle
=
(
void
*
)
GetProcAddress
(
hntdll
,
"RtlWakeAddressSingle"
);
pNtOpenProcess
=
(
void
*
)
GetProcAddress
(
hntdll
,
"NtOpenProcess"
);
test_case_sensitive
();
test_namespace_pipe
();
...
...
@@ -2096,4 +2148,5 @@ START_TEST(om)
test_keyed_events
();
test_null_device
();
test_wait_on_address
();
test_process
();
}
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