Repository navigation
Conversation
|
Looks good to me. Just needs build-version support to properly support my TLS 1.3 PR. |
- Use RtlVerifyVersionInfo instead of VerifyVersionInfo, when possible. Later versions of Windows have normal version functions that compare and return versions based on the way the application is manifested, instead of the actual version of Windows the application is running on. We prefer the actual version of Windows so we'll now call the Rtl variant of version functions (RtlVerifyVersionInfo) which does a proper comparison of the actual version. Reported-by: Wyatt O'Day Ref: curl#7727 Fixes curl#7742 Closes #xxxx
8e2579e to
61bd2e1
Compare
|
You're welcome to add a |
MarcelRaad
left a comment
There was a problem hiding this comment.
For the record, I agree with @vszakats that it's not libcurl's job to work around bugs in applications libcurl is directly or indirectly used in, and even if it does, there are many more libraries that don't. I don't have a strong opinion on that though, which is why I've been silent in #7727. And as this seems to have no drawbacks, and especially if it helps to land #7784 in a less controversial way, I'm fine with it. Thanks to both of you @jay and @wyattoday !
|
This looks good. With the concern that it's not libcurl's job to fix the bad OS design around Windows version/feature detection. Such practice will result in libcurl behaving unexpectedly and differently from other code that's designed to honor manifests and the official way of feature-detection. I don't think this is the correct direction, though with some luck, it will not cause (or seldom cause) problems in practice. |
Will do. As soon as this is merged I'll make a new PR. |
OSVERSIONINFOEXW and RTLOSVERSIONINFOEXW have always been defined by MS as the same struct. It's unlikely they'll diverge at some point however in the interest of best practice I've copied the current one as OUR_OSVERSIONINFOEXW so there is no chance that in the future some (RTL)OSVERSIONINFOEXW ends up being passed that is not compatible with both VerifyVersionInfoW and RtlVerifyVersionInfo.
|
I've made a slight change to this, defining OUR_OSVERSIONINFOEXW to be certain the struct we use is always compatible with both VerifyVersionInfoW and RtlVerifyVersionInfo. More details can be seen in the separate commit which I will later squash in. |
curl requires Windows XP since 2023. Drop version detection code using `GetVersionEx()` aimed to support earlier Windows versions. With that call deleted, the embedded manifest in `curl.rc` becomes unnecessary. Delete it too, along with the enabler logic in build systems. This allows to stop forcing `/MANIFEST:NO` for MSVC builds. Dropping it fixes VS2008 shared builds, that require an auto-generated SxS manifest to find their CRT DLLs. This was the issue that prevented VS2008 `curl.exe` launching on AppVeyor CI. FWIW the `curl.rc` embedded manifest wasn't ever enabled for VS2008 CI builds either, because CMake did not pass our custom macro via `CMAKE_RC_FLAGS` to `rc.exe`. For reasons I couldn't figure out. After this patch the curl build no longer inject its own manifest, and lets the default be applied by linkers and toolchains. It fixes VS2008 shared builds. curl continues to detect the real Windows version via `RtlVerifyVersionInfo` from `ntdll`. Follow-up to 960d601 curl#12225 Follow-up to 5044909 curl#7810 Follow-up to ebd2132 curl#1221 Cherry-picked from curl#16394
curl requires Windows XP since 2023. Drop version detection code using `GetVersionEx()` aimed to support earlier Windows versions. With that call deleted, the embedded manifest in `curl.rc` becomes unnecessary. Delete it too, along with the enabler logic in build systems. This allows to stop forcing `/MANIFEST:NO` for MSVC builds. Dropping it fixes VS2008 shared builds, that require an auto-generated SxS (side-by-side assembly) manifest to find their CRT DLLs. This was the issue that prevented VS2008 `curl.exe` launching on AppVeyor CI: ``` src/curl.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory ``` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51577006/job/eitypvwlb1rxr11d#L261 FWIW the `curl.rc` embedded manifest wasn't ever enabled for VS2008 CI builds either, because CMake did not pass our custom macro via `CMAKE_RC_FLAGS` to `rc.exe`. For reasons I could not figure out. After this patch the curl build no longer inject its own manifest, and lets the default be applied by linkers and toolchains. It fixes VS2008 shared builds. curl continues to detect the real Windows version via `RtlVerifyVersionInfo()` from `ntdll`. Follow-up to 960d601 #12225 Follow-up to 5044909 #7810 Follow-up to ebd2132 #1221 Ref: #15972 Cherry-picked from #16394 Closes #16453
curl requires Windows XP since 2023. Drop version detection code using `GetVersionEx()` aimed to support earlier Windows versions. With that call deleted, the embedded manifest in `curl.rc` becomes unnecessary. Delete it too, along with the enabler logic in build systems. This allows to stop forcing `/MANIFEST:NO` for MSVC builds. Dropping it fixes VS2008 shared builds, that require an auto-generated SxS (side-by-side assembly) manifest to find their CRT DLLs. This was the issue that prevented VS2008 `curl.exe` launching on AppVeyor CI: ``` src/curl.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory ``` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51577006/job/eitypvwlb1rxr11d#L261 FWIW the `curl.rc` embedded manifest wasn't ever enabled for VS2008 CI builds either, because CMake did not pass our custom macro via `CMAKE_RC_FLAGS` to `rc.exe`. For reasons I could not figure out. After this patch the curl build no longer inject its own manifest, and lets the default be applied by linkers and toolchains. It fixes VS2008 shared builds. curl continues to detect the real Windows version via `RtlVerifyVersionInfo()` from `ntdll`. Follow-up to 960d601 curl#12225 Follow-up to 5044909 curl#7810 Follow-up to ebd2132 curl#1221 Ref: curl#15972 Cherry-picked from curl#16394 Closes curl#16453
curl requires Windows XP since 2023. Drop version detection code using `GetVersionEx()` aimed to support earlier Windows versions. With that call deleted, the embedded manifest in `curl.rc` becomes unnecessary. Delete it too, along with the enabler logic in build systems. This allows to stop forcing `/MANIFEST:NO` for MSVC builds. Dropping it fixes VS2008 shared builds, that require an auto-generated SxS (side-by-side assembly) manifest to find their CRT DLLs. This was the issue that prevented VS2008 `curl.exe` launching on AppVeyor CI: ``` src/curl.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory ``` Ref: https://ci.appveyor.com/project/curlorg/curl/builds/51577006/job/eitypvwlb1rxr11d#L261 FWIW the `curl.rc` embedded manifest wasn't ever enabled for VS2008 CI builds either, because CMake did not pass our custom macro via `CMAKE_RC_FLAGS` to `rc.exe`. For reasons I could not figure out. After this patch the curl build no longer inject its own manifest, and lets the default be applied by linkers and toolchains. It fixes VS2008 shared builds. curl continues to detect the real Windows version via `RtlVerifyVersionInfo()` from `ntdll`. Follow-up to 960d601 curl#12225 Follow-up to 5044909 curl#7810 Follow-up to ebd2132 curl#1221 Ref: curl#15972 Cherry-picked from curl#16394 Closes curl#16453
Later versions of Windows have normal version functions that compare and
return versions based on the way the application is manifested, instead
of the actual version of Windows the application is running on. We
prefer the actual version of Windows so we'll now call the Rtl variant
of version functions (RtlVerifyVersionInfo) which does a proper
comparison of the actual version.
Reported-by: Wyatt O'Day
Ref: #7727
Fixes #7742
Closes #xxxx