On Mon Jan 15 13:47:02 2024 +0000, Etaash Mathamsetty wrote:
Could you add a test for this behavior?
Looked more into this and this is wrong, on Windows giving larger buffer still returns `STATUS_SUCCESS` but because current number of handles keeps changing it's easy to run into situation like
```c NtQuerySystemInformation(SystemHandleInformation, buffer, 0x32, &ReturnLength); status = NtQuerySystemInformation(SystemHandleInformation, buffer, ReturnLength, NULL); // status returns STATUS_INFO_LENGTH_MISMATCH because now there are more handles so need larger buffer
```
But Wine's implementation is wrong in different way, on Windows you can give smaller buffer and it will get filled with available information because it writes directly in user provided buffer, but here Wine will write output only if buffer is large enough and thus programs that give smaller buffer will fail with Wine but succeed on Windows.