PpDevNodeLockTree

UINT8 __stdcall PpDevNodeLockTree(PNP_LOCK_LEVEL LockLevel){
  INT64 v1; 
  INT64 v2; 
  _ETHREAD *CurrentThread; 
  UINT8 v4; 
  __int32 v5; 
  __int32 v6; 
  __int32 v7; 
  NTSTATUS IsResourceAcquiredSharedLite; 
  INT64 v9; 
  NTSTATUS i; 
  INT64 v11; 

  CurrentThread = (_ETHREAD *)KeGetCurrentThread();
  v4 = 1;
  --CurrentThread->Tcb.KernelApcDisable;
  if( LockLevel == PPL_SIMPLE_READ )
    goto LABEL_15;
  v5 = LockLevel - 1;
  if( !v5 )
  {
    ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6400, 1, v2);
    goto LABEL_15;
  }
  v6 = v5 - 1;
  if( !v6 )
  {
    if( !ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6400, 0, v2) )
    {
      v4 = 0;
      KeLeaveCriticalRegion();
      return v4;
    }
LABEL_15:
    ExAcquireResourceSharedLite((UINT64)&PnpReplaceEvent + 6048, 1);
    return v4;
  }
  v7 = v6 - 1;
  if( v7 )
  {
    if( v7 == 1 )
    {
      IsResourceAcquiredSharedLite = ExIsResourceAcquiredSharedLite((UINT64)&PnpReplaceEvent + 6048, v1, v2);
      for( i = IsResourceAcquiredSharedLite; i; --i )
        ExReleaseResourceLite((PERESOURCE)((char *)&PnpReplaceEvent + 6048));
      for( ; IsResourceAcquiredSharedLite; --IsResourceAcquiredSharedLite )
        ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6048, 1, v9);
    }
  }
  else
  {
    ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6400, 1, v2);
    ExAcquireResourceExclusiveLite((UINT64)&PnpReplaceEvent + 6048, 1, v11);
  }
  return v4;
}

Referenced by:

IoGetLegacyVetoList
IoLockUnlockPnpDeviceTree
IoReportDetectedDevice
IoReportRootDevice
IoTranslateBusAddress
IopQueryInterfaceRecurseUp
IopRetryDeviceRemovalForReset
IopWarmEjectDevice
PiCMCreateDevice
PiCMDeleteDevice
PiControlGetPropertyData
PiControlGetSetDeviceStatus
PiControlQueryConflictList
PiGetDeviceDepth
PiGetRelatedDevice
PiInitializeDevice
PiPagePathSetState
PiProfileUpdateDeviceTreeWorker
PiQueryDeviceRelations
PiQueryPowerRelations
PipForDeviceNodeSubtree
PipProcessDevNodeTree
PnpAcquireDependencyRelationsLock
PnpDelayedRemoveWorker
PnpDeviceActionWorker
PnpDiagRundownRegisterCallback
PnpLockDeviceActionQueue
PnpProcessCompletedEject
PnpProcessQueryRemoveAndEject
PnpQueuePendingEject
PnpRestartDeviceNode
PnpUnlinkDeviceRemovalRelations
PpDevCfgProcessDevices
PpHotSwapGetDevnodeRemovalPolicy
PpResetProblemDevices