MiPartitionObjectToPartition

NTSTATUS __stdcall MiPartitionObjectToPartition(PVOID BugCheckParameter2){
  char v1; 
  _BYTE *v2; 
  void *BugCheckParameter4; 
  _BYTE *v4; 
  char v5; 
  int v6; 
  _MI_PARTITION *v7; 
  void *v9; 

  LOBYTE(BugCheckParameter4) = 0;
  v4 = v2;
  v5 = v1;
  v6 = 0;
  if( BugCheckParameter2 )
  {
    if( BugCheckParameter2 == (PVOID)-1i64 )
    {
      v7 = *(_MI_PARTITION **)(*(&stru_140C4DB30 + 267)
                             + 8i64 * KeGetCurrentThread()->ApcState.Process->Vm.Instance.PartitionId);
    }
    else
    {
      v7 = *(_MI_PARTITION **)BugCheckParameter2;
      v6 = 1;
    }
  }
  else
  {
    v7 = &Irp;
  }
  if( v7->Core.Signature != 305535296 )
    goto LABEL_15;
  if( v6 != 1 )
    goto LABEL_5;
  if( v7->Core.PartitionObject != BugCheckParameter2 )
LABEL_15:
    KeBugCheckEx(0x1Au, (PVOID)0x41001, BugCheckParameter2, v7, 0i64);
  if( PsReferencePartitionSafe((INT64)BugCheckParameter2) )
  {
    LOBYTE(BugCheckParameter4) = 1;
  }
  else
  {
    if( v5 )
      KeBugCheckEx(0x1Au, (PVOID)0x41002, v9, v7, BugCheckParameter4);
    LODWORD(v7) = (_DWORD)BugCheckParameter4;
  }
LABEL_5:
  *v4 = (_BYTE)BugCheckParameter4;
  return(int)v7;
}

Referenced by:

MmAllocateNonChargedSecurePages
MmAllocatePartitionNodePagesForMdlEx
MmAllocateSecureKernelPages
MmBuildLargePages
MmFreeNonChargedSecurePages
MmGetNodeFastLargePageCounts
MmGetPageFileInformation
MmGetPhysicalMemoryRangesEx2