Author: ekohl
Date: Fri Sep 22 10:05:48 2017
New Revision: 75924

URL: http://svn.reactos.org/svn/reactos?rev=75924&view=rev
Log:
[SAMSRV]
Implement SamIFree_SAMPR_ALIAS_INFO_BUFFER, SamIFree_SAMPR_DOMAIN_INFO_BUFFER 
and SamIFree_SAMPR_GROUP_INFO_BUFFER.

Modified:
    trunk/reactos/dll/win32/samsrv/samsrv.c
    trunk/reactos/dll/win32/samsrv/samsrv.spec

Modified: trunk/reactos/dll/win32/samsrv/samsrv.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.c?rev=75924&r1=75923&r2=75924&view=diff
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samsrv.c     [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samsrv.c     [iso-8859-1] Fri Sep 22 
10:05:48 2017
@@ -151,6 +151,122 @@
 
 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)
 {
     ULONG i;
@@ -206,6 +322,47 @@
 
 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)
 {
     if (Ptr != NULL)

Modified: trunk/reactos/dll/win32/samsrv/samsrv.spec
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/samsrv/samsrv.spec?rev=75924&r1=75923&r2=75924&view=diff
==============================================================================
--- trunk/reactos/dll/win32/samsrv/samsrv.spec  [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/samsrv/samsrv.spec  [iso-8859-1] Fri Sep 22 
10:05:48 2017
@@ -17,13 +17,13 @@
 @ 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)


Reply via email to