From 33cac1114c308dab8ba30d9cc651a21f9986591e Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 27 Jun 2019 09:46:33 +0000 Subject: Fix up comment about replacement for ->Reserved Signed-off-by: Jason A. Donenfeld --- wintun.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/wintun.c b/wintun.c index c9a9212..be40c39 100644 --- a/wintun.c +++ b/wintun.c @@ -1197,12 +1197,15 @@ TunInitializeEx( status = NDIS_STATUS_FAILURE; goto cleanup_NdisDeregisterDeviceEx; } - - /* Jason reverse engineered and found NdisWdfGetAdapterContextFromAdapterHandle. - * Switch from device object's "Reserved" to this when we drop support for Windows 8.1. */ DEVICE_OBJECT *functional_device; NdisMGetDeviceProperty(MiniportAdapterHandle, NULL, &functional_device, NULL, NULL, NULL); + /* Reverse engineering indicates that we'd be better off calling + * NdisWdfGetAdapterContextFromAdapterHandle(functional_device), + * which points to our TUN_CTX object directly, but this isn't + * available before Windows 10, so for now we just stick it into + * this reserved field. Revisit this when we drop support for old + * Windows versions. */ #pragma warning(suppress : 28175) ASSERT(!functional_device->Reserved); #pragma warning(suppress : 28175) -- cgit v1.2.3-59-g8ed1b