ROUND_TO_PAGES - NtDoc

Native API online documentation, based on the System Informer (formerly Process Hacker) phnt headers
#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
#ifndef ROUND_TO_PAGES

#define ROUND_TO_PAGES(Size) (((ULONG_PTR)(Size) + PAGE_MASK) & ~PAGE_MASK)

#endif
#endif
#endif

View code on GitHub
// wdm.h

void ROUND_TO_PAGES(
  [in] Size
);
View the official Windows Driver Kit DDI reference

NtDoc

No description available.

Windows Driver Kit DDI reference (nf-wdm-round_to_pages)

Description

The ROUND_TO_PAGES macro takes a size in bytes and rounds it up to the next full page.

Parameters

Size [in]

Specifies the size in bytes to round up to a page multiple.

Remarks

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.