DuplicateHandle function Null safety kernel32

int DuplicateHandle(
  1. int hSourceProcessHandle,
  2. int hSourceHandle,
  3. int hTargetProcessHandle,
  4. Pointer<IntPtr> lpTargetHandle,
  5. int dwDesiredAccess,
  6. int bInheritHandle,
  7. int dwOptions
)

Duplicates an object handle.

BOOL DuplicateHandle(
  HANDLE   hSourceProcessHandle,
  HANDLE   hSourceHandle,
  HANDLE   hTargetProcessHandle,
  LPHANDLE lpTargetHandle,
  DWORD    dwDesiredAccess,
  BOOL     bInheritHandle,
  DWORD    dwOptions
);

Implementation

int DuplicateHandle(
        int hSourceProcessHandle,
        int hSourceHandle,
        int hTargetProcessHandle,
        Pointer<IntPtr> lpTargetHandle,
        int dwDesiredAccess,
        int bInheritHandle,
        int dwOptions) =>
    _DuplicateHandle(hSourceProcessHandle, hSourceHandle, hTargetProcessHandle,
        lpTargetHandle, dwDesiredAccess, bInheritHandle, dwOptions);