PopBatteryInitPhaseTwo

NTSTATUS __stdcall PopBatteryInitPhaseTwo(){
  NTSTATUS result; 
  struct _EX_RUNDOWN_REF *v1; 
  PopReadUlongPowerKey((WCHAR *)L"ChargerWeakDetectionThresholdPercent", &WeakChargerChargeDropMilliPercent);
  WeakChargerChargeDropMilliPercent *= 1000;
  PopReadUlongPowerKey(
    (WCHAR *)L"BatteryChargeTrajectoryThresholdPercent",
    &BatteryChargeTrajectoryThresholdMilliPercent);
  BatteryChargeTrajectoryThresholdMilliPercent *= 1000;
  result = EtwRegister(&BATTERY_ETW_PROVIDER, (PETWENABLECALLBACK)PopBatteryEtwCallback, 0i64, &PopBatteryEtwHandle);
  if( result >= 0 )
  {
    PopBatteryEtwRegistered = 1;
    return ExSubscribeWnfStateChange(
             &v1,
             (INT64 *)&WNF_USB_ERROR_NOTIFICATION,
             1i64,
             0i64,
             (INT64)PopUsbErrorWNFNotificationCallback,
             0i64);
  }
  return result;
}

Referenced by:

PoInitSystem