![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#11 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
If you still don't understand, you have to have it like this: HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_TERMINATE, FALSE, processID ); @Cache: I gave that link in the post two before yours. ![]()
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#12 | |||
|
Hobbyist Programmer
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4
![]() |
Quote:
Quote:
![]()
__________________
Learning to use C++ and loving every minute of it. |
|||
|
|
|
|
|
#13 |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 4
![]() |
Bonus tip: get debug privs and you'll have a better chance of getting a handle to a process with the access rights you want. Use the function below in your app then check it's output. You should get less <unknowns>'s.
bool GetDebugPrivs( void )
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tp;
if ( OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken) )
{
if ( !LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &sedebugnameValue) )
{
CloseHandle( hToken );
return false;
}
tp.PrivilegeCount = 1;
tp.Privileges[0].Luid = sedebugnameValue;
tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(tp), NULL, NULL);
CloseHandle( hToken );
}
return ( GetLastError() == ERROR_SUCCESS );
} |
|
|
|
|
|
#14 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
#15 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4
![]() |
Thanks again for the help. I did try the debug privledges and that showed one process that used to be unknown. Not really useful for much now, but maybe in the future.
Thanks, -BB98
__________________
Learning to use C++ and loving every minute of it. |
|
|
|
|
|
#16 | |
|
Hobbyist
Join Date: Sep 2005
Posts: 261
Rep Power: 4
![]() |
Quote:
@badbasser98: On my machine your program only showed about 5 out of 20(ish) processes without debug privs. Plus, even if you only see 1 extra process then thats a 10% increase in accuracy over 10 processes. I'd say it's worth it. |
|
|
|
|
|
|
#17 |
|
Hobbyist Programmer
Join Date: Mar 2005
Location: United States
Posts: 124
Rep Power: 4
![]() |
on my work PC (where I do most of my programming) that program shows all but three of 46 processes without debug privs. Now that's down to two with the privs.
__________________
Learning to use C++ and loving every minute of it. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|