Commit fc5f36f0 authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

wined3d: Fix IWineD3DPixelShader_GetFunction / IWineD3DVertexShader_GetFunction.

parent b68c72fa
...@@ -127,8 +127,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader* ...@@ -127,8 +127,10 @@ static HRESULT WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader*
return WINED3D_OK; return WINED3D_OK;
} }
if (*pSizeOfData < This->baseShader.functionLength) { if (*pSizeOfData < This->baseShader.functionLength) {
*pSizeOfData = This->baseShader.functionLength; /* MSDN claims (for d3d8 at least) that if *pSizeOfData is smaller
return WINED3DERR_MOREDATA; * than the required size we should write the required size and
* return D3DERR_MOREDATA. That's not actually true. */
return WINED3DERR_INVALIDCALL;
} }
if (NULL == This->baseShader.function) { /* no function defined */ if (NULL == This->baseShader.function) { /* no function defined */
TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData); TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData);
......
...@@ -521,8 +521,10 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader* ...@@ -521,8 +521,10 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader*
return WINED3D_OK; return WINED3D_OK;
} }
if (*pSizeOfData < This->baseShader.functionLength) { if (*pSizeOfData < This->baseShader.functionLength) {
*pSizeOfData = This->baseShader.functionLength; /* MSDN claims (for d3d8 at least) that if *pSizeOfData is smaller
return WINED3DERR_MOREDATA; * than the required size we should write the required size and
* return D3DERR_MOREDATA. That's not actually true. */
return WINED3DERR_INVALIDCALL;
} }
if (NULL == This->baseShader.function) { /* no function defined */ if (NULL == This->baseShader.function) { /* no function defined */
TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData); TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData);
......
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