aboutsummaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 12:27:42 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2020-11-03 12:27:42 +0100
commit7dede73406a970e910516ca9e5ea8a0f82945ae3 (patch)
tree6466c752da664bdc698d82c9d056d4aba725b52e /example
parentapi: move _L macro where it belongs (diff)
downloadwintun-7dede73406a970e910516ca9e5ea8a0f82945ae3.tar.xz
wintun-7dede73406a970e910516ca9e5ea8a0f82945ae3.zip
api: add pool/driver removal for uninstaller semantics
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'example')
-rw-r--r--example/example.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/example/example.c b/example/example.c
index 5f1ec7a..fb84da7 100644
--- a/example/example.c
+++ b/example/example.c
@@ -14,7 +14,7 @@
static WINTUN_CREATE_ADAPTER_FUNC WintunCreateAdapter;
static WINTUN_DELETE_ADAPTER_FUNC WintunDeleteAdapter;
-static WINTUN_DELETE_DRIVER_FUNC WintunDeleteDriver;
+static WINTUN_DELETE_POOL_DRIVER_FUNC WintunDeletePoolDriver;
static WINTUN_ENUM_ADAPTERS_FUNC WintunEnumAdapters;
static WINTUN_FREE_ADAPTER_FUNC WintunFreeAdapter;
static WINTUN_GET_ADAPTER_FUNC WintunGetAdapter;
@@ -258,8 +258,9 @@ InitializeWintun(void)
return NULL;
#define X(Name, Type) ((Name = (Type)GetProcAddress(Wintun, #Name)) == NULL)
if (X(WintunCreateAdapter, WINTUN_CREATE_ADAPTER_FUNC) || X(WintunDeleteAdapter, WINTUN_DELETE_ADAPTER_FUNC) ||
- X(WintunDeleteDriver, WINTUN_DELETE_DRIVER_FUNC) || X(WintunEnumAdapters, WINTUN_ENUM_ADAPTERS_FUNC) ||
- X(WintunFreeAdapter, WINTUN_FREE_ADAPTER_FUNC) || X(WintunGetAdapter, WINTUN_GET_ADAPTER_FUNC) ||
+ X(WintunDeletePoolDriver, WINTUN_DELETE_POOL_DRIVER_FUNC) ||
+ X(WintunEnumAdapters, WINTUN_ENUM_ADAPTERS_FUNC) || X(WintunFreeAdapter, WINTUN_FREE_ADAPTER_FUNC) ||
+ X(WintunGetAdapter, WINTUN_GET_ADAPTER_FUNC) ||
X(WintunGetAdapterDeviceObject, WINTUN_GET_ADAPTER_DEVICE_OBJECT_FUNC) ||
X(WintunGetAdapterGUID, WINTUN_GET_ADAPTER_GUID_FUNC) ||
X(WintunGetAdapterLUID, WINTUN_GET_ADAPTER_LUID_FUNC) ||
@@ -315,17 +316,14 @@ main(void)
}
DWORD Version = WintunGetVersion();
- Log(WINTUN_LOG_INFO,
- L"Wintun v%u.%u loaded",
- (Version >> 16) & 0xff,
- (Version >> 0) & 0xff);
+ Log(WINTUN_LOG_INFO, L"Wintun v%u.%u loaded", (Version >> 16) & 0xff, (Version >> 0) & 0xff);
MIB_UNICASTIPADDRESS_ROW AddressRow;
InitializeUnicastIpAddressEntry(&AddressRow);
WintunGetAdapterLUID(Adapter, &AddressRow.InterfaceLuid);
AddressRow.Address.Ipv4.sin_family = AF_INET;
AddressRow.Address.Ipv4.sin_addr.S_un.S_addr = htonl((10 << 24) | (6 << 16) | (7 << 8) | (7 << 0)); /* 10.6.7.7 */
- AddressRow.OnLinkPrefixLength = 24; /* This is a /24 network */
+ AddressRow.OnLinkPrefixLength = 24; /* This is a /24 network */
Result = CreateUnicastIpAddressEntry(&AddressRow);
if (Result != ERROR_SUCCESS)
{