UpdateProcThreadAttribute function Null safety kernel32

int UpdateProcThreadAttribute (
  1. Pointer<NativeType> 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.

BOOL UpdateProcThreadAttribute(
  LPPROC_THREAD_ATTRIBUTE_LIST lpAttributeList,
  DWORD                        dwFlags,
  DWORD_PTR                    Attribute,
  PVOID                        lpValue,
  SIZE_T                       cbSize,
  PVOID                        lpPreviousValue,
  PSIZE_T                      lpReturnSize
);

Implementation

int UpdateProcThreadAttribute(
    Pointer lpAttributeList,
    int dwFlags,
    int Attribute,
    Pointer lpValue,
    int cbSize,
    Pointer lpPreviousValue,
    Pointer<IntPtr> lpReturnSize) {
  final _UpdateProcThreadAttribute = _kernel32.lookupFunction<
      Int32 Function(
          Pointer lpAttributeList,
          Uint32 dwFlags,
          IntPtr Attribute,
          Pointer lpValue,
          IntPtr cbSize,
          Pointer lpPreviousValue,
          Pointer<IntPtr> lpReturnSize),
      int Function(
          Pointer lpAttributeList,
          int dwFlags,
          int Attribute,
          Pointer lpValue,
          int cbSize,
          Pointer lpPreviousValue,
          Pointer<IntPtr> lpReturnSize)>('UpdateProcThreadAttribute');
  return _UpdateProcThreadAttribute(lpAttributeList, dwFlags, Attribute,
      lpValue, cbSize, lpPreviousValue, lpReturnSize);
}