Exemplo n.º 1
0
        public static IEnumerable <string> EnumerateSystemStoreLocations()
        {
            var      info   = new List <string>();
            GCHandle handle = GCHandle.Alloc(info);

            try
            {
                var callBack = new CertEnumSystemStoreLocationCallback(SystemStoreLocationCallback);
                Direct.CertEnumSystemStoreLocation(
                    dwFlags: 0,
                    pvArg: GCHandle.ToIntPtr(handle),
                    pfnEnum: callBack);
            }
            finally
            {
                handle.Free();
            }

            return(info);
        }
 public static extern bool CertEnumSystemStoreLocation(
     [In] uint dwFlags,
     [In] IntPtr pvArg,
     [In] CertEnumSystemStoreLocationCallback pfnEnum);
 public static extern bool CertEnumSystemStoreLocation(uint reserved,
                                                       IntPtr stateObject,
                                                       CertEnumSystemStoreLocationCallback callback);