Re: [ctypes-users] ctypes.CDLL("") fails on MS Windows [SEC=PERSONAL]
Brought to you by:
theller
From: Andrew M. <And...@ac...> - 2012-01-04 08:15:54
|
> From: Jacob Schmidt > > On Windows, you can use something like this: > > exe = ctypes.CDLL("myprocess", > > ctypes.windll.kernel32.GetModuleHandleA(None)) > > > > to get the current process. However, I'm not sure if this makes > > sense: an exe cannot export functions. > > Where did you hear that from Thomas? The PE format applies to both exe > and dlls, both can import and export functions. True, but the exports are explicit and have to be defined at link time - not automatic the way they are on Unix-like OSes, which makes them less useful in general (most exes are linked without any exported functions). -------------------------> "These thoughts are mine alone!" <--------- Andrew MacIntyre Operations Branch tel: +61 2 6219 5356 Communications Infrastructure Division fax: +61 2 6253 3277 Australian Communications & Media Authority email: and...@ac... http://www.acma.gov.au/ NOTICE: This email message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. |