Author: akhaldi
Date: Sat Nov 28 21:47:43 2015
New Revision: 70198
URL:
http://svn.reactos.org/svn/reactos?rev=70198&view=rev
Log:
[ADVAPI32] Apply Wine commit 4f3acf3 by Michael Müller: Add initial implementation for
GetWindowsAccountDomainSid. CORE-10536
Modified:
trunk/reactos/dll/win32/advapi32/wine/security.c
Modified: trunk/reactos/dll/win32/advapi32/wine/security.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/wine/se…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/wine/security.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/wine/security.c [iso-8859-1] Sat Nov 28 21:47:43
2015
@@ -3645,17 +3645,50 @@
return r;
}
-/*
- * @unimplemented
- */
-BOOL
-WINAPI
-GetWindowsAccountDomainSid(IN PSID pSid,
- OUT PSID ppDomainSid,
- IN OUT DWORD* cbSid)
-{
- UNIMPLEMENTED;
- return FALSE;
+/******************************************************************************
+ * 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;
}
/*