CertOpenStore failing on SP

C

casey chesnut

This call works on the desktop and PocketPC emulators, but is failing on the
smartPhone emulator.
Anybody gotten it to work on the SP emulator?

//from a sample Alex F. put out long ago
[DllImport("crypt32", SetLastError=true)]
public static extern IntPtr CertOpenStore(IntPtr lpszStoreProvider, UInt32
dwMsgAndCertEncodingType, IntPtr hCryptProv, UInt32 dwFlags, string pvPara);

const int CERT_STORE_PROV_SYSTEM = 10;
const int CERT_SYSTEM_STORE_CURRENT_USER = 0x1 << 16;
IntPtr hStore = CertOpenStore((IntPtr)CERT_STORE_PROV_SYSTEM, 0,
IntPtr.Zero, CERT_SYSTEM_STORE_CURRENT_USER, "MY");
//hStore comes back 0 on SP, meaning a Certificate Store was not found

Thanks,
casey
 
A

Alex Feinman [MVP]

It worked on a freshly installed SP2003 emulator. What about eVC? Does it
work for you from there?
 
C

casey chesnut

Thanks Alex,
I just tried it on a different machine and it worked for me too!
Time to reinstall the other :)
casey

Alex Feinman said:
It worked on a freshly installed SP2003 emulator. What about eVC? Does it
work for you from there?

casey chesnut said:
This call works on the desktop and PocketPC emulators, but is failing on the
smartPhone emulator.
Anybody gotten it to work on the SP emulator?

//from a sample Alex F. put out long ago
[DllImport("crypt32", SetLastError=true)]
public static extern IntPtr CertOpenStore(IntPtr lpszStoreProvider, UInt32
dwMsgAndCertEncodingType, IntPtr hCryptProv, UInt32 dwFlags, string pvPara);

const int CERT_STORE_PROV_SYSTEM = 10;
const int CERT_SYSTEM_STORE_CURRENT_USER = 0x1 << 16;
IntPtr hStore = CertOpenStore((IntPtr)CERT_STORE_PROV_SYSTEM, 0,
IntPtr.Zero, CERT_SYSTEM_STORE_CURRENT_USER, "MY");
//hStore comes back 0 on SP, meaning a Certificate Store was not found

Thanks,
casey
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top