[2/2] winhttp: Add custom implementation of IWinHttpRequest::Invoke(DISPID_HTTPREQUEST_OPTION).

Jacek Caban jacek at codeweavers.com
Fri Sep 4 07:58:35 CDT 2015


Hi Dmitry,

On 09/02/15 11:49, Dmitry Timoshkov wrote:
> Hi Jacek,
>
> thanks for the review,

I'm sorry for the delay, I wanted to take a closer look at those tests.

> Jacek Caban <jacek at codeweavers.com> wrote:
>
>> On 09/02/15 07:44, Dmitry Timoshkov wrote:
>>> +    if (member == DISPID_HTTPREQUEST_OPTION)
>> Why can't we use standard, ITypeInfo-based implementation here?
> The tests (1/2 and existing ones) show that ITypeInfo->Invoke doesn't work
> for a lot of cases when native IWinHttpRequest::Invoke succeeds. In fact,
> after a lot of attempts I failed to force ITypeInfo->Invoke work at all
> under Windows using same code that winhttp request (and many other places
> in Wine) uses to load a typelib from winhttp.dll and forward Invoke to
> ITypeInfo implementation.

It seems to me that it's a typelib problem. I think that Invoke
implementation can't find how to handle enum arguments. Did you try if
building the typelib with midl helps? My guess is that the typelib
produced by widl is somehow broken.

>>> +    {
>>> +        VARIANT ret_value, option;
>>> +        UINT err_pos;
>>> +
>>> +        if (!result) result = &ret_value;
>>> +        if (!arg_err) arg_err = &err_pos;
>>> +
>>> +        VariantInit( &option );
>>> +        VariantInit( result );
>>> +
>>> +        if (flags == DISPATCH_PROPERTYPUT)
>>> +        {
>>> +            hr = DispGetParam( params, 0, VT_I4, &option, arg_err );
>>> +            if (FAILED(hr)) return hr;
>>> +
>>> +            hr = IWinHttpRequest_put_Option( &request->IWinHttpRequest_iface, V_I4( &option ), params->rgvarg[0] );
>>> +            if (FAILED(hr))
>>> +                WARN("put_Option(%d) failed: %x\n", V_I4( &option ), hr);
>>> +            return hr;
>>> +        }
>>> +        else if (flags & (DISPATCH_PROPERTYGET | DISPATCH_METHOD))
>>> +        {
>>> +            hr = DispGetParam( params, 0, VT_I4, &option, arg_err );
>>> +            if (FAILED(hr)) return hr;
>>> +
>>> +            hr = IWinHttpRequest_get_Option( &request->IWinHttpRequest_iface, V_I4( &option ), result );
>>> +            if (FAILED(hr))
>>> +                WARN("get_Option(%d) failed: %x\n", V_I4( &option ), hr);
>>> +            return hr;
>>> +        }
>>> +
>>> +        return S_OK;
>> I don't think silently returning S_OK is right for not handled flags.
> Do you have some particular flags in mind? I tried to follow the test results,
> although probably the tests don't cover every case.

DISPATCH_PROPERTYPUTREF mostly, maybe some invalid combination. Having a
FIXME like you did in the other version of the patch looks good to me.

Thanks,
Jacek




More information about the wine-devel mailing list