220 references to SafeNativeMethods
WsatUI (220)
Configuration\CertificateManager.cs (20)
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, 77int ret = SafeNativeMethods.RegConnectRegistry( 81if (ret != SafeNativeMethods.ERROR_SUCCESS) 86ret = SafeNativeMethods.RegOpenKeyEx( 90SafeNativeMethods.KEY_READ, 92if (ret != SafeNativeMethods.ERROR_SUCCESS) 97storeHandle = SafeNativeMethods.CertOpenStore_ptr( 98SafeNativeMethods.CERT_STORE_PROV_REG, 100SafeNativeMethods.CERT_REGISTRY_STORE_REMOTE_FLAG | 101SafeNativeMethods.CERT_STORE_READONLY_FLAG | 102SafeNativeMethods.CERT_STORE_OPEN_EXISTING_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\ETWSafeNativeMethods.cs (8)
74[MarshalAs(UnmanagedType.ByValArray, SizeConst = SafeNativeMethods.MaxTraceLoggerNameLen)] 76[MarshalAs(UnmanagedType.ByValArray, SizeConst = SafeNativeMethods.MaxTraceFileNameLen)] 109Tail.LoggerName = new char[SafeNativeMethods.MaxTraceLoggerNameLen]; 110Tail.LogFileName = new char[SafeNativeMethods.MaxTraceFileNameLen]; 115if (loggerNameChars.Length < SafeNativeMethods.MaxTraceLoggerNameLen) 121Array.Copy(loggerNameChars, 0, Tail.LoggerName, 0, SafeNativeMethods.MaxTraceLoggerNameLen - 1); 128if (logFileNameChars.Length < SafeNativeMethods.MaxTraceFileNameLen) 134Array.Copy(logFileNameChars, 0, Tail.LogFileName, 0, SafeNativeMethods.MaxTraceFileNameLen - 1);
Configuration\ETWWsatTraceSession.cs (24)
34uint err = SafeNativeMethods.FlushTrace(0, WsatTraceSessionName, ref properties); 36if (err != SafeNativeMethods.ERROR_SUCCESS) 38if (err == SafeNativeMethods.ERROR_ACCESS_DENIED) 65uint err = SafeNativeMethods.EnableTrace(0, 0, 0, ref providerGuid, sessionHandle); 67if (err == SafeNativeMethods.ERROR_SUCCESS) 70err = SafeNativeMethods.StopTrace(0, WsatTraceSessionName, ref properties); 74if (err != SafeNativeMethods.ERROR_SUCCESS || IsSessionExist()) 76if (err == SafeNativeMethods.ERROR_ACCESS_DENIED) 95uint err = SafeNativeMethods.QueryTrace(0, WsatTraceSessionName, ref properties); 97if (err == SafeNativeMethods.ERROR_SUCCESS) 184if (logFileName.Length >= SafeNativeMethods.MaxTraceFileNameLen) 249properties.Head.Wnode.Flags = SafeNativeMethods.WNODE_FLAG_TRACED_GUID; 253properties.Head.LogFileMode = SafeNativeMethods.EVENT_TRACE_FILE_MODE_CIRCULAR | SafeNativeMethods.EVENT_TRACE_USE_PAGED_MEMORY; 257uint err = SafeNativeMethods.StartTrace(out sessionHandle, WsatTraceSessionName, ref properties); 259if (err != SafeNativeMethods.ERROR_SUCCESS) 263case SafeNativeMethods.ERROR_BAD_PATHNAME: 266case SafeNativeMethods.ERROR_DISK_FULL: 269case SafeNativeMethods.ERROR_FILE_NOT_FOUND: 272case SafeNativeMethods.ERROR_PATH_NOT_FOUND: 282err = SafeNativeMethods.EnableTrace(1, 0, 0, ref providerGuid, sessionHandle); 284if (err != SafeNativeMethods.ERROR_SUCCESS) 288SafeNativeMethods.StopTrace(0, WsatTraceSessionName, ref properties2); 290if (err == SafeNativeMethods.ERROR_ACCESS_DENIED)
Configuration\MsdtcClusterUtils.cs (32)
26SafeHCluster hCluster = SafeNativeMethods.OpenCluster(Utilities.IsLocalMachineName(machineName) ? null : machineName); 41SafeHCluster hCluster = SafeNativeMethods.OpenCluster(Utilities.IsLocalMachineName(machineName) ? null : machineName); 50SafeHClusEnum hEnum = SafeNativeMethods.ClusterOpenEnum(hCluster, ClusterEnum.Resource); 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 (5)
22IntPtr pointer = SafeNativeMethods.LocalAlloc(SafeNativeMethods.LMEM_ZEROINIT, size); 33IntPtr pointer = SafeNativeMethods.LocalAlloc(SafeNativeMethods.LMEM_ZEROINIT, Marshal.SizeOf(source)); 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)
MMCUI\ACLWrapper.cs (1)
26int result = SafeNativeMethods.EditSecurity(hwndOwner, psi);
MMCUI\SafePropertyPage.cs (2)
21SetHandle(SafeNativeMethods.CreatePropertySheetPage(ref psp)); 26return SafeNativeMethods.DestroyPropertySheetPage(handle);
MMCUI\WSATControl.cs (6)
212SafeNativeMethods.SendMessage(propSheetDialog, PSM.CHANGED, propPage, IntPtr.Zero); 316SafeCertificateContext certContext = SafeNativeMethods.CryptUIDlgSelectCertificateFromStore( 321SafeNativeMethods.CRYPTUI_SELECT_LOCATION_COLUMN, 363crt = SafeNativeMethods.CertFindCertificateInStore( 365SafeNativeMethods.X509_ASN_ENCODING, 367SafeNativeMethods.CERT_FIND_ANY,
MMCUI\WSATPropertySheet.cs (12)
155stg.unionmember = SafeNativeMethods.GlobalAlloc(SafeNativeMethods.GMEM_SHARE, 255); 175SafeNativeMethods.ReleaseStgMedium(ref stg); 232SafeNativeMethods.DWL_MSGRESULT, 245SafeNativeMethods.DWL_MSGRESULT, 267IntPtr parent = SafeNativeMethods.GetParent(windowUnmanagedParent); 276SafeNativeMethods.SetParent(wsatControl.Handle, this.windowUnmanagedParent); 302header.hwndFrom != SafeNativeMethods.GetParent(windowUnmanagedParent)) 332result = SafeNativeMethods.SetWindowLongPtr(hWnd, nIndex, dwNewLong); 338int intResult = SafeNativeMethods.SetWindowLong(hWnd, nIndex, (int)dwNewLong); 348result = SafeNativeMethods.SetWindowLongPtr(hWnd, nIndex, dwNewLong); 353int intResult = SafeNativeMethods.SetWindowLong(hWnd, nIndex, (int)dwNewLong);
MMCUI\WsatSecurityModel.cs (4)
93SafeNativeMethods.MapGenericMask(out generic.Mask, ref ServiceGenericMapping); 112bool ret = SafeNativeMethods.ConvertSecurityDescriptorToStringSecurityDescriptorW( 127SafeNativeMethods.LocalFree(pszSD); 196bool ret = SafeNativeMethods.ConvertStringSecurityDescriptorToSecurityDescriptor(