public IntPtr GetFirstCert(CertificateFilterInfo filter) { this.filterHandle = null; if (X509NativeStore.fIsWin8AndAbove && filter != null) { IntPtr zero = IntPtr.Zero; this.filterHandle = new CertificateFilterHandle(); int num = NativeMethods.CCFindCertificateBuildFilter(filter.FilterString, ref zero); if (num == 0) { this.filterHandle.Handle = zero; } else { this.filterHandle = null; throw new Win32Exception(num); } } return(this.GetNextCert(IntPtr.Zero)); }
public IntPtr GetFirstCert( CertificateFilterInfo filter) { _filterHandle = null; if (DownLevelHelper.NativeFilteringSupported() && filter != null) { IntPtr hFilter = IntPtr.Zero; _filterHandle = new CertificateFilterHandle(); int hr = Security.NativeMethods.CCFindCertificateBuildFilter( filter.FilterString, ref hFilter); if (hr != Security.NativeConstants.S_OK) { _filterHandle = null; throw new System.ComponentModel.Win32Exception(hr); } _filterHandle.Handle = hFilter; } return GetNextCert(IntPtr.Zero); }
public IntPtr GetFirstCert(CertificateFilterInfo filter) { this.filterHandle = null; if (X509NativeStore.fIsWin8AndAbove && filter != null) { IntPtr zero = IntPtr.Zero; this.filterHandle = new CertificateFilterHandle(); int num = NativeMethods.CCFindCertificateBuildFilter(filter.FilterString, ref zero); if (num == 0) { this.filterHandle.Handle = zero; } else { this.filterHandle = null; throw new Win32Exception(num); } } return this.GetNextCert(IntPtr.Zero); }