HalpWdatExecuteActionBeforeInitialize

NTSTATUS __stdcall HalpWdatExecuteActionBeforeInitialize(
        INT64 Action,
        UINT64 InputValue,
        UINT64 *OutputValue,
        _WATCHDOG_TIMER_ACTION_TABLE *Wdat,
        _WATCHDOG_TIMER_RESOURCE_TABLE *Wdrt){
  UINT8 v5; 
  NTSTATUS v7; 
  __int64 i; 
  NTSTATUS v9; 
  NTSTATUS v10; 
  __int16 *v11; 
  __int64 v12; 
  NTSTATUS v13; 
  NTSTATUS v14; 
  _WD_INSTRUCTION Instruction; 

  v5 = Action;
  memset(&Instruction, 0i64, sizeof(Instruction));
  v7 = 0;
  if( Wdat )
  {
    for( i = 0i64; (unsigned int)i < Wdat->InstructionCount; i = (unsigned int)(i + 1) )
    {
      if( Wdat->InstructionEntry[i].WatchdogAction == v5 )
      {
        v9 = WdInstrInitializeInstruction(
               &Instruction,
               v5,
               Wdat->InstructionEntry[i].InstructionFlags,
               &Wdat->InstructionEntry[i].RegisterRegion);
        if( v9 < 0 )
        {
          v7 = v9;
        }
        else
        {
          v10 = WdInstrExecuteInstruction(&Instruction, 0i64);
          if( v10 < 0 )
            v7 = v10;
          WdInstrDestroyInstruction(&Instruction);
        }
      }
    }
  }
  else if( Wdrt )
  {
    v11 = &word_140030862;
    v12 = 15i64;
    do
    {
      if( *((_BYTE *)v11 - 2) == v5 )
      {
        v13 = WdInstrInitializeInstruction(
                &Instruction,
                v5,
                *((_BYTE *)v11 - 1),
                (_GEN_ADDR *)((char *)Wdrt + (*(_BYTE *)v11 != 0 ? 48i64 : 36i64)));
        if( v13 < 0 )
        {
          v7 = v13;
        }
        else
        {
          v14 = WdInstrExecuteInstruction(&Instruction, 0i64);
          if( v14 < 0 )
            v7 = v14;
          WdInstrDestroyInstruction(&Instruction);
        }
      }
      v11 += 6;
      --v12;
    }
    while( v12 );
  }
  return v7;
}

Referenced by:

HalpWdatDiscover