PnpIrpQueryID

NTSTATUS __fastcall PnpIrpQueryID(_DEVICE_OBJECT *DeviceObject, int a2, UINT64 *a3){
  NTSTATUS result; 
  _IO_STACK_LOCATION TopStackLocation; 

  *a3 = 0i64;
  memset(&TopStackLocation, 0i64, sizeof(TopStackLocation));
  LODWORD(TopStackLocation.Parameters.SecurityContext) = a2;
  *(_WORD *)&TopStackLocation.MajorFunction = 4891;
  result = IopSynchronousCall(DeviceObject, &TopStackLocation, 3221225659i64, 0i64, a3);
  if( result < 0 )
  {
    *a3 = 0i64;
  }
  else if( !*a3 )
  {
    return -1073741637;
  }
  return result;
}

Referenced by:

PiProcessNewDeviceNode
PnpQueryID
PpProfileCommitTransitioningDock
PpProfileIncludeInHardwareProfileTransition