The MSDN documentation for CryptGetProvParam says
This function must not be used on a thread of a multithreaded program.
I'm hoping there is some set of conditions under which it can be used that way. Does anyone have any experience in this area and can tell me a work-around?
Thanks.
Some of the MSDN documentation is written by interns and the quality is not always great. They are clearly talking about issues related to calling this function from multiple threads at the same time, not just having multiple threads in the process.
If you look at some of the query values and how the API is designed it should be easy to spot the queries that cannot work with multiple threads. Anything that uses CRYPT_FIRST
/NEXT
(PP_*ENUM*
) will have to rely on some internal state to remember "where it is". These queries have the thread warning in their description as well.
This does not mean that the other queries are thread safe but I would imagine that they are. You could debug the functions but things might change over time/versions and parts of the crypto system is extensible as well so you can never truly know without official information from Microsoft. You can add feedback to the MSDN page and hope that they update it.