I have
var H: array of THandle;
then in a loop I create multiple threads, and assign thread handles to the elements of H, and then wait on them. Passing @H[0] as the 2nd parameter to WFMO below works.
WaitForMultipleObjects(Length(H), @H[0], True, INFINITE) <-- Works
But passing @H as below Fails with WAIT_FAILED. GetLastError returns "Invalid Handle".
WaitForMultipleObjects(Length(H), @H, True, INFINITE) <--- Fails.
Why is @H different from @H[0] ?
H: array[0..10] of THandle
then @H and @H[0] would be the same, I suppose. I can check it. – Archipelago