-
-
Notifications
You must be signed in to change notification settings - Fork 7k
windows: bump minimum to Vista (from XP) #18009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9b136f3 to
f0b639c
Compare
vszakats
added a commit
that referenced
this pull request
Jul 24, 2025
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jul 24, 2025
Seen with a non-unity, mingw-w64 CI job targeting a Vista+ Windows
version while working on a PR. This combination is not normally
tested in CI.
Fixing:
```
In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0,
from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17,
from D:/a/curl/curl/lib/url.c:63:
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB'
CERT_NAME_BLOB *certificateNames;
^~~~~~~~~~~~~~
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB'
CRYPT_HASH_BLOB certBlob;
^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140
Follow-up to 0d71b18 curl#17413
Ref: curl#18009
3 tasks
vszakats
added a commit
to vszakats/curl
that referenced
this pull request
Jul 24, 2025
Seen with a non-unity, mingw-w64 CI job targeting a Vista+ Windows
version while working on a PR. This combination is not normally
tested in CI.
Fixing:
```
In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0,
from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17,
from D:/a/curl/curl/lib/url.c:63:
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB'
CERT_NAME_BLOB *certificateNames;
^~~~~~~~~~~~~~
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB'
CRYPT_HASH_BLOB certBlob;
^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140
Follow-up to 0d71b18 curl#17413
Ref: curl#18009
vszakats
added a commit
that referenced
this pull request
Jul 24, 2025
Required for mingw-w64 5.x (and older) builds targeting a Windows 7+.
mingw-w64 6+ fixed `mprapi.h` (included indirectly via `iphlpapi.h`)
to include `wincrypt.h` for the missing types.
MSVC is not affected because SDK 7.1a (the oldest MS SDK curl supports),
`mprapi.h` does include `wincrypt.h`.
Make sure to include `wincrypt.h` before including `iphlpapi.h` as
a workaround. `wincrypt.h` is used unconditionally even though it's
not available in UWP. This is safe in this context, because we use
`iphlpapi.h` for `if_nametoindex`, which is not supported and used
in UWP builds.
This fixes auto-detection that missed detecting `if_nametoindex` in
the affected combination, and this build error in non-unity builds:
```
In file included from D:/my-cache/mingw32/i686-w64-mingw32/include/iprtrmib.h:9:0,
from D:/my-cache/mingw32/i686-w64-mingw32/include/iphlpapi.h:17,
from D:/a/curl/curl/lib/url.c:63:
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:865:3: error: unknown type name 'CERT_NAME_BLOB'
CERT_NAME_BLOB *certificateNames;
^~~~~~~~~~~~~~
D:/my-cache/mingw32/i686-w64-mingw32/include/mprapi.h:887:3: error: unknown type name 'CRYPT_HASH_BLOB'
CRYPT_HASH_BLOB certBlob;
^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/16497057672/job/46645264552?pr=18012#step:10:140
This combination is not normally tested in CI. It was caught in
the `dl-mingw, CM 6.4.0-i686 schannel !unity Win7` job while working
on another PR.
Follow-up to 0d71b18 #17413
Ref: #18009
Closes #18012
8c9ff31 to
5410661
Compare
a87bd89 to
4c0a94f
Compare
vszakats
added a commit
that referenced
this pull request
Jul 27, 2025
Collision happens when building with mingw-w64 v3 or v2 while targeting Vista or newer. `iphlpapi.h` includes `windns.h` in this case, which defines macros named `DNS_TYPE_*`, colliding with curl doh enums. The issue was fixed in mingw-w64 v4: mirror/mingw-w64@ea95d55 Fixes: ``` lib/doh.h:54:3: error: expected identifier before numeric constant DNS_TYPE_A = 1, ^ ``` Ref: https://github.com/curl/curl/actions/runs/16551209676/job/46806303365?pr=18009#step:10:17 This workaround seems harmless and generally good practice, but another option is to require mingw-w64 v4. Ref: #18009 Closes #18041
7db8996 to
20cfc9e
Compare
UWP builds don't support iphlpapi's if_nametoindex().
```
D:/a/curl/curl/lib/url.c: In function 'zonefrom_url':
D:/a/curl/curl/lib/url.c:1777:55: error: unused parameter 'data' [-Werror=unused-parameter]
1777 | static void zonefrom_url(CURLU *uh, struct Curl_easy *data,
| ~~~~~~~~~~~~~~~~~~^~~~
```
```
C:\a\curl\curl\lib\url.c(1777,55): warning C4100: 'data': unreferenced parameter [C:\a\curl\curl\bld\lib\libcurl_object.vcxproj]
```
…ista mingw-w64 v5.x and older defaults to 0x0502 (WS2003) mingw-w64 v6 v7 v8 defaults to 0x0502 (WS2003) by default mingw-w64 v9.x and later (as of v13) defaults to 0x0a00 (Win10) by default
Present in all supported toolchains (VS2008+, mingw-w64), but requires targeting XP SP2+.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CI
Continuous Integration
feature-window
A merge of this requires an open feature window
tests
Windows
Windows-specific
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After this patch curl requires targeting Vista or newer, and a toolchain
with Vista support.
Supported MSVC compilers (VS2010+) all support Vista:
Supported mingw-w64 versions (v3+) all support Vista:
After this patch it may be necessary to override the default Windows
target version to Vista (or newer) via:
autotools:
CPPFLAGS=-D_WIN32_WINNT=0x0600cmake:
-DCURL_TARGET_WINDOWS_VERSION=0x0600Notes:
if_nametoindexneeds to beallowlisted in
curl_setup.h, if they do support it.Fixes #17985 (discussion)
w/o sp https://github.com/curl/curl/pull/18009/files?w=1
6, 2, 0or6, 1, 0, or10, 0, 20348, whichever may save a call for most runs. Or just one and do the rest in separate PR. (grepcurlx_verify_windows_version). Most checks are now for Schannel, except one in tool which we cannot cache from libcurl, and another in cf-socket for10, 0, 16299. Schannel would need a different kind of caching within the module. Question if it's worth it for cf-socket → Probably not, because it's only used if the off-by-default setoptCURLOPT_TCP_KEEPALIVEis enabled.easy_lock.h.CALG_SHA_256. (present in all supported toolchains, but requires targeting XP SP2+)schannel.c/struct algo? May be worth a try, but probably not. [WORKS]config-win32.htocurl_setup.h? (it's still needed for VS2010, and also for mingw-w64) [ended up not needed for VS2010 which defaults to Win7. The logic got deleted instead]HAVE_ATOMIC,HAVE_STDATOMIC_H. Consider deleting logic dealing with them under Windows. (e.g. pre-fill) [Maybe in a future PR.]_WIN32_WINNTwhen using old mingw-w64 versions? (within cmake, autotools, to apply to feature checks) [Seem super-complicated, to avoid interfering with any existing custom options. Recommended is to upgrade to mingw-w64 v9 (2021) or newer, or set the necessary options] [SKIP]https://github.com/curl/curl/actions/runs/20212652678/job/58021652209?pr=18009
https://github.com/curl/curl/actions/runs/20212652678/attempts/1?pr=18009
Rebase on tests/server: fix initialization on Windows Vista+ #19973.
Targeting Windows 7 (instead of Vista) as a minimum, would save 20
lines more and two runtime version checks in Schannel. I think it's fine
to keep supporting Vista.