[PATCH] oleaut32: Fix calling function with instance and VARIANT return type.

Huw Davies huw at codeweavers.com
Tue Nov 13 09:45:48 CST 2018


On Tue, Nov 13, 2018 at 04:15:30PM +0300, Dmitry Timoshkov wrote:
> diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
> index 4555802a61..52d335fe47 100644
> --- a/dlls/oleaut32/typelib.c
> +++ b/dlls/oleaut32/typelib.c
> @@ -6720,7 +6720,13 @@ DispCallFunc(
>          break;
>      case VT_DECIMAL:
>      case VT_VARIANT:
> -        args[0] = (DWORD)pvargResult;  /* arg 0 is a pointer to the result */
> +        if (pvInstance)
> +        {
> +            args[0] = (DWORD)pvInstance;  /* arg 0 is a pointer to the instance */
> +            args[1] = (DWORD)pvargResult; /* arg 1 is a pointer to the result */
> +        }
> +        else
> +            args[0] = (DWORD)pvargResult;  /* arg 0 is a pointer to the result */
>          call_method( func, argspos, args, &stack_offset );
>          break;
>      case VT_I8:


Hi Dmitry,

While this looks good, it would be better to add pvargResult to the
args array before the other args are processed (just after pvInstance
is added).  That would mean we could avoid all the args + 1 hacks in
the various call_method() calls.  I realise that would increase the
patch size somewhat, but we'd end up with a much cleaner function.

What do you think?

Huw.



More information about the wine-devel mailing list