Site icon EfmSoft

What does Windows error code 1368 (ERROR_CANNOT_IMPERSONATE) mean?

 
Previous Next
ERROR_INVALID_LOGON_TYPE ERROR_RXACT_INVALID_STATE

ERROR_CANNOT_IMPERSONATE

The pipe server has not yet read the client message whose security context would be impersonated

ImpersonateNamedPipeClient changes the server thread to the security context of the client associated with the last message read from the pipe. The API therefore depends on the server having read client data first. This error identifies an ordering problem in the named-pipe protocol, not simply the absence of SeImpersonatePrivilege.

Trace connect, read, impersonate, request processing, and RevertToSelf on the same server thread. With overlapped I/O, ensure the read has actually completed before the impersonation call. Always check the return value: Microsoft warns that a failed impersonation leaves the thread in its previous process context, which can be more privileged than the client. Do not continue handling the client request after failure. If impersonation level or privilege is the problem, capture that separately after the message-read ordering is correct.

What to inspect

References


Looking for a different code? Search another status or error code.

Exit mobile version