SKETCH OF HOW RESEARCH MIGHT CONTINUE AND RESULTS BE PRESENTED

NtCreatePartition

This function creates a memory partition.

Declaration

NTSTATUS 
NtCreatePartition (
    HANDLE ParentPartitionHandle, 
    HANDLE *PartitionHandle, 
    ULONG DesiredAccess, 
    POBJECT_ATTRIBUTES ObjectAttributes);

in Version 1511 and higher, but originally

NTSTATUS 
NtCreatePartition (
    HANDLE ParentPartitionHandle, 
    HANDLE *PartitionHandle, 
    ULONG DesiredAccess, 
    POBJECT_ATTRIBUTES ObjectAttributes, 
    ULONG PreferredNode);

Parameters

The ParentPartitionHandle argument is a handle to a memory partition that is to be the parent of the created partition. This argument can be NULL to represent the system partition. If a parent is specified, the handle must have the MEMORY_PARTITION_MODIFY_ACCESS permission.

The PartitionHandle argument is the address of a variable that is to receive a handle to the created partition.

The DesiredAccess argument is an access mask of generic, standard and specific rights that are wanted to the created partition. The specific rights that are defined for partitions are MEMORY_PARTITION_QUERY_ACCESS (0x0001) and MEMORY_PARTITION_MODIFY_ACCESS (0x0002).

The ObjectAttributes argument specifies a name and other properties for the created partition as an object.

The PreferredNode argument selects a Non-Uniform Memory Access (NUMA) node. It can be 0xFFFFFFFF to select the node for the current thread’s ideal processor.

Return Value

The function returns STATUS_SUCCESS if successful, else a negative error code.

Availability

The NtCreatePartition function and its alias ZwCreatePartition are exported by name from NTDLL in version 10.0 and higher. In kernel mode, where ZwCreatePartition is a stub and NtCreatePartition is the implementation, neither is exported until the 1607 release of Windows 10 exports the stub.

For all practical effect, the functions are available only in 64-bit Windows: the functions are exported in 32-bit Windows but the 32-bit kernel’s implementation trivially returns STATUS_NOT_SUPPORTED. Put another way, 32-bit Windows has only the system partition: creating others is not supported.

Documentation Status

Neither NtCreatePartition nor its alias is documented. As ZwCreatePartition, it is declared in a header named ZWAPI.H which Microsoft published, possibly by mistake, in the Windows Driver Kit (WDK) for the original and 1511 editions of Windows 10.

The specific access rights for partitions are defined symbolically in both WDM.H and WINNT.H from those same editions of the WDK, continuing up to and including for Version 1703, and then they’re gone.