Distinguish Fast startup and General cold startup of Win8 in the driver

Source: Internet
Author: User
Tags change settings

Win8 has an option in power management. Default will be enable. It is "turn on Fast startup ".

How do we find this option and set it? See: http://www.eightforums.com/tutorials/6320-fast-startup-turn-off-windows-8-a.html.

Locates: Control Panel-> power options-> choose what the power buttons do-> change settings that are currently unavailable-> shutup settings

Location: Control Panel-> power options-> select Power Button Function-> change settings that cannot be displayed currently-> display in shutdown settings.

But how do we distinguish Fast startup from normal tranditional cold startup?

I believe that the differences between the two can be obtained if the driver is debugged. During the debugging, the author finds that in the Fast startup phase, the system will issue irp_mn_set_power IRP, which includes two, one is used to notify systempowerstate, and the other is used to notify devicepowerstate. The difference is being compared with systempowerstate.

During Fast startup, the state corresponding to systempowerstate is powersystemhibernate.

When tranditional cold startup, the state corresponding to systempowerstate is powersystemshutdown.

We can see their differences. According to the MS explanation, the above differences are normal.

Ms for Fast startup interpretation can refer to: http://msdn.microsoft.com/en-us/library/windows/hardware/jj835779 (V = vs.85). aspx

Therefore, if you need to distinguish the above two types of startup, you can consider the difference in irp_mn_set_power IRP here.

Our driver needs some special settings to distinguish hibernate from cold boot. Therefore, you need to differentiate them during boot. This can be done through the methods provided by MS:

To distinguish a Fast startup from a wake-from-hibernation, a driver can inspect the information in the system set-power (Irp_mn_set_power)
IRP that informs the driver that the computer has entered the S0 (working) state. The driver's I/O
Stack location in this IRP containsPowerMember, which is a structure that contains power-related information. Starting with Windows Vista,PowerMember structure containsSystempowerstatecontextMember,
Which isSystem_power_state_contextStructure
That contains information about the previous system power states. This information is encoded in BIT fields inSystem_power_state_contextStructure.

Most of the bit fields inSystem_power_state_contextStructure are reserved for system use and are opaque to drivers. However, this structure contains two bit fields,TargetsystemstateAndEffectivesystemstate,
That can be read by drivers to determine whether a Fast startup or a wake-from-hibernation occurred.

The targetsystemstate and specified tivesystemstate bit
Fields are setSystem_power_stateEnumeration
Values. iftargetsystemstate = powersystemhibernate and effectivesystemstate = powersystemhibernate,
A wake-from-hibernation occurred. However, if targetsystemstate = powersystemhibernate and javastivesystemstate = powersystemshutdown,
A Fast startup occurred.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.