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
bbb29e9d
Commit
bbb29e9d
authored
Jan 16, 2013
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Improve the stub for CreateRestrictedToken.
parent
0d0f05e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
security.c
dlls/advapi32/security.c
+14
-2
security.c
dlls/advapi32/tests/security.c
+16
-4
No files found.
dlls/advapi32/security.c
View file @
bbb29e9d
...
...
@@ -801,13 +801,25 @@ BOOL WINAPI CreateRestrictedToken(
PSID_AND_ATTRIBUTES
restrictSids
,
PHANDLE
newToken
)
{
TOKEN_TYPE
type
;
SECURITY_IMPERSONATION_LEVEL
level
=
TokenImpersonationLevel
;
DWORD
size
;
FIXME
(
"(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p): stub
\n
"
,
baseToken
,
flags
,
nDisableSids
,
disableSids
,
nDeletePrivs
,
deletePrivs
,
nRestrictSids
,
restrictSids
,
newToken
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
size
=
sizeof
(
type
);
if
(
!
GetTokenInformation
(
baseToken
,
TokenType
,
&
type
,
size
,
&
size
))
return
FALSE
;
if
(
type
==
TokenImpersonation
)
{
size
=
sizeof
(
level
);
if
(
!
GetTokenInformation
(
baseToken
,
TokenImpersonationLevel
,
&
level
,
size
,
&
size
))
return
FALSE
;
}
return
DuplicateTokenEx
(
baseToken
,
MAXIMUM_ALLOWED
,
NULL
,
level
,
type
,
newToken
);
}
/* ##############################
...
...
dlls/advapi32/tests/security.c
View file @
bbb29e9d
...
...
@@ -4076,6 +4076,8 @@ static void test_CreateRestrictedToken(void)
HANDLE
process_token
,
token
,
r_token
;
PTOKEN_GROUPS
token_groups
,
groups2
;
SID_AND_ATTRIBUTES
sattr
;
SECURITY_IMPERSONATION_LEVEL
level
;
TOKEN_TYPE
type
;
BOOL
is_member
;
DWORD
size
;
BOOL
ret
;
...
...
@@ -4126,7 +4128,7 @@ static void test_CreateRestrictedToken(void)
sattr
.
Attributes
=
0
;
r_token
=
NULL
;
ret
=
pCreateRestrictedToken
(
token
,
0
,
1
,
&
sattr
,
0
,
NULL
,
0
,
NULL
,
&
r_token
);
todo_wine
ok
(
ret
,
"got error %d
\n
"
,
GetLastError
());
ok
(
ret
,
"got error %d
\n
"
,
GetLastError
());
if
(
ret
)
{
...
...
@@ -4134,7 +4136,7 @@ static void test_CreateRestrictedToken(void)
is_member
=
TRUE
;
ret
=
pCheckTokenMembership
(
r_token
,
token_groups
->
Groups
[
i
].
Sid
,
&
is_member
);
ok
(
ret
,
"got error %d
\n
"
,
GetLastError
());
ok
(
!
is_member
,
"not a member
\n
"
);
todo_wine
ok
(
!
is_member
,
"not a member
\n
"
);
ret
=
GetTokenInformation
(
r_token
,
TokenGroups
,
NULL
,
0
,
&
size
);
ok
(
!
ret
&&
GetLastError
()
==
ERROR_INSUFFICIENT_BUFFER
,
"got %d with error %d
\n
"
,
...
...
@@ -4149,12 +4151,22 @@ static void test_CreateRestrictedToken(void)
break
;
}
ok
(
groups2
->
Groups
[
j
].
Attributes
&
SE_GROUP_USE_FOR_DENY_ONLY
,
todo_wine
ok
(
groups2
->
Groups
[
j
].
Attributes
&
SE_GROUP_USE_FOR_DENY_ONLY
,
"got wrong attributes
\n
"
);
ok
((
groups2
->
Groups
[
j
].
Attributes
&
SE_GROUP_ENABLED
)
==
0
,
todo_wine
ok
((
groups2
->
Groups
[
j
].
Attributes
&
SE_GROUP_ENABLED
)
==
0
,
"got wrong attributes
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
groups2
);
size
=
sizeof
(
type
);
ret
=
GetTokenInformation
(
r_token
,
TokenType
,
&
type
,
size
,
&
size
);
ok
(
ret
,
"got error %d
\n
"
,
GetLastError
());
ok
(
type
==
TokenImpersonation
,
"got type %u
\n
"
,
type
);
size
=
sizeof
(
level
);
ret
=
GetTokenInformation
(
r_token
,
TokenImpersonationLevel
,
&
level
,
size
,
&
size
);
ok
(
ret
,
"got error %d
\n
"
,
GetLastError
());
ok
(
level
==
SecurityImpersonation
,
"got level %u
\n
"
,
type
);
}
HeapFree
(
GetProcessHeap
(),
0
,
token_groups
);
...
...
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