Skip to content
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

incorrectly detecting if bcrypt is available #287

Open
malytomas opened this issue Jul 5, 2023 · 3 comments · May be fixed by #296
Open

incorrectly detecting if bcrypt is available #287

malytomas opened this issue Jul 5, 2023 · 3 comments · May be fixed by #296

Comments

@malytomas
Copy link

In

check_symbol_exists(BCryptEncrypt windows.h BCRYPT_AVAILABLE)

the test for bcrypt is incorrect.

Bcrypt functions are in bcrypt.h, not in windows.h.
(the actual include in the code is correct, just the test in cmake is wrong.)

I got that response here: https://stackoverflow.com/questions/76620272/missing-bcrypt-in-github-actions-windows-2019/76624127#76624127

@zpostfacto
Copy link
Contributor

LoL, for me it works as is, but when I change windows.h to bcrypt.h, it doesn't work.

I suspect it has something to do with the version of the compiler or Windows platform SDK. I've got this, what do you have?

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\ATLMFC\include;
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.29.30133\include;
C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared;
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um;
C:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt;
C:\Program Files (x86)\Windows Kits\10\include\10.0.1;

@malytomas
Copy link
Author

You are right - it does not help :(
I have made some attempts and updated the question on stack overflow.

@malytomas
Copy link
Author

this works for me on my developer machine, as well as on windows-2022 and windows-2019 github actions runners:

try_compile(bcryptAvailable "${CMAKE_CURRENT_BINARY_DIR}/tryCompile" SOURCES "${CMAKE_CURRENT_LIST_DIR}/tryCompileBcrypt.cpp" OUTPUT_VARIABLE bcryptMessages)
message(STATUS "bcryptAvailable: ${bcryptAvailable}")

tryCompileBcrypt.cpp:

#include <Windows.h>
#include <bcrypt.h>
#include <cstdio>
#pragma comment(lib, "bcrypt.lib")

int main(int, char **)
{
	printf("%p\n", &BCryptEncrypt);
}

please try this in your usecase (xbox?). ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants