Terraria v1.4.4.9
Terraria source code documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Macros

◆ SetValue()

void Internal.Win32.RegistryKey.SetValue ( string name,
string value )
inlinepackage

Definition at line 284 of file RegistryKey.cs.

285 {
286 if (value == null)
287 {
288 throw new ArgumentNullException("value");
289 }
290 if (name != null && name.Length > 16383)
291 {
292 throw new ArgumentException(SR.Arg_RegValStrLenBug, "name");
293 }
294 int num = Interop.Advapi32.RegSetValueEx(_hkey, name, 0, 1, value, checked(value.Length * 2 + 2));
295 if (num != 0)
296 {
297 Win32Error(num, null);
298 }
299 }
readonly SafeRegistryHandle _hkey
static void Win32Error(int errorCode, string str)
static int RegSetValueEx(SafeRegistryHandle hKey, string lpValueName, int Reserved, int dwType, string lpData, int cbData)
static string Arg_RegValStrLenBug
Definition SR.cs:392
Definition SR.cs:7

References Internal.Win32.RegistryKey._hkey, System.SR.Arg_RegValStrLenBug, Interop.Advapi32.RegSetValueEx(), System.value, and Internal.Win32.RegistryKey.Win32Error().

Referenced by System.Environment.SetEnvironmentVariableFromRegistry().