mirror of
https://github.com/reactos/reactos
synced 2025-10-06 00:12:51 +02:00
- Validate the opened `WinSta0_DesktopSwitch` handle; - Don't pass the `ahEvents` array containing a NULL pointer to `MsgWaitForMultipleObjects()`, but provide the correct number of non-NULL handles, otherwise the function fails and the code ends up busy-looping. - Validate the `MsgWaitForMultipleObjects()` result: bail out if `WAIT_FAILED` is returned. - Validate the event index passed to `CRegWatcher::InitEvent()` and `CRegWatcher::OnEvent()`. - Rename `WATCHENTRY_MAX` to `WI_REGEVTS_MAX` and add it in the `WATCH_INDEX` enumeration. - Fix some code comments.