aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-27 09:46:33 +0000
committerJason A. Donenfeld <Jason@zx2c4.com>2019-07-03 08:50:30 +0000
commit33cac1114c308dab8ba30d9cc651a21f9986591e (patch)
tree6567e8f0dcafb6998a76410bb2916f592133e701
parentSimplify IRP processing after mapping (diff)
downloadwintun-33cac1114c308dab8ba30d9cc651a21f9986591e.tar.xz
wintun-33cac1114c308dab8ba30d9cc651a21f9986591e.zip
Fix up comment about replacement for ->Reserved
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r--wintun.c9
1 files 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)