From: Jactry Zeng Subject: Re: [PATCH v2 4/4] propsys: Implement PropVariantToBuffer(). Message-Id: Date: Fri, 15 Feb 2019 08:57:16 +0000 In-Reply-To: References: <276f5ad2-9aad-fb58-681f-b9a59d68ec44@codeweavers.com> Hi Nikolay, Thanks for review! On Fri, Feb 15, 2019 at 8:34 AM Nikolay Sivov wrote: > > > +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb) > > +{ > > + TRACE("(%p, %p, %d)\n", propvarIn, ret, cb); > > + > > + if(cb > propvarIn->u.caub.cElems) > > + return E_FAIL; > > + > > + memcpy(ret, propvarIn->u.caub.pElems, cb); > > + > > + return S_OK; > > +} > > This one should probably check variant type. > Well, I've thought about this. From MSDN it said that it only supports VT_VECTOR | VT_UI1 and VT_ARRRAY | VT_UI1. In order to verify this, we will need to test many other types. So it maybe better to just ignore type checking at this point and adding it in the future if a real application requests it? -- Regards, Jactry Zeng
Hi Nikolay,

Thanks for review!

On Fri, Feb 15, 2019 at 8:34 AM Nikolay Sivov <nsivov@codeweavers.com> wrote:
>
> > +HRESULT WINAPI PropVariantToBuffer(REFPROPVARIANT propvarIn, void *ret, UINT cb)
> > +{
> > +    TRACE("(%p, %p, %d)\n", propvarIn, ret, cb);
> > +
> > +    if(cb > propvarIn->u.caub.cElems)
> > +        return E_FAIL;
> > +
> > +    memcpy(ret, propvarIn->u.caub.pElems, cb);
> > +
> > +    return S_OK;
> > +}
>
> This one should probably check variant type.
>
Well, I've thought about this. From MSDN it said that it only supports VT_VECTOR | VT_UI1 and VT_ARRRAY | VT_UI1. In order to verify this, we will need to test many other types. So it maybe better to just ignore type checking at this point and adding it in the future if a real application requests it?


--
Regards,
Jactry Zeng