1 /* COPYRIGHT: See COPYING in the top level directory
2 * PROJECT: ReactOS system libraries
4 * PURPOSE: Memory functions
5 * PROGRAMMER: David Welch (welch@mcmail.com)
8 /* INCLUDES *****************************************************************/
15 #undef RtlUlonglongByteSwap
16 #undef RtlUlongByteSwap
17 #undef RtlUshortByteSwap
19 /*************************************************************************
22 * Swap the bytes of an unsigned short value.
25 * Based on the inline versions in Wine winternl.h
30 RtlUshortByteSwap (IN USHORT Source
)
32 return (Source
>> 8) | (Source
<< 8);
37 /*************************************************************************
38 * RtlUlongByteSwap [NTDLL.@]
40 * Swap the bytes of an unsigned int value.
43 * Based on the inline versions in Wine winternl.h
53 return ((ULONG
)RtlUshortByteSwap((USHORT
)Source
) << 16) | RtlUshortByteSwap((USHORT
)(Source
>> 16));
57 /*************************************************************************
58 * RtlUlonglongByteSwap
60 * Swap the bytes of an unsigned long long value.
63 * i [I] Value to swap bytes of
66 * The value with its bytes swapped.
71 RtlUlonglongByteSwap (IN ULONGLONG Source
)
73 return ((ULONGLONG
) RtlUlongByteSwap (Source
) << 32) | RtlUlongByteSwap (Source
>>32);