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
a2cdb3ba
Commit
a2cdb3ba
authored
Jul 20, 2006
by
Robert Reif
Committed by
Alexandre Julliard
Jul 21, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Partial LookupAccountSid implementation.
parent
d49884c3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
1 deletion
+35
-1
security.c
dlls/advapi32/security.c
+0
-0
security.c
dlls/advapi32/tests/security.c
+35
-1
No files found.
dlls/advapi32/security.c
View file @
a2cdb3ba
This diff is collapsed.
Click to expand it.
dlls/advapi32/tests/security.c
View file @
a2cdb3ba
...
...
@@ -47,6 +47,7 @@ typedef BOOL (WINAPI *fnConvertStringSidToSidA)( LPCSTR str, PSID pSid );
typedef
BOOL
(
WINAPI
*
fnGetFileSecurityA
)(
LPCSTR
,
SECURITY_INFORMATION
,
PSECURITY_DESCRIPTOR
,
DWORD
,
LPDWORD
);
typedef
DWORD
(
WINAPI
*
fnRtlAdjustPrivilege
)(
ULONG
,
BOOLEAN
,
BOOLEAN
,
PBOOLEAN
);
typedef
BOOL
(
WINAPI
*
fnCreateWellKnownSid
)(
WELL_KNOWN_SID_TYPE
,
PSID
,
PSID
,
DWORD
*
);
static
HMODULE
hmod
;
...
...
@@ -59,6 +60,7 @@ fnConvertSidToStringSidA pConvertSidToStringSidA;
fnConvertStringSidToSidA
pConvertStringSidToSidA
;
fnGetFileSecurityA
pGetFileSecurityA
;
fnRtlAdjustPrivilege
pRtlAdjustPrivilege
;
fnCreateWellKnownSid
pCreateWellKnownSid
;
struct
sidRef
{
...
...
@@ -737,7 +739,7 @@ static void test_token_attr(void)
Domain
[
0
]
=
'\0'
;
ret
=
LookupAccountSid
(
NULL
,
Groups
->
Groups
[
i
].
Sid
,
Name
,
&
NameLength
,
Domain
,
&
DomainLength
,
&
SidNameUse
);
ok
(
ret
,
"LookupAccountSid failed with error %ld
\n
"
,
GetLastError
());
trace
(
"
\t
%s, %s
\\
%s
attr: 0x%08lx
\n
"
,
SidString
,
Domain
,
Nam
e
,
Groups
->
Groups
[
i
].
Attributes
);
trace
(
"
\t
%s, %s
\\
%s
use: %d attr: 0x%08lx
\n
"
,
SidString
,
Domain
,
Name
,
SidNameUs
e
,
Groups
->
Groups
[
i
].
Attributes
);
LocalFree
(
SidString
);
}
...
...
@@ -780,6 +782,14 @@ static void test_LookupAccountSid(void)
PSID
pUsersSid
=
NULL
;
SID_NAME_USE
use
;
BOOL
ret
;
DWORD
size
;
union
u
{
SID
sid
;
char
max
[
SECURITY_MAX_SID_SIZE
];
}
max_sid
;
char
*
str_sid
;
int
i
;
/* native windows crashes if account size, domain size, or name use is NULL */
...
...
@@ -798,6 +808,30 @@ static void test_LookupAccountSid(void)
dom_size
=
MAX_PATH
;
ret
=
LookupAccountSid
(
NULL
,
pUsersSid
,
account
,
&
acc_size
,
NULL
,
&
dom_size
,
&
use
);
ok
(
ret
,
"Expected TRUE, got FALSE
\n
"
);
pCreateWellKnownSid
=
(
fnCreateWellKnownSid
)
GetProcAddress
(
hmod
,
"CreateWellKnownSid"
);
if
(
pCreateWellKnownSid
&&
pConvertSidToStringSidA
)
{
trace
(
"Well Known SIDs:
\n
"
);
for
(
i
=
0
;
i
<=
60
;
i
++
)
{
size
=
SECURITY_MAX_SID_SIZE
;
if
(
pCreateWellKnownSid
(
i
,
NULL
,
&
max_sid
.
sid
,
&
size
))
{
if
(
pConvertSidToStringSidA
(
&
max_sid
.
sid
,
&
str_sid
))
{
acc_size
=
MAX_PATH
;
dom_size
=
MAX_PATH
;
if
(
LookupAccountSid
(
NULL
,
&
max_sid
.
sid
,
account
,
&
acc_size
,
domain
,
&
dom_size
,
&
use
))
trace
(
" %d: %s %s
\\
%s %d
\n
"
,
i
,
str_sid
,
domain
,
account
,
use
);
LocalFree
(
str_sid
);
}
}
else
trace
(
" CreateWellKnownSid(%d) failed: %ld
\n
"
,
i
,
GetLastError
());
}
}
}
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