advapi32: Return a fake security descriptor from CreatePrivateObjectSecurity.
Hans Leidekker
hans at codeweavers.com
Fri Mar 30 05:19:23 CDT 2012
Based on a patch by Robert Shearman.
---
dlls/advapi32/security.c | 43 ++++++++++++++++++++++++++++++++++++++++---
1 files changed, 40 insertions(+), 3 deletions(-)
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 172b9a2..f375889 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -5105,16 +5105,53 @@ BOOL WINAPI CreatePrivateObjectSecurity(
HANDLE Token,
PGENERIC_MAPPING GenericMapping )
{
- FIXME("%p %p %p %d %p %p - stub\n", ParentDescriptor, CreatorDescriptor,
- NewDescriptor, IsDirectoryObject, Token, GenericMapping);
+ SECURITY_DESCRIPTOR_RELATIVE *relative;
+ DWORD needed, offset;
+ BYTE *buffer;
- return FALSE;
+ FIXME("%p %p %p %d %p %p - returns fake SECURITY_DESCRIPTOR\n", ParentDescriptor,
+ CreatorDescriptor, NewDescriptor, IsDirectoryObject, Token, GenericMapping);
+
+ needed = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
+ needed += sizeof(sidWorld);
+ needed += sizeof(sidWorld);
+ needed += WINE_SIZE_OF_WORLD_ACCESS_ACL;
+ needed += WINE_SIZE_OF_WORLD_ACCESS_ACL;
+
+ if (!(buffer = HeapAlloc( GetProcessHeap(), 0, needed ))) return FALSE;
+ relative = (SECURITY_DESCRIPTOR_RELATIVE *)buffer;
+ if (!InitializeSecurityDescriptor( relative, SECURITY_DESCRIPTOR_REVISION ))
+ {
+ HeapFree( GetProcessHeap(), 0, buffer );
+ return FALSE;
+ }
+ relative->Control |= SE_SELF_RELATIVE;
+ offset = sizeof(SECURITY_DESCRIPTOR_RELATIVE);
+
+ memcpy( buffer + offset, &sidWorld, sizeof(sidWorld) );
+ relative->Owner = offset;
+ offset += sizeof(sidWorld);
+
+ memcpy( buffer + offset, &sidWorld, sizeof(sidWorld) );
+ relative->Group = offset;
+ offset += sizeof(sidWorld);
+
+ GetWorldAccessACL( (ACL *)(buffer + offset) );
+ relative->Dacl = offset;
+ offset += WINE_SIZE_OF_WORLD_ACCESS_ACL;
+
+ GetWorldAccessACL( (ACL *)(buffer + offset) );
+ relative->Sacl = offset;
+
+ *NewDescriptor = relative;
+ return TRUE;
}
BOOL WINAPI DestroyPrivateObjectSecurity( PSECURITY_DESCRIPTOR* ObjectDescriptor )
{
FIXME("%p - stub\n", ObjectDescriptor);
+ HeapFree( GetProcessHeap(), 0, *ObjectDescriptor );
return TRUE;
}
--
1.7.9.1
More information about the wine-patches
mailing list