Ejemplo n.º 1
0
            /// <summary>
            /// Gets the system stores.
            /// </summary>
            /// <param name="flags">The Flags representing a System Stores Location.</param>
            /// <returns>An array of strings (never null).</returns>
            public string[] GetPhysicalStores()
            {
                tempPhysicalStoreList = new List<string>();
                var cb = new NativeMethods.CertEnumPhysicalStoreCallback(CertEnumPhysicalStoreCallback);
                bool ok = NativeMethods.CertEnumPhysicalStore(
                    systemStoreName,
                    CapiConstants.CERT_SYSTEM_STORE_CURRENT_USER,
                    IntPtr.Zero,
                    cb);

                string[] array = null;

                if (ok) array = tempPhysicalStoreList.ToArray();
                else array = new string[] { };

                tempPhysicalStoreList = null;
                return array;
            }
Ejemplo n.º 2
0
            /// <summary>
            /// Gets the system stores.
            /// </summary>
            /// <param name="flags">The Flags representing a System Stores Location.</param>
            /// <returns>An array of strings (never null).</returns>
            public string[] GetPhysicalStores()
            {
                tempPhysicalStoreList = new List <string>();
                var  cb = new NativeMethods.CertEnumPhysicalStoreCallback(CertEnumPhysicalStoreCallback);
                bool ok = NativeMethods.CertEnumPhysicalStore(
                    systemStoreName,
                    CapiConstants.CERT_SYSTEM_STORE_CURRENT_USER,
                    IntPtr.Zero,
                    cb);

                string[] array = null;

                if (ok)
                {
                    array = tempPhysicalStoreList.ToArray();
                }
                else
                {
                    array = new string[] { }
                };

                tempPhysicalStoreList = null;
                return(array);
            }