Retrieving session ID
Retrieving session ID
(OP)
Hi,
I'm trying to retrieve the session ID of a process. More specifically, a printer driver process; and the session ID I need is the one in which the user who submitted the print job is working.
In Windows XP, I use the user's security token to let SYSTEM impersonate as that user, call GetCurrentProcessId and convert the process ID to a session ID using ProcessIdToSessionId.
My problem lies with Vindows Vista: here, the driver runs as user LOCAL SERVICE and ProcessIdToSessionId fails with error 5, E_ACCESSDENIED.
Does anyone know how I can get the process to session ID conversion working in Vista?
If you need more information about what I'm trying to do, please ask.
I'm trying to retrieve the session ID of a process. More specifically, a printer driver process; and the session ID I need is the one in which the user who submitted the print job is working.
In Windows XP, I use the user's security token to let SYSTEM impersonate as that user, call GetCurrentProcessId and convert the process ID to a session ID using ProcessIdToSessionId.
My problem lies with Vindows Vista: here, the driver runs as user LOCAL SERVICE and ProcessIdToSessionId fails with error 5, E_ACCESSDENIED.
Does anyone know how I can get the process to session ID conversion working in Vista?
If you need more information about what I'm trying to do, please ask.
Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com
RE: Retrieving session ID
Regards,
Bert Vingerhoets
vingerhoetsbert@hotmail.com