implemented some stubs needed by ClamWin
[reactos.git] / reactos / lib / advapi32 / sec / sec.c
index ead1ddd..20d664e 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: sec.c,v 1.22 2004/08/15 17:03:15 chorns Exp $
+/* $Id$
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS system libraries
@@ -11,7 +11,9 @@
  *                  Created 01/11/98
  */
 
-#include "advapi32.h"
+#include <advapi32.h>
+
+#define NDEBUG
 #include <debug.h>
 
 /*
@@ -102,19 +104,6 @@ GetSecurityDescriptorGroup (
 }
 
 
-/*
- * @implemented
- */
-DWORD
-STDCALL
-GetSecurityDescriptorLength (
-       PSECURITY_DESCRIPTOR    pSecurityDescriptor
-       )
-{
-       return RtlLengthSecurityDescriptor(pSecurityDescriptor);
-}
-
-
 /*
  * @implemented
  */
@@ -124,7 +113,7 @@ GetSecurityDescriptorOwner (
        PSECURITY_DESCRIPTOR    pSecurityDescriptor,
        PSID                    *pOwner,
        LPBOOL                  lpbOwnerDefaulted
-)
+       )
 {
        BOOLEAN OwnerDefaulted;
        NTSTATUS Status;
@@ -144,6 +133,23 @@ GetSecurityDescriptorOwner (
 }
 
 
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+GetSecurityDescriptorRMControl (
+       PSECURITY_DESCRIPTOR    SecurityDescriptor,
+       PUCHAR                  RMControl)
+{
+  if (!RtlGetSecurityDescriptorRMControl(SecurityDescriptor,
+                                        RMControl))
+    return ERROR_INVALID_DATA;
+
+  return ERROR_SUCCESS;
+}
+
+
 /*
  * @implemented
  */
@@ -262,6 +268,28 @@ MakeAbsoluteSD (
 }
 
 
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+MakeAbsoluteSD2(IN OUT PSECURITY_DESCRIPTOR pSelfRelativeSecurityDescriptor,
+                OUT LPDWORD lpdwBufferSize)
+{
+    NTSTATUS Status;
+
+    Status = RtlSelfRelativeToAbsoluteSD2(pSelfRelativeSecurityDescriptor,
+                                          lpdwBufferSize);
+       if (!NT_SUCCESS(Status))
+       {
+               SetLastError (RtlNtStatusToDosError (Status));
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
 /*
  * @implemented
  */
@@ -288,6 +316,31 @@ MakeSelfRelativeSD (
 }
 
 
+/*
+ * @implemented
+ */
+BOOL
+STDCALL
+SetSecurityDescriptorControl (
+       PSECURITY_DESCRIPTOR            pSecurityDescriptor,
+       SECURITY_DESCRIPTOR_CONTROL     ControlBitsOfInterest,
+       SECURITY_DESCRIPTOR_CONTROL     ControlBitsToSet)
+{
+       NTSTATUS Status;
+
+       Status = RtlSetControlSecurityDescriptor(pSecurityDescriptor,
+                                                ControlBitsOfInterest,
+                                                ControlBitsToSet);
+       if (!NT_SUCCESS(Status))
+       {
+               SetLastError (RtlNtStatusToDosError (Status));
+               return FALSE;
+       }
+
+       return TRUE;
+}
+
+
 /*
  * @implemented
  */
@@ -368,6 +421,22 @@ SetSecurityDescriptorOwner (
 }
 
 
+/*
+ * @implemented
+ */
+DWORD
+STDCALL
+SetSecurityDescriptorRMControl (
+       PSECURITY_DESCRIPTOR    SecurityDescriptor,
+       PUCHAR                  RMControl)
+{
+  RtlSetSecurityDescriptorRMControl(SecurityDescriptor,
+                                   RMControl);
+
+  return ERROR_SUCCESS;
+}
+
+
 /*
  * @implemented
  */
@@ -395,4 +464,120 @@ SetSecurityDescriptorSacl (
        return TRUE;
 }
 
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+ConvertToAutoInheritPrivateObjectSecurity(IN PSECURITY_DESCRIPTOR ParentDescriptor,
+                                          IN PSECURITY_DESCRIPTOR CurrentSecurityDescriptor,
+                                          OUT PSECURITY_DESCRIPTOR* NewSecurityDescriptor,
+                                          IN GUID* ObjectType,
+                                          IN BOOLEAN IsDirectoryObject,
+                                          IN PGENERIC_MAPPING GenericMapping)
+{
+    UNIMPLEMENTED;
+    return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+STDCALL
+BuildSecurityDescriptorW(IN PTRUSTEE_W pOwner  OPTIONAL,
+                         IN PTRUSTEE_W pGroup  OPTIONAL,
+                         IN ULONG cCountOfAccessEntries,
+                         IN PEXPLICIT_ACCESS pListOfAccessEntries  OPTIONAL,
+                         IN ULONG cCountOfAuditEntries,
+                         IN PEXPLICIT_ACCESS pListOfAuditEntries  OPTIONAL,
+                         IN PSECURITY_DESCRIPTOR pOldSD  OPTIONAL,
+                         OUT PULONG pSizeNewSD,
+                         OUT PSECURITY_DESCRIPTOR* pNewSD)
+{
+    UNIMPLEMENTED;
+    return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+DWORD
+STDCALL
+BuildSecurityDescriptorA(IN PTRUSTEE_A pOwner  OPTIONAL,
+                         IN PTRUSTEE_A pGroup  OPTIONAL,
+                         IN ULONG cCountOfAccessEntries,
+                         IN PEXPLICIT_ACCESS pListOfAccessEntries  OPTIONAL,
+                         IN ULONG cCountOfAuditEntries,
+                         IN PEXPLICIT_ACCESS pListOfAuditEntries  OPTIONAL,
+                         IN PSECURITY_DESCRIPTOR pOldSD  OPTIONAL,
+                         OUT PULONG pSizeNewSD,
+                         OUT PSECURITY_DESCRIPTOR* pNewSD)
+{
+    UNIMPLEMENTED;
+    return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI DecryptFileW(LPCWSTR lpFileName, DWORD dwReserved)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI DecryptFileA(LPCSTR lpFileName, DWORD dwReserved)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI EncryptFileW(LPCWSTR lpFileName)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+/*
+ * @unimplemented
+ */
+BOOL WINAPI EncryptFileA(LPCSTR lpFileName)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorW(
+    PSECURITY_DESCRIPTOR pSecurityDescriptor, 
+    DWORD dword, 
+    SECURITY_INFORMATION SecurityInformation, 
+    LPWSTR* lpwstr,
+    PULONG pulong)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
+BOOL WINAPI ConvertSecurityDescriptorToStringSecurityDescriptorA(
+    PSECURITY_DESCRIPTOR pSecurityDescriptor, 
+    DWORD dword, 
+    SECURITY_INFORMATION SecurityInformation, 
+    LPSTR* lpstr,
+    PULONG pulong)
+{
+    DPRINT1("%s() not implemented!\n", __FUNCTION__);
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
+
 /* EOF */