Commit 3754cdd7 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

wined3d: Correctly handle the size parameter in get_private_data.

parent 3d09d1a9
......@@ -250,18 +250,21 @@ HRESULT CDECL wined3d_resource_get_private_data(const struct wined3d_resource *r
void *data, DWORD *data_size)
{
const struct private_data *d;
DWORD size_in;
TRACE("resource %p, guid %s, data %p, data_size %p.\n",
resource, debugstr_guid(guid), data, data_size);
d = resource_find_private_data(resource, guid);
if (!d) return WINED3DERR_NOTFOUND;
if (*data_size < d->size)
{
*data_size = d->size;
if (!d)
return WINED3DERR_NOTFOUND;
size_in = *data_size;
*data_size = d->size;
if (!data)
return WINED3D_OK;
if (size_in < d->size)
return WINED3DERR_MOREDATA;
}
if (d->flags & WINED3DSPD_IUNKNOWN)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment