PspReferenceSystemDll

UINT64 __fastcall PspReferenceSystemDll(_EX_FAST_REF *FastRef){
  VOID *v2; 
  _ETHREAD *CurrentThread; 

  v2 = ObFastReferenceObject(FastRef);
  if( !v2 )
  {
    CurrentThread = (_ETHREAD *)KeGetCurrentThread();
    --CurrentThread->Tcb.KernelApcDisable;
    ExAcquirePushLockSharedEx((_EX_PUSH_LOCK *)&FastRef[1], 0i64);
    v2 = ObFastReferenceObjectLocked(FastRef);
    if( _InterlockedCompareExchange64((volatile signed __int64 *)&FastRef[1], 0i64, 17i64) != 17 )
      ExfReleasePushLockShared((_EX_PUSH_LOCK *)&FastRef[1]);
    KeAbPostRelease(&FastRef[1]);
    KeLeaveCriticalRegionThread(&CurrentThread->Tcb);
  }
  return(UINT64)v2;
}

Referenced by:

DbgkCreateThread
MmInitSystemDll
PspGetSystemDllSecureHandle
PspMapSystemDll