Export (0) Print
Expand All
Expand Minimize

RtlUshortByteSwap routine

The RtlUshortByteSwap routine reverses the ordering of the two bytes in a 16-bit unsigned integer value.

Syntax


USHORT RtlUshortByteSwap(
  _In_  USHORT Source
);

Parameters

Source [in]

A USHORT 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 0x1234, the routine returns 0x3412.

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

Use this routine instead of ntohs or htons.

To reverse the ordering of bytes in a ULONG value, use the RtlUlongByteSwap routine. To reverse ordering of bytes in a ULONGLONG value, use the RtlUlonglongByteSwap routine.

Requirements

Version

Available starting with Windows 2000.

Header

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

Library

Ntoskrnl.lib

IRQL

Any level

See also

RtlUlongByteSwap
RtlUlonglongByteSwap

 

 

Send comments about this topic to Microsoft

Show:
© 2014 Microsoft