BYTES_TO_PAGES

ULONG
BYTES_TO_PAGES(

IN ULONG Size
);

BYTES_TO_PAGES takes the size in bytes of the transfer request and calculates the number of pages required to contain the bytes.

Parameters

Size

Specifies the size in bytes of the transfer request.

Return Value

BYTES_TO_PAGES returns the number of pages required to contain the specified number of bytes.

Comments

The system-defined constant PAGE_SIZE can be used to determine whether a given length in bytes for a transfer is less than the page size of the current platform.

Callers of BYTES_TO_PAGES can be running at any IRQL.

See Also

ADDRESS_AND_SIZE_TO_SPAN_PAGES