Pierre Schweitzer : iphlpapi: Flags in IP_ADAPTER_ADDRESSES_LH can be used as a bit field.

Alexandre Julliard julliard at winehq.org
Tue Mar 14 16:14:36 CDT 2017


Module: wine
Branch: master
Commit: 30a27f0ba7fb275ab64d4b49fcddc44b8422a21f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=30a27f0ba7fb275ab64d4b49fcddc44b8422a21f

Author: Pierre Schweitzer <pierre at reactos.org>
Date:   Mon Mar 13 19:39:50 2017 +0100

iphlpapi: Flags in IP_ADAPTER_ADDRESSES_LH can be used as a bit field.

Signed-off-by: Pierre Schweitzer <pierre at reactos.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/iphlpapi/iphlpapi_main.c |  4 ++--
 include/iptypes.h             | 16 +++++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c
index 953af88..6f16807 100644
--- a/dlls/iphlpapi/iphlpapi_main.c
+++ b/dlls/iphlpapi/iphlpapi_main.c
@@ -1067,7 +1067,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
         {
             IP_ADAPTER_UNICAST_ADDRESS *ua;
             struct WS_sockaddr_in *sa;
-            aa->Flags |= IP_ADAPTER_IPV4_ENABLED;
+            aa->u1.s1.Ipv4Enabled = TRUE;
             ua = aa->FirstUnicastAddress = (IP_ADAPTER_UNICAST_ADDRESS *)ptr;
             for (i = 0; i < num_v4addrs; i++)
             {
@@ -1101,7 +1101,7 @@ static ULONG adapterAddressesFromIndex(ULONG family, ULONG flags, IF_INDEX index
             IP_ADAPTER_UNICAST_ADDRESS *ua;
             struct WS_sockaddr_in6 *sa;
 
-            aa->Flags |= IP_ADAPTER_IPV6_ENABLED;
+            aa->u1.s1.Ipv6Enabled = TRUE;
             if (aa->FirstUnicastAddress)
             {
                 for (ua = aa->FirstUnicastAddress; ua->Next; ua = ua->Next)
diff --git a/include/iptypes.h b/include/iptypes.h
index e4fa90c..c1a253d 100644
--- a/include/iptypes.h
+++ b/include/iptypes.h
@@ -244,7 +244,21 @@ typedef struct _IP_ADAPTER_ADDRESSES_LH {
     PWCHAR                          FriendlyName;
     BYTE                            PhysicalAddress[MAX_ADAPTER_ADDRESS_LENGTH];
     DWORD                           PhysicalAddressLength;
-    DWORD                           Flags;
+    union {
+        DWORD                       Flags;
+        struct {
+            DWORD                   DdnsEnabled : 1;
+            DWORD                   RegisterAdapterSuffix : 1;
+            DWORD                   Dhcpv4Enabled : 1;
+            DWORD                   ReceiveOnly : 1;
+            DWORD                   NoMulticast : 1;
+            DWORD                   Ipv6OtherStatefulConfig : 1;
+            DWORD                   NetbiosOverTcpipEnabled : 1;
+            DWORD                   Ipv4Enabled : 1;
+            DWORD                   Ipv6Enabled : 1;
+            DWORD                   Ipv6ManagedAddressConfigurationSupported : 1;
+        } DUMMYSTRUCTNAME1;
+    } DUMMYUNIONNAME1;
     DWORD                           Mtu;
     DWORD                           IfType;
     IF_OPER_STATUS                  OperStatus;




More information about the wine-cvs mailing list