IpHlpApi struct fixes

pull/423/head
David Hall 2023-09-07 14:59:11 -06:00
parent a041fc9a67
commit 43476149cd
2 changed files with 11 additions and 3 deletions

View File

@ -1293,7 +1293,7 @@ namespace Vanara.PInvoke
// _IP_ADAPTER_MULTICAST_ADDRESS_XP { union { ULONGLONG Alignment; struct { ULONG Length; DWORD Flags; }; }; struct
// _IP_ADAPTER_MULTICAST_ADDRESS_XP *Next; SOCKET_ADDRESS Address; } IP_ADAPTER_MULTICAST_ADDRESS_XP, *PIP_ADAPTER_MULTICAST_ADDRESS_XP;
[PInvokeData("iptypes.h", MSDNShortId = "b85a6e0a-df2c-4608-b07a-191b34440a43")]
[StructLayout(LayoutKind.Sequential, Pack = 8)]
[StructLayout(LayoutKind.Sequential)]
public struct IP_ADAPTER_MULTICAST_ADDRESS : ILinkedListElement<IP_ADAPTER_MULTICAST_ADDRESS>
{
private long Alignment;

View File

@ -6167,11 +6167,17 @@ namespace Vanara.PInvoke
/// <summary>Initializes a new instance of the <see cref="MIB_IF_ROW2"/> struct.</summary>
/// <param name="interfaceIndex">Index of the interface.</param>
public MIB_IF_ROW2(uint interfaceIndex) : this() => InterfaceIndex = interfaceIndex;
public MIB_IF_ROW2(uint interfaceIndex) : this(false) => InterfaceIndex = interfaceIndex;
/// <summary>Initializes a new instance of the <see cref="MIB_IF_ROW2"/> struct.</summary>
/// <param name="interfaceLuid">The interface luid.</param>
public MIB_IF_ROW2(NET_LUID interfaceLuid) : this() => InterfaceLuid = interfaceLuid;
public MIB_IF_ROW2(NET_LUID interfaceLuid) : this(false) => InterfaceLuid = interfaceLuid;
private MIB_IF_ROW2(bool _) : this()
{
Alias = Description = string.Empty;
PhysicalAddress = PermanentPhysicalAddress = new byte[IF_MAX_PHYS_ADDRESS_LENGTH];
}
}
/// <summary>The MIB_IFSTACK_ROW structure represents the relationship between two network interfaces.</summary>
@ -6958,12 +6964,14 @@ namespace Vanara.PInvoke
private MIB_IPNET_ROW2(SOCKADDR_IN ipV4, byte[] macAddr) : this()
{
Address.Ipv4 = ipV4;
PhysicalAddress = new byte[IF_MAX_PHYS_ADDRESS_LENGTH];
SetMac(macAddr);
}
private MIB_IPNET_ROW2(SOCKADDR_IN6 ipV6, byte[] macAddr) : this()
{
Address.Ipv6 = ipV6;
PhysicalAddress = new byte[IF_MAX_PHYS_ADDRESS_LENGTH];
SetMac(macAddr);
}