locked
How to Experimentally Confirm that Connected Standby Mode is Enabled on a Computer System?

    Question

  • In Windows 8 Microsoft has released a new power state called "Connected Standby".  I've watched a number of the videos from BUILD2011 and read the material I could find on microsoft.com about this new state.  What I'd like is a way to confirm that the hardware I'm using supports connected standby and the OS is configured to take advantage of it. I'm working with prerelease hardware from a vendor and they claim it's in there.  I've found nothing in the BIOS about it and in Windows 8 I find no new settings confirming that it is enabled.  I just see the usual sleep and hibernate settings.  Can anyone tell me the following?

    - Does Microsoft have a tool (a Metro app perhaps) that can be run to confirm that the hardware supports connected standby and the OS is configured to take advantage of it?

    - Is there a sample app I can download & build to prove that the system supports connected standby?  For example Andrew Ritz & Mahender Hari demoed an always-connected Metro app in this presentation they gave at BUILD2011.  See minute 22 to about minute 25:  http://channel9.msdn.com/Events/BUILD/BUILD2011/HW-566T.  I've not, however, been able to find the source code for this app published anywhere. 

    ...or any other way to experimentally confirm that the system I'm using supports connected standby.

    Thanks in advance!

    LM

    Friday, August 24, 2012 3:18 PM

Answers

All replies

  • Hi,

    Does this help?

    C:\WINDOWS\system32>powercfg /availablesleepstates

    The following sleep states are available on this system:
        Standby (S3)
        Hibernate
        Hybrid Sleep
        Fast Startup

    The following sleep states are not available on this system:
        Standby (S1)
            The system firmware does not support this standby state.

        Standby (S2)
            The system firmware does not support this standby state.

        Standby (Connected)
            The system firmware does not support this standby state.

    Thanks.

    -Bobby

    Wednesday, August 29, 2012 12:38 AM
  • Programmatically you can call:

    CallNtPowerInformation with SystemPowerCapabilities

    http://msdn.microsoft.com/en-us/library/windows/desktop/aa372675(v=vs.85).aspx

    SYSTEM_POWER_CAPABILITIES.AoAc
    http://msdn.microsoft.com/en-us/library/windows/desktop/aa373215(v=vs.85).aspx

    Thanks.

    -Bobby

    Wednesday, August 29, 2012 12:49 AM
  • Thanks so much!  You've given me a few things to try.

    Thanks in advance, LM

    • Proposed as answer by antalu Thursday, August 30, 2012 12:15 AM
    • Unproposed as answer by antalu Thursday, August 30, 2012 12:15 AM
    Wednesday, August 29, 2012 11:09 PM
  • how I Can check if the windows in Connected Standby ? from System APi or from BIOS?
    Thursday, August 30, 2012 7:32 AM
  • Did you figure this out?

    Michael Tissington

    Wednesday, September 5, 2012 10:48 PM
  • hi Bobby Ma,

    I am tried the CallNtPowerInformation with SystemPowerCapabilities  as you can see  below but always got false( connected standby not supported )   where if run powercfg /a  I found connected standby supported ?

     uint result;
                bool isConnectedStandbyEnable;

                IntPtr connectedStandbyPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(SYSTEM_POWER_CAPABILITIES)));
                result = CallNtPowerInformation(
                    (int)POWER_INFORMATION_LEVEL.SystemPowerCapabilities,
                    IntPtr.Zero,
                    0,
                    connectedStandbyPtr,
                    (uint)Marshal.SizeOf(typeof(SYSTEM_POWER_CAPABILITIES))
                    );
                if (result != 0)
                {
                    MessageBox.Show("Failed");
                    return;
                }

                SYSTEM_POWER_CAPABILITIES systemPowerCapabilites = (SYSTEM_POWER_CAPABILITIES)Marshal.PtrToStructure(connectedStandbyPtr, typeof(SYSTEM_POWER_CAPABILITIES));
                isConnectedStandbyEnable = systemPowerCapabilites.AoAc;
                MessageBox.Show("isConnectedStandbyEnable = " +isConnectedStandbyEnable.ToString());

                Marshal.FreeCoTaskMem(connectedStandbyPtr);

    Sunday, September 9, 2012 11:26 AM
  • Yasser,  I didn't look through your code to see what the problem might be but this worked for me:

    #include "stdafx.h"
    #include <windows.h>
    #include <PowrProf.h>
    #include <Ntpoapi.h>
    
    int _tmain(int argc, _TCHAR* argv[])
    {
    	printf("Testing to see if Connected-Standby Mode is enabled on this Windows 8 system...\n");
    
    	OSVERSIONINFO osinfo;
    	memset(&osinfo, 0, sizeof(osinfo));
    	osinfo.dwOSVersionInfoSize = sizeof(osinfo);
    	if (GetVersionEx(&osinfo))
    	{
    		printf("Windows Version: %d.%d.%d\n", osinfo.dwMajorVersion, osinfo.dwMinorVersion, osinfo.dwBuildNumber);
    		if (osinfo.dwMajorVersion == 6 && osinfo.dwMinorVersion == 2)
    			printf("Found Windows 8.\n");
    		else
    		{
    			printf("Doesn't look like this is running on Windows 8.  Connected-Standby is not supported.\n");
    			return 0;
    		}
    	}
    	else
    	{
    		printf("GetVersionEx failed.  GetLastError: %d\n", GetLastError());
    		return -1;
    	}
    
    	SYSTEM_POWER_CAPABILITIES  cap;
    	memset(&cap, 0, sizeof(cap));
    	NTSTATUS rs = CallNtPowerInformation(POWER_INFORMATION_LEVEL(SystemPowerCapabilities), NULL, 0, &cap, sizeof(cap));
    	if (rs == 0) 
    	{
    		printf("AOAC: %d\n", cap.AoAc);
    		if (cap.AoAc)
    			printf("Connected Standby is enabled\n");
    		else
    			printf("Connected Standby is NOT enabled\n");
    	} 
    	else 
    	{
    		printf("CallNtPowerInformation returned: %d\n", rs);
    		printf("Call to CallNTPowerInformation failed. GetLastError: %d\n", GetLastError());
    		return -1;
    	}
    
    	return 0;
    }
    


    Thanks in advance, LM

    Monday, September 10, 2012 3:55 PM
  • I have solved my problem with C# code

    but I have a question which Microsoft API used to sending the Computer to Connected Standby mode ?

    Tuesday, September 11, 2012 12:50 PM
  • Tuesday, September 25, 2012 11:14 PM
    Moderator