acquiring access token for "LocalService" from application started by the admin for SHGetFolderPath()
- From: mb <google.groups@xxxxxxxxxxxxxxxxx>
- Date: Tue, 03 Jul 2007 04:28:40 -0700
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
.
- Follow-Ups:
- Prev by Date: Can there be any bug in GetSecurityInfo ?
- Next by Date: RE: Can there be any bug in GetSecurityInfo ?
- Previous by thread: Can there be any bug in GetSecurityInfo ?
- Next by thread: Re: acquiring access token for "LocalService" from application started by the admin for SHGetFolderPath()
- Index(es):