Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ SetEnvironmentVariableCore()

static void System.Environment.SetEnvironmentVariableCore ( string variable,
string value )
inlinestaticprivate

Definition at line 888 of file Environment.cs.

889 {
891 {
892 int lastPInvokeError = Marshal.GetLastPInvokeError();
893 switch (lastPInvokeError)
894 {
895 case 203:
896 break;
897 case 206:
898 throw new ArgumentException(SR.Argument_LongEnvVarValue);
899 case 8:
900 case 1450:
901 throw new OutOfMemoryException(Interop.Kernel32.GetMessage(lastPInvokeError));
902 default:
903 throw new ArgumentException(Interop.Kernel32.GetMessage(lastPInvokeError));
904 }
905 }
906 }
static bool SetEnvironmentVariable(string lpName, string lpValue)
static string GetMessage(int errorCode)
Definition Interop.cs:113

References System.SR.Argument_LongEnvVarValue, System.Runtime.InteropServices.Marshal.GetLastPInvokeError(), Interop.Kernel32.GetMessage(), Interop.Kernel32.SetEnvironmentVariable(), and System.value.

Referenced by System.Environment.SetEnvironmentVariable().