Diagnosing bugs preventing sleep on Windows
a year ago
- #PowerManagement
- #Windows
- #Debugging
- Diagnosing programs preventing Windows auto-lock and sleep is straightforward using breakpoints and Windows APIs.
- The issue was traced to a hidden dialog in a CEF-based application that kept a power request active, preventing the lock screen and sleep mode.
- Tools like `powercfg`, `pwrtest`, and ETW with the Microsoft-Windows-Kernel-Power provider can help monitor and diagnose power requests.
- The bug was fixed after identifying the hidden dialog as the root cause.