Hi,

I am logged into Windows as User A and running a service under Local System
account. This service is trying to find a certificate that is in the user
store (not the local machine store). To search for the certificate, I assume
I have to impersonate the user (User A) programmatically. The impersonation
functions are returning successfully and I am able to find the certificate.

However, the problem is that although the impersonation functions are
working, they do not load the registry hive for User A. So if I am logged in
to Windows as User B (or even logged out), the certificate searching fails.

How can I programmatically load the registry hive for a specific user?

Thanks,
Mat.