regSetDWORD function

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

Sets a Windows registry key to a string value of type REG_SZ.

A WindowsException is thrown the call falls.

Implementation

void regSetDWORD(
  int hkey,
  String subKey,
  String valueName,
  int value, {
  int accessRights = KEY_SET_VALUE,
}) {
  final pValue = calloc<Uint32>()..value = value;

  try {
    _regSetValue(
        hkey, subKey, valueName, pValue.cast(), sizeOf<Uint32>(), REG_DWORD,
        accessRights: accessRights);
  } finally {
    calloc.free(pValue);
  }
}