Rename endian conversion routines to match naming convention

This commit is contained in:
Rafal Kupiec 2023-04-04 21:02:14 +02:00
parent 2257ad1567
commit 4073b1589d
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 34 additions and 34 deletions

View File

@ -194,6 +194,18 @@ LONGLONG
RtlAtomicXor64(IN VOLATILE PLONGLONG Address,
IN LONGLONG Mask);
XTFASTCALL
USHORT
RtlByteSwap16(IN USHORT Source);
XTFASTCALL
ULONG
RtlByteSwap32(IN ULONG Source);
XTFASTCALL
ULONGLONG
RtlByteSwap64(IN ULONGLONG Source);
XTAPI
SIZE_T
RtlCompareMemory(IN PCVOID LeftBuffer,
@ -281,18 +293,6 @@ RtlStringToWideString(OUT PWCHAR Destination,
IN CONST PUCHAR *Source,
IN SIZE_T Length);
XTFASTCALL
ULONG
RtlUlongByteSwap(IN ULONG Source);
XTFASTCALL
ULONGLONG
RtlUlonglongByteSwap(IN ULONGLONG Source);
XTFASTCALL
USHORT
RtlUshortByteSwap(IN USHORT Source);
XTCDECL
INT
RtlWideStringCompare(IN CONST PWCHAR String1,

View File

@ -9,6 +9,24 @@
#include <xtos.h>
/**
* This routine converts endianness on 16bit value.
*
* @param Source
* Supplies a value to swap bytes.
*
* @return Swapped 16bit value.
*
* @since XT 1.0
*/
XTFASTCALL
USHORT
RtlByteSwap16(IN USHORT Source)
{
return (USHORT)(((Source >> 8) & 0x00FF) |
((Source << 8) & 0xFF00));
}
/**
* This routine converts endianness on 32bit value.
*
@ -17,11 +35,11 @@
*
* @return Swapped 32bit value.
*
* @since NT 4.0
* @since XT 1.0
*/
XTFASTCALL
ULONG
RtlUlongByteSwap(IN ULONG Source)
RtlByteSwap32(IN ULONG Source)
{
return (ULONG)(((Source >> 24) & 0x000000FF) |
((Source >> 8) & 0x0000FF00) |
@ -37,11 +55,11 @@ RtlUlongByteSwap(IN ULONG Source)
*
* @return Swapped 64bit value.
*
* @since NT 4.0
* @since XT 1.0
*/
XTFASTCALL
ULONGLONG
RtlUlonglongByteSwap(IN ULONGLONG Source)
RtlByteSwap64(IN ULONGLONG Source)
{
return (ULONGLONG)(((Source >> 56) & 0x00000000000000FF) |
((Source >> 40) & 0x000000000000FF00) |
@ -52,21 +70,3 @@ RtlUlonglongByteSwap(IN ULONGLONG Source)
((Source << 40) & 0x00FF000000000000) |
((Source << 56) & 0xFF00000000000000));
}
/**
* This routine converts endianness on 16bit value.
*
* @param Source
* Supplies a value to swap bytes.
*
* @return Swapped 16bit value.
*
* @since NT 4.0
*/
XTFASTCALL
USHORT
RtlUshortByteSwap(IN USHORT Source)
{
return (USHORT)(((Source >> 8) & 0x00FF) |
((Source << 8) & 0xFF00));
}