The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
Windows 8 introduced a new power saving mode called connected standby. In Windows 10, this was extended and re-named "modern" standby. Some Microsoft documents refer to it as “S0 low-power idle mode” or "Always On / Always Connected". The new mode was initially used on the Microsoft Surface range and subsequently seems to be becoming more common on other high-end laptop such as the Dell XPS.
Behind the scenes, the new power mode works differently to the normal S1-S4 power states. Power saving starts when the display turns off and is transparent to applications.
Traditionally, usermode apps could use the SetSuspendState() API to suspend (S1-S3) or hibernate (S4) the PC. However, this no longer works and attempting to suspend will fail with ERROR_NOT_SUPPORTED. A workaround is to turn off the display directly. Usermode apps do this with:
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
A problem with this approach is that it can only be used by applications that have access to the display. It won't work for services running in session 0 due to session 0 isolation.
In the past, the display could be powered down directly with:
IOCTL_VIDEO_SET_OUTPUT_DEVICE_POWER_STATE - Not available in Vista and later
IOCTL_VIDEO_SET_POWER_MANAGEMENT - Not available in Win2000 and later
The only other alternative I can find is to write a video filter and use DxgkDdiSetPowerState. This seems like massive overkill.
Please, is there a simpler way to turn off the display?
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Internals & Software Drivers||7 February 2022||Live, Online|
|Kernel Debugging||21 March 2022||Live, Online|
|Developing Minifilters||23 May 2022||Live, Online|
|Writing WDF Drivers||12 September 2022||Live, Online|