I have been work开发者_运维问答ing on a file system filter for the past two weeks and I have come across an interesting issue. I basically built the encoding/decoding implementation in an app that runs on the OS startup in Platform Builder first to verify that it works and for debugging purposes. This app works fine and is able to acquire a context ,generate keys , encrypt /decrypt without issue.
When I try to do the same thing on filesys dll load (this is the point at which file system filters are loaded in my understanding), no CSP services seem available to my file system filter. CryptAcquireContext fails with NTE_BAD_KEYSET or when I attempt to use the default provider, it fails with NTE_PROV_TYPE_NOT_DEF.
In frustration I wrote some code to enumerate all the providers available at that time and it turns out there arent any when filesys is loaded, wondering if anyone has any experience or ideas that can help. I have officially run out of ideas.
Cheers Bernard
精彩评论