NtCreatePagingFile - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _NTMMAPI_H
#if (PHNT_MODE != PHNT_MODE_KERNEL)

/**
 * Creates or extends a paging file.
 *
 * \param PageFileName The NT path of the paging file to create or extend.
 * \param MinimumSize A pointer to the minimum size of the paging file, in bytes.
 * \param MaximumSize A pointer to the maximum size of the paging file, in bytes.
 * \param Priority The paging file priority.
 * \return NTSTATUS Successful or errant status.
 * \remarks The caller must have the SeCreatePagefilePrivilege privilege.
 */
NTSYSCALLAPI
NTSTATUS
NTAPI
NtCreatePagingFile(
    _In_ PCUNICODE_STRING PageFileName,
    _In_ PLARGE_INTEGER MinimumSize,
    _In_ PLARGE_INTEGER MaximumSize,
    _In_ ULONG Priority
    );

#endif
#endif

View code on GitHub
#ifndef _NTZWAPI_H

NTSYSCALLAPI
NTSTATUS
NTAPI
ZwCreatePagingFile(
    _In_ PCUNICODE_STRING PageFileName,
    _In_ PLARGE_INTEGER MinimumSize,
    _In_ PLARGE_INTEGER MaximumSize,
    _In_ ULONG Priority
    );

#endif

View code on GitHub

NtDoc

No description available.

NTinternals.net (undocumented.ntinternals.net)

Function NtCreatePagingFile is typically used by Control Panel's "System" applet for creating new paged files.

PageFileName

System path to newly created paged file.

MinimumSize

Minimum size of paged file, in bytes. This value must be multiply of page size (0x1000 bytes on x86), and must be greater then 2MB (0x02000000 bytes).

MaximumSize

Maximum size of paged file, in bytes. Also this value must be multiply of page size. Minimal value accepted is 5MB (0x05000000 bytes).

ActualSize

Optional (and currently unused) parameter.

Documented by

Requirements

Privilege: SE_CREATE_PAGEFILE_PRIVILEGE

See also