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
ce58c358
Commit
ce58c358
authored
Jul 05, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Jul 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add tests for LookupAccountSid.
parent
8fb90dea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
6 deletions
+35
-6
security.c
dlls/advapi32/security.c
+6
-6
security.c
dlls/advapi32/tests/security.c
+29
-0
No files found.
dlls/advapi32/security.c
View file @
ce58c358
...
...
@@ -1485,15 +1485,15 @@ LookupAccountSidA(
domain
,
domainSize
,
domainSize
?*
domainSize
:
0
,
name_use
);
if
(
accountSize
)
*
accountSize
=
strlen
(
ac
)
+
1
;
*
accountSize
=
strlen
(
ac
)
+
1
;
if
(
account
&&
(
*
accountSize
>
strlen
(
ac
)))
strcpy
(
account
,
ac
);
if
(
domainSize
)
*
domainSize
=
strlen
(
dm
)
+
1
;
*
domainSize
=
strlen
(
dm
)
+
1
;
if
(
domain
&&
(
*
domainSize
>
strlen
(
dm
)))
strcpy
(
domain
,
dm
);
if
(
name_use
)
*
name_use
=
SidTypeUser
;
*
name_use
=
SidTypeUser
;
return
TRUE
;
}
...
...
@@ -1527,15 +1527,15 @@ LookupAccountSidW(
domain
,
domainSize
,
domainSize
?*
domainSize
:
0
,
name_use
);
if
(
accountSize
)
*
accountSize
=
strlenW
(
ac
)
+
1
;
*
accountSize
=
strlenW
(
ac
)
+
1
;
if
(
account
&&
(
*
accountSize
>
strlenW
(
ac
)))
strcpyW
(
account
,
ac
);
if
(
domainSize
)
*
domainSize
=
strlenW
(
dm
)
+
1
;
*
domainSize
=
strlenW
(
dm
)
+
1
;
if
(
domain
&&
(
*
domainSize
>
strlenW
(
dm
)))
strcpyW
(
domain
,
dm
);
if
(
name_use
)
*
name_use
=
SidTypeUser
;
*
name_use
=
SidTypeUser
;
return
TRUE
;
}
...
...
dlls/advapi32/tests/security.c
View file @
ce58c358
...
...
@@ -772,6 +772,34 @@ static void test_token_attr(void)
}
}
static
void
test_LookupAccountSid
(
void
)
{
SID_IDENTIFIER_AUTHORITY
SIDAuthNT
=
{
SECURITY_NT_AUTHORITY
};
char
account
[
MAX_PATH
],
domain
[
MAX_PATH
];
DWORD
acc_size
,
dom_size
;
PSID
pUsersSid
=
NULL
;
SID_NAME_USE
use
;
BOOL
ret
;
/* native windows crashes if account size, domain size, or name use is NULL */
ret
=
AllocateAndInitializeSid
(
&
SIDAuthNT
,
2
,
SECURITY_BUILTIN_DOMAIN_RID
,
DOMAIN_ALIAS_RID_USERS
,
0
,
0
,
0
,
0
,
0
,
0
,
&
pUsersSid
);
ok
(
ret
,
"AllocateAndInitializeSid failed with error %ld
\n
"
,
GetLastError
());
/* try NULL account */
acc_size
=
MAX_PATH
;
dom_size
=
MAX_PATH
;
ret
=
LookupAccountSid
(
NULL
,
pUsersSid
,
NULL
,
&
acc_size
,
domain
,
&
dom_size
,
&
use
);
ok
(
ret
,
"Expected TRUE, got FALSE
\n
"
);
/* try NULL domain */
acc_size
=
MAX_PATH
;
dom_size
=
MAX_PATH
;
ret
=
LookupAccountSid
(
NULL
,
pUsersSid
,
account
,
&
acc_size
,
NULL
,
&
dom_size
,
&
use
);
ok
(
ret
,
"Expected TRUE, got FALSE
\n
"
);
}
START_TEST
(
security
)
{
init
();
...
...
@@ -782,4 +810,5 @@ START_TEST(security)
test_FileSecurity
();
test_AccessCheck
();
test_token_attr
();
test_LookupAccountSid
();
}
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