ViSettingsEnableKernelHandleChecking

VOID __stdcall ViSettingsEnableKernelHandleChecking(UINT64 Enable){
  PROCESS_HANDLE_TRACING_ENABLE_EX *p_CapturedEnableInformation; 
  PROCESS_HANDLE_TRACING_ENABLE_EX CapturedEnableInformation; 

  if( (_DWORD)Enable )
  {
    if( VfHandleTracingEntries )
    {
      CapturedEnableInformation.Flags = 0;
      p_CapturedEnableInformation = &CapturedEnableInformation;
      CapturedEnableInformation.TotalSlots = VfHandleTracingEntries;
    }
    else
    {
      p_CapturedEnableInformation = 0i64;
    }
    PsSetProcessHandleTracingInformation((_EX_RUNDOWN_REF *)PsInitialSystemProcess, p_CapturedEnableInformation);
    _InterlockedOr((volatile signed __int32 *)&NtGlobalFlag, 0x40000000u);
  }
  else
  {
    PsSetProcessHandleTracingInformation((_EX_RUNDOWN_REF *)PsInitialSystemProcess, 0i64);
    _InterlockedAnd((volatile signed __int32 *)&NtGlobalFlag, 0xBFFFFFFF);
  }
}

Referenced by:

VfSettingsCheckForChanges
VfSettingsMiscellaneousChecksInitPhase1