NtCreatePartition

NTSTATUS __stdcall NtCreatePartition(
        PVOID ParentPartitionHandle,
        PVOID *PartitionHandle,
        UINT64 DesiredAccess,
        OBJECT_ATTRIBUTES *ObjectAttributes){
  unsigned int v5; 
  INT8 v8; 
  __int64 v9; 
  NTSTATUS v10; 
  HANDLE Handle; 
  INT64 a4; 
  __int64 a6[3]; 
  v5 = DesiredAccess;
  a6[0] = 0i64;
  Handle = 0i64;
  a4 = 0i64;
  v8 = *((_BYTE *)KeGetCurrentThread() + 562);
  if( v8 )
  {
    v9 = 0x7FFFFFFF0000i64;
    if( (unsigned __int64)PartitionHandle < 0x7FFFFFFF0000i64 )
      v9 = (__int64)PartitionHandle;
    *(_QWORD *)v9 = *(_QWORD *)v9;
  }
  if( SeSinglePrivilegeCheck(*(_QWORD *)&SeLockMemoryPrivilege, v8) )
  {
    if( !ParentPartitionHandle
      || (v10 = PsReferencePartitionByHandle(ParentPartitionHandle, 2ui64, v8, 0x70437350ui64, &a4), v10 >= 0) )
    {
      v10 = PspAllocatePartition((INT64)ObjectAttributes, v5, v8, a4, 0, a6, &Handle);
      if( v10 >= 0 )
      {
        PsDereferencePartition(a6[0]);
        *PartitionHandle = Handle;
      }
    }
  }
  else
  {
    v10 = -1073741727;
  }
  if( a4 )
    PsDereferencePartition(a4);
  return v10;
}

Referenced by:

No references.