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
f212579a
Commit
f212579a
authored
Apr 09, 2009
by
Andreas.Rosenberg
Committed by
Alexandre Julliard
Apr 09, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32/tests: Added a test to verify result of LookupAccountSid.
parent
5ab983e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
security.c
dlls/advapi32/tests/security.c
+25
-3
No files found.
dlls/advapi32/tests/security.c
View file @
f212579a
...
...
@@ -1410,8 +1410,8 @@ static void test_CreateWellKnownSid(void)
static
void
test_LookupAccountSid
(
void
)
{
SID_IDENTIFIER_AUTHORITY
SIDAuthNT
=
{
SECURITY_NT_AUTHORITY
};
CHAR
accountA
[
MAX_PATH
],
domainA
[
MAX_PATH
];
DWORD
acc_sizeA
,
dom_sizeA
;
CHAR
accountA
[
MAX_PATH
],
domainA
[
MAX_PATH
]
,
usernameA
[
MAX_PATH
]
;
DWORD
acc_sizeA
,
dom_sizeA
,
user_sizeA
;
DWORD
real_acc_sizeA
,
real_dom_sizeA
;
WCHAR
accountW
[
MAX_PATH
],
domainW
[
MAX_PATH
];
DWORD
acc_sizeW
,
dom_sizeW
;
...
...
@@ -1419,10 +1419,12 @@ static void test_LookupAccountSid(void)
PSID
pUsersSid
=
NULL
;
SID_NAME_USE
use
;
BOOL
ret
;
DWORD
size
;
DWORD
size
,
cbti
=
0
;
MAX_SID
max_sid
;
CHAR
*
str_sidA
;
int
i
;
HANDLE
hToken
;
PTOKEN_USER
ptiUser
=
NULL
;
/* native windows crashes if account size, domain size, or name use is NULL */
...
...
@@ -1581,6 +1583,26 @@ static void test_LookupAccountSid(void)
FreeSid
(
pUsersSid
);
/* Test LookupAccountSid with Sid retrieved from token information.
This assumes this process is running under the account of the current user.*/
ret
=
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_QUERY
|
TOKEN_DUPLICATE
,
&
hToken
);
ret
=
GetTokenInformation
(
hToken
,
TokenUser
,
NULL
,
0
,
&
cbti
);
ptiUser
=
(
PTOKEN_USER
)
HeapAlloc
(
GetProcessHeap
(),
0
,
cbti
);
if
(
GetTokenInformation
(
hToken
,
TokenUser
,
ptiUser
,
cbti
,
&
cbti
))
{
acc_sizeA
=
dom_sizeA
=
MAX_PATH
;
ret
=
LookupAccountSidA
(
NULL
,
ptiUser
->
User
.
Sid
,
accountA
,
&
acc_sizeA
,
domainA
,
&
dom_sizeA
,
&
use
);
ok
(
ret
,
"LookupAccountSidA() Expected TRUE, got FALSE
\n
"
);
user_sizeA
=
MAX_PATH
;
ret
=
GetUserNameA
(
usernameA
,
&
user_sizeA
);
ok
(
ret
,
"GetUserNameA() Expected TRUE, got FALSE
\n
"
);
todo_wine
{
ok
(
lstrcmpA
(
usernameA
,
accountA
)
==
0
,
"LookupAccountSidA() Expected account name: %s got: %s
\n
"
,
usernameA
,
accountA
);
}
}
HeapFree
(
GetProcessHeap
(),
0
,
ptiUser
);
if
(
pCreateWellKnownSid
&&
pConvertSidToStringSidA
)
{
trace
(
"Well Known SIDs:
\n
"
);
...
...
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