boostorg / winapi

Windows API declarations without <windows.h>, for internal Boost use.
62 stars 58 forks source link

Fix CryptReleaseContext signature for Windows 2000 (#11896) #37

Closed gjasny closed 7 years ago

gjasny commented 7 years ago

See #11896.

Lastique commented 7 years ago

The ticket says the problem is specific to VS2012, yet the preprocessor check does not reflect that.

Also, are you using Windows SDK that comes with the compiler?

gjasny commented 7 years ago

I does not have anything to do with VS version, just the _WIN32_WINNT setting matters. I created the simple test case with VS2013:

#define _WIN32_WINNT 0x0500
#include <windows.h>
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/uuid_generators.hpp> 

When I change the value from Win2000 / 0x0500 to XP / 0x0501 the error vanished. You can see in the Windows SDK that the function signature for CryptReleaseContext changes between 2000 and XP. So my patch just reflects that in the Boost winapi header as well.

Lastique commented 7 years ago

Should be fixed in https://github.com/boostorg/winapi/commit/d1ce3b2d3ff45f2958c43d0a8d4296995aca053d.

gjasny commented 7 years ago

Thank you for taking care. I guess you did not image going down that rabbit hole 👍