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