Author: cwittich
Date: Sun Oct 26 07:16:48 2008
New Revision: 36981
URL:
http://svn.reactos.org/svn/reactos?rev=36981&view=rev
Log:
-move ConvertSecurityDescriptorToStringSecurityDescriptorA/W from sec.c to sid.c
-import ConvertSecurityDescriptorToStringSecurityDescriptorA from wine
Modified:
trunk/reactos/dll/win32/advapi32/sec/sec.c
trunk/reactos/dll/win32/advapi32/sec/sid.c
Modified: trunk/reactos/dll/win32/advapi32/sec/sec.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/sec…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/sec.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/sec.c [iso-8859-1] Sun Oct 26 07:16:48 2008
@@ -607,36 +607,4 @@
return ret;
}
-
-/*
- * @unimplemented
- */
-BOOL WINAPI
-ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR
pSecurityDescriptor,
- DWORD dword,
- SECURITY_INFORMATION
SecurityInformation,
- LPWSTR *lpwstr,
- PULONG pulong)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-BOOL WINAPI
-ConvertSecurityDescriptorToStringSecurityDescriptorA(PSECURITY_DESCRIPTOR
pSecurityDescriptor,
- DWORD dword,
- SECURITY_INFORMATION
SecurityInformation,
- LPSTR *lpstr,
- PULONG pulong)
-{
- FIXME("%s() not implemented!\n", __FUNCTION__);
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
-}
-
/* EOF */
Modified: trunk/reactos/dll/win32/advapi32/sec/sid.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/sid…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/sid.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/sec/sid.c [iso-8859-1] Sun Oct 26 07:16:48 2008
@@ -612,6 +612,65 @@
/******************************************************************************
+ * ConvertSecurityDescriptorToStringSecurityDescriptorW [ADVAPI32.@]
+ * @unimplemented
+ */
+BOOL WINAPI
+ConvertSecurityDescriptorToStringSecurityDescriptorW(PSECURITY_DESCRIPTOR
SecurityDescriptor,
+ DWORD SDRevision,
+ SECURITY_INFORMATION
SecurityInformation,
+ LPWSTR *OutputString,
+ PULONG OutputLen)
+{
+ if (SDRevision != SDDL_REVISION_1)
+ {
+ ERR("Pogram requested unknown SDDL revision %d\n", SDRevision);
+ SetLastError(ERROR_UNKNOWN_REVISION);
+ return FALSE;
+ }
+
+ FIXME("%s() not implemented!\n", __FUNCTION__);
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return FALSE;
+}
+
+
+/******************************************************************************
+ * ConvertSecurityDescriptorToStringSecurityDescriptorA [ADVAPI32.@]
+ * @implemented
+ */
+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);
+ WideCharToMultiByte(CP_ACP, 0, wstr, len, *OutputString, lenA, NULL, NULL);
+ LocalFree(wstr);
+
+ if (OutputLen != NULL)
+ *OutputLen = lenA;
+ return TRUE;
+ }
+ else
+ {
+ *OutputString = NULL;
+ if (OutputLen)
+ *OutputLen = 0;
+ return FALSE;
+ }
+}
+
+/******************************************************************************
* ConvertStringSecurityDescriptorToSecurityDescriptorW [ADVAPI32.@]
* @implemented
*/