Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken unregistration of 64bit type libraries (second attempt) #678

Merged
merged 2 commits into from
Dec 3, 2024
Merged

Fix broken unregistration of 64bit type libraries (second attempt) #678

merged 2 commits into from
Dec 3, 2024

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Dec 3, 2024

The UnRegisterTypeLib function currently always assume 32bit type libraries (SYS_WIN32) if called without explicit syskind argument. This is currently the case when UnRegisterTypeLib is called implicitly from comtypes.server.register.UseCommandLine, since the _reg_typelib_ field only contains the first 3 libID , wVerMajor and wVerMinor arguments.

Propose to fix the problem by updating the hardcoding to SYS_WIN64 for 64bit Python and SYS_WIN32 for 32bit Python installations. This ensures that existing 32bit COM servers continue to function on 32bit Python installations.

The UnRegisterTypeLib function currently always assume 32bit type libraries (SYS_WIN32) if called without explicit `syskind` argument. This is currently the case when UnRegisterTypeLib is called implicitly from comtypes.server.register.UseCommandLine, since the `_reg_typelib_` field only contains the first 3 libID , wVerMajor and wVerMinor arguments.

Propose to fix the problem by updating the hardcoding to SYS_WIN64 for 64bit Python and SYS_WIN32 for 32bit Python installations.
@forderud forderud changed the title Fix broken unregistration of 64bit type libraries Fix broken unregistration of 64bit type libraries (second attempt) Dec 3, 2024
junkmd added a commit to junkmd/pywinauto that referenced this pull request Dec 3, 2024
Copy link
Collaborator

@junkmd junkmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reproducer in your ComSamples repository and @bennyrowland ’s insights helped in approving this PR.

Reviving the COM server tests in this project will be addressed in a separate scope.

@junkmd junkmd added enhancement New feature or request 64-bit labels Dec 3, 2024
@junkmd junkmd merged commit 17d37b6 into enthought:main Dec 3, 2024
49 checks passed
@forderud forderud deleted the tlb-unreg-fix2 branch December 4, 2024 07:45
@forderud
Copy link
Contributor Author

forderud commented Dec 4, 2024

Thanks a lot for your rapid support on this @junkmd @bennyrowland.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
64-bit enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants