Skip to content

Commit b887eee

Browse files
committed
Fix broken unregistration of 64bit type libraries
The UnRegisterTypeLib function does currently 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 64bit Windows with SYS_WIN64.
1 parent b05b80b commit b887eee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

comtypes/typeinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ def LoadTypeLib(szFile: str) -> ITypeLib:
632632

633633

634634
def UnRegisterTypeLib(
635-
libID: str, wVerMajor: int, wVerMinor: int, lcid: int = 0, syskind: int = SYS_WIN32
635+
libID: str, wVerMajor: int, wVerMinor: int, lcid: int = 0, syskind: int = SYS_WIN64
636636
) -> int:
637637
"""Unregister a registered type library"""
638638
return _oleaut32.UnRegisterTypeLib(

0 commit comments

Comments
 (0)