PiPagePathSetState

NTSTATUS __stdcall PiPagePathSetState(PFILE_OBJECT FileObject, BOOL InPath){
  INT64 v4; 
  _IRP *DeviceUsageNotification; 
  UINT64 v6; 
  int v7; 
  INT64 v9[8]; 
  _DEVICE_OBJECT *DeviceObject; 

  memset(v9, 0i64, sizeof(v9));
  DeviceObject = 0i64;
  ObfReferenceObject(FileObject);
  LODWORD(v4) = IoGetRelatedDeviceObject((INT64)FileObject);
  v9[0] = v4;
  LODWORD(v9[1]) = 1;
  BYTE4(v9[1]) = InPath;
  v9[2] = (INT64)FileObject;
  DeviceUsageNotification = PpIrpAllocateDeviceUsageNotification((INT64)v9);
  v6 = (UINT64)DeviceUsageNotification;
  if( DeviceUsageNotification )
  {
    IoQueueThreadIrp((INT64)DeviceUsageNotification);
    PpDevNodeLockTree(PPL_TREEOP_ALLOW_READS);
    v7 = IofCallDriver(v9[0], v6);
    if( v7 == 259 )
    {
      KeWaitForSingleObject((UINT64)&v9[5], 0, 0, 0, 0i64);
      v7 = v9[3];
    }
    if( v7 >= 0 && IoGetRelatedTargetDevice(FileObject, &DeviceObject) >= 0 )
    {
      PoDirectedDripsNotifyPagingDeviceUsage(DeviceObject, InPath);
      HalPutDmaAdapter((PADAPTER_OBJECT)DeviceObject);
    }
    PpDevNodeUnlockTree(PPL_TREEOP_ALLOW_READS);
    return v7;
  }
  else
  {
    HalPutDmaAdapter((PADAPTER_OBJECT)FileObject);
    return -1073741801;
  }
}

Referenced by:

CmpVolumeContextCleanup
MiDeletePagefile
PpPagePathAssign
PpPagePathRelease