Commit 4f3acf31 authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

advapi32: Add initial implementation for GetWindowsAccountDomainSid.

parent 54b3973e
......@@ -363,7 +363,7 @@
@ stdcall GetTrusteeTypeW(ptr)
@ stdcall GetUserNameA(ptr ptr)
@ stdcall GetUserNameW(ptr ptr)
# @ stub GetWindowsAccountDomainSid
@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr)
# @ stub I_QueryTagInformation
# @ stub I_ScGetCurrentGroupStateW
# @ stub I_ScIsSecurityProcess
......
......@@ -1538,6 +1538,52 @@ BOOL WINAPI SetSecurityDescriptorControl( PSECURITY_DESCRIPTOR pSecurityDescript
pSecurityDescriptor, ControlBitsOfInterest, ControlBitsToSet ) );
}
/******************************************************************************
* GetWindowsAccountDomainSid [ADVAPI32.@]
*/
BOOL WINAPI GetWindowsAccountDomainSid( PSID sid, PSID domain_sid, DWORD *size )
{
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;
}
/* ##############################
###### ACL FUNCTIONS ######
##############################
......
......@@ -5938,7 +5938,7 @@ static void test_GetWindowsAccountDomainSid(void)
if (!pGetWindowsAccountDomainSid)
{
skip("GetWindowsAccountDomainSid not available\n");
win_skip("GetWindowsAccountDomainSid not available\n");
return;
}
......
......@@ -57,7 +57,7 @@
@ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority
@ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount
@ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation
@ stub GetWindowsAccountDomainSid
@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid
@ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken
@ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser
@ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf
......
......@@ -63,7 +63,7 @@
@ stdcall GetSidSubAuthority(ptr long) advapi32.GetSidSubAuthority
@ stdcall GetSidSubAuthorityCount(ptr) advapi32.GetSidSubAuthorityCount
@ stdcall GetTokenInformation(long long ptr long ptr) advapi32.GetTokenInformation
@ stub GetWindowsAccountDomainSid
@ stdcall GetWindowsAccountDomainSid(ptr ptr ptr) advapi32.GetWindowsAccountDomainSid
@ stdcall ImpersonateAnonymousToken(long) advapi32.ImpersonateAnonymousToken
@ stdcall ImpersonateLoggedOnUser(long) advapi32.ImpersonateLoggedOnUser
@ stdcall ImpersonateSelf(long) advapi32.ImpersonateSelf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment