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
be303074
Commit
be303074
authored
Aug 09, 2004
by
Mike McCormack
Committed by
Alexandre Julliard
Aug 09, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented ConvertSidToStringSidA/W.
parent
6d33f1c2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
68 additions
and
2 deletions
+68
-2
advapi32.spec
dlls/advapi32/advapi32.spec
+2
-2
security.c
dlls/advapi32/security.c
+66
-0
No files found.
dlls/advapi32/advapi32.spec
View file @
be303074
...
...
@@ -28,8 +28,8 @@
@ stdcall CloseServiceHandle(long)
@ stdcall CommandLineFromMsiDescriptor(wstr wstr ptr)
@ stdcall ControlService(long long ptr)
@ st
ub ConvertSidToStringSidA #(ptr str) ConvertSidToStringSidA
@ st
ub ConvertSidToStringSidW #(ptr wstr) ConvertSidToStringSidW
@ st
dcall ConvertSidToStringSidA(ptr ptr)
@ st
dcall ConvertSidToStringSidW(ptr ptr)
@ stub ConvertStringSecurityDescriptorToSecurityDescriptorA #(str long ptr ptr) ConvertStringSecurityDescriptorToSecurityDescriptorA
@ stdcall ConvertStringSecurityDescriptorToSecurityDescriptorW(wstr long ptr ptr)
@ stdcall CopySid(long ptr ptr)
...
...
dlls/advapi32/security.c
View file @
be303074
...
...
@@ -2083,6 +2083,72 @@ BOOL WINAPI ConvertStringSidToSidW(LPCWSTR StringSid, PSID* Sid)
}
/******************************************************************************
* ConvertSidToStringSidW [ADVAPI32.@]
*
* format of SID string is:
* S-<count>-<auth>-<subauth1>-<subauth2>-<subauth3>...
* where
* <rev> is the revision of the SID encoded as decimal
* <auth> is the identifier authority encoded as hex
* <subauthN> is the subauthority id encoded as decimal
*/
BOOL
WINAPI
ConvertSidToStringSidW
(
PSID
pSid
,
LPWSTR
*
pstr
)
{
DWORD
sz
,
i
;
LPWSTR
str
;
WCHAR
fmt
[]
=
{
'S'
,
'-'
,
'%'
,
'u'
,
'-'
,
'%'
,
'2'
,
'X'
,
'%'
,
'2'
,
'X'
,
'%'
,
'X'
,
'%'
,
'X'
,
'%'
,
'X'
,
'%'
,
'X'
,
0
};
WCHAR
subauthfmt
[]
=
{
'-'
,
'%'
,
'u'
,
0
};
TRACE
(
"%p %p
\n
"
,
pSid
,
pstr
);
if
(
!
IsValidSid
(
pSid
)
)
return
FALSE
;
if
(
pSid
->
Revision
!=
SDDL_REVISION
)
return
FALSE
;
sz
=
14
+
pSid
->
SubAuthorityCount
*
11
;
str
=
LocalAlloc
(
0
,
sz
*
sizeof
(
WCHAR
)
);
sprintfW
(
str
,
fmt
,
pSid
->
Revision
,
pSid
->
IdentifierAuthority
.
Value
[
2
],
pSid
->
IdentifierAuthority
.
Value
[
3
],
pSid
->
IdentifierAuthority
.
Value
[
0
]
&
0x0f
,
pSid
->
IdentifierAuthority
.
Value
[
4
]
&
0x0f
,
pSid
->
IdentifierAuthority
.
Value
[
1
]
&
0x0f
,
pSid
->
IdentifierAuthority
.
Value
[
5
]
&
0x0f
);
for
(
i
=
0
;
i
<
pSid
->
SubAuthorityCount
;
i
++
)
sprintfW
(
str
+
strlenW
(
str
),
subauthfmt
,
pSid
->
SubAuthority
[
i
]
);
*
pstr
=
str
;
return
TRUE
;
}
/******************************************************************************
* ConvertSidToStringSidA [ADVAPI32.@]
*/
BOOL
WINAPI
ConvertSidToStringSidA
(
PSID
pSid
,
LPSTR
*
pstr
)
{
LPWSTR
wstr
=
NULL
;
LPSTR
str
;
UINT
len
;
TRACE
(
"%p %p
\n
"
,
pSid
,
pstr
);
if
(
!
ConvertSidToStringSidW
(
pSid
,
&
wstr
)
)
return
FALSE
;
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
str
=
LocalAlloc
(
0
,
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
wstr
,
-
1
,
str
,
len
,
NULL
,
NULL
);
LocalFree
(
wstr
);
*
pstr
=
str
;
return
TRUE
;
}
/******************************************************************************
* ComputeStringSidSize
*/
static
DWORD
ComputeStringSidSize
(
LPCWSTR
StringSid
)
...
...
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