DdeImpersonateClient function (ddeml.h)

Impersonates a Dynamic Data Exchange (DDE) client application in a DDE client conversation.


BOOL DdeImpersonateClient(
  [in] HCONV hConv


[in] hConv


A handle to the DDE client conversation to be impersonated.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.


Impersonation is the ability of a process to take on the security attributes of another process. When a client in a DDE conversation requests information from a DDE server, the server impersonates the client. When the server requests access to an object, the system verifies the access against the client's security attributes.

When the impersonation is complete, the server normally calls the RevertToSelf function.

Security Considerations

If the call to DdeImpersonateClient fails for any reason, the client is not impersonated and the client request is made in the security context of the calling process. If the calling process is running as a highly privileged account, such as LocalSystem, or as a member of an administrative group, the user may be able to perform actions that would otherwise be disallowed. Therefore it is important that you always check the return value of the call, and if it fails to raise an error, do not continue execution of the client request.


Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header ddeml.h (include Windows.h)
Library User32.lib
DLL User32.dll

See also


Dynamic Data Exchange Management Library


Other Resources