[SAMSRV]
authorEric Kohl <eric.kohl@reactos.org>
Fri, 22 Sep 2017 10:05:48 +0000 (10:05 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Fri, 22 Sep 2017 10:05:48 +0000 (10:05 +0000)
Implement SamIFree_SAMPR_ALIAS_INFO_BUFFER, SamIFree_SAMPR_DOMAIN_INFO_BUFFER and SamIFree_SAMPR_GROUP_INFO_BUFFER.

svn path=/trunk/; revision=75924

reactos/dll/win32/samsrv/samsrv.c
reactos/dll/win32/samsrv/samsrv.spec

index a67865e..eb94e58 100644 (file)
@@ -149,6 +149,122 @@ SamIFreeVoid(PVOID Ptr)
 }
 
 
+VOID
+NTAPI
+SamIFree_SAMPR_ALIAS_INFO_BUFFER(
+    PSAMPR_ALIAS_INFO_BUFFER Ptr,
+    ALIAS_INFORMATION_CLASS InformationClass)
+{
+    if (Ptr == NULL)
+        return;
+
+    switch (InformationClass)
+    {
+        case AliasGeneralInformation:
+            if (Ptr->General.Name.Buffer != NULL)
+                MIDL_user_free(Ptr->General.Name.Buffer);
+
+            if (Ptr->General.AdminComment.Buffer != NULL)
+                MIDL_user_free(Ptr->General.AdminComment.Buffer);
+            break;
+
+        case AliasNameInformation:
+            if (Ptr->Name.Name.Buffer != NULL)
+                MIDL_user_free(Ptr->Name.Name.Buffer);
+            break;
+
+        case AliasAdminCommentInformation:
+            if (Ptr->AdminComment.AdminComment.Buffer != NULL)
+                MIDL_user_free(Ptr->AdminComment.AdminComment.Buffer);
+            break;
+
+        default:
+            FIXME("Unsupported information class: %lu\n", InformationClass);
+            break;
+    }
+
+    MIDL_user_free(Ptr);
+}
+
+
+VOID
+NTAPI
+SamIFree_SAMPR_DOMAIN_INFO_BUFFER(
+    PSAMPR_DOMAIN_INFO_BUFFER Ptr,
+    DOMAIN_INFORMATION_CLASS InformationClass)
+{
+    if (Ptr == NULL)
+        return;
+
+    switch (InformationClass)
+    {
+        case DomainPasswordInformation:
+            break;
+
+        case DomainGeneralInformation:
+            if (Ptr->General.OemInformation.Buffer != NULL)
+                MIDL_user_free(Ptr->General.OemInformation.Buffer);
+
+            if (Ptr->General.DomainName.Buffer != NULL)
+                MIDL_user_free(Ptr->General.DomainName.Buffer);
+
+            if (Ptr->General.ReplicaSourceNodeName.Buffer != NULL)
+                MIDL_user_free(Ptr->General.ReplicaSourceNodeName.Buffer);
+            break;
+
+        case DomainLogoffInformation:
+            break;
+
+        case DomainOemInformation:
+            if (Ptr->Oem.OemInformation.Buffer != NULL)
+                MIDL_user_free(Ptr->Oem.OemInformation.Buffer);
+            break;
+
+        case DomainNameInformation:
+            if (Ptr->Name.DomainName.Buffer != NULL)
+                MIDL_user_free(Ptr->Name.DomainName.Buffer);
+            break;
+
+        case DomainReplicationInformation:
+            if (Ptr->Replication.ReplicaSourceNodeName.Buffer != NULL)
+                MIDL_user_free(Ptr->Replication.ReplicaSourceNodeName.Buffer);
+            break;
+
+        case DomainServerRoleInformation:
+            break;
+
+        case DomainModifiedInformation:
+            break;
+
+        case DomainStateInformation:
+            break;
+
+        case DomainGeneralInformation2:
+            if (Ptr->General2.I1.OemInformation.Buffer != NULL)
+                MIDL_user_free(Ptr->General2.I1.OemInformation.Buffer);
+
+            if (Ptr->General2.I1.DomainName.Buffer != NULL)
+                MIDL_user_free(Ptr->General2.I1.DomainName.Buffer);
+
+            if (Ptr->General2.I1.ReplicaSourceNodeName.Buffer != NULL)
+                MIDL_user_free(Ptr->General2.I1.ReplicaSourceNodeName.Buffer);
+            break;
+
+        case DomainLockoutInformation:
+            break;
+
+        case DomainModifiedInformation2:
+            break;
+
+        default:
+            FIXME("Unsupported information class: %lu\n", InformationClass);
+            break;
+    }
+
+    MIDL_user_free(Ptr);
+}
+
+
 VOID
 NTAPI
 SamIFree_SAMPR_ENUMERATION_BUFFER(PSAMPR_ENUMERATION_BUFFER Ptr)
