Skip to content

makepy generates a bad format IID for a vtable function returning an object derived from IDispatch. #714

@ghost

Description

makepy generates a bad format IID for a vtable function returning an object derived from IDispatch.

It generated this line (for example):
(( u'WaitComplete' , u'request' , ), 5, (5, (), [ (16393, 10, None, "IID('{19B26BC8-9E3A-4321-B965-8ECC5F4670A4}')") , ], 1 , 1 , 4 , 0 , 44 , (3, 0, None, None) , 0 , )),

but the IID portion is in double-quotes, so it is a string. When processed by PyWinObject_AsIID, the string cannot be converted into a valid IID and becomes IID_NULL, which then fails when the returned object's QueryInterface is called with IID_NULL.

The bug seems to be in genpy's VTableItem.WriteVTableMap where it writes repr(arg[3]) instead of just arg[3].

This happens in v219 and v220 in Python 2.7, 32-bit.

Reported by: dsmithti

Original Ticket: pywin32/bugs/714

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions