#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
#if defined(__INTELLISENSE__) || defined(DOXYGEN)
#ifndef BYTES_TO_PAGES
/**
* Calculates the number of pages required to hold a specified number of bytes.
*
* @param Size The size in bytes.
* @return The number of pages, rounded up if the size is not page-aligned.
*/
#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + (((Size) & PAGE_MASK) != 0))
View code on GitHub#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
#if defined(__INTELLISENSE__) || defined(DOXYGEN)
// ...
#else
#ifndef BYTES_TO_PAGES
#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + (((Size) & PAGE_MASK) != 0))
View code on GitHub// wdm.h
void BYTES_TO_PAGES(
[in] Size
);
View the official Windows Driver Kit DDI referenceNo description available.
The BYTES_TO_PAGES macro takes the size in bytes of the transfer request and calculates the number of pages required to contain the bytes.
Size [in]Specifies the size in bytes of the transfer request.
BYTES_TO_PAGES returns the number of pages required to contain the specified number of bytes.
The system-defined constant PAGE_SIZE can be used to determine whether a given length in bytes for a transfer is less than the virtual memory page size of the current platform.