@@ -204,6 +320,47 @@ SamIFree_SAMPR_GET_MEMBERS_BUFFER(PSAMPR_GET_MEMBERS_BUFFER Ptr)
 }
 
 
+VOID
+NTAPI
+SamIFree_SAMPR_GROUP_INFO_BUFFER(
+    PSAMPR_GROUP_INFO_BUFFER Ptr,
+    GROUP_INFORMATION_CLASS InformationClass)
+{
+    if (Ptr == NULL)
+        return;
+
+    switch (InformationClass)
+    {
+        case GroupGeneralInformation:
+            if (Ptr->General.Name.Buffer != NULL)
+                MIDL_user_free(Ptr->General.Name.Buffer);
+
+            if (Ptr->General.AdminComment.Buffer != NULL)
+                MIDL_user_free(Ptr->General.AdminComment.Buffer);
+            break;
+
+        case GroupNameInformation:
+            if (Ptr->Name.Name.Buffer != NULL)
+                MIDL_user_free(Ptr->Name.Name.Buffer);
+            break;
+
+        case GroupAttributeInformation:
+            break;
+
+        case GroupAdminCommentInformation:
+            if (Ptr->AdminComment.AdminComment.Buffer != NULL)
+                MIDL_user_free(Ptr->AdminComment.AdminComment.Buffer);
+            break;
+
+        default:
+            FIXME("Unsupported information class: %lu\n", InformationClass);
+            break;
+    }
+
+    MIDL_user_free(Ptr);
+}
+
+
 VOID
 NTAPI
 SamIFree_SAMPR_PSID_ARRAY(PSAMPR_PSID_ARRAY Ptr)
index f28eacb..35a7084 100644 (file)
 @ stub SamIFreeSidAndAttributesList
 @ stub SamIFreeSidArray
 @ stdcall SamIFreeVoid(ptr)
-@ stub SamIFree_SAMPR_ALIAS_INFO_BUFFER
+@ stdcall SamIFree_SAMPR_ALIAS_INFO_BUFFER(ptr long)
 @ stub SamIFree_SAMPR_DISPLAY_INFO_BUFFER
-@ stub SamIFree_SAMPR_DOMAIN_INFO_BUFFER
+@ stdcall SamIFree_SAMPR_DOMAIN_INFO_BUFFER(ptr long)
 @ stdcall SamIFree_SAMPR_ENUMERATION_BUFFER(ptr)
 @ stdcall SamIFree_SAMPR_GET_GROUPS_BUFFER(ptr)
 @ stdcall SamIFree_SAMPR_GET_MEMBERS_BUFFER(ptr)
-@ stub SamIFree_SAMPR_GROUP_INFO_BUFFER
+@ stdcall SamIFree_SAMPR_GROUP_INFO_BUFFER(ptr long)
 @ stdcall SamIFree_SAMPR_PSID_ARRAY(ptr)
 @ stdcall SamIFree_SAMPR_RETURNED_USTRING_ARRAY(ptr)
 @ stdcall SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR(ptr)