Sleuthing a Windows Auto-Lock Bug: A Tale of Hidden Dialogs and Power Requests
2025-04-06

A new feature in a software product prevented Windows machines from auto-locking, and even going to sleep. Debugging revealed the culprit: `PowerCreateRequest` and `PowerSetRequest` functions were being used to keep the display on by a seemingly innocuous 'What's New' dialog. Even closing the dialog didn't solve the problem. Further investigation with Spy++ showed the dialog was merely hidden, not closed, leaving a persistent power request. The team responsible for the new feature fixed the bug. The article also details alternative diagnostic tools like `powercfg`, `pwrtest`, and the powerful ETW tracing method.
Development
Bug Debugging