Implement SamIFree_SAMPR_DISPLAY_INFO_BUFFER.

svn path=/trunk/; revision=75925
This commit is contained in:
Eric Kohl 2017-09-22 12:29:53 +00:00
parent 70d4f2c68f
commit 451d484fcd
2 changed files with 153 additions and 56 deletions

View file

@ -187,6 +187,103 @@ SamIFree_SAMPR_ALIAS_INFO_BUFFER(
} }
VOID
NTAPI
SamIFree_SAMPR_DISPLAY_INFO_BUFFER(
PSAMPR_DISPLAY_INFO_BUFFER Ptr,
DOMAIN_DISPLAY_INFORMATION InformationClass)
{
ULONG i;
if (Ptr == NULL)
return;
switch (InformationClass)
{
case DomainDisplayUser:
if (Ptr->UserInformation.Buffer != NULL)
{
for (i = 0; i < Ptr->UserInformation.EntriesRead; i++)
{
if (Ptr->UserInformation.Buffer[i].AccountName.Buffer != NULL)
MIDL_user_free(Ptr->UserInformation.Buffer[i].AccountName.Buffer);
if (Ptr->UserInformation.Buffer[i].AdminComment.Buffer != NULL)
MIDL_user_free(Ptr->UserInformation.Buffer[i].AdminComment.Buffer);
if (Ptr->UserInformation.Buffer[i].FullName.Buffer != NULL)
MIDL_user_free(Ptr->UserInformation.Buffer[i].FullName.Buffer);
}
MIDL_user_free(Ptr->UserInformation.Buffer);
}
break;
case DomainDisplayMachine:
if (Ptr->MachineInformation.Buffer != NULL)
{
for (i = 0; i < Ptr->MachineInformation.EntriesRead; i++)
{
if (Ptr->MachineInformation.Buffer[i].AccountName.Buffer != NULL)
MIDL_user_free(Ptr->MachineInformation.Buffer[i].AccountName.Buffer);
if (Ptr->MachineInformation.Buffer[i].AdminComment.Buffer != NULL)
MIDL_user_free(Ptr->MachineInformation.Buffer[i].AdminComment.Buffer);
}
MIDL_user_free(Ptr->MachineInformation.Buffer);
}
break;
case DomainDisplayGroup:
if (Ptr->GroupInformation.Buffer != NULL)
{
for (i = 0; i < Ptr->GroupInformation.EntriesRead; i++)
{
if (Ptr->GroupInformation.Buffer[i].AccountName.Buffer != NULL)
MIDL_user_free(Ptr->GroupInformation.Buffer[i].AccountName.Buffer);
if (Ptr->GroupInformation.Buffer[i].AdminComment.Buffer != NULL)
MIDL_user_free(Ptr->GroupInformation.Buffer[i].AdminComment.Buffer);
}
MIDL_user_free(Ptr->GroupInformation.Buffer);
}
break;
case DomainDisplayOemUser:
if (Ptr->OemUserInformation.Buffer != NULL)
{
for (i = 0; i < Ptr->OemUserInformation.EntriesRead; i++)
{
if (Ptr->OemUserInformation.Buffer[i].OemAccountName.Buffer != NULL)
MIDL_user_free(Ptr->OemUserInformation.Buffer[i].OemAccountName.Buffer);
}
MIDL_user_free(Ptr->OemUserInformation.Buffer);
}
break;
case DomainDisplayOemGroup:
if (Ptr->OemGroupInformation.Buffer != NULL)
{
for (i = 0; i < Ptr->OemGroupInformation.EntriesRead; i++)
{
if (Ptr->OemGroupInformation.Buffer[i].OemAccountName.Buffer != NULL)
MIDL_user_free(Ptr->OemGroupInformation.Buffer[i].OemAccountName.Buffer);
}
MIDL_user_free(Ptr->OemGroupInformation.Buffer);
}
break;
default:
FIXME("Unsupported information class: %lu\n", InformationClass);
break;
}
}
VOID VOID
NTAPI NTAPI
SamIFree_SAMPR_DOMAIN_INFO_BUFFER( SamIFree_SAMPR_DOMAIN_INFO_BUFFER(
@ -271,8 +368,9 @@ SamIFree_SAMPR_ENUMERATION_BUFFER(PSAMPR_ENUMERATION_BUFFER Ptr)
{ {
ULONG i; ULONG i;
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Buffer != NULL) if (Ptr->Buffer != NULL)
{ {
for (i = 0; i < Ptr->EntriesRead; i++) for (i = 0; i < Ptr->EntriesRead; i++)
@ -286,29 +384,29 @@ SamIFree_SAMPR_ENUMERATION_BUFFER(PSAMPR_ENUMERATION_BUFFER Ptr)
MIDL_user_free(Ptr); MIDL_user_free(Ptr);
} }
}
VOID VOID
NTAPI NTAPI
SamIFree_SAMPR_GET_GROUPS_BUFFER(PSAMPR_GET_GROUPS_BUFFER Ptr) SamIFree_SAMPR_GET_GROUPS_BUFFER(PSAMPR_GET_GROUPS_BUFFER Ptr)
{ {
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Groups != NULL) if (Ptr->Groups != NULL)
MIDL_user_free(Ptr->Groups); MIDL_user_free(Ptr->Groups);
MIDL_user_free(Ptr); MIDL_user_free(Ptr);
} }
}
VOID VOID
NTAPI NTAPI
SamIFree_SAMPR_GET_MEMBERS_BUFFER(PSAMPR_GET_MEMBERS_BUFFER Ptr) SamIFree_SAMPR_GET_MEMBERS_BUFFER(PSAMPR_GET_MEMBERS_BUFFER Ptr)
{ {
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Members != NULL) if (Ptr->Members != NULL)
MIDL_user_free(Ptr->Members); MIDL_user_free(Ptr->Members);
@ -317,7 +415,6 @@ SamIFree_SAMPR_GET_MEMBERS_BUFFER(PSAMPR_GET_MEMBERS_BUFFER Ptr)
MIDL_user_free(Ptr); MIDL_user_free(Ptr);
} }
}
VOID VOID
@ -365,14 +462,14 @@ VOID
NTAPI NTAPI
SamIFree_SAMPR_PSID_ARRAY(PSAMPR_PSID_ARRAY Ptr) SamIFree_SAMPR_PSID_ARRAY(PSAMPR_PSID_ARRAY Ptr)
{ {
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Sids != NULL) if (Ptr->Sids != NULL)
{ {
MIDL_user_free(Ptr->Sids); MIDL_user_free(Ptr->Sids);
} }
} }
}
VOID VOID
@ -381,8 +478,9 @@ SamIFree_SAMPR_RETURNED_USTRING_ARRAY(PSAMPR_RETURNED_USTRING_ARRAY Ptr)
{ {
ULONG i; ULONG i;
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Element != NULL) if (Ptr->Element != NULL)
{ {
for (i = 0; i < Ptr->Count; i++) for (i = 0; i < Ptr->Count; i++)
@ -396,29 +494,29 @@ SamIFree_SAMPR_RETURNED_USTRING_ARRAY(PSAMPR_RETURNED_USTRING_ARRAY Ptr)
Ptr->Count = 0; Ptr->Count = 0;
} }
} }
}
VOID VOID
NTAPI NTAPI
SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR(PSAMPR_SR_SECURITY_DESCRIPTOR Ptr) SamIFree_SAMPR_SR_SECURITY_DESCRIPTOR(PSAMPR_SR_SECURITY_DESCRIPTOR Ptr)
{ {
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->SecurityDescriptor != NULL) if (Ptr->SecurityDescriptor != NULL)
MIDL_user_free(Ptr->SecurityDescriptor); MIDL_user_free(Ptr->SecurityDescriptor);
MIDL_user_free(Ptr); MIDL_user_free(Ptr);
} }
}
VOID VOID
NTAPI NTAPI
SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr) SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr)
{ {
if (Ptr != NULL) if (Ptr == NULL)
{ return;
if (Ptr->Element != NULL) if (Ptr->Element != NULL)
{ {
MIDL_user_free(Ptr->Element); MIDL_user_free(Ptr->Element);
@ -426,7 +524,6 @@ SamIFree_SAMPR_ULONG_ARRAY(PSAMPR_ULONG_ARRAY Ptr)
Ptr->Count = 0; Ptr->Count = 0;
} }
} }
}
VOID VOID

View file

@ -18,7 +18,7 @@
@ stub SamIFreeSidArray @ stub SamIFreeSidArray
@ stdcall SamIFreeVoid(ptr) @ stdcall SamIFreeVoid(ptr)
@ stdcall SamIFree_SAMPR_ALIAS_INFO_BUFFER(ptr long) @ stdcall SamIFree_SAMPR_ALIAS_INFO_BUFFER(ptr long)
@ stub SamIFree_SAMPR_DISPLAY_INFO_BUFFER @ stdcall SamIFree_SAMPR_DISPLAY_INFO_BUFFER(ptr long)
@ stdcall SamIFree_SAMPR_DOMAIN_INFO_BUFFER(ptr long) @ stdcall SamIFree_SAMPR_DOMAIN_INFO_BUFFER(ptr long)
@ stdcall SamIFree_SAMPR_ENUMERATION_BUFFER(ptr) @ stdcall SamIFree_SAMPR_ENUMERATION_BUFFER(ptr)
@ stdcall SamIFree_SAMPR_GET_GROUPS_BUFFER(ptr) @ stdcall SamIFree_SAMPR_GET_GROUPS_BUFFER(ptr)