curl / curl-for-win

Reproducible curl binaries for Linux, macOS and Windows
https://curl.se/windows/
MIT License
694 stars 207 forks source link

Entry Point Not Found: AcquireSRWLockExclusive (KERNEL32.DLL) #32

Closed Fierelier closed 2 years ago

Fierelier commented 2 years ago

I did this

I downloaded the newest build from https://curl.se/windows/, and ran the exe. I received the following error: The procedure entry point AcquireSRWLockExclusive could not be located in the dynamic link library KERNEL32.dll. I suspect the latest version caused this.

curl/libcurl version

curl-7.81.0-win32-mingw

operating system

Windows XP Professional Service Pack 3 (5.1.2600)

jay commented 2 years ago

Windows XP Professional Service Pack 3 (5.1.2600)

curl for windows official build is built using MSYS2 which requires the minimum OS to be Vista I think.

/cc @vszakats

vszakats commented 2 years ago

The missing reference comes from OpenSSL 3.x, so the live build environment [Linux mingw-w64/clang cross-toolchain] isn't relevant here: https://github.com/openssl/openssl/blob/b3242ca622ef3da34ebb7b78b1f82cd5f0b516e7/crypto/threads_win.c#L76 It's referenced if _WIN32_WINNT >= 0x600 (= Vista or above).

curl-for-win does not override _WIN32_WINNT, and the toolchain / respective package defaults are used. Apparently these are not Windows XP compatible anymore.

One possible solution is to override the default with -D_WIN32_WINNT=0x0501 for x86 builds, another one is to build curl-for-win with Schannel support only. It may also be fixed/mitigated in OpenSSL.

vszakats commented 2 years ago

Can someone confirm if this test build works on various x86 Windows systems (XP included)?: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/43171473/artifacts

It includes this patch: https://github.com/curl/curl-for-win/commit/31885631449debfb6a91bbf9c61f89687de6d22d

Fierelier commented 2 years ago

I did curl https://curl.se, with success, on the following systems:

Fierelier commented 2 years ago

I did the same test on Windows 10 Home 21H2 (19044.1288) 64-bit with success. I'll do the same with W11 as well.

Fierelier commented 2 years ago

Actually, I'm burnt-out as-is with installing W10, I reckon it oughta run on W11.

vszakats commented 2 years ago

Thank you @Fierelier, I think this is fine for now. I'm more worried of future fallouts due to stepping off the default build path; so pushing this patch on an experimental note.