Author: greatlrd
Date: Thu Nov 13 03:43:46 2008
New Revision: 37337
URL:
http://svn.reactos.org/svn/reactos?rev=37337&view=rev
Log:
Adding a old test for ddraw, that have lying around for awhile now, small rewrite have
been done so it can be compile with reactos
Modified:
branches/reactx/rostests/apitests/ddrawapi/testlist.c
branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
Modified: branches/reactx/rostests/apitests/ddrawapi/testlist.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawa…
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/testlist.c [iso-8859-1] (original)
+++ branches/reactx/rostests/apitests/ddrawapi/testlist.c [iso-8859-1] Thu Nov 13 03:43:46
2008
@@ -3,6 +3,7 @@
#include "ddrawapi.h"
void dump_ddrawi_directdraw_int(LPDDRAWI_DIRECTDRAW_INT lpDraw_int);
+void dump_ddrawi_directdraw_lcl(LPDDRAWI_DIRECTDRAW_LCL lpDraw_lcl);
/* dump all data struct when this is trun onm usefull when u debug ddraw.dll */
#define DUMP_ON 1
@@ -26,7 +27,7 @@
/* The function that gives us the number of tests */
INT NumTests(void)
{
- return sizeof(TestList) / sizeof(TESTENTRY);
+ return sizeof(TestList) / sizeof(TESTENTRY);
}
/* old debug macro and dump data */
@@ -34,11 +35,45 @@
void dump_ddrawi_directdraw_int(LPDDRAWI_DIRECTDRAW_INT lpDraw_int)
{
- printf("%08lx pIntDirectDraw7->lpVtbl : 0x%p\n",
FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpVtbl), lpDraw_int->lpVtbl);
- printf("%08lx pIntDirectDraw7->lpLcl : 0x%p\n",
FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLcl), lpDraw_int->lpLcl );
- printf("%08lx pIntDirectDraw7->lpLink : 0x%p\n",
FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLink), lpDraw_int->lpLink );
- printf("%08lx pIntDirectDraw7->dwIntRefCnt : 0x%08lx \n",
FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, dwIntRefCnt), lpDraw_int->dwIntRefCnt );
+ printf("%08lx LPVOID pDirectDraw->lpVtbl : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpVtbl), lpDraw_int->lpVtbl);
+ printf("%08lx LPDDRAWI_DIRECTDRAW_LCL pDirectDraw->lpLcl : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLcl), lpDraw_int->lpLcl );
+ printf("%08lx LPDDRAWI_DIRECTDRAW_INT pDirectDraw->lpLink : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, lpLink), lpDraw_int->lpLink );
+ printf("%08lx DWORD pDirectDraw->dwIntRefCnt :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_INT, dwIntRefCnt),
lpDraw_int->dwIntRefCnt );
}
+
+
+void dump_ddrawi_directdraw_lcl(LPDDRAWI_DIRECTDRAW_LCL lpDraw_lcl)
+{
+ printf("%08lx DWORD lpLcl->lpDDMore :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpDDMore),
lpDraw_lcl->lpDDMore);
+ printf("%08lx LPDDRAWI_DIRECTDRAW_GBL lpLcl->lpGbl : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpGbl), lpDraw_lcl->lpGbl);
+ printf("%08lx DWORD lpLcl->dwUnused0 :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwUnused0),
lpDraw_lcl->dwUnused0);
+ printf("%08lx DWORD lpLcl->dwLocalFlags :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwLocalFlags),
lpDraw_lcl->dwLocalFlags);
+ printf("%08lx DWORD lpLcl->dwLocalRefCnt :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwLocalRefCnt),
lpDraw_lcl->dwLocalRefCnt);
+ printf("%08lx DWORD lpLcl->dwProcessId :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwProcessId),
lpDraw_lcl->dwProcessId);
+ printf("%08lx PVOID lpLcl->pUnkOuter : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, pUnkOuter), lpDraw_lcl->pUnkOuter);
+ printf("%08lx DWORD lpLcl->dwObsolete1 :
0x%08lx\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwObsolete1),
lpDraw_lcl->dwObsolete1);
+ printf("%08lx ULONG_PTR lpLcl->hWnd : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hWnd), (PVOID)lpDraw_lcl->hWnd);
+ printf("%08lx ULONG_PTR lpLcl->hDC : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hDC), (PVOID) lpDraw_lcl->hDC);
+ printf("%08lx DWORD lpLcl->dwErrorMode :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwErrorMode),
lpDraw_lcl->dwErrorMode);
+ printf("%08lx LPDDRAWI_DDRAWSURFACE_INT lpLcl->lpPrimary : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpPrimary), lpDraw_lcl->lpPrimary);
+ printf("%08lx LPDDRAWI_DDRAWSURFACE_INT lpLcl->lpCB : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpCB), lpDraw_lcl->lpCB);
+ printf("%08lx DWORD lpLcl->dwPreferredMode :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwPreferredMode),
lpDraw_lcl->dwPreferredMode);
+ printf("%08lx HINSTANCE lpLcl->hD3DInstance : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hD3DInstance),
lpDraw_lcl->hD3DInstance);
+ printf("%08lx PVOID lpLcl->pD3DIUnknown : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, pD3DIUnknown), (PVOID)
lpDraw_lcl->pD3DIUnknown);
+ printf("%08lx LPDDHAL_CALLBACKS lpLcl->lpDDCB : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpDDCB), lpDraw_lcl->lpDDCB);
+ printf("%08lx ULONG_PTR lpLcl->hDDVxd : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hDDVxd), (PVOID) lpDraw_lcl->hDDVxd);
+ printf("%08lx DWORD lpLcl->dwAppHackFlags :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwAppHackFlags),
lpDraw_lcl->dwAppHackFlags);
+ printf("%08lx ULONG_PTR lpLcl->hFocusWnd : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hFocusWnd), (PVOID)
lpDraw_lcl->hFocusWnd);
+ printf("%08lx DWORD lpLcl->dwHotTracking :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwHotTracking),
lpDraw_lcl->dwHotTracking);
+ printf("%08lx DWORD lpLcl->dwIMEState :
0x%08lx \n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, dwIMEState),
lpDraw_lcl->dwIMEState);
+ printf("%08lx ULONG_PTR lpLcl->hWndPopup : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hWndPopup), (PVOID)
lpDraw_lcl->hWndPopup);
+ printf("%08lx ULONG_PTR lpLcl->hDD : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hDD), (PVOID) lpDraw_lcl->hDD);
+ printf("%08lx ULONG_PTR lpLcl->hGammaCalibrator : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, hGammaCalibrator), (PVOID)
lpDraw_lcl->hGammaCalibrator);
+ printf("%08lx LPDDGAMMACALIBRATORPROC lpLcl->lpGammaCalibrator : 0x%p
\n", FIELD_OFFSET(DDRAWI_DIRECTDRAW_LCL, lpGammaCalibrator),
lpDraw_lcl->lpGammaCalibrator);
+}
+
+
+
#endif
/* EOF */
Modified: branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
URL:
http://svn.reactos.org/svn/reactos/branches/reactx/rostests/apitests/ddrawa…
==============================================================================
--- branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
[iso-8859-1] (original)
+++ branches/reactx/rostests/apitests/ddrawapi/tests/Test_DirectDrawCreateEx.c
[iso-8859-1] Thu Nov 13 03:43:46 2008
@@ -19,12 +19,47 @@
RTEST(pIntDirectDraw7->lpLcl != NULL);
RTEST(pIntDirectDraw7->lpLink == NULL);
RTEST(pIntDirectDraw7->dwIntRefCnt == 1);
+
+ RTEST(pIntDirectDraw7->lpLcl->lpDDMore == 0);
+ RTEST(pIntDirectDraw7->lpLcl->lpGbl != NULL);
+ RTEST(pIntDirectDraw7->lpLcl->dwUnused0 == 0);
+ RTEST(pIntDirectDraw7->lpLcl->dwLocalFlags == DDRAWILCL_DIRECTDRAW7);
+ RTEST(pIntDirectDraw7->lpLcl->dwLocalRefCnt == 1);
+
+ /* pIntDirectDraw7->lpLcl->dwProcessId call see if we have same ProcessId
*/
+ RTEST(pIntDirectDraw7->lpLcl->dwProcessId != 0);
+
+ RTEST(pIntDirectDraw7->lpLcl->pUnkOuter == NULL);
+ RTEST(pIntDirectDraw7->lpLcl->dwObsolete1 == 0);
+ RTEST(pIntDirectDraw7->lpLcl->hWnd == 0);
+
+ /* FIXME vaildate pIntDirectDraw7->lpLcl->hDC */
+ RTEST(pIntDirectDraw7->lpLcl->hDC != 0);
+
+ RTEST(pIntDirectDraw7->lpLcl->dwErrorMode == 0);
+ RTEST(pIntDirectDraw7->lpLcl->lpPrimary == NULL);
+ RTEST(pIntDirectDraw7->lpLcl->lpCB == NULL);
+ RTEST(pIntDirectDraw7->lpLcl->dwPreferredMode == 0);
+ RTEST(pIntDirectDraw7->lpLcl->hD3DInstance == NULL);
+ RTEST(pIntDirectDraw7->lpLcl->pD3DIUnknown == NULL);
+
+ RTEST(pIntDirectDraw7->lpLcl->lpDDCB != NULL);
+ //RTEST(pIntDirectDraw7->lpLcl->hDDVxd != -1); fixme
+ RTEST(pIntDirectDraw7->lpLcl->hFocusWnd == 0);
+ RTEST(pIntDirectDraw7->lpLcl->dwHotTracking == 0);
+ RTEST(pIntDirectDraw7->lpLcl->dwIMEState == 0);
+
+ RTEST(pIntDirectDraw7->lpLcl->hWndPopup == 0);
+ RTEST(pIntDirectDraw7->lpLcl->hDD != 0);
+ RTEST(pIntDirectDraw7->lpLcl->hGammaCalibrator != 0);
+ RTEST(pIntDirectDraw7->lpLcl->lpGammaCalibrator != NULL);
}
#if DUMP_ON
if (pIntDirectDraw7 != NULL)
{
dump_ddrawi_directdraw_int(pIntDirectDraw7);
+ dump_ddrawi_directdraw_lcl(pIntDirectDraw7->lpLcl);
}
#endif