Hi Hans,

On 07/22/11 16:00, Hans Leidekker wrote:
> ---
>  dlls/winhttp/request.c       |   13 +++++++++++--
>  dlls/winhttp/tests/winhttp.c |    9 ++++++++-
>  2 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
> index 0c4c726..a73be22 100644
> --- a/dlls/winhttp/request.c
> +++ b/dlls/winhttp/request.c
> @@ -2747,8 +2747,17 @@ static HRESULT WINAPI winhttp_request_get_ResponseBody(
>      IWinHttpRequest *iface,
>      VARIANT *body )
>  {
> -    FIXME("\n");
> -    return E_NOTIMPL;
> +    struct winhttp_request *request = impl_from_IWinHttpRequest( iface );
> +    DWORD err;
> +
> +    TRACE("%p, %p\n", request, body);
> +
> +    if ((err = request_read_body( request, INFINITE ))) return 
> HRESULT_FROM_WIN32( err );
> +
> +    VariantInit( body );
> +    V_VT( body ) = VT_ARRAY|VT_UI1;
> +    V_ARRAY( body ) = request->buffer;

The caller is responsible for freeing the result, so it will destroy
your internal data. I think you should create an array here and not use
it to store the data internally.

Also VariantInit call is not needed if you set both type and value of
variant.


Jacek


Reply via email to