Smarter stub implementation for CreatePrivateObjectSecurity

Nick Sukharev nicksukharev at gmail.com
Wed Dec 8 00:41:09 CST 2010


---
 dlls/advapi32/security.c |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
index 0458033..21562e0 100644
--- a/dlls/advapi32/security.c
+++ b/dlls/advapi32/security.c
@@ -4976,16 +4976,26 @@ BOOL WINAPI CreatePrivateObjectSecurity(
         HANDLE Token,
         PGENERIC_MAPPING GenericMapping )
 {
-    FIXME("%p %p %p %d %p %p - stub\n", ParentDescriptor, CreatorDescriptor,
+    FIXME("%p %p %p %d %p %p - semi- stub\n", ParentDescriptor, CreatorDescriptor,
           NewDescriptor, IsDirectoryObject, Token, GenericMapping);
 
-    return FALSE;
+
+    *NewDescriptor = HeapAlloc( GetProcessHeap(), 0, sizeof(SECURITY_DESCRIPTOR) );
+    if (!*NewDescriptor) return FALSE;
+    if (!InitializeSecurityDescriptor(*NewDescriptor, SECURITY_DESCRIPTOR_REVISION)) {
+	HeapFree(GetProcessHeap(), 0, *NewDescriptor);
+        return FALSE;
+    }
+
+    return TRUE;
 }
 
 BOOL WINAPI DestroyPrivateObjectSecurity( PSECURITY_DESCRIPTOR* ObjectDescriptor )
 {
-    FIXME("%p - stub\n", ObjectDescriptor);
-
+    TRACE("%p\n", ObjectDescriptor);
+    if (ObjectDescriptor && *ObjectDescriptor) {
+	HeapFree(GetProcessHeap(), 0, *ObjectDescriptor);
+    }
     return TRUE;
 }
 
-- 
1.7.0.4


--=-sd8JZJLhoCj4HZRbR0kl--




More information about the wine-patches mailing list