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
9b3b9a10
Commit
9b3b9a10
authored
Nov 10, 2009
by
Rob Shearman
Committed by
Alexandre Julliard
Nov 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Fix CheckTokenMembership test on Windows.
parent
d7c9bd13
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
3 deletions
+15
-3
security.c
dlls/advapi32/tests/security.c
+15
-3
No files found.
dlls/advapi32/tests/security.c
View file @
9b3b9a10
...
...
@@ -3206,7 +3206,7 @@ static void test_CheckTokenMembership(void)
{
PTOKEN_GROUPS
token_groups
;
DWORD
size
;
HANDLE
token
;
HANDLE
process_token
,
token
;
BOOL
is_member
;
BOOL
ret
;
DWORD
i
;
...
...
@@ -3216,9 +3216,12 @@ static void test_CheckTokenMembership(void)
win_skip
(
"CheckTokenMembership is not available
\n
"
);
return
;
}
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_
QUERY
,
&
token
);
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_
DUPLICATE
|
TOKEN_QUERY
,
&
process_
token
);
ok
(
ret
,
"OpenProcessToken failed with error %d
\n
"
,
GetLastError
());
ret
=
DuplicateToken
(
process_token
,
SecurityImpersonation
,
&
token
);
ok
(
ret
,
"DuplicateToken failed with error %d
\n
"
,
GetLastError
());
/* groups */
ret
=
GetTokenInformation
(
token
,
TokenGroups
,
NULL
,
0
,
&
size
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
...
...
@@ -3244,10 +3247,19 @@ static void test_CheckTokenMembership(void)
ret
=
pCheckTokenMembership
(
token
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
ok
(
ret
,
"CheckTokenMembership failed with error %d
\n
"
,
GetLastError
());
ok
(
is_member
,
"CheckTokenMembership should have detected sid as member"
);
ok
(
is_member
,
"CheckTokenMembership should have detected sid as member
\n
"
);
ret
=
pCheckTokenMembership
(
process_token
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
todo_wine
{
ok
(
!
ret
&&
GetLastError
()
==
ERROR_NO_IMPERSONATION_TOKEN
,
"CheckTokenMembership with process token %s with error %d
\n
"
,
ret
?
"succeeded"
:
"failed"
,
GetLastError
());
ok
(
!
is_member
,
"CheckTokenMembership should have cleared is_member
\n
"
);
}
HeapFree
(
GetProcessHeap
(),
0
,
token_groups
);
CloseHandle
(
token
);
CloseHandle
(
process_token
);
}
START_TEST
(
security
)
...
...
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