Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

byteswap.c File Reference

#include "nt.h"
#include "ntrtlp.h"

Go to the source code of this file.

Functions

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


Function Documentation

ULONG FASTCALL RtlUlongByteSwap IN ULONG  Source  ) 
 

Definition at line 60 of file byteswap.c.

00066 : 00067 00068 The RtlUlongByteSwap function exchanges byte pairs 0:3 and 1:2 of 00069 Source and returns the resulting ULONG. 00070 00071 Arguments: 00072 00073 Source - 32-bit value to byteswap. 00074 00075 Return Value: 00076 00077 Swapped 32-bit value. 00078 00079 --*/ 00080 { 00081 ULONG swapped; 00082 00083 swapped = ((Source) << (8 * 3)) | 00084 ((Source & 0x0000FF00) << (8 * 1)) | 00085 ((Source & 0x00FF0000) >> (8 * 1)) | 00086 ((Source) >> (8 * 3)); 00087 00088 return swapped; 00089 }

ULONGLONG FASTCALL RtlUlonglongByteSwap IN ULONGLONG  Source  ) 
 

Definition at line 94 of file byteswap.c.

00100 : 00101 00102 The RtlUlongByteSwap function exchanges byte pairs 0:7, 1:6, 2:5, and 00103 3:4 of Source and returns the resulting ULONGLONG. 00104 00105 Arguments: 00106 00107 Source - 64-bit value to byteswap. 00108 00109 Return Value: 00110 00111 Swapped 64-bit value. 00112 00113 --*/ 00114 { 00115 ULONGLONG swapped; 00116 00117 swapped = ((Source) << (8 * 7)) | 00118 ((Source & 0x000000000000FF00) << (8 * 5)) | 00119 ((Source & 0x0000000000FF0000) << (8 * 3)) | 00120 ((Source & 0x00000000FF000000) << (8 * 1)) | 00121 ((Source & 0x000000FF00000000) >> (8 * 1)) | 00122 ((Source & 0x0000FF0000000000) >> (8 * 3)) | 00123 ((Source & 0x00FF000000000000) >> (8 * 5)) | 00124 ((Source) >> (8 * 7)); 00125 00126 return swapped; 00127 }

USHORT FASTCALL RtlUshortByteSwap IN USHORT  Source  ) 
 

Definition at line 28 of file byteswap.c.

References USHORT.

00034 : 00035 00036 The RtlUshortByteSwap function exchanges bytes 0 and 1 of Source 00037 and returns the resulting USHORT. 00038 00039 Arguments: 00040 00041 Source - 16-bit value to byteswap. 00042 00043 Return Value: 00044 00045 Swapped 16-bit value. 00046 00047 --*/ 00048 { 00049 USHORT swapped; 00050 00051 swapped = ((Source) << (8 * 1)) | 00052 ((Source) >> (8 * 1)); 00053 00054 return swapped; 00055 }


Generated on Sat May 15 19:42:58 2004 for test by doxygen 1.3.7