Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ MarshalIpAddressInformationCollection()

static IPAddressInformationCollection Interop.IpHlpApi.IpAdapterAddress.MarshalIpAddressInformationCollection ( IntPtr ptr)
inlinestaticpackage

Definition at line 125 of file Interop.cs.

126 {
127 IPAddressInformationCollection iPAddressInformationCollection = new IPAddressInformationCollection();
128 while (ptr != IntPtr.Zero)
129 {
130 IpAdapterAddress ipAdapterAddress = Marshal.PtrToStructure<IpAdapterAddress>(ptr);
131 IPAddress iPAddress = ipAdapterAddress.address.MarshalIPAddress();
132 iPAddressInformationCollection.InternalAdd(new SystemIPAddressInformation(iPAddress, ipAdapterAddress.flags));
133 ptr = ipAdapterAddress.next;
134 }
135 return iPAddressInformationCollection;
136 }
static ? object PtrToStructure(IntPtr ptr, [DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicConstructors|DynamicallyAccessedMemberTypes.NonPublicConstructors)] Type structureType)
Definition Marshal.cs:1164
static readonly IntPtr Zero
Definition IntPtr.cs:18

References Interop.IpHlpApi.IpAdapterAddress.address, Interop.IpHlpApi.IpAdapterAddress.flags, System.Net.NetworkInformation.IPAddressInformationCollection.InternalAdd(), Interop.IpHlpApi.IpSocketAddress.MarshalIPAddress(), Interop.IpHlpApi.IpAdapterAddress.next, System.Runtime.InteropServices.Marshal.PtrToStructure(), and System.IntPtr.Zero.