RtlUlongByteSwap routine

The RtlUlongByteSwap routine reverses the ordering of the four bytes in a 32-bit unsigned integer value.

Syntax


ULONG RtlUlongByteSwap(
  _In_ ULONG Source
);

Parameters

Source [in]

A ULONG value to convert to a byte-swapped version.

Return value

The byte-swapped version of the Source input parameter value.

Remarks

For example, if the Source parameter value is 0x12345678, the routine returns 0x78563412.

A typical use of this routine is to convert a ULONG value from little-endian byte format to big-endian byte format, and vice versa.

Use this routine instead of ntohl or htonl.

To reverse the ordering of bytes in a USHORT value, use the RtlUshortByteSwap routine. To reverse ordering of bytes in a ULONGLONG value, use the RtlUlonglongByteSwap routine.

Requirements

Target platform

Universal

Version

Available starting with Windows 2000.

Header

Wdm.h (include Wdm.h, Ntddk.h, or Ntifs.h)

Library

NtosKrnl.lib

DLL

NtosKrnl.exe

IRQL

Any level

See also

RtlUlonglongByteSwap
RtlUshortByteSwap

 

 

Send comments about this topic to Microsoft

Show: