RevertToSelf

ITcUserManager::RevertToSelf

A previous impersonation is cancelled.

HRESULT RevertToSelf();

Return Values

HRESULT == S_OK

User account has successfully been created.

HRESULT != S_OK

If an error occurs an error code generated by Windows NT appears in HRESULT. In order to instigate a COM/OLE error handling sequence, an HRESULT is created from the error code from HRESULT_FROM_NT(nErrror) or HRESULT_FROM_WIN32(nErrror). Here it should be noted that the Windows NT error code is displayed in low-order 16 bit format.

Comments

The RevertToSelf method reassigns the „primary token“ of the process to the invoking thread. Thus RevertToSelf does not only cancel the last impersonation, but also after successive impersonations re-establishes the first user of the process.