[pywin32-bugs] [ pywin32-Bugs-1285688 ] Argument types for win32process.GetModuleFileNameEx
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: SourceForge.net <no...@so...> - 2005-09-11 08:58:47
|
Bugs item #1285688, was opened at 2005-09-09 17:27 Message generated for change (Settings changed) made by mhammond You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1285688&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Rejected Priority: 5 Submitted By: nanotube (nanotube) Assigned to: Nobody/Anonymous (nobody) Summary: Argument types for win32process.GetModuleFileNameEx Initial Comment: Hi, According to the msdn docs, the function GetModuleFileNameEx can accept NULL as the handle to the module, in which case it returns the path of the executable of the process itself, rather than the module. Here is the direct quote from the msdn doc: hModule [in] Handle to the module. If this parameter is NULL, GetModuleFileNameEx returns the path of the executable file of the process specified in hProcess. and a link to the same doc: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/getmodulefilenameex.asp Currently, when trying to give None as second argument to the function gives me error, "TypeError: an integer is required". So I am unable to invoke that functionality of GetModuleFileNameEx using win32all. Bug or feature? Using win32all 203, iirc. (by the way, is there a quick way to check which version of win32all I have installed?) Would appreciate your input on this. Or a workaround on how to get the process name from process id, without using this function. :) Thanks! ---------------------------------------------------------------------- >Comment By: Mark Hammond (mhammond) Date: 2005-09-11 18:58 Message: Logged In: YES user_id=14198 Thanks Stefan! ---------------------------------------------------------------------- Comment By: nanotube (nanotube) Date: 2005-09-10 03:21 Message: Logged In: YES user_id=1173666 Ah, thanks. When i tried that earlier, i had another problem with my code, and i thought that was caused by the argument type... So i tried doing the same thing through ctypes, got same problem, solved it... and now putting 0 instead of None into win32process.GetModuleFileNameEx works as you say. so bug can be closed. Thank you for quick reply! :) ---------------------------------------------------------------------- Comment By: Stefan Schukat (sschukat) Date: 2005-09-09 21:03 Message: Logged In: YES user_id=977439 The handle maps to a Python int. So instead of using None try 0 then it will work. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1285688&group_id=78018 |