aboutsummaryrefslogtreecommitdiffstats
path: root/wintun.proj (unfollow)
Commit message (Collapse)AuthorFilesLines
2022-04-22README: mention Windows 11Simon Rozman1-1/+1
Reported-by: Dimitri Papadopoulos Orfanos <dimitri.papadopoulos@cea.fr> Signed-off-by: Simon Rozman <simon@rozman.si>
2021-12-03api: header: silence MSVC warnings for MSVC onlySimon Rozman1-3/+7
MinGW ignores unknown `#pragma warning` lines, but displays a warning nevertheless. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-10-25proj: stop building for arm32Simon Rozman1-3/+2
This does not remove 32-bit ARM compilation support out of the project yet. Shipping of 32-bit ARM drivers became a real challenge: - Microsoft changed policy to prohibit EV-signed drivers - Attestation signing is not supported for this platform - Setting up Windows 8 ARM HCK to get WHQL certification requires a lot of effort if doable in 2021 at all. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-10-17driver: address Code Analysis warningSimon Rozman1-0/+1
In this case, we're referencing objects by handle for closing user space handles. Should be UserMode, not Irp->RequestorMode as C28126 suggests. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-10-17driver: allow ring registration from kernelSimon Rozman1-4/+4
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-10-17driver: address Code Analysis warningsSimon Rozman1-1/+2
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-10-17version: bump0.14.1Jason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-15api: main: avoid excessive function castJason A. Donenfeld1-4/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-15example: remove overly specific castsJason A. Donenfeld1-10/+5
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-14api: header: fix typoJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-14api: use proper instance id boundsJason A. Donenfeld5-9/+9
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-14api: adapter: handle cases explicitly in dev query callbackJason A. Donenfeld1-5/+10
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-13downlevelshim: remove in preparation for full WHQLJason A. Donenfeld7-159/+4
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12README: correct solution nameJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12version: bump0.14Jason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12driver: automatically close long-lived handleJason A. Donenfeld4-132/+77
There's only one handle that's likely to be open in a long lived way: the tun registration handle. So we can force that closed automatically when the device is about to close, if it's been improperly left open. Other handles will indeed hold up closing, but if those exist, they're a sign of a larger bug elsewhere that should be addressed. On the other hand, tun registration handles might legitimately be open during driver upgrades. This also saves us the trouble of dereferencing a freed FileObject as in the general case. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-12api: rewrite based on SwDeviceJason A. Donenfeld30-2669/+2387
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-10-11proj: remove SDV and DVL supportSimon Rozman1-22/+1
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-09-28api: adapter: cleanup wintrust shim if install failsJason A. Donenfeld1-6/+6
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-24driver: inf: remove LoadOrderGroupJason A. Donenfeld1-1/+0
It's useless for PnP drivers. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-16driver: allow userspace to write garbageJason A. Donenfeld1-2/+3
Not discouraging userspace from skipping checking IP packets seems like a bad thing, but they skip it anyway, so at least avoid the DoS due to API misuse. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-09-13driver: Replace depreciated ExAllocatePoolWithTagSimon Rozman1-1/+1
CodeQL with Windows-Driver-Developer-Supplemental-Tools suggests the ExAllocatePoolWithTag() should no longer be used. The Static Tools Logo Test in HLK spots this in the DVL log and fails. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-09-09example: disable dad for faster startupJason A. Donenfeld1-0/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-25props: inverse SDVHacks logicSimon Rozman1-2/+2
SDV is allergic to code analysis. So, when we're doing SDV (SDVHacks is "true"), we need to turn the code analysis off. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-08-25.gitignore: ignore CodeQL outputSimon Rozman1-0/+4
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-08-10props: unify import .lib of DLLsSimon Rozman2-1/+1
This moves downlevelshim.lib and those .lib from any future DLLs in this repo to the matching IntDir. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-08-08api: rundll32: make empty string if no instance idJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-07driver: mark as network driver rather than system driverJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-04props: tie code analysis to sdv hacks rather than debug buildsJason A. Donenfeld2-3/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02version: bump0.13Jason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02proj: fix header linesJason A. Donenfeld2-2/+2
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02api: incorporate new win7 code signing techniqueJason A. Donenfeld7-4/+160
https://git.zx2c4.com/downlevel-driver-enabler/about/ Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02proj: clean up loose endsJason A. Donenfeld2-3/+3
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-08-02api: remove authenticode supportJason A. Donenfeld3-103/+5
Certificates are no longer valid. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-07-30props: use ForcedTargetVersion for overrideJason A. Donenfeld2-5/+8
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-30editorconfig: farewell wixJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-30driver: remove useless defines from resourceJason A. Donenfeld1-3/+0
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28api: upgradeSimon Rozman20-1383/+1539
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28example: resolve signed/unsigned code analysis warningSimon Rozman1-1/+1
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28global: upgrade clang-formatSimon Rozman1-24/+41
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-28vs: move shared configuration to wintun.props and upgradeSimon Rozman18-391/+229
Remember to rename wintun.vcxproj.user file in your local working folder to wintun.props.user manually. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-27driver: workaround SDV failure with code analysisSimon Rozman2-7/+9
SDV is using own CL.EXE which returns error code 2 when code analysis is turned on. However, we need code analysis results for DVL. While we could use a new "ReleaseSDV" configuration, we don't really require limited code analysis in Release builds, as long as we address all full code analysis warnings in Debug builds. To make DVL happier, an intermediate Release build was injected with code analysis turned on. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-23api: build with WDKJason A. Donenfeld9-4/+33
Makes builds more reproducable, as we can do our next release using the EWDK, an all-in-one ISO of build tools from Microsoft. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-07-13api: remove unused pch fileJason A. Donenfeld1-6/+0
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-07-13driver: switch to MS-recommended memory allocSimon Rozman2-3/+5
Suggested-by: Static Driver Verifier Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-12driver: cleanup project fileSimon Rozman1-155/+132
Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-12driver: remove excessive media connection reporting on adapter initSimon Rozman1-4/+1
The initial adapter state (including media connection) is provided by the NDIS_MINIPORT_ADAPTER_GENERAL_ATTRIBUTES. Additional NdisMIndicateStatusEx() call seems excessive. Signed-off-by: Simon Rozman <simon@rozman.si>
2021-07-09api: use SuggestedInstanceId instead of NetSetupAnticipatedInstanceIdJason A. Donenfeld7-466/+158
All was well with NetSetupAnticipatedInstanceId, until a bug crept into recent Windows builds that caused old GUIDs not to be properly removed, resulting in subsequent adapter creations to fail, because NetSetup AnticipatedInstanceId considers it fatal when the target GUID already exists, even if in diminished form. The initial solution was to detect cruft, and then steal a TrustedInstaller token and sleuth around the registry cleaning things up. The horror! Uncomfortable with this, I reopened IDA and had a look around with fresh eyes, three years after the original discovery of NetSetupAnticipated InstanceId. There, I found some interesting behavior in NetSetupSvcDeviceManager::InstallNetworkInterfaces, which amounts to something like: if (IsSet("RetiredNetCfgInstanceId") { if (IsSet("NetSetupAnticipatedInstanceId") DeleteAdapter(GetValue("RetiredNetCfgInstanceId")); else Set("NetSetupAnticipatedInstanceId", GetValue("RetiredNetCfgInstanceId")); Delete("RetiredNetCfgInstanceId"); } CreateAdapter = TRUE; if (IsSet("NetSetupAnticipatedInstanceId")) { Guid = GetValue("NetSetupAnticipatedInstanceId"); if (AdapterAlreadyExists(Guid)) CreateAdapter = FALSE; else SetGuidOfNewAdapter(Guid); Delete("NetSetupAnticipatedInstanceId"); } else if (IsSet("SuggestedInstanceId")) { Guid = GetValue("SuggestedInstanceId"); if (!AdapterAlreadyExists(Guid)) SetGuidOfNewAdapter(Guid); Delete("SuggestedInstanceId"); } Thus, one appealing strategy would be to set both NetSetupAnticipated InstanceId and RetiredInstanceId to the same value, and let the service handle deleting the old one for us before creating the new one. However, the cleanup of the old adapter winds up being quasi- asynchronous, and thus we still wind up in the CreateAdapter = FALSE case. So, the remaining strategy is to simply use SuggestedInstanceId instead. This has the behavior that if there's an adapter already in use, it'll use a new random GUID. The result is that adapter creation won't fail. That's not great, but the docs have always made it clear that "requested" is a best-effort sort of thing. Plus, hopefully the creation of the new adapter will help nudge the bug a bit and cleanup the old cruft. In some ways, transitioning from our old strategy of "cudgel the registry until we get the GUID we want" to "ask politely and accept no for an answer" is a disappointing regression in functionality. But it also means we don't need to keep crazy token stealing code around, or fish around in the registry dangerously. This probably also increases the likelihood that an adapter will be created during edge cases, which means fewer errors for users, which could be a good thing. On the downside, we have the perpetual tensions caused by a system that now "fails open" instead of "fails closed". But so it goes in Windows land. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-07-08api: log instance id when object file name is emptyJason A. Donenfeld1-1/+1
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2021-07-08api: print correct last error when failingJason A. Donenfeld1-1/+1
Prior to the conversion, LastError is ERROR_SUCCESS, so move the logging to be after the conversion. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>