ComAdminWrapper.cs (7)
280if (SafeNativeMethods.ERROR_SUCCESS == RegistryHandle.TryGetCorrectBitnessHKLMSubkey(is64bit, Wcf30RegistryKey, out regkey))
304ICreateTypeLib typelib = SafeNativeMethods.CreateTypeLib(fileName);
670if (SafeNativeMethods.ERROR_SUCCESS == SafeNativeMethods.CLRCreateInstance(CLSID_CLRMetaHost, typeof(IClrMetaHost).GUID, out pCLRMetaHost))
680while (SafeNativeMethods.ERROR_SUCCESS == enumUnknownPtr.Next(1, pUnk, out pceltFetched) && !isRuntimeVersionDetermined)
738isFrameworkVersionSet = (SafeNativeMethods.ERROR_SUCCESS == SafeNativeMethods.GetRequestedRuntimeVersionForCLSID(classInfo.Clsid, version, versionStrSize, ref length, 0));
SafeNativeMethods.cs (57)
41int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, @"Software\Classes", 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE, out regHandle);
42if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
53int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, @"Software\Classes", 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE | SafeNativeMethods.KEY_WOW64_64KEY, out regHandle);
54if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
64int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, @"Software\Classes", 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE | SafeNativeMethods.KEY_WOW64_32KEY, out regHandle);
65if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
109return SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE, out regHandle);
111return SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE | SafeNativeMethods.KEY_WOW64_64KEY, out regHandle);
113return SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE | SafeNativeMethods.KEY_WOW64_32KEY, out regHandle);
115return SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE, out regHandle);
123int samDesired = SafeNativeMethods.KEY_READ;
126samDesired = samDesired | SafeNativeMethods.KEY_WRITE;
128int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, samDesired, out regHandle);
129if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
140int samDesired = SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WOW64_64KEY;
143samDesired = samDesired | SafeNativeMethods.KEY_WRITE;
145int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, samDesired, out regHandle);
146if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
156int samDesired = SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WOW64_32KEY;
159samDesired = samDesired | SafeNativeMethods.KEY_WRITE;
161int status = SafeNativeMethods.RegOpenKeyEx(HKEY_LOCAL_MACHINE, key, 0, samDesired, out regHandle);
162if (status != SafeNativeMethods.ERROR_SUCCESS || null == regHandle || regHandle.IsInvalid)
186int status = SafeNativeMethods.RegDeleteKey(this, key);
187if (status == SafeNativeMethods.ERROR_SUCCESS)
197int status = SafeNativeMethods.RegCreateKeyEx(this, subKey, 0, null, 0, SafeNativeMethods.KEY_READ | SafeNativeMethods.KEY_WRITE, IntPtr.Zero, out regHandle, out disposition);
198if (status != SafeNativeMethods.ERROR_SUCCESS || regHandle == null || regHandle.IsInvalid)
205int status = SafeNativeMethods.RegSetValueEx(this, valName, 0, SafeNativeMethods.REG_SZ, value, (value.Length * 2) + 2);
206if (status != SafeNativeMethods.ERROR_SUCCESS)
214int ret = SafeNativeMethods.RegQueryValueEx(this, valName, null, ref type, (byte[])null, ref datasize);
215if (ret == SafeNativeMethods.ERROR_SUCCESS)
216if (type == SafeNativeMethods.REG_SZ)
219ret = SafeNativeMethods.RegQueryValueEx(this, valName, null, ref type, (byte[])blob, ref datasize);
228if (SafeNativeMethods.RegCloseKey(handle) == SafeNativeMethods.ERROR_SUCCESS)