Re: Get a process owner username...

Alex Ivanoff <[email protected]> Wed, 20 May 2009 10:31:26 -0500
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
1. Call OpenProcess with PROCESS_QUERY_INFORMATION.
2. Call OpenProcessToken with TOKEN_QUERY.
3. Call GetTokenInformation with TokenOwner.


-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[email protected]] On Behalf Of Mike Andrews
Sent: Wednesday, May 20, 2009 10:28
To: [email protected]
Subject: Re: [ADVANCED-DOTNET] Get a process owner username...

Hi Peter.
Yes, I figured as much.
I do have plans for this to be run by another user but for now I'm
running
it under my own account.  My OS is Windows XP Pro and my account is an
Administrator.  I've tried the various flags but each one gives me the
same
Access Denied message.  I must be doing something wrong since I can use
Process Explorer from sysinternals and it shows the Domain\Username just
fine.



On Wed, May 20, 2009 at 10:19 AM, Peter Ritchie <
[email protected]> wrote:

> One thing to keep in mind when calling this method is that the current
user
> needs to have permission to request that information.  I believe if
the user
> is not an administrator they will not have that permission; which
would
> result in the Access Denied error.
>
> -- Peter
>
> ===================================
> View archives and manage your subscription(s) at
> http://peach.ease.lsoft.com/archives
>

===================================
View archives and manage your subscription(s) at
http://peach.ease.lsoft.com/archives

===================================
View archives and manage your subscription(s) at http://peach.ease.lsoft.com/archives