Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

how does sleep work in windows kernel

tony_zhutony_zhu Member Posts: 38

so when i press Start -> Shut down or sign out -> Sleep , then the windows should go to sleep. But what is behind all this? Will the System BIOS be involved?
suppose this new device supports S3 power transition from D0, then its driver must have function that will be called after Sleep is pressed.
but what if Sleep is pressed, but the driver's sleep function never get called. What would be the reason?


  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,267

    If the device is already in D3, the system doesn't have to let the driver know when the system goes to sleep. The system is now rather aggressive about power management, and will try to put your device in D3 as soon as can. That way, system sleep can happen almost instantly.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • tony_zhutony_zhu Member Posts: 38

    Hi @Tim_Roberts , how do i know if my device is already in D3? (I suppose this D3 is the same as S3 )
    actually this device is video card , so i have set a breakpoint at DxgkDdiSetPowerState this DDI function. but it never get called even after i press Sleep.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,267

    Devices have D-states. The system has an S-state. The two are rather lightly connected. When the system wants to go to S3, it will ask the devices to fall out of D0. It's up to the device how they handle that. If a device is already not in D0, then the system doesn't necessarily need to ask it to change. You can find out what D-state you're in in Device Manager; it's one of the property pages.

    There are some good power management tools that allow you to force the system into certain states, like powercfg. I suppose you could use some of those to chase this down.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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!
Kernel Debugging 30 Mar 2020 OSR Seminar Space
Developing Minifilters 20 Apr 2020 LIVE ONLINE
Writing WDF Drivers 11 May 2020 LIVE ONLINE
Internals & Software Drivers 28 Sept 2020 Dulles, VA