Thanks. The SleepEx function is quite interesting. It breaks the sleep as soon as the event is created IF there is a callback. Otherwise the event is triggered and the readdirectory stuff breaks its polling for event loop, but the sleep keeps going - until the delay has passed.

So SleepEx reacts to the existence of a callback, and also to the alertable state set TRUE.