internal SystemEnvironmentValue(string name, byte[] value, OptionalInt32 attributes, OptionalGuid vendor_guid)
 {
     Name       = name;
     Value      = value;
     Attributes = (SystemEnvironmentValueAttribute)attributes.Value;
     VendorGuid = vendor_guid.Value;
 }
        internal SystemEnvironmentValue(SafeStructureInOutBuffer <SystemEnvironmentValueNameAndValue> buffer)
        {
            SystemEnvironmentValueNameAndValue value = buffer.Result;

            Name       = buffer.Data.ReadNulTerminatedUnicodeString();
            Value      = buffer.ReadBytes((ulong)value.ValueOffset, value.ValueLength);
            Attributes = value.Attributes;
            VendorGuid = value.VendorGuid;
        }
Example #3
0
 /// <summary>
 /// Set a system environment variable.
 /// </summary>
 /// <param name="name">The name of the variable.</param>
 /// <param name="vendor_guid">The vendor GUID</param>
 /// <param name="value">The value to set</param>
 /// <param name="attributes">Attributes of the value</param>
 public static void SetSystemEnvironmentValue(string name, Guid vendor_guid, string value, SystemEnvironmentValueAttribute attributes)
 {
     SetSystemEnvironmentValue(name, vendor_guid, value, (int)attributes);
 }