Advertisement

03.16.2004 at 06:09PM PST, ID: 20921370
[x]
Attachment Details

Finding the Window Station from a process ID

Asked by bjornsone in Windows Programming

Tags: ,

I am trying to find the process ID of explorer that relates
to window station that my service is allowed to interact with (WinSta0).  
I can use EnumProcesses to get process IDs, but I don't know which
explorer.exe belongs to which window station (on XP there can be multiple
connected users each with their own Window Station).  I need to find the
proper explorer to get the token which is used to ImpersonateLoggedOnUser,
but on Windows XP, this causes problems when I can't figure which explorer
is the right one.

I can easily get the window station of my process.  How can I find the
process ID of explorer that uses the same window station when there is
more than one explorer.exe running for multiple users?
Start Free Trial
 
Loading Advertisement...
 
[+][-]03.17.2004 at 03:30AM PST, ID: 10614218

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows Programming
Tags: process, window
Sign Up Now!
Solution Provided By: Madshi
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.17.2004 at 06:10AM PST, ID: 10615162

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 05:24PM PST, ID: 10620234

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32