<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML dir=ltr><HEAD>
<META content="MSHTML 6.00.2900.2873" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText35409 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>I think I found the
problem : the object name that is passed to EnumObjectItems must be
localized in the system language!!</FONT></DIV>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>damned
Windows...</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>I used win32process functions to get the
work done, I post it so in case it can help
somebody...</FONT></DIV></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>import win32process, win32api,
winnt, os</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2>def
GetProcessNames():<BR> id_list =
win32process.EnumProcesses()<BR> result =
[]<BR> for id in
id_list:<BR>
try:<BR>
try:<BR>
proc_handle
=win32api.OpenProcess(<BR>
winnt.PROCESS_QUERY_INFORMATION |
winnt.PROCESS_VM_READ,<BR>
False,
id)<BR>
module_handle =
win32process.EnumProcessModules(proc_handle)[0]<BR>
process_path = win32process.GetModuleFileNameEx(proc_handle,
module_handle)<BR>
result.append(os.path.basename(process_path))<BR>
finally:<BR>
win32api.CloseHandle(proc_handle)<BR>
except:<BR>
pass</FONT></DIV>
<DIV dir=ltr><FONT face="Courier New" size=2> return
result<BR></FONT><BR></DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>De:</B> python-win32-bounces@python.org
de la part de Charles BROSSOLLET<BR><B>Date:</B> sam. 15/07/2006
11:45<BR><B>À:</B> Mark Hammond; python-win32<BR><B>Objet :</B> [python-win32]
RE : win32pdhutil.ShowAllProcesses() fails<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV id=idOWAReplyText81978 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>when I looked again in the
archives, I looks that people who have the problem are on non-english OSes...
Maybe it is related? </FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Cheers</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2>Charles</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>De:</B> Mark Hammond
[mailto:mhammond@skippinet.com.au]<BR><B>Date:</B> sam. 15/07/2006
03:00<BR><B>À:</B> Charles BROSSOLLET; 'python-win32'<BR><B>Objet :</B> RE:
[python-win32] win32pdhutil.ShowAllProcesses() fails<BR></FONT><BR></DIV>
<DIV dir=ltr>
<DIV><SPAN class=616035200-15072006><FONT face=Arial color=#0000ff size=2>I'm
afraid I can't help much. It looks like the API function is failing with
PDH_CSTATUS_NO_OBJECT. A quick google for this shows a win2k related
knowledge-base article, but nothing specific to Windows XP - but hopefully
knowing the exact error code being returned by PDH is
useful.</FONT></SPAN></DIV>
<DIV><SPAN class=616035200-15072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=616035200-15072006><FONT face=Arial color=#0000ff
size=2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=616035200-15072006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=616035200-15072006><FONT face=Arial color=#0000ff
size=2>Mark</FONT></SPAN></DIV>
<DIV><SPAN class=616035200-15072006></SPAN><FONT face=Tahoma><FONT size=2><SPAN
class=616035200-15072006><FONT face=Arial
color=#0000ff></FONT></SPAN></FONT></FONT> </DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=616035200-15072006> </SPAN>-----Original Message-----<BR><B>From:</B>
python-win32-bounces@python.org [mailto:python-win32-bounces@python.org]<B>On
Behalf Of </B>Charles BROSSOLLET<BR><B>Sent:</B> Saturday, 15 July 2006 3:16
AM<BR><B>To:</B> python-win32<BR><B>Subject:</B> [python-win32]
win32pdhutil.ShowAllProcesses() fails<BR><BR></DIV></FONT></FONT>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV><FONT face=Arial size=2>Hello,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I cannot manage to use the ShowAllProcesses()
function, it returns the following error :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>>>>
win32pdhutil.ShowAllProcesses()<BR>Traceback (most recent call
last):<BR> File "<input>", line 1, in ?<BR> File
"C:\Python24\Lib\site-packages\win32\lib\win32pdhutil.py", line 95, in
ShowAllProcesses<BR> items, instances =
win32pdh.EnumObjectItems(None,None,object,
win32pdh.PERF_DETAIL_WIZARD)<BR>error: (-1073738824, 'EnumObjectItems for
buffer size', 'No error message is available')<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>I'm using ActivePython 2.4.3 with win32all build
208, on WinXP SP2.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Thanks in advance for your support!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Charles
Brossollet</DIV></BLOCKQUOTE></FONT></DIV></DIV></BODY></HTML>