Module: wine
Branch: master
Commit: 9002468c7b4d7e8a15e536792fe2df2c99ca063c
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=9002468c7b4d7e8a15e5367…
Author: Louis. Lenders <xerox_xerox2000(a)yahoo.co.uk>
Date: Sun Sep 10 12:05:45 2006 +0100
d3d8: Better stub for ValidateVertexShader + tests.
---
dlls/d3d8/d3d8.spec | 2 +
dlls/d3d8/d3d8_main.c | 29 ++++++++++++++---
dlls/d3d8/tests/Makefile.in | 1 +
dlls/d3d8/tests/d3d8_main.c | 72 +++++++++++++++++++++++++++++++++++++++++++
4 files changed, 98 insertions(+), 6 deletions(-)
create mode 100644 dlls/d3d8/tests/d3d8_main.c
diff --git a/dlls/d3d8/d3d8.spec b/dlls/d3d8/d3d8.spec
index bc82cd0..4bad850 100644
--- a/dlls/d3d8/d3d8.spec
+++ b/dlls/d3d8/d3d8.spec
@@ -2,4 +2,4 @@
@ stdcall DebugSetMute()
@ stdcall Direct3DCreate8(long)
@ stdcall ValidatePixelShader(ptr long long ptr)
-@ stdcall ValidateVertexShader(ptr long long ptr)
+@ stdcall ValidateVertexShader(ptr ptr ptr long ptr)
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index b7627ab..65b8a00 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -72,13 +72,32 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL,
/***********************************************************************
* ValidateVertexShader (D3D8.@)
*
- * PARAMS
+ * I've seen reserved1 and reserved2 always passed as 0's
+ * bool seems always passed as 0 or 1, but other values work as well....
* toto result?
*/
-BOOL WINAPI ValidateVertexShader(LPVOID pFunction, int param1, int param2, LPVOID toto)
-{
- FIXME("(%p %d %d %p): stub\n", pFunction, param1, param2, toto);
- return TRUE;
+HRESULT WINAPI ValidateVertexShader(DWORD* vertexshader, DWORD* reserved1, DWORD* reserved2, int bool, DWORD* toto)
+{
+ HRESULT ret;
+ FIXME("(%p %p %p %d %p): stub\n", vertexshader, reserved1, reserved2, bool, toto);
+
+ if (!vertexshader)
+ return E_FAIL;
+
+ if (reserved1 || reserved2)
+ return E_FAIL;
+
+ switch(*vertexshader) {
+ case 0xFFFE0101:
+ case 0xFFFE0100:
+ ret=S_OK;
+ break;
+ default:
+ ERR("vertexshader version mismatch\n");
+ ret=E_FAIL;
+ }
+
+ return ret;
}
/***********************************************************************
diff --git a/dlls/d3d8/tests/Makefile.in b/dlls/d3d8/tests/Makefile.in
index 6576058..a936043 100644
--- a/dlls/d3d8/tests/Makefile.in
+++ b/dlls/d3d8/tests/Makefile.in
@@ -7,6 +7,7 @@ IMPORTS = user32 kernel32
EXTRALIBS = -ldxerr8
CTESTS = \
+ d3d8_main.c \
device.c
@MAKE_TEST_RULES@
diff --git a/dlls/d3d8/tests/d3d8_main.c b/dlls/d3d8/tests/d3d8_main.c
new file mode 100644
index 0000000..e2f03bd
--- /dev/null
+++ b/dlls/d3d8/tests/d3d8_main.c
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2006 Louis Lenders
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+#include "wine/test.h"
+
+static HRESULT (WINAPI *ValidateVertexShader)(DWORD*,DWORD*,DWORD*,int,DWORD*);
+
+static void test_ValidateVertexShader(void)
+{
+ HRESULT ret;
+ static DWORD simple_vs[] = {0xFFFE0101, /* vs_1_1 */
+ 0x00000009, 0xC0010000, 0x90E40000, 0xA0E40000, /* dp4 oPos.x, v0, c0 */
+ 0x00000009, 0xC0020000, 0x90E40000, 0xA0E40001, /* dp4 oPos.y, v0, c1 */
+ 0x00000009, 0xC0040000, 0x90E40000, 0xA0E40002, /* dp4 oPos.z, v0, c2 */
+ 0x00000009, 0xC0080000, 0x90E40000, 0xA0E40003, /* dp4 oPos.w, v0, c3 */
+ 0x0000FFFF};
+
+ ret=ValidateVertexShader(0,0,0,0,0);
+ ok(ret==E_FAIL,"ValidateVertexShader returned %lx but expected E_FAIL\n",ret);
+
+ ret=ValidateVertexShader(0,0,0,1,0);
+ ok(ret==E_FAIL,"ValidateVertexShader returned %lx but expected E_FAIL\n",ret);
+
+ ret=ValidateVertexShader(simple_vs,0,0,0,0);
+ ok(ret==S_OK,"ValidateVertexShader returned %lx but expected S_OK\n",ret);
+
+ ret=ValidateVertexShader(simple_vs,0,0,1,0);
+ ok(ret==S_OK,"ValidateVertexShader returned %lx but expected S_OK\n",ret);
+ /* seems to do some version checking */
+ *simple_vs=0xFFFE0100; /* vs_1_0 */
+ ret=ValidateVertexShader(simple_vs,0,0,0,0);
+ ok(ret==S_OK,"ValidateVertexShader returned %lx but expected S_OK\n",ret);
+
+ *simple_vs=0xFFFE0102; /* bogus version */
+ ret=ValidateVertexShader(simple_vs,0,0,1,0);
+ ok(ret==E_FAIL,"ValidateVertexShader returned %lx but expected E_FAIL\n",ret);
+ /* I've seen that applications pass 2nd and 3rd parameter always as 0;simple test with non-zero parameters */
+ *simple_vs=0xFFFE0101; /* vs_1_1 */
+ ret=ValidateVertexShader(simple_vs,simple_vs,0,1,0);
+ ok(ret==E_FAIL,"ValidateVertexShader returned %lx but expected E_FAIL\n",ret);
+
+ ret=ValidateVertexShader(simple_vs,0,simple_vs,1,0);
+ ok(ret==E_FAIL,"ValidateVertexShader returned %lx but expected E_FAIL\n",ret);
+ /* I've seen 4th parameter is always passed as either 0 or 1, but passing other values doesn't seem to hurt*/
+ ret=ValidateVertexShader(simple_vs,0,0,12345,0);
+ ok(ret==S_OK,"ValidateVertexShader returned %lx but expected S_OK\n",ret);
+ /* What is 5th parameter ???? Following works ok */
+ ret=ValidateVertexShader(simple_vs,0,0,1,simple_vs);
+ ok(ret==S_OK,"ValidateVertexShader returned %lx but expected S_OK\n",ret);
+}
+
+START_TEST(d3d8_main)
+{
+ HMODULE d3d8_handle = LoadLibraryA( "d3d8.dll" );
+ ValidateVertexShader = (void*)GetProcAddress (d3d8_handle, "ValidateVertexShader" );
+ test_ValidateVertexShader();
+}
Module: wine
Branch: master
Commit: abecd9e393925e008449a80ec14682790b29042c
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=abecd9e393925e008449a80…
Author: Matt Finnicum <mattfinn(a)gmail.com>
Date: Fri Sep 8 16:37:25 2006 -0500
riched20: Rewrite of scrolling and some redrawing code.
Replaces duplicated scrolling code with re-usable functions.
Removes excessive boundary checking on scroll code, since that's done
in the scrollbar control anyways.
Properly separates repaint calls based on what has changed.
Send EN_UPDATE and EN_CHANGE at the right places.
Only call EnsureVisible on changes, not all repaints.
---
dlls/riched20/caret.c | 12 +--
dlls/riched20/editor.c | 178 +++++++++++-----------------------------
dlls/riched20/editor.h | 14 ++-
dlls/riched20/editstr.h | 2
dlls/riched20/paint.c | 208 ++++++++++++++++++++++++++---------------------
5 files changed, 181 insertions(+), 233 deletions(-)
Diff: http://source.winehq.org/git/?p=wine.git;a=commitdiff;h=abecd9e393925e00844…