When I execute CryptFindLocalizedName more than once from my .Net code, it returns with invalid information. The first call is accurate, but any calls to subsequences using the same string return bad data. I am not an expert on using Win32 api in C #, so I could do something wrong.
Here is my code ...
[DllImport("cryp32.dll", CharSet = CharSet.Auto]
public static extern string CryptFindLocalizedName(
[In] string pwszCryptName
);
public static void Test()
{
Console.WriteLine(CryptFindLocalizedName("My"));
Console.WriteLine(CryptFindLocalizedName("My"));
}
I am trying to return friendly names to certificate stores.
What am I doing wrong?
GeneS source
share