windows: document toolchain support for some macros

The oldest MS SDK I checked is 6.0A (VS2008). Versions are approximate
beyond 7.1A. I only have two Win10 SDKs to verify:
10.0.16299.0 (VS2017-15.4) and 10.0.22621.0 (VS2022).

Ref: https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
Ref: https://developer.microsoft.com/windows/downloads/sdk-archive/index-legacy (recent versions mostly)

Closes #18085
This commit is contained in:
Viktor Szakats 2025-07-29 19:36:20 +02:00
parent 08acef2aab
commit 3bfcfe82b9
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201
8 changed files with 18 additions and 3 deletions

View File

@ -164,6 +164,7 @@ static void nosigpipe(struct Curl_easy *data,
#define KEEPALIVE_FACTOR(x)
#endif
/* Offered by mingw-w64 and MS SDK. Latter only when targeting Win7+. */
#if defined(USE_WINSOCK) && !defined(SIO_KEEPALIVE_VALS)
#define SIO_KEEPALIVE_VALS _WSAIOW(IOC_VENDOR,4)
@ -1406,6 +1407,7 @@ static void cf_socket_adjust_pollset(struct Curl_cfilter *cf,
#ifdef USE_WINSOCK
/* Offered by mingw-w64 v13+. MS SDK 7.0A+. */
#ifndef SIO_IDEAL_SEND_BACKLOG_QUERY
#define SIO_IDEAL_SEND_BACKLOG_QUERY 0x4004747B
#endif

View File

@ -65,6 +65,7 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define SP_NAME_NEGOTIATE "Negotiate"
#define SP_NAME_KERBEROS "Kerberos"
/* Offered by mingw-w64 v9+. MS SDK 7.0A+. */
#ifndef ISC_REQ_USE_HTTP_STYLE
#define ISC_REQ_USE_HTTP_STYLE 0x01000000
#endif
@ -288,12 +289,15 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define SEC_E_KDC_CERT_REVOKED ((HRESULT)0x8009035BL)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_E_INVALID_PARAMETER
#define SEC_E_INVALID_PARAMETER ((HRESULT)0x8009035DL)
#endif
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_E_DELEGATION_POLICY
#define SEC_E_DELEGATION_POLICY ((HRESULT)0x8009035EL)
#endif
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_E_POLICY_NLTM_ONLY
#define SEC_E_POLICY_NLTM_ONLY ((HRESULT)0x8009035FL)
#endif
@ -324,6 +328,8 @@ extern PSecurityFunctionTable Curl_pSecFn;
#define SEC_I_NO_LSA_CONTEXT ((HRESULT)0x00090323L)
#endif
#endif /* __MINGW32CE__ */
/* Offered by mingw-w64 v8+. MS SDK 6.0A+. */
#ifndef SEC_I_SIGNATURE_NEEDED
#define SEC_I_SIGNATURE_NEEDED ((HRESULT)0x0009035CL)
#endif

View File

@ -55,6 +55,7 @@
# ifdef _MSC_VER
# pragma comment(lib, "bcrypt.lib")
# endif
/* Offered by mingw-w64 v3+. MS SDK v7.0A+. */
# ifndef BCRYPT_USE_SYSTEM_PREFERRED_RNG
# define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
# endif

View File

@ -191,6 +191,7 @@ struct sha256_ctx {
};
typedef struct sha256_ctx my_sha256_ctx;
/* Offered when targeting Vista (XP SP2+) */
#ifndef CALG_SHA_256
#define CALG_SHA_256 0x0000800c
#endif

View File

@ -734,7 +734,7 @@ struct connectdata {
/*************** Request - specific items ************/
#if defined(USE_WINDOWS_SSPI) && defined(SECPKG_ATTR_ENDPOINT_BINDINGS)
CtxtHandle *sslContext;
CtxtHandle *sslContext; /* mingw-w64 v9+. MS SDK 7.0A+. */
#endif
#ifdef USE_NTLM

View File

@ -117,6 +117,7 @@
* #define failf(x, y, ...) printf(y, __VA_ARGS__)
*/
/* Offered when targeting Vista (XP SP2+) */
#ifndef CALG_SHA_256
#define CALG_SHA_256 0x0000800c
#endif
@ -127,10 +128,12 @@
#define ALG_CLASS_DHASH ALG_CLASS_HASH
#endif
/* Offered by mingw-w64 v4+. MS SDK 6.0A+. */
#ifndef PKCS12_NO_PERSIST_KEY
#define PKCS12_NO_PERSIST_KEY 0x00008000
#endif
/* Offered by mingw-w64 v4+. MS SDK ~10+/~VS2017+. */
#ifndef CERT_FIND_HAS_PRIVATE_KEY
#define CERT_FIND_HAS_PRIVATE_KEY (21 << CERT_COMPARE_SHIFT)
#endif
@ -1672,7 +1675,7 @@ static CURLcode schannel_connect(struct Curl_cfilter *cf,
if(ssl_connect_done == connssl->connecting_state) {
connssl->state = ssl_connection_complete;
#ifdef SECPKG_ATTR_ENDPOINT_BINDINGS
#ifdef SECPKG_ATTR_ENDPOINT_BINDINGS /* mingw-w64 v9+. MS SDK 7.0A+. */
/* When SSPI is used in combination with Schannel
* we need the Schannel context to create the Schannel
* binding to pass the IIS extended protection checks.

View File

@ -34,6 +34,7 @@
#define HAS_MANUAL_VERIFY_API
#endif
/* These two macros are missing from mingw-w64 in UWP mode as of v13 */
#if defined(CryptStringToBinary) && defined(CRYPT_STRING_HEX) && \
!defined(DISABLE_SCHANNEL_CLIENT_CERT)
#define HAS_CLIENT_CERT_PATH
@ -50,6 +51,7 @@
#define CERT_STORE_PROV_SYSTEM_W ((LPCSTR)(size_t)10)
#endif
/* Offered by mingw-w64 v8+, MS SDK ~10+/~VS2022+ */
#ifndef SCH_CREDENTIALS_VERSION
#define SCH_CREDENTIALS_VERSION 0x00000005

View File

@ -94,7 +94,7 @@ struct cert_chain_engine_config_win8 {
DWORD dwExclusiveFlags;
};
/* Not defined before mingw-w64 4.0.0 */
/* Offered by mingw-w64 v4+. MS SDK ~10+/~VS2017+. */
#ifndef CERT_CHAIN_EXCLUSIVE_ENABLE_CA_FLAG
#define CERT_CHAIN_EXCLUSIVE_ENABLE_CA_FLAG 0x00000001
#endif