[python-win32] Re: Memory Usage for Processes

Tom Haddon thaddon at equilar.com
Fri Feb 11 02:40:22 CET 2005


Hi Roger,

I tried both of these but was getting the following messages. Is there any way of confirming which parameter it's refering to? Could it be my "process" parameter?

Thanks, Tom

Traceback (most recent call last):
  File "C:\test\memusage.py", line 24, in ?
    test = processes.listprocesses()
  File "C:\test\memusage.py", line 11, in listprocesses
    han = win32api.OpenProcess(win32con.PROCESS_VM_READ, 0, process)
error: (87, 'OpenProcess', 'The parameter is incorrect.')
>>> 
Traceback (most recent call last):
  File "C:\test\memusage.py", line 24, in ?
    test = processes.listprocesses()
  File "C:\test\memusage.py", line 11, in listprocesses
    han = win32api.OpenProcess(win32con.PROCESS_QUERY_INFORMATION, 0, process)
error: (87, 'OpenProcess', 'The parameter is incorrect.')

-----Original Message-----
From: python-win32-bounces at python.org
[mailto:python-win32-bounces at python.org]On Behalf Of Roger Upole
Sent: Thursday, February 10, 2005 4:51 PM
To: python-win32 at python.org
Subject: [python-win32] Re: Memory Usage for Processes


You'll need to specify more access in OpenProcess.
It's 1 now, which is only PROCESS_TERMINATE.
Most likely you're getting an access denied in the
GetProcessMemoryInfo call.  (This is why a bare except:
is not generally a good thing to do)  Try changing the access mode to
win32con.PROCESS_QUERY_INFORMATION|win32con.PROCESS_VM_READ.
    hth
        Roger

_______________________________________________
Python-win32 mailing list
Python-win32 at python.org
http://mail.python.org/mailman/listinfo/python-win32


More information about the Python-win32 mailing list