Click to See Complete Forum and Search --> : Impersonation in Service


April 13th, 1999, 10:14 AM
I have an ATL COM Server that I can compile either as an EXE or as a Service.
One of the interface methods essentially does the following:

IServerSecurity* pss;
HRESULT hres = CoGetCallContext(IID_IServerSecurity, (void**)&pss);
hres = pss->ImpersonateClient();
GetUserName(UserName,&cchUserName);
...

When this method is called in the EXE, I correctly get the user name of the client who initiated the call. However, in the Service, all the calls succeed, but I am left with the user name "SYSTEM" which is the account the Server is running in, not the client. It seems as if the impersonation hasn't been particularly successful.

Any help would be much appreciated.

Darren

mailto:d_joyner@mother.co.uk