149 references to SafeNativeMethods
WsatConfig (149)
Configuration\CertificateManager.cs (10)
36int ret = SafeNativeMethods.RegOpenKeyEx( 40SafeNativeMethods.KEY_READ, 42if (ret != SafeNativeMethods.ERROR_SUCCESS) 47storeHandle = SafeNativeMethods.CertOpenStore_ptr( 48SafeNativeMethods.CERT_STORE_PROV_REG, 51SafeNativeMethods.CERT_STORE_OPEN_EXISTING_FLAG | 52SafeNativeMethods.CERT_STORE_READONLY_FLAG, 223current = SafeNativeMethods.CertFindCertificateInStore( 225SafeNativeMethods.X509_ASN_ENCODING, 227SafeNativeMethods.CERT_FIND_ANY,
Configuration\ClusterRegistryConfigurationProvider.cs (19)
32SafeHKey rootKey = SafeNativeMethods.GetClusterResourceKey(hResource, 51int ret = SafeNativeMethods.ClusterRegCreateKey(rootKey, 53SafeNativeMethods.REG_OPTION_NON_VOLATILE, 58if (ret != SafeNativeMethods.ERROR_SUCCESS) 89int ret = SafeNativeMethods.ClusterRegCreateKey(hKey, 91SafeNativeMethods.REG_OPTION_NON_VOLATILE, 96if (ret != SafeNativeMethods.ERROR_SUCCESS) 113int ret = SafeNativeMethods.ClusterRegQueryValue(this.hKey, 119if (ret == SafeNativeMethods.ERROR_SUCCESS || ret == SafeNativeMethods.ERROR_MORE_DATA) 127ret = SafeNativeMethods.ClusterRegQueryValue(this.hKey, 132if (ret == SafeNativeMethods.ERROR_SUCCESS) 150int ret = SafeNativeMethods.ClusterRegSetValue(this.hKey, 155if (ret == SafeNativeMethods.ERROR_SUCCESS) 301ret = SafeNativeMethods.ClusterRegGetKeySecurity(hKey, SecurityInfos.DiscretionaryAcl, binarySecurityDescriptor, ref dwSize); 302if (ret == SafeNativeMethods.ERROR_SUCCESS) 306else if (ret == SafeNativeMethods.ERROR_INSUFFICIENT_BUFFER) 358ret = SafeNativeMethods.ClusterRegSetKeySecurity(hKey, SecurityInfos.DiscretionaryAcl, newBinarySecurityDescriptor); 359if (ret != SafeNativeMethods.ERROR_SUCCESS)
Configuration\ClusterSafeNativeMethods.cs (6)
36[DllImport(SafeNativeMethods.ClusApi)] 48[DllImport(SafeNativeMethods.ClusApi)] 60[DllImport(SafeNativeMethods.ClusApi)] 66return ClusterCloseEnum(handle) == SafeNativeMethods.ERROR_SUCCESS; 72[DllImport(SafeNativeMethods.ClusApi)] 78return ClusterRegCloseKey(handle) == SafeNativeMethods.ERROR_SUCCESS;
Configuration\MsdtcClusterUtils.cs (30)
26SafeHCluster hCluster = SafeNativeMethods.OpenCluster(Utilities.IsLocalMachineName(machineName) ? null : machineName); 91SafeHCluster hCluster = SafeNativeMethods.OpenCluster(null); 108SafeHClusEnum hEnum = SafeNativeMethods.ClusterOpenEnum(hCluster, ClusterEnum.Resource); 151int ret = SafeNativeMethods.GetClusterInformation( 156if (ret != SafeNativeMethods.ERROR_SUCCESS || ret == SafeNativeMethods.ERROR_MORE_DATA) 158if (ret == SafeNativeMethods.ERROR_MORE_DATA) 161ret = SafeNativeMethods.GetClusterInformation( 166if (ret != SafeNativeMethods.ERROR_SUCCESS) 204if (SafeNativeMethods.GetClusterResourceNetworkName(hResource, sb, ref cch)) 222uint ret = SafeNativeMethods.ClusterEnum(hEnum, index, out type, null, ref cch); 223if (ret == SafeNativeMethods.ERROR_NO_MORE_ITEMS) 227else if (ret == SafeNativeMethods.ERROR_SUCCESS || ret == SafeNativeMethods.ERROR_MORE_DATA) 230ret = SafeNativeMethods.ClusterEnum(hEnum, index, out type, sb, ref cch); 232if (ret == SafeNativeMethods.ERROR_SUCCESS) 237hResource = SafeNativeMethods.OpenClusterResource(hCluster, resourceName); 255SafeHClusEnum hEnum = SafeNativeMethods.ClusterOpenEnum(hCluster, ClusterEnum.Node); 269ret = SafeNativeMethods.ClusterEnum(hEnum, index, out type, null, ref cch); 270if (ret == SafeNativeMethods.ERROR_NO_MORE_ITEMS) 274else if (ret == SafeNativeMethods.ERROR_SUCCESS || ret == SafeNativeMethods.ERROR_MORE_DATA) 277ret = SafeNativeMethods.ClusterEnum(hEnum, index, out type, sb, ref cch); 278if (ret == SafeNativeMethods.ERROR_SUCCESS) 285} while (ret == SafeNativeMethods.ERROR_SUCCESS); 295uint ret = SafeNativeMethods.ClusterResourceControl(hResource, 304if (ret == SafeNativeMethods.ERROR_SUCCESS || ret == SafeNativeMethods.ERROR_MORE_DATA) 307ret = SafeNativeMethods.ClusterResourceControl(hResource, 316if (ret == SafeNativeMethods.ERROR_SUCCESS)
Configuration\MsdtcWrapper.cs (7)
80SafeNativeMethods.OLE_TM_CONFIG_PARAMS_V2 configParams = new SafeNativeMethods.OLE_TM_CONFIG_PARAMS_V2(); 81configParams.dwVersion = SafeNativeMethods.OLE_TM_CONFIG_VERSION_2; 84hr = SafeNativeMethods.DtcGetTransactionManagerEx_WithConfigParams( 88SafeNativeMethods.OLE_TM_FLAG_NONE, 94hr = SafeNativeMethods.DtcGetTransactionManagerEx( 98SafeNativeMethods.OLE_TM_FLAG_NONE,
Configuration\QfeChecker.cs (8)
27int hr = SafeNativeMethods.CoInitializeEx(IntPtr.Zero, SafeNativeMethods.COINIT_APARTMENTTHREADED); 34hr = SafeNativeMethods.CoGetClassObject(new Guid(CLSID_CGatewayProtocol), 35SafeNativeMethods.CLSCTX.CLSCTX_INPROC_SERVER, 51SafeNativeMethods.CoUninitialize(); 67int ret = SafeNativeMethods.RegOpenKeyEx( 71SafeNativeMethods.KEY_WOW64_64KEY | SafeNativeMethods.KEY_QUERY_VALUE,
Configuration\SafeCertificateContext.cs (1)
32int r = SafeNativeMethods.CertFreeCertificateContext(handle);
Configuration\SafeCertificateStore.cs (1)
35return SafeNativeMethods.CertCloseStore(handle, 0);
Configuration\SafeLocalAllocation.cs (3)
22IntPtr pointer = SafeNativeMethods.LocalAlloc(SafeNativeMethods.LMEM_ZEROINIT, size); 55IntPtr r = SafeNativeMethods.LocalFree(handle);
Configuration\SafeRegistryKey.cs (1)
30int r = SafeNativeMethods.RegCloseKey(handle);
Configuration\Utilities.cs (15)
50int hr = SafeNativeMethods.NetWkstaGetInfo( 55if (hr == SafeNativeMethods.NERR_Success && workstationPtr != IntPtr.Zero) 59SafeNativeMethods.WKSTA_INFO_100 workstationInfo = (SafeNativeMethods.WKSTA_INFO_100)Marshal.PtrToStructure(workstationPtr, typeof(SafeNativeMethods.WKSTA_INFO_100)); 65hr = SafeNativeMethods.NetApiBufferFree(workstationPtr); 158IntPtr comResDll = SafeNativeMethods.LoadLibrary(comResDllName); 167len = SafeNativeMethods.LoadString(comResDll, IDS_MYCOMPUTER, sb, size); 176SafeNativeMethods.FreeLibrary(comResDll); 201int retCode = SafeNativeMethods.NoError; 205retCode = SafeNativeMethods.HttpInitialize(new HttpApiVersion(1, 0), SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 206SafeNativeMethods.HttpTerminate(SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 207if (retCode != SafeNativeMethods.NoError)
Configuration\WsatServiceAddress.cs (23)
43int retVal = SafeNativeMethods.NoError; 47retVal = SafeNativeMethods.HttpInitialize(HttpWrapper.HttpApiVersion1, SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 49if (SafeNativeMethods.NoError == retVal) 60retVal = SafeNativeMethods.HttpSetServiceConfiguration_UrlAcl(IntPtr.Zero, 66if (SafeNativeMethods.ErrorAlreadyExists == retVal) 68retVal = SafeNativeMethods.HttpDeleteServiceConfiguration_UrlAcl(IntPtr.Zero, 74if (SafeNativeMethods.NoError == retVal) 76retVal = SafeNativeMethods.HttpSetServiceConfiguration_UrlAcl(IntPtr.Zero, 87SafeNativeMethods.HttpTerminate(SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 90if (SafeNativeMethods.NoError != retVal) 92if (SafeNativeMethods.ErrorAlreadyExists == retVal) 108int retVal = SafeNativeMethods.NoError; 111retVal = SafeNativeMethods.HttpInitialize(HttpWrapper.HttpApiVersion1, SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 112if (SafeNativeMethods.NoError == retVal) 123retVal = SafeNativeMethods.HttpDeleteServiceConfiguration_UrlAcl(IntPtr.Zero, 132SafeNativeMethods.HttpTerminate(SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 135if (retVal != SafeNativeMethods.NoError && retVal != SafeNativeMethods.FileNotFound && retVal != SafeNativeMethods.ErrorInvalidParameter)
Configuration\WsatServiceCertificate.cs (25)
43int retVal = SafeNativeMethods.NoError; 48retVal = SafeNativeMethods.HttpInitialize(HttpWrapper.HttpApiVersion1, SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 49if (SafeNativeMethods.NoError == retVal) 57sslConf.ParamDesc.DefaultFlags = SafeNativeMethods.HTTP_SERVICE_CONFIG_SSL_FLAG_NEGOTIATE_CLIENT_CERT; 68retVal = SafeNativeMethods.HttpSetServiceConfiguration_Ssl(IntPtr.Zero, 72if (SafeNativeMethods.ErrorAlreadyExists == retVal) 74retVal = SafeNativeMethods.HttpDeleteServiceConfiguration_Ssl(IntPtr.Zero, 80if (SafeNativeMethods.NoError == retVal) 82retVal = SafeNativeMethods.HttpSetServiceConfiguration_Ssl(IntPtr.Zero, 100SafeNativeMethods.HttpTerminate(SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 103if (SafeNativeMethods.NoError != retVal) 105if (SafeNativeMethods.ErrorAlreadyExists == retVal) 120int retVal = SafeNativeMethods.NoError; 125retVal = SafeNativeMethods.HttpInitialize(HttpWrapper.HttpApiVersion1, SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 126if (SafeNativeMethods.NoError == retVal) 134sslConf.ParamDesc.DefaultFlags = SafeNativeMethods.HTTP_SERVICE_CONFIG_SSL_FLAG_NEGOTIATE_CLIENT_CERT; 144retVal = SafeNativeMethods.HttpDeleteServiceConfiguration_Ssl(IntPtr.Zero, 159SafeNativeMethods.HttpTerminate(SafeNativeMethods.HTTP_INITIALIZE_CONFIG, IntPtr.Zero); 162if (retVal != SafeNativeMethods.NoError && retVal != SafeNativeMethods.FileNotFound && retVal != SafeNativeMethods.ErrorInvalidParameter)