Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

TR_COMPARE_NETWORK_ADDRESSES (Windows Embedded CE 6.0)

1/6/2010

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
);

_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.

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;                                         \
    }                                                           \
}

Headerndis.h
Windows Embedded CEWindows CE .NET 4.0 and later

Community Additions

ADD
Show:
© 2015 Microsoft