PopBatteryInitPhaseTwo

NTSTATUS __stdcall PopBatteryInitPhaseTwo(){
  NTSTATUS result; 
  INT8 *v1; 

  PopReadUlongPowerKey(L"ChargerWeakDetectionThresholdPercent", &WeakChargerChargeDropMilliPercent);
  WeakChargerChargeDropMilliPercent *= 1000;
  PopReadUlongPowerKey(L"BatteryChargeTrajectoryThresholdPercent", &BatteryChargeTrajectoryThresholdMilliPercent);
  BatteryChargeTrajectoryThresholdMilliPercent *= 1000;
  result = (unsigned int)EtwRegister(
                           (_LPCGUID)&BATTERY_ETW_PROVIDER,
                           (PETWENABLECALLBACK)PopBatteryEtwCallback,
                           0i64,
                           (PREGHANDLE)&PopIrpWorkerControlEvent + 1005);
  if( result >= 0 )
  {
    PopBatteryEtwRegistered = 1;
    return ExSubscribeWnfStateChange(
             &v1,
             (INT64 *)&WNF_USB_ERROR_NOTIFICATION,
             1i64,
             0i64,
             (INT64)PopUsbErrorWNFNotificationCallback,
             0i64);
  }
  return result;
}

Referenced by:

PoInitSystem