public static ICollection <string> GetStoreNames(StoreLocation location) { var callback = new CertEnumSystemStoreCallBackProto(CertEnumSystemStoreCallBack); var names = new List <string>(); CertificateSystemStoreLocation locationFlags; switch (location) { case StoreLocation.CurrentUser: locationFlags = CertificateSystemStoreLocation.CurrentUser; break; case StoreLocation.LocalMachine: locationFlags = CertificateSystemStoreLocation.LocalMachine; break; default: throw new ArgumentOutOfRangeException(nameof(location), location, null); } lock (StoreNamesSyncLock) { EnumeratedStoreNames.Clear(); CertEnumSystemStore(locationFlags, IntPtr.Zero, IntPtr.Zero, callback); names.AddRange(EnumeratedStoreNames); } return(names); }
bool CertEnumSystemStore(CertificateSystemStoreLocation dwFlags, IntPtr notUsed1, IntPtr notUsed2, CertEnumSystemStoreCallBackProto fn);
internal static extern bool CertEnumSystemStore(CertStoreFlags Flags, IntPtr notUsed1, IntPtr notUsed2, CertEnumSystemStoreCallBackProto fn);
bool CertEnumSystemStore(CertStoreFlags Flags, IntPtr notUsed1, IntPtr notUsed2, CertEnumSystemStoreCallBackProto fn);