Should you not be calling CryptAcquireContextW ?