PfSnIsHostingApplication

UINT8 __stdcall PfSnIsHostingApplication(WCHAR *ExecutableName){
  __int64 v1; 
  __int64 v3; 
  _ETHREAD *CurrentThread; 
  UINT8 v5; 
  WORD *v6; 
  WORD *v7; 
  WORD *v8; 
  WORD *v10; 

  v1 = -1i64;
  v3 = -1i64;
  do
    ++v3;
  while( ExecutableName[v3] );
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v5 = 0;
  --CurrentThread->Tcb.KernelApcDisable;
  ExAcquirePushLockSharedEx(&stru_140C4FFF8, 0i64);
  do
    ++v1;
  while( Str[v1] );
  v6 = Str;
  v7 = (WORD *)&SuperfetchParameters + v1 + 120;
  while( 1 )
  {
    v8 = wcsstr(v6, (INT8 *)ExecutableName);
    if( !v8 || v8 < Str || v8 >= v7 )
      break;
    if( v8 == Str || *(v8 - 1) == 44 )
    {
      v10 = &v8[(unsigned int)v3];
      if( v10 == v7 || *v10 == 44 )
      {
        v5 = 1;
        break;
      }
    }
    v6 = v8 + 1;
  }
  if( _InterlockedCompareExchange64(&stru_140C4FFF8._bf_0, 0i64, 17i64) != 17 )
    ExfReleasePushLockShared(&stru_140C4FFF8);
  KeAbPostRelease(&stru_140C4FFF8);
  KeLeaveCriticalRegion();
  return v5;
}

Referenced by:

PfSnBeginAppLaunch