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
e9e4da8f
Commit
e9e4da8f
authored
Oct 18, 2008
by
Paul Bryan Roberts
Committed by
Alexandre Julliard
Oct 21, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
advapi32: LookupAccountNameW() - return correct domain name length for not-so-well-known SIDs.
parent
a1a2dd35
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
security.c
dlls/advapi32/security.c
+13
-6
security.c
dlls/advapi32/tests/security.c
+1
-3
No files found.
dlls/advapi32/security.c
View file @
e9e4da8f
...
...
@@ -2502,8 +2502,8 @@ LookupAccountNameA(
if
(
ret
&&
lpReferencedDomainNameW
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
lpReferencedDomainNameW
,
*
cbReferencedDomainName
,
ReferencedDomainName
,
*
cbReferencedDomainName
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
lpReferencedDomainNameW
,
-
1
,
ReferencedDomainName
,
*
cbReferencedDomainName
+
1
,
NULL
,
NULL
);
}
RtlFreeUnicodeString
(
&
lpSystemW
);
...
...
@@ -2526,6 +2526,8 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
PSID
pSid
;
static
const
WCHAR
dm
[]
=
{
'D'
,
'O'
,
'M'
,
'A'
,
'I'
,
'N'
,
0
};
unsigned
int
i
;
DWORD
nameLen
;
LPCWSTR
domainName
;
FIXME
(
"%s %s %p %p %p %p %p - stub
\n
"
,
debugstr_w
(
lpSystemName
),
debugstr_w
(
lpAccountName
),
Sid
,
cbSid
,
ReferencedDomainName
,
cchReferencedDomainName
,
peUse
);
...
...
@@ -2567,16 +2569,21 @@ BOOL WINAPI LookupAccountNameW( LPCWSTR lpSystemName, LPCWSTR lpAccountName, PSI
}
*
cbSid
=
GetLengthSid
(
pSid
);
if
(
ReferencedDomainName
!=
NULL
&&
(
*
cchReferencedDomainName
>
strlenW
(
dm
)))
strcpyW
(
ReferencedDomainName
,
dm
);
domainName
=
dm
;
nameLen
=
strlenW
(
domainName
);
if
(
*
cchReferencedDomainName
<=
strlenW
(
dm
)
)
if
(
*
cchReferencedDomainName
<=
nameLen
||
!
ret
)
{
SetLastError
(
ERROR_INSUFFICIENT_BUFFER
);
nameLen
+=
1
;
ret
=
FALSE
;
}
else
if
(
ReferencedDomainName
&&
domainName
)
{
strcpyW
(
ReferencedDomainName
,
domainName
);
}
*
cchReferencedDomainName
=
strlenW
(
dm
)
+
1
;
*
cchReferencedDomainName
=
nameLen
;
if
(
ret
)
{
...
...
dlls/advapi32/tests/security.c
View file @
e9e4da8f
...
...
@@ -1554,9 +1554,9 @@ static void test_LookupAccountName(void)
{
ok
(
!
lstrcmp
(
account
,
user_name
),
"Expected %s, got %s
\n
"
,
user_name
,
account
);
ok
(
!
lstrcmp
(
domain
,
sid_dom
),
"Expected %s, got %s
\n
"
,
sid_dom
,
domain
);
}
ok
(
domain_size
==
domain_save
-
1
,
"Expected %d, got %d
\n
"
,
domain_save
-
1
,
domain_size
);
ok
(
lstrlen
(
domain
)
==
domain_size
,
"Expected %d, got %d
\n
"
,
lstrlen
(
domain
),
domain_size
);
}
ok
(
sid_use
==
SidTypeUser
,
"Expected SidTypeUser (%d), got %d
\n
"
,
SidTypeUser
,
sid_use
);
domain_size
=
domain_save
;
sid_size
=
sid_save
;
...
...
@@ -1572,10 +1572,8 @@ static void test_LookupAccountName(void)
ok
(
ret
,
"Failed to lookup account name
\n
"
);
ok
(
sid_size
!=
0
,
"sid_size was zero
\n
"
);
ok
(
!
lstrcmp
(
account
,
"Everyone"
),
"Expected Everyone, got %s
\n
"
,
account
);
todo_wine
ok
(
!
lstrcmp
(
domain
,
sid_dom
),
"Expected %s, got %s
\n
"
,
sid_dom
,
domain
);
ok
(
domain_size
==
0
,
"Expected 0, got %d
\n
"
,
domain_size
);
todo_wine
ok
(
lstrlen
(
domain
)
==
domain_size
,
"Expected %d, got %d
\n
"
,
lstrlen
(
domain
),
domain_size
);
ok
(
sid_use
==
SidTypeWellKnownGroup
,
"Expected SidTypeWellKnownGroup (%d), got %d
\n
"
,
SidTypeWellKnownGroup
,
sid_use
);
domain_size
=
domain_save
;
...
...
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