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
7aa3be47
Commit
7aa3be47
authored
Feb 21, 2006
by
Ulrich Czekalla
Committed by
Alexandre Julliard
Feb 22, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: Add partial implementation of LookupAccountNameW.
parent
f7b678e8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
22 deletions
+49
-22
security.c
dlls/advapi32/security.c
+49
-22
No files found.
dlls/advapi32/security.c
View file @
7aa3be47
...
...
@@ -1775,13 +1775,50 @@ LookupAccountNameA(
IN
OUT
LPDWORD
cbReferencedDomainName
,
OUT
PSID_NAME_USE
name_use
)
{
BOOL
ret
;
UNICODE_STRING
lpSystemW
;
UNICODE_STRING
lpAccountW
;
LPWSTR
lpReferencedDomainNameW
=
NULL
;
RtlCreateUnicodeStringFromAsciiz
(
&
lpSystemW
,
system
);
RtlCreateUnicodeStringFromAsciiz
(
&
lpAccountW
,
account
);
if
(
ReferencedDomainName
)
lpReferencedDomainNameW
=
HeapAlloc
(
GetProcessHeap
(),
0
,
*
cbReferencedDomainName
*
sizeof
(
WCHAR
));
ret
=
LookupAccountNameW
(
lpSystemW
.
Buffer
,
lpAccountW
.
Buffer
,
sid
,
cbSid
,
lpReferencedDomainNameW
,
cbReferencedDomainName
,
name_use
);
if
(
ret
&&
lpReferencedDomainNameW
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
lpReferencedDomainNameW
,
*
cbReferencedDomainName
,
ReferencedDomainName
,
*
cbReferencedDomainName
,
NULL
,
NULL
);
}
RtlFreeUnicodeString
(
&
lpSystemW
);
RtlFreeUnicodeString
(
&
lpAccountW
);
if
(
lpReferencedDomainNameW
)
HeapFree
(
GetProcessHeap
(),
0
,
lpReferencedDomainNameW
);
return
ret
;
}
/******************************************************************************
* LookupAccountNameW [ADVAPI32.@]
*/
BOOL
WINAPI
LookupAccountNameW
(
LPCWSTR
lpSystemName
,
LPCWSTR
lpAccountName
,
PSID
Sid
,
LPDWORD
cbSid
,
LPWSTR
ReferencedDomainName
,
LPDWORD
cchReferencedDomainName
,
PSID_NAME_USE
peUse
)
{
/* Default implementation: Always return a default SID */
SID_IDENTIFIER_AUTHORITY
identifierAuthority
=
{
SECURITY_NT_AUTHORITY
};
BOOL
ret
;
PSID
pSid
;
static
const
char
dm
[]
=
"DOMAIN"
;
static
const
WCHAR
dm
[]
=
{
'D'
,
'O'
,
'M'
,
'A'
,
'I'
,
'N'
}
;
FIXME
(
"(%s,%s,%p,%p,%p,%p,%p), stub.
\n
"
,
system
,
account
,
sid
,
cbSid
,
ReferencedDomainName
,
cbReferencedDomainName
,
name_use
);
FIXME
(
"%s %s %p %p %p %p %p - stub
\n
"
,
debugstr_w
(
lpSystemName
),
debugstr_w
(
lpAccountName
),
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
ret
=
AllocateAndInitializeSid
(
&
identifierAuthority
,
2
,
...
...
@@ -1792,14 +1829,15 @@ LookupAccountNameA(
if
(
!
ret
)
return
FALSE
;
if
(
!
RtlValidSid
(
pSid
))
if
(
!
RtlValidSid
(
pSid
))
{
FreeSid
(
pSid
);
return
FALSE
;
}
if
(
s
id
!=
NULL
&&
(
*
cbSid
>=
GetLengthSid
(
pSid
)))
CopySid
(
*
cbSid
,
s
id
,
pSid
);
if
(
S
id
!=
NULL
&&
(
*
cbSid
>=
GetLengthSid
(
pSid
)))
CopySid
(
*
cbSid
,
S
id
,
pSid
);
if
(
*
cbSid
<
GetLengthSid
(
pSid
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
...
...
@@ -1807,14 +1845,16 @@ LookupAccountNameA(
}
*
cbSid
=
GetLengthSid
(
pSid
);
if
(
ReferencedDomainName
!=
NULL
&&
(
*
cbReferencedDomainName
>
strlen
(
dm
)))
strcpy
(
ReferencedDomainName
,
dm
);
if
(
*
cbReferencedDomainName
<=
strlen
(
dm
))
if
(
ReferencedDomainName
!=
NULL
&&
(
*
cchReferencedDomainName
>
strlenW
(
dm
)))
strcpyW
(
ReferencedDomainName
,
dm
);
if
(
*
cchReferencedDomainName
<=
strlenW
(
dm
))
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
ret
=
FALSE
;
}
*
cbReferencedDomainName
=
strlen
(
dm
)
+
1
;
*
cchReferencedDomainName
=
strlenW
(
dm
)
+
1
;
FreeSid
(
pSid
);
...
...
@@ -1822,19 +1862,6 @@ LookupAccountNameA(
}
/******************************************************************************
* LookupAccountNameW [ADVAPI32.@]
*/
BOOL
WINAPI
LookupAccountNameW
(
LPCWSTR
lpSystemName
,
LPCWSTR
lpAccountName
,
PSID
Sid
,
LPDWORD
cbSid
,
LPWSTR
ReferencedDomainName
,
LPDWORD
cchReferencedDomainName
,
PSID_NAME_USE
peUse
)
{
FIXME
(
"%s %s %p %p %p %p %p - stub
\n
"
,
debugstr_w
(
lpSystemName
),
debugstr_w
(
lpAccountName
),
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
return
FALSE
;
}
/******************************************************************************
* PrivilegeCheck [ADVAPI32.@]
*/
BOOL
WINAPI
PrivilegeCheck
(
HANDLE
ClientToken
,
PPRIVILEGE_SET
RequiredPrivileges
,
LPBOOL
pfResult
)
...
...
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