-
-
Notifications
You must be signed in to change notification settings - Fork 104
Description
Assigning 0x80020004 to VARIANT.missing may not be appropriate.
comtypes/comtypes/automation.py
Lines 551 to 556 in 6c1788a
| v.vt = VT_ERROR | |
| if sys.version_info >= (3, 0): | |
| v._.VT_I4 = 0x80020004 | |
| else: | |
| v._.VT_I4 = 0x80020004L | |
| del v |
comtypes/comtypes/automation.py
Lines 551 to 553 in 2e94dbc
| v.vt = VT_ERROR | |
| v._.VT_I4 = 0x80020004 | |
| del v |
The line is intended to assign DISP_E_PARAMNOTFOUND to a VARIANT field to create an instance for missing parameters.
0x80020004 is evaluated as an unsigned 32-bit hexadecimal integer in Python, so it is 2147549188, thus it does not match DISP_E_PARAMNOTFOUND(-2147352572).
Since neither -2147352572 nor 2147549188 has caused any errors or behavioral differences in VARIANT, assigning VT_ERROR to the vt field might be the more crucial aspect.
Regardless, this part is highly non-obvious, and this is confusing.