#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
#ifndef ROUND_TO_PAGES
#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_MASK) & ~PAGE_MASK)
View code on GitHub// wdm.h
void ROUND_TO_PAGES(
[in] Size
);
View the official Windows Driver Kit DDI referenceNo description available.
The ROUND_TO_PAGES macro takes a size in bytes and rounds it up to the next full page.
Size [in]Specifies the size in bytes to round up to a page multiple.
ROUND_TO_PAGES returns a ULONG_PTR with the input size rounded up to a multiple of the virtual memory page size for the current platform.
Callers of ROUND_TO_PAGES can be running at any IRQL. The caller must ensure that the supplied parameter cannot cause memory overflow.