I'm using libeay32.dll/ssleay32.dll library in my application for https support. Library is successfully loaded on Windows 7 (not by my application, by Qt library), however I'm getting SSL error on Windows 10.
I wrote a small application to ensure whether correct instance of library is loaded (not from PATH for example) and got interesting result.
Here's the code
HMODULE hSsleay = LoadLibrary("ssleay32.dll");
DWORD pathSize = GetModuleFileName(hSsleay, ssleayPath, pathSize);
if (pathSize) {
std::cout << "Module ssleay32.dll detected path = " << ssleayPath << '\n';
}
else {
std::cout << "Module ssleay32.dll detection error LastError = " << GetLastError() << '\n';
}
Output on Windows 7 x86 is
Module ssleay32.dll detected path = C:/Program Files/My Application/ssleay32.dll
However, on Windows 10 x64 it is
Module ssleay32.dll detected path = C:/Program Files (x86)/My Application/LibraryLocator.exe
Where LibraryLocator.exe is a name of a testing application, containing the code above
LoadLibrary
fails, callGetLastError
to find out why. This is explained in the documentation. I urge you to get in to the habit of reading it. – David Heffernan