v2: - Replaced check for -1 by changing type of variable `i` from unsigned to signed. - Added the same check to `enum_process_handles_cb`.
Thanks @epo for the review, this matches way better the surrounding code. I have pushed v2 with your recommendation.
For convenience following triggers the issue quite fast, when the cmd-loop runs at the same time as the querysysteminformation.exe: ```c /* x86_64-w64-mingw32-gcc -g -O0 querysysteminformation.c -o querysysteminformation.exe -lntdll wine querysysteminformation.exe wine cmd /C "for /L %%i in (0,1,1000) do @hostname" */ #include <windows.h> #include <winternl.h> int main() { LONG status; ULONG ulSize; ULONG BufferSize = 0x10000; LPBYTE SysHandleInfoData = HeapAlloc(GetProcessHeap(), 0, BufferSize); while (1) { status = NtQuerySystemInformation(SystemHandleInformation, SysHandleInfoData, BufferSize, &ulSize); } } ```