mirror of
https://github.com/reactos/reactos.git
synced 2025-08-02 22:06:53 +00:00
[ADVAPI32] Apply Wine commit 4f3acf3 by Michael Müller: Add initial implementation for GetWindowsAccountDomainSid. CORE-10536
svn path=/trunk/; revision=70198
This commit is contained in:
parent
c8433464e9
commit
dbf61f13bd
1 changed files with 42 additions and 9 deletions
|
@ -3645,17 +3645,50 @@ GetNamedSecurityInfoA(LPSTR pObjectName,
|
|||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
* @unimplemented
|
||||
/******************************************************************************
|
||||
* GetWindowsAccountDomainSid [ADVAPI32.@]
|
||||
*/
|
||||
BOOL
|
||||
WINAPI
|
||||
GetWindowsAccountDomainSid(IN PSID pSid,
|
||||
OUT PSID ppDomainSid,
|
||||
IN OUT DWORD* cbSid)
|
||||
BOOL WINAPI GetWindowsAccountDomainSid( PSID sid, PSID domain_sid, DWORD *size )
|
||||
{
|
||||
UNIMPLEMENTED;
|
||||
return FALSE;
|
||||
SID_IDENTIFIER_AUTHORITY domain_ident = { SECURITY_NT_AUTHORITY };
|
||||
DWORD required_size;
|
||||
int i;
|
||||
|
||||
FIXME( "(%p %p %p): semi-stub\n", sid, domain_sid, size );
|
||||
|
||||
if (!sid || !IsValidSid( sid ))
|
||||
{
|
||||
SetLastError( ERROR_INVALID_SID );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!size)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (*GetSidSubAuthorityCount( sid ) < 4)
|
||||
{
|
||||
SetLastError( ERROR_INVALID_SID );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
required_size = GetSidLengthRequired( 4 );
|
||||
if (*size < required_size || !domain_sid)
|
||||
{
|
||||
*size = required_size;
|
||||
SetLastError( domain_sid ? ERROR_INSUFFICIENT_BUFFER :
|
||||
ERROR_INVALID_PARAMETER );
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
InitializeSid( domain_sid, &domain_ident, 4 );
|
||||
for (i = 0; i < 4; i++)
|
||||
*GetSidSubAuthority( domain_sid, i ) = *GetSidSubAuthority( sid, i );
|
||||
|
||||
*size = required_size;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue