Partager via


IS_ALIGNED macro

The IS_ALIGNED macro determines whether the first argument is aligned on the specified power-of-2 boundary.

Syntax

 IS_ALIGNED(
    _pointer,
    _alignment
);

Parameters

  • _pointer
    The pointer to check for proper alignment.

  • _alignment
    A power of two that specifies the alignment.

Return value

The IS_ALIGNED macro returns a value of TRUE if the pointer is properly aligned or FALSE if the pointer is not properly aligned.

Remarks

Minifilter drivers can use the IS_ALIGNED macro to verify that a pointer has the proper alignment for a 32-bit or 64-bit process. For instance, the following example verifies that the pointer is properly aligned for a 32-bit process:

if ( !IS_ALIGNED(OutputBuffer,sizeof(ULONG))) {
    status = STATUS_DATATYPE_MISALIGNMENT;
    break;
}

Requirements

Target platform

Desktop

Header

FltKernel.h (include FltKernel.h)

 

 

Send comments about this topic to Microsoft