<?xml version='1.0' encoding='utf-8' standalone='yes'?>
<assembly
    xmlns="urn:schemas-microsoft-com:asm.v3"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    manifestVersion="1.0"
    >
  <assemblyIdentity
      language="neutral"
      name="Microsoft-Windows-Power-Policy-Definitions"
      processorArchitecture="*"
      version="0.0.0.3"
      />
  <!-- version 3 = Win10 -->
  <migration
      replacementSettingsVersionRange="3"
      settingsVersion="3"
      >
    <machineSpecific>
      <migXml xmlns="">
        <environment context="System">
          <variable name="HibernateTimeoutBackendStore">
            <text>HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\9d7815a6-7ee4-497e-8888-515a05f02364\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e</text>
          </variable>
          <variable name="HibernateTimeoutUserStore">
            <text>HKLM\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\9d7815a6-7ee4-497e-8888-515a05f02364</text>
          </variable>
          <variable name="SmartStandbyUserStore">
            <text>HKLM\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\8619b916-e004-4dd8-9b66-dae86f806698\82011705-fb95-4d46-8d35-4042b1d20def</text>
          </variable>
          <variable name="StandbyBudgetPercentageUserStore">
            <text>HKLM\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes\381b4222-f694-41f0-9685-ff5bb260df2e\8619b916-e004-4dd8-9b66-dae86f806698\9fe527be-1b70-48da-930d-7bcf17b44990</text>
          </variable>
        </environment>
        <rules context="System">
          <include>
            <objectSet>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power\User\* [*]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power\SecurityDescriptors\* [*]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power\PowerRequestOverride\* [*]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [HibernateEnabled]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [HiberFileSizePercent]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [CustomizeDuringSetup]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power [AwayModeEnabled]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [EnforceDisconnectedStandby]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [IgnoreCsComplianceCheck]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [EnforceConsoleLockScreenTimeout]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [LidNotifyReliable]</pattern>
              <pattern type="Registry">HKLM\SYSTEM\CurrentControlSet\Control\Power [HiberFileType]</pattern>
            </objectSet>
          </include>
          <!-- -->
          <!-- Check whether HIBERNATEIDLE is set to 0. This is done via the -->
          <!-- following three <detect> checks : -->
          <!-- -->
          <!-- 1. Check whether HIBERNATEIDLE is set to 0 in user store, and -->
          <!-- -->
          <!-- 2. Check whether HIBERNATEIDLE is set to 0 as runtime override -->
          <!--    in backend store (if the override in user-store does not -->
          <!--    exist), and -->
          <!-- -->
          <!-- 3. Check whether HIBERNATEIDLE is set to 0 in backend store -->
          <!--    (if the user and backend overrides do not exist). -->
          <!-- -->
          <!-- N.B. The following pseudo-code summarizes the intent: -->
          <!-- -->
          <!-- if (exist(user_hibernateidle)) {              -->
          <!--     if (user_hibernateidle==0) {              -->
          <!--         [apply rules]                         -->
          <!--     } else {                                  -->
          <!--         [do nothing]                          -->
          <!--     }                                         -->
          <!--                                               -->
          <!-- } else if (exist(runtime_hibernateidle)) {    -->
          <!--     if (runtime_hibernateidle==0) {           -->
          <!--         [apply rules]                         -->
          <!--     } else {                                  -->
          <!--         [do nothing]                          -->
          <!--     }                                         -->
          <!--                                               -->
          <!-- } else if (exist(skudefault_hibernateidle)) { -->
          <!--     if (skudefault_hibernateidle==0) {        -->
          <!--         [apply rules]                         -->
          <!--     } else {                                  -->
          <!--         [do nothing]                          -->
          <!--     }                                         -->
          <!-- }                                             -->
          <!-- -->
          <!-- N.B. All checks are for DC on Balanced plan.  -->
          <!-- -->
          <!-- -->
          <!-- N.B. The <detect> sections are AND'd while <condition> -->
          <!--      sections are OR'd. -->
          <!-- -->
          <rules context="System">
            <detects>
              <detect>
                <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","%HibernateTimeoutUserStore% [DcSettingIndex]")</condition>
                <condition>MigXmlHelper.DoesStringContentEqual("Registry","%HibernateTimeoutUserStore% [DcSettingIndex]","0x00000000")</condition>
              </detect>
              <detect>
                <condition>MigXmlHelper.DoesObjectExist("Registry","%HibernateTimeoutUserStore% [DcSettingIndex]")</condition>
                <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","%HibernateTimeoutBackendStore% [OverrideDcSettingIndex]")</condition>
                <condition>MigXmlHelper.DoesStringContentEqual("Registry","%HibernateTimeoutBackendStore% [OverrideDcSettingIndex]","0x00000000")</condition>
              </detect>
              <detect>
                <condition>MigXmlHelper.DoesObjectExist("Registry","%HibernateTimeoutUserStore% [DcSettingIndex]")</condition>
                <condition>MigXmlHelper.DoesObjectExist("Registry","%HibernateTimeoutBackendStore% [OverrideDcSettingIndex]")</condition>
                <condition>MigXmlHelper.DoesStringContentEqual("Registry","%HibernateTimeoutBackendStore% [DcSettingIndex]","0x00000000")</condition>
              </detect>
            </detects>
            <!-- -->
            <!-- Do not allow target to enable adaptive standby by default. -->
            <!-- -->
            <!-- N.B. This setting is not present on the source. -->
            <!-- -->
            <addObjects>
              <object>
                <location type="Registry">%StandbyBudgetPercentageUserStore% [DcSettingIndex]</location>
                <attributes>DWORD</attributes>
                <bytes>00000000</bytes>
              </object>
            </addObjects>
            <!-- -->
            <!-- Do not allow target to enable smart standby by default. -->
            <!-- -->
            <addObjects>
              <conditions>
                <condition negation="Yes">MigXmlHelper.DoesObjectExist("Registry","%SmartStandbyUserStore% [DcSettingIndex]")</condition>
              </conditions>
              <object>
                <location type="Registry">%SmartStandbyUserStore% [DcSettingIndex]</location>
                <attributes>DWORD</attributes>
                <bytes>00000000</bytes>
              </object>
            </addObjects>
            <!-- -->
            <!-- Gather the newly added objects. -->
            <!-- -->
            <rules context="System">
              <include>
                <objectSet>
                  <pattern type="Registry">%SmartStandbyUserStore% [DcSettingIndex]</pattern>
                  <pattern type="Registry">%StandbyBudgetPercentageUserStore% [DcSettingIndex]</pattern>
                </objectSet>
              </include>
            </rules>
          </rules>
        </rules>
      </migXml>
    </machineSpecific>
  </migration>
</assembly>
