PiPnpRtlGetCurrentOperation

INT64 __fastcall PiPnpRtlGetCurrentOperation(INT64 **a1){
  _ETHREAD *CurrentThread; 
  unsigned int v2; 
  INT64 *v4; 
  __int64 *v5; 
  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v2 = 0;
  v4 = 0i64;
  *a1 = 0i64;
  --*((_WORD *)CurrentThread + 242);
  ExAcquireResourceSharedLite(&PiPnpRtlActiveOperationsLock, 1);
  v5 = (__int64 *)PiPnpRtlActiveOperations;
  while( v5 != &PiPnpRtlActiveOperations )
  {
    v4 = v5;
    if( (_ETHREAD *)v5[2] == CurrentThread )
      break;
    v5 = (__int64 *)*v5;
    v4 = 0i64;
  }
  ExReleaseResourceLite(&PiPnpRtlActiveOperationsLock);
  KeLeaveCriticalRegionThread((__int64)KeGetCurrentThread());
  if( v4 )
    *a1 = v4;
  else
    return(unsigned int)-1073741275;
  return v2;
}

Referenced by:

PiPnpRtlBeginOperation
PiPnpRtlCacheObjectBaseKey