regSetExpandString function

void regSetExpandString(
  1. int hkey,
  2. String subKey,
  3. String valueName,
  4. String value, {
  5. int accessRights = KEY_SET_VALUE,
})

Sets the value of the hkey located at hkey/subKey in the Windows Registry. The value is set to type REG_EXPAND_SZ.

A WindowsException is thrown the call falls.

Implementation

void regSetExpandString(
  int hkey,
  String subKey,
  String valueName,
  String value, {
  int accessRights = KEY_SET_VALUE,
}) {
  final pValue = TEXT(value);
  try {
    _regSetValue(hkey, subKey, valueName, pValue.cast(), (value.length + 1) * 2,
        REG_EXPAND_SZ,
        accessRights: accessRights);
  } finally {
    calloc.free(pValue);
  }
}