• [转]WM/WINCE代码研读系列之Power Management(4)


    下面是PmSetSystemPowerState函数的详细内容

    PmSetSystemPowerState
    {
        PlatformSendSystemPowerState
        {
            SendSystemPowerState
            {
                  PlatformMapPowerStateHint;   //将StateFlags转化成电源状态名
                  {
                            对应关系如下:
                            POWER_STATE_ON -- _T("on");
                            POWER_STATE_IDLE -- _T("screenoff");
                            POWER_STATE_SUSPEND -- _T("suspend");
                            POWER_STATE_OFF -- _T("suspend");
                            POWER_STATE_CRITICAL -- _T("suspend");
                            POWER_STATE_RESET -- _T("reboot");
                            POWER_STATE_USERIDLE -- _T("useridle");
                    }
     
                    //下面两个函数由要设置的电源状态名得到相应的对象指针
                    SystemStateToActivityState
                    GetStateObject
     
                    AppsCanRequestState           //判断要设置的电源状态是否可以被设置
                    if((dwOptions & POWER_DUMPDW)!=0)
                    {
                              //Options 参数带POWER_DUMPDW 时会产生Dr. Watson dump file.
                              CaptureDumpFileOnDevice; 
                     }
                     pNewPowerState->EnterState();//这里是实质的设置函数
     
                     //将电源状态的状态机转至设置的系统电源状态
                     pNewPowerState = SetSystemState(pNewPowerState);
                     m_pCurPowerState = pNewPowerState;
     
                 //将ResumingSuspendTimeout,SuspendTimeout,BacklightTimeout,UserIdleTimeout这几个定时器复位
                     ReInitTimeOuts(FALSE);
     
                    //通知PowerStateManager::ThreadRun,这里没有做实质性内容
                    SetEvent(m_hSystemApiCalled);
              }
          }
    }

  • 相关阅读:
    PHP 使用 Redis
    Redis /etc/redis.conf 常用配置
    Redis 常用操作
    Redis 操作哈希数据
    Redis 操作有序集合数据
    Redis 操作集合数据
    Redis 操作列表数据
    Redis 操作字符串数据
    Redis 安装
    Redis 简介
  • 原文地址:https://www.cnblogs.com/answer/p/1956254.html
Copyright © 2020-2023  润新知