Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This macro uses an arbitrary ordering to set a caller-supplied variable to a value indicating whether a given Token Ring address is greater than, less than, or equal to another given Token Ring address.
VOID TR_COMPARE_NETWORK_ADDRESSES(PCHAR_A,PCHAR_B,PINT_Result);
Parameters
- _A
Points to the first network address. - _B
Points to the second network address. - _Result
Points to a caller-supplied variable in which this macro returns the result of its comparison. The following table shows how _Result relates to the ordering of _A to _B.Value Description < 0 _A is less than _B. > 0 _A is greater than _B. = 0 _A equals _B.
Return Values
None.
Remarks
Token Ring network addresses do not have a defined ordering relationship. Consequently, the results of this macro for unequal addresses depend on the argument ordering.
The TR_COMPARE_NETWORK_ADDRESSES macro is defined as follows.
#define TR_COMPARE_NETWORK_ADDRESSES(_A, _B, _Result) \
{ \
if (*(ULONG UNALIGNED *)&(_A)[2] > \
*(ULONG UNALIGNED *)&(_B)[2]) \
{ \
*(_Result) = 1; \
} \
else if (*(ULONG UNALIGNED *)&(_A)[2] < \
*(ULONG UNALIGNED *)&(_B)[2]) \
{ \
*(_Result) = (UINT)-1; \
} \
else if (*(USHORT UNALIGNED *)(_A) > \
*(USHORT UNALIGNED *)(_B)) \
{ \
*(_Result) = 1; \
} \
else if (*(USHORT UNALIGNED *)(_A) < \
*(USHORT UNALIGNED *)(_B)) \
{ \
*(_Result) = (UINT)-1; \
} \
else \
{ \
*(_Result) = 0; \
} \
}
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Ndis.h.
See Also
Send Feedback on this topic to the authors