Repository navigation
Fix packaged Windows SDK LNK2019 (RtlSetVolatileMemory) in libcurl - #1960
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates CMakeLists.txt to set Windows 10 baseline compile definitions (_WIN32_WINNT and NTDDI_VERSION) for libcurl targets when building with MSVC. The review feedback correctly points out that using an elseif block makes the configuration of libcurl_object and libcurl_static mutually exclusive; it is recommended to use independent if statements to ensure both targets are configured properly if they both exist.
✅ Integration test succeeded!Requested by @AustinBenoit on commit 74db05c |
Contributor
Author
CI Validation Runs (
|
a-maurice
approved these changes
Nov 10, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
When compiled against Windows SDK 10.0.26100.0+ (
NTDDI_VERSION >= 0x0A000010),libcurl8.23.0 switches its internal memory-zeroing macro toSecureZeroMemory2()(RtlSetVolatileMemoryinvolatileaccessu.lib), whose#pragma comment(lib, "volatileaccessu.lib")directive is stripped during SDK library packaging (causingLNK2019on packaged Windows builds) and is unavailable to consumers using Windows 10 SDKs. Defining_WIN32_WINNT=0x0A00andNTDDI_VERSION=0x0A000000(NTDDI_WIN10) onlibcurltargets baseline Windows 10+ solibcurluses header-onlySecureZeroMemory()instead while remaining fully compatible with both Windows 10 and Windows 11.References
WINVERor_WIN32_WINNTlib/curl_setup.h(SecureZeroMemory2/NTDDI_VERSIONguard) (curl/curl#21598)SecureZeroMemory2(winbase.h/volatileaccessu.lib)