ReactOS  0.4.14-dev-608-gd495a4f
byteswap.c File Reference
#include <rtl.h>
#include <debug.h>
Include dependency graph for byteswap.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

USHORT FASTCALL RtlUshortByteSwap (IN USHORT Source)
 
ULONG FASTCALL RtlUlongByteSwap (IN ULONG Source)
 
ULONGLONG FASTCALL RtlUlonglongByteSwap (IN ULONGLONG Source)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 13 of file byteswap.c.

Function Documentation

◆ RtlUlongByteSwap()

ULONG FASTCALL RtlUlongByteSwap ( IN ULONG  Source)

Definition at line 61 of file byteswap.c.

63 {
64 #if defined(_M_AMD64)
65  return _byteswap_ulong(Source);
66 #else
67  return ((ULONG)RtlUshortByteSwap((USHORT)Source) << 16) | RtlUshortByteSwap((USHORT)(Source >> 16));
68 #endif
69 }
USHORT FASTCALL RtlUshortByteSwap(IN USHORT Source)
Definition: byteswap.c:37
_Check_return_ unsigned long __cdecl _byteswap_ulong(_In_ unsigned long)
unsigned short USHORT
Definition: pedump.c:61
unsigned int ULONG
Definition: retypes.h:1
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

Referenced by RtlUlonglongByteSwap().

◆ RtlUlonglongByteSwap()

ULONGLONG FASTCALL RtlUlonglongByteSwap ( IN ULONGLONG  Source)

Definition at line 86 of file byteswap.c.

88 {
89 #if defined(_M_AMD64)
90  return _byteswap_uint64(Source);
91 #else
92  return ((ULONGLONG) RtlUlongByteSwap (Source) << 32) | RtlUlongByteSwap (Source>>32);
93 #endif
94 }
uint64_t ULONGLONG
Definition: typedefs.h:65
_Check_return_ unsigned __int64 __cdecl _byteswap_uint64(_In_ unsigned __int64)
ULONG FASTCALL RtlUlongByteSwap(IN ULONG Source)
Definition: byteswap.c:61
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

◆ RtlUshortByteSwap()

USHORT FASTCALL RtlUshortByteSwap ( IN USHORT  Source)

Definition at line 37 of file byteswap.c.

39 {
40 #if defined(_M_AMD64)
41  return _byteswap_ushort(Source);
42 #else
43  return (Source >> 8) | (Source << 8);
44 #endif
45 }
_Check_return_ unsigned short __cdecl _byteswap_ushort(_In_ unsigned short)
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

Referenced by RtlUlongByteSwap().