MEMORY_REMOVE_WORKING_SET_INFORMATION - NtDoc

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

// rev
/**
 * The MEMORY_REMOVE_WORKING_SET_INFORMATION structure defines control flags for
 * VmRemoveFromWorkingSetInformation operations.
 *
 * \remarks The memory manager processes each MEMORY_RANGE_ENTRY and attempts to
 * remove resident pages from the target process working set. This is a trim
 * operation (resident-set management), not an unmap or free operation.
 *
 * Removing resident pages from a process reduces its working set,
 * which frees physical RAM for other work without destroying the process's
 * virtual memory mappings. Use MEMORY_REMOVE_WORKING_SET_FLAG_DEFAULT (0) for
 * normal trimming, or MEMORY_REMOVE_WORKING_SET_FLAG_NO_ZERO_PAGE_OPTIMIZATION (1)
 * to disable the eligible-zero-page demand-zero optimization. Both preserve the
 * contents of the virtual allocation; neither decommits it or changes protection.
 * On x64 all other flag bits are rejected with
 * STATUS_INVALID_PARAMETER_5. Whether a particular page can be trimmed is decided
 * by the kernel; disabling the optimization does not guarantee physical residency.
 */
typedef struct _MEMORY_REMOVE_WORKING_SET_INFORMATION
{
    ULONG Flags; // MEMORY_REMOVE_WORKING_SET_FLAG_DEFAULT or MEMORY_REMOVE_WORKING_SET_FLAG_NO_ZERO_PAGE_OPTIMIZATION.
} MEMORY_REMOVE_WORKING_SET_INFORMATION, *PMEMORY_REMOVE_WORKING_SET_INFORMATION;

#endif
#endif

View code on GitHub

NtDoc

No description available.