SetThreadToken function advapi32
Assigns an impersonation token to a thread.
The function can also cause a thread to stop using an impersonation token.
To learn more, see learn.microsoft.com/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadtoken.
Implementation
Win32Result<bool> SetThreadToken(Pointer<Pointer>? thread, HANDLE? token) {
resolveGetLastError();
final result_ = _SetThreadToken(thread ?? nullptr, token ?? nullptr);
return .new(value: result_ != FALSE, error: GetLastError());
}