SetFirmwareEnvironmentVariableEx function kernel32

Win32Result<bool> SetFirmwareEnvironmentVariableEx(
  1. PCWSTR lpName,
  2. PCWSTR lpGuid,
  3. Pointer<NativeType>? pValue,
  4. int nSize,
  5. int dwAttributes,
)

Sets the value of the specified firmware environment variable and the attributes that indicate how this variable is stored and maintained.

To learn more, see learn.microsoft.com/windows/win32/api/winbase/nf-winbase-setfirmwareenvironmentvariableexw.

Implementation

Win32Result<bool> SetFirmwareEnvironmentVariableEx(
  PCWSTR lpName,
  PCWSTR lpGuid,
  Pointer? pValue,
  int nSize,
  int dwAttributes,
) {
  final result_ = SetFirmwareEnvironmentVariableExW_Wrapper(
    lpName,
    lpGuid,
    pValue ?? nullptr,
    nSize,
    dwAttributes,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}