|
-
November 10th, 2004, 08:18 AM
#1
How to determine under which user account a process runs
HI,
I enumerated all currently running processes with the psapi functions.
(enumprocesses, openprocess etc.)
I would like to know under which user account (System, userx...) a specific process is running.
I'm really new in microsoft world, so I din't find the right function call....
Best regards
Andre
-
November 10th, 2004, 08:28 AM
#2
Re: How to determine under which user account a process runs
-
November 10th, 2004, 08:28 AM
#3
Re: How to determine under which user account a process runs
you could access environment variables. under XP (so i think also 2K and NT) the variable is USERNAME.
with the C function getenv you can gain access to the env variables:
Code:
char uid[ 256 ];
strncpy( uid, getenv("USERNAME"), sizeof(uid));
-
November 11th, 2004, 03:58 PM
#4
Re: How to determine under which user account a process runs
no because that gives you the username who is logged on to the system, which is not necessarily the user who is running the specified process.
Look at the thread AdaraCD posted because he knows the correct answer.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|