> 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/createremotethread.md).

# CreateRemoteThread

```csharp
[DllImport("KERNEL32.dll", ExactSpelling = true, SetLastError = true)]
[DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
public static extern unsafe HANDLE CreateRemoteThread(
    HANDLE hProcess,
    [Optional] SECURITY_ATTRIBUTES* lpThreadAttributes,
    nuint dwStackSize,
    LPTHREAD_START_ROUTINE lpStartAddress,
    [Optional] void* lpParameter,
    THREAD_CREATION_FLAGS dwCreationFlags,
    [Optional] uint* lpThreadId);
```

[LPTHREAD\_START\_ROUTINE](/threading/lpthread_start_routine.md)

[THREAD\_CREATION\_FLAGS](/threading/thread_creation_flags.md)
