mhammond / pywin32

Python for Windows (pywin32) Extensions
5.01k stars 793 forks source link

PyCom_PyObjectFromVariant won't convert VT_VARIANT #351

Closed ghost closed 6 years ago

ghost commented 16 years ago

Any attempts to use the function PyCom_PyObjectFromVariant with an input variant of type VT_VARIANT will fail with "E_OUTOFMEMORY."

Should this function recurse until it finds a different variant type underneath?

IDispEventSimpleImpl clients from ATL will handle this case correctly, does that mean this is a bug :-)?

Reported by: urban_dk

Original Ticket: "pywin32/bugs/351":https://sourceforge.net/p/pywin32/bugs/351

ghost commented 16 years ago

A patch that tries to indirect

Original comment by: mhammond

ghost commented 16 years ago

Logged In: YES user_id=14198 Originator: NO

I'm afraid this appears invalid. I made a patch to the test suite, which does work correctly for in-process clients - but fails with E_INVALID_PARAM when executed as a LocalServer (ie, as an external process). It appears the COM marshaller is raising this error, implying it doesn't know how to move such a variant between processes. If anyone can find evidence to the contrary, please re-open. File Added: variant_in_variant.patch

Original comment by: mhammond

ghost commented 16 years ago

Original comment by: mhammond