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



Hi,
I have a service running as "LocalService". This services stores his
configuration in the directory given by SHGetFolderPath(), so this is
"C:\Documents ....\LocalService\Application Data\...".
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 don't like the idea do grab the root directory directly from
"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
\ProfileList\S-1-5-19\ProfileImagePath" and add a localized
subdirectory name (Application Data) to it manually.


Marco

.