http://support.microsoft.com/kb/941561
Quote:
"On a Windows Vista-based computer, you develop an application by using the WTSWaitSystemEvent function. When you set the value of the EventMask parameter to WTS_EVENT_FLUSH, all pending WTSWaitSystemEvent function calls on the specified terminal server handle are returned. However, no pending calls to the WTSWaitSystemEvent function return as expected.
..."