GetDispParam discriminate b/w VT_EMPTY & zero VT_I4

Michael Stefaniuc mstefani at
Tue May 8 04:33:37 CDT 2007

Misha Koshelev wrote:
> Hi, thank you very much for your help.
> I am implementing Installer::RegistryValue for MSI OLE automation and I need a way to tell apart
> a VT_EMPTY and a VT_I4 type variant with a value of 0 as these have two different behaviors for this
> function under Windows XP. I have not figured out a way to do this with DispGetParam (or VariantChangeType for
> that matter; specifically I made a little test to check every single type and find one that could be coerced
> to only from a VT_EMPTY but not from a VT_BSTR or a VT_I4 but it did not find any such types; a coercion to a
> VT_I4 succeeds and makes a variant of value 0 if coercing either a VT_EMPTY variant or a zero value VT_I4 
> variant). I can always just check directly in the DISPPARAMS structure but that seems to be a little dirty if I 
> am using DispGetParam for everything else.
Dumb question: if you already have the variant why don't you use the
V_VT() macro on it to its type?

Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
Red Hat GmbH                    Email: mstefani at
Hauptstaetterstr. 58  
D-70178 Stuttgart

More information about the wine-devel mailing list