Re: [comtypes-users] Getting AddressOfMember working?

2014-05-19 Thread Thomas Heller
Am 17.05.2014 21:20, schrieb Will Dormann:
 Hi folks,

 I'm interested in using comtypes to get the actual addresses of
 method/property names in a COM object.

 In typeinfo.py, I've commented out the following line:
 #raise Check Me

 Using test_typeinfo.py as a starting point, I've got a script that
 attempts to use AddressOfMember in the following way:
 address = ti.AddressOfMember(fd.memid, fd.invkind)

 This results in the following error:
 Traceback (most recent call last):
File C:\ax.py, line 31, in module
  address = ti.AddressOfMember(fd.memid, fd.invkind)
File
 C:\Python27\lib\site-packages\comtypes-1.0.0-py2.7.egg\comtypes\typeinfo.py,
 line 316, in AddressOfMember
  self.__com_AddressOfMember(memid, invkind, byref(p))
 _ctypes.COMError: (-2147317571, 'Wrong module kind for the operation.',
 (None, None, None, 0, None))

 The best info I could find online is this:
 http://forums.codeguru.com/showthread.php?497293-Why-Exception-occured-getting-address-of-COM-function
 but there's no answer.

MSDN says in 
http://msdn.microsoft.com/en-us/library/windows/desktop/ms221544%28v=vs.85%29.aspx:

 Retrieves the addresses of static functions or variables, such as
 those defined in a DLL.

This seems to suggest that ITypeInfo::GetAddressOfMember works only for
static functions or static variables, but not for methods of COM object.

Thomas


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users


Re: [comtypes-users] Getting AddressOfMember working?

2014-05-19 Thread Will Dormann
On 5/19/14, 6:51 AM, Thomas Heller wrote:
 This seems to suggest that ITypeInfo::GetAddressOfMember works only for
 static functions or static variables, but not for methods of COM object.


Ahh.   Given that there was already an AddressOfMember function in
typininfo.py (albeit blocked by a raise), I had hoped that it was
possible but just unfinished.


Thanks
-WD

--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users


Re: [comtypes-users] Getting AddressOfMember working?

2014-05-19 Thread Will Dormann
On 5/19/14, 10:29 AM, Thomas Heller wrote:
 Am 19.05.2014 14:13, schrieb Will Dormann:

 P.S.Do you have any idea on how I might be able to get the address
 of a method or property of a COM object?Or is that outside the scope
 of comtypes?
 
 Why do you need the address?  What do you want to do with it?


This info is quite valuable for reverse engineering.   e.g. if a COM
object exposes a function foo(), then where in the module is the actual
code to handle foo()?


-WD


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users


Re: [comtypes-users] Getting AddressOfMember working?

2014-05-19 Thread Thomas Heller
Am 19.05.2014 16:31, schrieb Will Dormann:
 On 5/19/14, 10:29 AM, Thomas Heller wrote:
 Am 19.05.2014 14:13, schrieb Will Dormann:

 P.S.Do you have any idea on how I might be able to get the address
 of a method or property of a COM object?Or is that outside the scope
 of comtypes?

 Why do you need the address?  What do you want to do with it?


 This info is quite valuable for reverse engineering.   e.g. if a COM
 object exposes a function foo(), then where in the module is the actual
 code to handle foo()?

comtypes doesn't expose the address of the methods directly.


However, with some advanced ctypes-wizardry you should be able to find 
out.  Nevertheless I cannot help you with this.

Thomas


--
Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free.
http://p.sf.net/sfu/SauceLabs
___
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users