CryptProtectMemory and Windows XP

Jan 5, 2015 at 11:34 AM
Hello everyone,

I wonder if anyone has successfully managed to run a windows desktop app using the C++ rest api on Windows XP. I have built both version 2.3.0 and 2.4.0 and for both versions the cpprest110?xp_2?.dll is linking against CryptProtectMemory/CryptUnrotectMemory APIs from crypt32.dll, which is only available on Server 2003 on and later, but not XP x86. Since crypt32.dll is not delayloaded by the cpprest110?xp_2?.dll, any application of mine (and the BingRequest110.xp sample) refuse to run on XP x86. What am I doing wrong?

Regards,

Stefan
Jan 5, 2015 at 12:27 PM
Hello everyone,

it seems like the only thing to do is to add crypt32.dll to the delayload linker section and all of a sudden things seem to work. I did this for the VS2012 project file for the 2.4.0 release of the c++ rest api and everything seems to work now. I will file a bug for this.

Stefan
Jan 5, 2015 at 12:34 PM
Added this as issue Id #334, is this the right place to file a bug?
Jan 5, 2015 at 5:23 PM
Hi Stefan,

Yes are correct. This is a regression, we can't use the Crypto APIs on XP. Yes you filed the bug in the correct place, I'll investigate what the best option for fixing is. We started using ProtectMemory and UnprotectMemory for encrypting any passwords provided to the http_client_config in memory. On XP we will have to keep in plaintext or do something else.

Steve
Jan 8, 2015 at 1:51 AM
FYI this bug has been fixed now in the development branch. If you want to target XP you can build from source there until the next release 2.5.0.

Steve