BYTES_TO_PAGES - NtDoc

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

#define BYTES_TO_PAGES(Size) (((Size) >> PAGE_SHIFT) + (((Size) & PAGE_MASK) != 0))

#endif
#endif
#endif

View code on GitHub
// wdm.h

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

NtDoc

No description available.

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

Description

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.

Parameters

Size [in]

Specifies the size in bytes of the transfer request.

Remarks

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.