Implement ITypeInfo.AddressOfMember with tests and clarifications.
#905
+36
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces the usable
ITypeInfo.AddressOfMembermethod, enabling developers to retrieve the memory addresses of static functions and variables within COM objects.While the high-level wrapper has existed since the project's inception, it was effectively unusable as it always raised an error when called—a fact consistent across its entire project Git history.
Now, after nearly 20 years, it is finally functional.
This capability is crucial for advanced interoperability scenarios where direct memory access to COM object members is required, opening up new possibilities for low-level integration and performance optimizations.
The accompanying comprehensive test suite for
ITypeInfo.AddressOfMember(test_typeinfo.py) ensures the reliability and correctness of this new functionality. These tests go beyond basic validation by specifically verifying:cImplTypes,typekind) for modules, which was previously an uncovered area.GetDllEntrymethod's ability to accurately resolve the exported DLL name, function name, and ordinal.AddressOfMemberwith a dynamically resolved function address, the tests confirm thatAddressOfMemberprovides accurate and actionable memory locations.ITypeInfo.AddressOfMemberinclude extensive comments and type hints.