# 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](https://www.pinvoke.dev/threading/lpthread_start_routine "mention")

[thread\_creation\_flags](https://www.pinvoke.dev/threading/thread_creation_flags "mention")
