SetSecurity function

Retrieves the impersonation token associated with the current thread.

Note

This API is for internal use only. It's not intended for use from developer code.

Syntax

HRESULT SetSecurity (
   [out] boolean* pNeedToReset,
   [out] HANDLE* pCurrentThreadToken
);

Parameters

pNeedToReset
[out] When the function returns, contains a pointer to a boolean that indicates whether the token should be reset by calling the ResetSecurity function.

token
[out] When the function returns, contains a pointer to the handle of the impersonation token associated with the current thread. Its value can be null if there is no token associated with the current thread.

Return value

If the function succeeds, the return value is S_OK (0).

If the function fails, the return value is a non-zero error code. To get extended error information, call the GetErrorInfo function.

Requirements

Platforms: See System Requirements.

Header: WMINet_Utils.idl

.NET Framework Versions: Available since 4.7.2

See also