> For the complete documentation index, see [llms.txt](https://www.pinvoke.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.pinvoke.dev/kernel32/duplicatehandle.md).

# DuplicateHandle

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe BOOL DuplicateHandle(
    HANDLE hSourceProcessHandle,
    HANDLE hSourceHandle,
    HANDLE hTargetProcessHandle,
    HANDLE* lpTargetHandle,
    uint dwDesiredAccess,
    BOOL bInheritHandle,
    DUPLICATE_HANDLE_OPTIONS dwOptions);
```

[DUPLICATE\_HANDLE\_OPTIONS](/foundation/duplicate_handle_options.md)
