[PATCH] msado15: Add helper function to create CommandText interface

Hans Leidekker hans at codeweavers.com
Mon Feb 22 06:59:55 CST 2021


On Sun, 2021-02-21 at 19:45 +1100, Alistair Leslie-Hughes wrote:
> +static HRESULT WINAPI connection_Execute( _Connection *iface, BSTR command, VARIANT *records_affected,
> +                                          LONG options, _Recordset **record_set )
> +{
> +    struct connection *connection = impl_from_Connection( iface );
> +    HRESULT hr;
> +    ICommandText *comand_text = NULL;
> +    DBROWCOUNT affected;
> +    IUnknown *rowset = NULL;
> +    _Recordset *recordset = NULL;

These initializations are not necessary.

> +    ADORecordsetConstruction *construct;
> +    FIXME( "%p, %s, %p, 0x%08x, %p Semi-stub\n", iface, debugstr_w(command), records_affected, options, record_set );
> +
> +    if (connection->state == adStateClosed) return MAKE_ADO_HRESULT( adErrObjectClosed );
> +
> +    hr = create_command_text(connection->session, command, &comand_text);
>      if (FAILED(hr))
> -        goto done;
> +        return hr;
> 
>  
>      hr = ICommandText_Execute(comand_text, NULL, &IID_IUnknown, NULL, &affected, &rowset);
> +    ICommandText_Release(comand_text);
>      if (FAILED(hr))
> -        goto done;
> +        return hr;
>  
> 
>      hr = Recordset_create( (void**)&recordset);
>      if (FAILED(hr))
> -        goto done;
> +    {
> +        return hr;
> +    }

rowset should be released here.





More information about the wine-devel mailing list