Bug 481171 - Windows Service process don't show up in Select Process to attach dialog
Summary: Windows Service process don't show up in Select Process to attach dialog
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: Next   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-31 07:04 EDT by Gabor Janak CLA
Modified: 2020-09-04 15:18 EDT (History)
1 user (show)

See Also:


Attachments
Simple patch,workaround around problem by requesting Debug privileges (1.55 KB, patch)
2015-10-31 07:38 EDT, Gabor Janak CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Janak CLA 2015-10-31 07:04:28 EDT
On Windows (VISTA,Win7...) listtasks.exe don't show up processes running as Windows Services. (Introduced with UAC)

This pretend attaching to this process, if Eclipse is running with administrator privileges. GDB does handle this already.

I noticed that it is enough if listtasks try to call
AdjustTokenPrivileges and enable SE_DEBUG_NAME. 

Without this any OpenProcess will fail on a process running as a service.

if AdjustTokenPrivileges fails, listtasks should continue without error to work as before, if user doesn't have Debug Rights. 
(Common: Run eclipse as Administrator)

I could provide a simple patch for 
"org.eclipse.cdt/core/org.eclipse.cdt.core.win32/library/listtasks/listtasks.cpp" , but currently this will break support for Windows95 ;)

 
If any more information is required, please ask. 
It's my first bugreport here.



Technical Details:

listtasks enumerate over all process IDs. On each process it calls OpenProcess to get image name/filenname. This will fail with "5 - Access denied" if calling thread is missing SE_DEBUG_NAME rights.

To Reproduce, try to attach to any process running as an service.
Comment 1 Gabor Janak CLA 2015-10-31 07:38:22 EDT
Created attachment 257664 [details]
Simple patch,workaround around problem by requesting Debug privileges

Patch should only show a possible solution.