diff --git a/dlls/advapi32/advapi32.spec b/dlls/advapi32/advapi32.spec index 460014234ac..ec27440a5ab 100644 --- a/dlls/advapi32/advapi32.spec +++ b/dlls/advapi32/advapi32.spec @@ -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 diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c index 028dcc6d9e3..c2ce1e1d031 100644 --- a/dlls/advapi32/security.c +++ b/dlls/advapi32/security.c @@ -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 ###### ############################## diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c index 898ddba3500..098fa8f9ec9 100644 --- a/dlls/advapi32/tests/security.c +++ b/dlls/advapi32/tests/security.c @@ -5938,7 +5938,7 @@ static void test_GetWindowsAccountDomainSid(void) if (!pGetWindowsAccountDomainSid) { - skip("GetWindowsAccountDomainSid not available\n"); + win_skip("GetWindowsAccountDomainSid not available\n"); return; } diff --git a/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec b/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec index 42777068803..edae6d169a2 100644 --- a/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec +++ b/dlls/api-ms-win-security-base-l1-1-0/api-ms-win-security-base-l1-1-0.spec @@ -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 diff --git a/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec b/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec index 3adef23e82a..e19fe53d4e5 100644 --- a/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec +++ b/dlls/api-ms-win-security-base-l1-2-0/api-ms-win-security-base-l1-2-0.spec @@ -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