UpdateProcThreadAttribute function kernel32

Win32Result<bool> UpdateProcThreadAttribute(
  1. LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
  2. int dwFlags,
  3. int attribute,
  4. Pointer<NativeType>? lpValue,
  5. int cbSize,
  6. Pointer<NativeType>? lpPreviousValue,
  7. Pointer<IntPtr>? lpReturnSize,
)

Updates the specified attribute in a list of attributes for process and thread creation.

To learn more, see learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-updateprocthreadattribute.

Implementation

Win32Result<bool> UpdateProcThreadAttribute(
  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
  int dwFlags,
  int attribute,
  Pointer? lpValue,
  int cbSize,
  Pointer? lpPreviousValue,
  Pointer<IntPtr>? lpReturnSize,
) {
  final result_ = UpdateProcThreadAttribute_Wrapper(
    lpAttributeList,
    dwFlags,
    attribute,
    lpValue ?? nullptr,
    cbSize,
    lpPreviousValue ?? nullptr,
    lpReturnSize ?? nullptr,
  );
  return .new(value: result_.value.i32 != FALSE, error: result_.error);
}