Re: acquiring access token for "LocalService" from application started by the admin for SHGetFolderPath()



It is possible that the service isn't running while running the configuration program.

Marco

Stefan Kuhr wrote:
Marco,

mb wrote:
Hi,
I have a service running as "LocalService". [...]
Now the configuration program, which is started from a admin, needs
this path.
SHGetFolderPath() has a parameter hToken "An access token that can be
used to represent a particular user.".
How to get a access token for "LocalService"? I've tried LogonUser but
that doesn't work.

[...]



I would try to set up sort of IPC from the admin program to the service, where the admin program transmits its PID to the service. The service then could duplicate its own access token into the admin program and return the handle value with the IPC to the admin program.

.