On 02.11.2016 23:11, Donat Enikeev wrote:
Hi Jacek,
Regarding thread safe part, to use CreateSemaphore instead of CreateMutex
After a deeper thinking and code/wiki reading, it would be better to get some clarify first, I believe, probably I missed something on the way.
I meant a race like this: 1. process 1 calls CRYPT_ImportSystemRootCertsToReg, creates a mutex and starts to process system certs 2. process 2 calls CRYPT_ImportSystemRootCertsToReg, mutex exists so reads certs from registry which is empty at this point 3. process 1 writes to registry
See [1] for an example how this may be handled.
Thanks, Jacek
[1] http://source.winehq.org/git/wine.git/blob/cc361eefcef4e1fe0f15ecbf1aae65bcd...