Author: akhaldi
Date: Sat Nov 15 15:12:24 2014
New Revision: 65409

URL: http://svn.reactos.org/svn/reactos?rev=65409&view=rev
Log:
[ADVAPI32]
* Update ConvertSecurityDescriptorToStringSecurityDescriptor{A,W}().
CORE-8540

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/security.c?rev=65409&r1=65408&r2=65409&view=diff
==============================================================================
--- 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 15 
15:12:24 2014
@@ -3061,14 +3061,8 @@
 
 /******************************************************************************
  * ConvertSecurityDescriptorToStringSecurityDescriptorW [ADVAPI32.@]
- * @implemented
- */
-BOOL WINAPI
-ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR 
SecurityDescriptor,
-                                                     DWORD SDRevision,
-                                                     SECURITY_INFORMATION 
SecurityInformation,
-                                                     LPWSTR *OutputString,
-                                                     PULONG OutputLen)
+ */
+BOOL WINAPI 
ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR 
SecurityDescriptor, DWORD SDRevision, SECURITY_INFORMATION 
RequestedInformation, LPWSTR *OutputString, PULONG OutputLen)
 {
     ULONG len;
     WCHAR *wptr, *wstr;
@@ -3081,35 +3075,45 @@
     }
 
     len = 0;
-    if (SecurityInformation & OWNER_SECURITY_INFORMATION)
+    if (RequestedInformation & OWNER_SECURITY_INFORMATION)
         if (!DumpOwner(SecurityDescriptor, NULL, &len))
             return FALSE;
-    if (SecurityInformation & GROUP_SECURITY_INFORMATION)
+    if (RequestedInformation & GROUP_SECURITY_INFORMATION)
         if (!DumpGroup(SecurityDescriptor, NULL, &len))
             return FALSE;
-    if (SecurityInformation & DACL_SECURITY_INFORMATION)
+    if (RequestedInformation & DACL_SECURITY_INFORMATION)
         if (!DumpDacl(SecurityDescriptor, NULL, &len))
             return FALSE;
-    if (SecurityInformation & SACL_SECURITY_INFORMATION)
+    if (RequestedInformation & SACL_SECURITY_INFORMATION)
         if (!DumpSacl(SecurityDescriptor, NULL, &len))
             return FALSE;
 
     wstr = wptr = LocalAlloc(0, (len + 1)*sizeof(WCHAR));
+#ifdef __REACTOS__
     if (wstr == NULL)
         return FALSE;
-        
-    if (SecurityInformation & OWNER_SECURITY_INFORMATION)
-        if (!DumpOwner(SecurityDescriptor, &wptr, NULL))
+#endif
+
+    if (RequestedInformation & OWNER_SECURITY_INFORMATION)
+        if (!DumpOwner(SecurityDescriptor, &wptr, NULL)) {
+            LocalFree (wstr);
             return FALSE;
-    if (SecurityInformation & GROUP_SECURITY_INFORMATION)
-        if (!DumpGroup(SecurityDescriptor, &wptr, NULL))
+        }
+    if (RequestedInformation & GROUP_SECURITY_INFORMATION)
+        if (!DumpGroup(SecurityDescriptor, &wptr, NULL)) {
+            LocalFree (wstr);
             return FALSE;
-    if (SecurityInformation & DACL_SECURITY_INFORMATION)
-        if (!DumpDacl(SecurityDescriptor, &wptr, NULL))
+        }
+    if (RequestedInformation & DACL_SECURITY_INFORMATION)
+        if (!DumpDacl(SecurityDescriptor, &wptr, NULL)) {
+            LocalFree (wstr);
             return FALSE;
-    if (SecurityInformation & SACL_SECURITY_INFORMATION)
-        if (!DumpSacl(SecurityDescriptor, &wptr, NULL))
+        }
+    if (RequestedInformation & SACL_SECURITY_INFORMATION)
+        if (!DumpSacl(SecurityDescriptor, &wptr, NULL)) {
+            LocalFree (wstr);
             return FALSE;
+        }
     *wptr = 0;
 
     TRACE("ret: %s, %d\n", wine_dbgstr_w(wstr), len);
@@ -3121,30 +3125,25 @@
 
 /******************************************************************************
  * ConvertSecurityDescriptorToStringSecurityDescriptorA [ADVAPI32.@]
- * @implemented
- */
-BOOL WINAPI
-ConvertSecurityDescriptorToStringSecurityDescriptorA(PSECURITY_DESCRIPTOR 
SecurityDescriptor,
-                                                     DWORD SDRevision,
-                                                     SECURITY_INFORMATION 
Information,
-                                                     LPSTR *OutputString,
-                                                     PULONG OutputLen)
+ */
+BOOL WINAPI 
ConvertSecurityDescriptorToStringSecurityDescriptorA(PSECURITY_DESCRIPTOR 
SecurityDescriptor, DWORD SDRevision, SECURITY_INFORMATION Information, LPSTR 
*OutputString, PULONG OutputLen)
 {
     LPWSTR wstr;
     ULONG len;
-
     if 
(ConvertSecurityDescriptorToStringSecurityDescriptorW(SecurityDescriptor, 
SDRevision, Information, &wstr, &len))
     {
         int lenA;
 
         lenA = WideCharToMultiByte(CP_ACP, 0, wstr, len, NULL, 0, NULL, NULL);
-        *OutputString = HeapAlloc(GetProcessHeap(), 0, lenA);
+        *OutputString = heap_alloc(lenA);
+#ifdef __REACTOS__
         if (*OutputString == NULL)
         {
             LocalFree(wstr);
             *OutputLen = 0;
             return FALSE;
         }
+#endif
         WideCharToMultiByte(CP_ACP, 0, wstr, len, *OutputString, lenA, NULL, 
NULL);
         LocalFree(wstr);
 


Reply via email to