H. Verbeet : wined3d: Fix IWineD3DPixelShader_GetFunction / IWineD3DVertexShader_GetFunction.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Mar 8 07:17:04 CST 2007


Module: wine
Branch: master
Commit: fc5f36f037ec2f807cf748d3083432b0b600c14b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fc5f36f037ec2f807cf748d3083432b0b600c14b

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Thu Mar  8 01:16:09 2007 +0100

wined3d: Fix IWineD3DPixelShader_GetFunction / IWineD3DVertexShader_GetFunction.

---

 dlls/wined3d/pixelshader.c  |    6 ++++--
 dlls/wined3d/vertexshader.c |    6 ++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/pixelshader.c b/dlls/wined3d/pixelshader.c
index b49f6d1..dba2f34 100644
--- a/dlls/wined3d/pixelshader.c
+++ b/dlls/wined3d/pixelshader.c
@@ -127,8 +127,10 @@ static HRESULT  WINAPI IWineD3DPixelShaderImpl_GetFunction(IWineD3DPixelShader*
     return WINED3D_OK;
   }
   if (*pSizeOfData < This->baseShader.functionLength) {
-    *pSizeOfData = This->baseShader.functionLength;
-    return WINED3DERR_MOREDATA;
+    /* MSDN claims (for d3d8 at least) that if *pSizeOfData is smaller
+     * 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 */
     TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData);
diff --git a/dlls/wined3d/vertexshader.c b/dlls/wined3d/vertexshader.c
index f812306..5d3a506 100644
--- a/dlls/wined3d/vertexshader.c
+++ b/dlls/wined3d/vertexshader.c
@@ -521,8 +521,10 @@ static HRESULT WINAPI IWineD3DVertexShaderImpl_GetFunction(IWineD3DVertexShader*
         return WINED3D_OK;
     }
     if (*pSizeOfData < This->baseShader.functionLength) {
-        *pSizeOfData = This->baseShader.functionLength;
-        return WINED3DERR_MOREDATA;
+        /* MSDN claims (for d3d8 at least) that if *pSizeOfData is smaller
+         * 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 */
         TRACE("(%p) : GetFunction no User Function defined using NULL to %p\n", This, pData);




More information about the wine-cvs mailing list