Am 06.02.2012 18:18, schrieb Luis Carlos Busquets Pérez:
The current implementation includes a check on param->bytes>= bytes

specifically:

if (data&&  param->bytes>= bytes)
{

...

}

So if bytes<param->bytes returns D3DERR_INVALIDCALL.

However, the MS version does not act that way: If the parameter is
shorter than the length of the data, then the data that fits in the
parameter is put and returns D3D_OK

Therefore, the check of the size should be eliminated and in memcpy
instead of referring to bytes, it should refer to min(bytes, param->bytes)

Yes, that looks partly correct, but the check needs to be in there and should be "if (data && param->bytes <= bytes)" and the copied size should be param->bytes. It doesn't show up, because there isn't a test in the test suite for this case, yet. So the trace was correct (http://www.winehq.org/pipermail/wine-devel/2011-December/093489.html) but not the if and the memcopy. :-) Well, I've overseen this. Feel free to send a patch, otherwise I'll do that tomorrow.

Cheers
Rico


Reply via email to