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
f9d2db93
Commit
f9d2db93
authored
Feb 06, 2021
by
Zebediah Figura
Committed by
Alexandre Julliard
Feb 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Add a couple tests for DuplicateTokenEx() access flags.
Signed-off-by:
Zebediah Figura
<
z.figura12@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f68659c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
security.c
dlls/advapi32/tests/security.c
+32
-0
No files found.
dlls/advapi32/tests/security.c
View file @
f9d2db93
...
...
@@ -7926,6 +7926,37 @@ static void test_pseudo_handle_security(void)
}
}
static
void
test_duplicate_token
(
void
)
{
HANDLE
token
,
token2
;
BOOL
ret
;
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_ADJUST_DEFAULT
,
&
token
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
ret
=
DuplicateToken
(
token
,
SecurityAnonymous
,
&
token2
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
TEST_GRANTED_ACCESS
(
token2
,
TOKEN_QUERY
|
TOKEN_IMPERSONATE
);
CloseHandle
(
token2
);
ret
=
DuplicateTokenEx
(
token
,
0
,
NULL
,
SecurityAnonymous
,
TokenPrimary
,
&
token2
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
TEST_GRANTED_ACCESS
(
token2
,
TOKEN_QUERY
|
TOKEN_DUPLICATE
|
TOKEN_ADJUST_DEFAULT
);
CloseHandle
(
token2
);
ret
=
DuplicateTokenEx
(
token
,
MAXIMUM_ALLOWED
,
NULL
,
SecurityAnonymous
,
TokenPrimary
,
&
token2
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
TEST_GRANTED_ACCESS
(
token2
,
TOKEN_ALL_ACCESS
);
CloseHandle
(
token2
);
ret
=
DuplicateTokenEx
(
token
,
TOKEN_QUERY_SOURCE
,
NULL
,
SecurityAnonymous
,
TokenPrimary
,
&
token2
);
ok
(
ret
,
"got error %u
\n
"
,
GetLastError
());
TEST_GRANTED_ACCESS
(
token2
,
TOKEN_QUERY_SOURCE
);
CloseHandle
(
token2
);
CloseHandle
(
token
);
}
START_TEST
(
security
)
{
init
();
...
...
@@ -7989,6 +8020,7 @@ START_TEST(security)
test_duplicate_handle_access
();
test_create_process_token
();
test_pseudo_handle_security
();
test_duplicate_token
();
/* Must be the last test, modifies process token */
test_token_security_descriptor
();
...
...
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