#ifndef _PHNT_NTDEF_H
#ifndef _NTDEF_
#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.