Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: return value of CertOpenStore #1386

Open
drauch opened this issue Mar 11, 2025 · 0 comments
Open

Question: return value of CertOpenStore #1386

drauch opened this issue Mar 11, 2025 · 0 comments

Comments

@drauch
Copy link

drauch commented Mar 11, 2025

According to the Microsoft Docs CertOpenStore returns NULL if it fails. Using CsWin32 the return type of CertOpenStore is "HCERTSTORE", which is a value type, which is never null.

How can I properly test for failure?

// Option 1:
if(returnValue == default)

// Option 2:
if(returnValue.Value == null)

Best regards,
D.R.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant