diff options
| author | Nathan Sashihara <21227491+n8sh@users.noreply.github.com> | 2023-09-22 15:58:06 -0400 |
|---|---|---|
| committer | Nathan Sashihara <21227491+n8sh@users.noreply.github.com> | 2023-09-22 16:07:59 -0400 |
| commit | 07b388eecb0861e04dd8280681033d961b5d7fc0 (patch) | |
| tree | 49e655e150ec878e4bdfc59abf01be931bfd8acc /source | |
| parent | 90797a48be55b98d86e4e9ceffeecddd4ab90ac7 (diff) | |
| download | tanya-07b388eecb0861e04dd8280681033d961b5d7fc0.tar.gz | |
Update tanya.net.iface to work on Windows
Needed because 0fcc83d00eb9d0699167bf105d522e7d23a44d32 removed
tanya.sys.windows.ifdef and tanya.sys.windows.iphlpapi.
Diffstat (limited to 'source')
| -rw-r--r-- | source/tanya/net/iface.d | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/tanya/net/iface.d b/source/tanya/net/iface.d index 8e2675a..3bc165a 100644 --- a/source/tanya/net/iface.d +++ b/source/tanya/net/iface.d @@ -22,8 +22,22 @@ import tanya.range; version (Windows)
{
- import tanya.sys.windows.ifdef;
- import tanya.sys.windows.iphlpapi;
+ private union NET_LUID_LH { ulong Value, Info; }
+ private alias NET_LUID = NET_LUID_LH;
+ private alias NET_IFINDEX = uint;
+ private enum IF_MAX_STRING_SIZE = 256;
+ extern(Windows) @nogc nothrow private @system
+ {
+ uint ConvertInterfaceNameToLuidA(const(char)* InterfaceName,
+ NET_LUID* InterfaceLuid);
+ uint ConvertInterfaceLuidToIndex(const(NET_LUID)* InterfaceLuid,
+ NET_IFINDEX* InterfaceIndex);
+ uint ConvertInterfaceIndexToLuid(NET_IFINDEX InterfaceIndex,
+ NET_LUID* InterfaceLuid);
+ uint ConvertInterfaceLuidToNameA(const(NET_LUID)* InterfaceLuid,
+ char* InterfaceName,
+ size_t Length);
+ }
}
else version (Posix)
{
|
