Author: tkreuzer
Date: Sun Aug 5 07:32:24 2007
New Revision: 28169
URL:
http://svn.reactos.org/svn/reactos?rev=28169&view=rev
Log:
- make apitest.c into a static lib to be used by different tests
- add a gdi32 api test, based on the one in the win32 folder
- add a user32 api test
- change type of test functions to int
- implement a quick 'n dirty html api status output
- uncomment NtGdiTransormPoints in w32kdll.def
- add ASSERT1 macro (ASSERT is already used)
- include some more headers
Added:
trunk/rostests/apitests/gdi32api/
trunk/rostests/apitests/gdi32api/gdi.h
trunk/rostests/apitests/gdi32api/gdi32api.c
trunk/rostests/apitests/gdi32api/gdi32api.h
trunk/rostests/apitests/gdi32api/gdi32api.rbuild
trunk/rostests/apitests/gdi32api/testlist.c
trunk/rostests/apitests/gdi32api/tests/
trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c
trunk/rostests/apitests/gdi32api/tests/CreateFont.c
trunk/rostests/apitests/gdi32api/tests/CreatePen.c
trunk/rostests/apitests/gdi32api/tests/CreateRectRgn.c
trunk/rostests/apitests/gdi32api/tests/ExtCreatePen.c
trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c
trunk/rostests/apitests/gdi32api/tests/GetObject.c
trunk/rostests/apitests/gdi32api/tests/GetStockObject.c
trunk/rostests/apitests/gdi32api/tests/SelectObject.c
trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c
trunk/rostests/apitests/gdi32api/tests/SetSysColors.c
trunk/rostests/apitests/user32api/
trunk/rostests/apitests/user32api/testlist.c
trunk/rostests/apitests/user32api/tests/
trunk/rostests/apitests/user32api/tests/ScrollDC.c
trunk/rostests/apitests/user32api/tests/ScrollWindowEx.c
trunk/rostests/apitests/user32api/user32api.c
trunk/rostests/apitests/user32api/user32api.h
trunk/rostests/apitests/user32api/user32api.rbuild
Modified:
trunk/rostests/apitests/apitest.c
trunk/rostests/apitests/apitest.h
trunk/rostests/apitests/directory.rbuild
trunk/rostests/apitests/w32kdll/w32kdll.def
trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c
trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c
trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdQueryDirectDrawObject.c
trunk/rostests/apitests/w32knapi/w32knapi.rbuild
Modified: trunk/rostests/apitests/apitest.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apitest.c?rev=28…
==============================================================================
--- trunk/rostests/apitests/apitest.c (original)
+++ trunk/rostests/apitests/apitest.c Sun Aug 5 07:32:24 2007
@@ -20,10 +20,10 @@
{
char szHeader[100];
- write(hFile, szFileHeader, strlen(szFileHeader));
+ _write(hFile, szFileHeader, strlen(szFileHeader));
sprintf(szHeader, "<H1>Test results for %ls</H1>", pszModule);
- write(hFile, szHeader, strlen(szHeader));
- write(hFile, szTableHeader, strlen(szTableHeader));
+ _write(hFile, szHeader, strlen(szHeader));
+ _write(hFile, szTableHeader, strlen(szTableHeader));
return TRUE;
}
@@ -56,7 +56,7 @@
sprintf(szLine + strlen(szLine), "<td>%d / %d /
%d</td><td>%d</td></tr>\n",
pti->passed+pti->failed, pti->passed, pti->failed,
pti->rfailed);
- write(hFile, szLine, strlen(szLine));
+ _write(hFile, szLine, strlen(szLine));
return TRUE;
}
@@ -86,15 +86,15 @@
/* Get options */
for (i = 1; i < argc; i++)
{
- if (wcsicmp(argv[i], L"-r") == 0)
+ if (_wcsicmp(argv[i], L"-r") == 0)
{
ti.bRegress = TRUE;
}
- else if (wcsicmp(argv[i], L"all") == 0)
+ else if (_wcsicmp(argv[i], L"all") == 0)
{
bAll = TRUE;
}
- else if (wcsicmp(argv[i], L"status") == 0)
+ else if (_wcsicmp(argv[i], L"status") == 0)
{
bAll = TRUE;
bStatus = TRUE;
@@ -106,7 +106,7 @@
ti.bRegress = TRUE;
char szOutputFile[MAX_PATH];
wsprintf(szOutputFile, "%ls.html", pszName);
- hFile = open(szOutputFile, O_CREAT | O_TRUNC | O_RDWR, 00700);
+ hFile = _open(szOutputFile, O_CREAT | O_TRUNC | O_RDWR, 00700);
if (hFile == -1)
{
printf("Could not create output file.\n");
@@ -119,7 +119,7 @@
{
for (j = 1; j < argc; j++)
{
- if (bAll || wcsicmp(argv[j], TestList[i].Test) == 0)
+ if (bAll || _wcsicmp(argv[j], TestList[i].Test) == 0)
{
ti.passed = 0;
ti.failed = 0;
@@ -158,8 +158,8 @@
if (bStatus)
{
- write(hFile, szFileFooter, strlen(szFileFooter));
- close(hFile);
+ _write(hFile, szFileFooter, strlen(szFileFooter));
+ _close(hFile);
}
if (ti.bRegress)
Modified: trunk/rostests/apitests/apitest.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/apitest.h?rev=28…
==============================================================================
--- trunk/rostests/apitests/apitest.h (original)
+++ trunk/rostests/apitests/apitest.h Sun Aug 5 07:32:24 2007
@@ -8,6 +8,8 @@
#include <stdio.h>
#include <fcntl.h>
#include <windows.h>
+
+#define open _open
#define APISTATUS_NORMAL 0
#define APISTATUS_NOT_FOUND 1
@@ -83,7 +85,7 @@
}
-#define ASSERT(x) \
+#define ASSERT1(x) \
if (!(x)) \
{ \
printf("Assertion failed in %s:%d (%s)\n", __FILE__, __LINE__, #x);\
Modified: trunk/rostests/apitests/directory.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/directory.rbuild…
==============================================================================
--- trunk/rostests/apitests/directory.rbuild (original)
+++ trunk/rostests/apitests/directory.rbuild Sun Aug 5 07:32:24 2007
@@ -1,3 +1,17 @@
+<module name="apitest" type="staticlibrary">
+ <include base="apitest">.</include>
+ <define name="__USE_W32API" />
+ <define name="_WIN32_WINNT">0x0501</define>
+ <file>apitest.c</file>
+</module>
+
+<directory name="gdi32api">
+ <xi:include href="gdi32api/gdi32api.rbuild" />
+</directory>
+
+<directory name="user32api">
+ <xi:include href="user32api/user32api.rbuild" />
+</directory>
<directory name="w32kdll">
<xi:include href="w32kdll/w32kdll.rbuild" />
Added: trunk/rostests/apitests/gdi32api/gdi.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi.h?r…
==============================================================================
--- trunk/rostests/apitests/gdi32api/gdi.h (added)
+++ trunk/rostests/apitests/gdi32api/gdi.h Sun Aug 5 07:32:24 2007
@@ -1,0 +1,193 @@
+#ifndef _WIN32_WINNT
+#define _WIN32_WINNT 0x0501
+#endif
+
+typedef struct _GDI_TABLE_ENTRY
+{
+ PVOID KernelData; /* Points to the kernel mode structure */
+ HANDLE ProcessId; /* process id that created the object, 0 for stock objects */
+ LONG Type; /* the first 16 bit is the object type including the stock obj flag,
the last 16 bits is just the object type */
+ PVOID UserData; /* Points to the user mode structure, usually NULL though */
+} GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY;
+
+typedef PGDI_TABLE_ENTRY (CALLBACK * GDIQUERYPROC) (void);
+
+/* GDI handle table can hold 0x4000 handles */
+#define GDI_HANDLE_COUNT 0x10000
+#define GDI_GLOBAL_PROCESS (0x0)
+
+/* Handle Masks and shifts */
+#define GDI_HANDLE_INDEX_MASK (GDI_HANDLE_COUNT - 1)
+#define GDI_HANDLE_TYPE_MASK 0x007f0000
+#define GDI_HANDLE_STOCK_MASK 0x00800000
+#define GDI_HANDLE_REUSE_MASK 0xff000000
+#define GDI_HANDLE_REUSECNT_SHIFT 24
+#define GDI_HANDLE_UPPER_MASK 0xffff0000
+
+/* Handle macros */
+#define GDI_HANDLE_CREATE(i, t) \
+ ((HANDLE)(((i) & GDI_HANDLE_INDEX_MASK) | ((t) << 16)))
+
+#define GDI_HANDLE_GET_INDEX(h) \
+ (((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK)
+
+#define GDI_HANDLE_GET_TYPE(h) \
+ (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK)
+
+#define GDI_HANDLE_IS_TYPE(h, t) \
+ ((t) == (((ULONG_PTR)(h)) & GDI_HANDLE_TYPE_MASK))
+
+#define GDI_HANDLE_IS_STOCKOBJ(h) \
+ (0 != (((ULONG_PTR)(h)) & GDI_HANDLE_STOCK_MASK))
+
+#define GDI_HANDLE_SET_STOCKOBJ(h) \
+ ((h) = (HANDLE)(((ULONG_PTR)(h)) | GDI_HANDLE_STOCK_MASK))
+
+#define GDI_HANDLE_GET_UPPER(h) \
+ (((ULONG_PTR)(h)) & GDI_HANDLE_UPPER_MASK)
+
+#define GDI_OBJECT_TYPE_DC 0x00010000
+#define GDI_OBJECT_TYPE_REGION 0x00040000
+#define GDI_OBJECT_TYPE_BITMAP 0x00050000
+#define GDI_OBJECT_TYPE_PALETTE 0x00080000
+#define GDI_OBJECT_TYPE_FONT 0x000a0000
+#define GDI_OBJECT_TYPE_BRUSH 0x00100000
+#define GDI_OBJECT_TYPE_EMF 0x00210000
+#define GDI_OBJECT_TYPE_PEN 0x00300000
+#define GDI_OBJECT_TYPE_EXTPEN 0x00500000
+#define GDI_OBJECT_TYPE_COLORSPACE 0x00090000
+#define GDI_OBJECT_TYPE_METADC 0x00660000
+#define GDI_OBJECT_TYPE_METAFILE 0x00260000
+#define GDI_OBJECT_TYPE_ENHMETAFILE 0x00460000
+/* Following object types made up for ROS */
+#define GDI_OBJECT_TYPE_ENHMETADC 0x00740000
+#define GDI_OBJECT_TYPE_MEMDC 0x00750000
+#define GDI_OBJECT_TYPE_DCE 0x00770000
+#define GDI_OBJECT_TYPE_DONTCARE 0x007f0000
+/** Not really an object type. Forces GDI_FreeObj to be silent. */
+#define GDI_OBJECT_TYPE_SILENT 0x80000000
+
+
+
+/* Number Representation */
+
+typedef LONG FIX;
+
+typedef struct _EFLOAT_S
+{
+ LONG lMant;
+ LONG lExp;
+} EFLOAT_S;
+
+/* XFORM Structures */
+typedef struct _MATRIX_S
+{
+ EFLOAT_S efM11;
+ EFLOAT_S efM12;
+ EFLOAT_S efM21;
+ EFLOAT_S efM22;
+ EFLOAT_S efDx;
+ EFLOAT_S efDy;
+ FIX fxDx;
+ FIX fxDy;
+ FLONG flAccel;
+} MATRIX;
+
+/* GDI object structures */
+
+typedef struct _RGNATTR
+{
+ ULONG AttrFlags;
+ ULONG Flags;
+ RECTL Rect;
+} RGNATTR,*PRGNATTR;
+
+// Local DC structure (_DC_ATTR) PVOID pvLDC;
+typedef struct _LDC
+{
+ HDC hDC;
+ ULONG Flags;
+ INT iType;
+ PVOID pvEmfDC; /* Pointer to ENHMETAFILE structure */
+ ABORTPROC pAbortProc; /* AbortProc for Printing */
+ HANDLE hPrinter; /* Local or Remote Printer driver */
+ INT iInitPage; /* Start/Stop */
+ INT iInitDocument;
+} LDC, *PLDC;
+
+typedef struct
+{
+ void * pvLDC; // 000
+ ULONG ulDirty;
+ HBRUSH hbrush;
+ HPEN hpen;
+
+ COLORREF crBackgroundClr; // 010
+ ULONG ulBackgroundClr;
+ COLORREF crForegroundClr;
+ ULONG ulForegroundClr;
+
+#if (_WIN32_WINNT >= 0x0500)
+ unsigned unk020_00000000[4]; // 020
+#endif
+ int iCS_CP; // 030
+ int iGraphicsMode;
+ BYTE jROP2; // 038
+ BYTE jBkMode;
+ BYTE jFillMode;
+ BYTE jStretchBltMode;
+
+ POINT ptlCurrent; // 03C
+ POINTFX ptfxCurrent; // 044
+ long lBkMode; // 04C
+
+ long lFillMode; // 050
+ long lStretchBltMode;
+
+#if (_WIN32_WINNT >= 0x0500)
+ long flFontMapper; // 058
+ long lIcmMode;
+ unsigned hcmXform; // 060
+ HCOLORSPACE hColorSpace;
+ unsigned unk068_00000000;
+ unsigned IcmBrushColor;
+ unsigned IcmPenColor; // 070
+ unsigned unk074_00000000;
+#endif
+
+ long flTextAlign; // 078
+ long lTextAlign;
+ long lTextExtra; // 080
+ long lRelAbs;
+ long lBreakExtra;
+ long cBreak;
+
+ HFONT hlfntNew; // 090
+ MATRIX mxWorldToDevice; // 094
+ MATRIX mxDeviceToWorld; // 0D0
+ MATRIX mxWorldToPage; // 10C
+
+ unsigned unk048_00000000[8]; // 148
+
+ int iMapMode; // 168
+
+#if (_WIN32_WINNT >= 0x0500)
+ DWORD dwLayout; // 16c
+ long lWindowOrgx; // 170
+#endif
+ POINT ptlWindowOrg; // 174
+ SIZE szlWindowExt; // 17c
+ POINT ptlViewportOrg; // 184
+ SIZE szlViewportExt; // 18c
+
+ long flXform; // 194
+ SIZE szlVirtualDevicePixel; // 198
+ SIZE szlVirtualDeviceMm; // 1a0
+ POINT ptlBrushOrigin; // 1a8
+
+ unsigned unk1b0_00000000[2]; // 1b0
+ unsigned RectRegionFlag; // 1b4
+ RECT VisRectRegion; // 1b8
+} DC_ATTR, *PDC_ATTR;
+
+
Added: trunk/rostests/apitests/gdi32api/gdi32api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi32ap…
==============================================================================
--- trunk/rostests/apitests/gdi32api/gdi32api.c (added)
+++ trunk/rostests/apitests/gdi32api/gdi32api.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,19 @@
+#include "gdi32api.h"
+
+HINSTANCE g_hInstance;
+
+BOOL
+IsFunctionPresent(LPWSTR lpszFunction)
+{
+ return TRUE;
+}
+
+int APIENTRY
+WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ g_hInstance = hInstance;
+ return TestMain(L"gdi32api", L"gdi32.dll");
+}
Added: trunk/rostests/apitests/gdi32api/gdi32api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi32ap…
==============================================================================
--- trunk/rostests/apitests/gdi32api/gdi32api.h (added)
+++ trunk/rostests/apitests/gdi32api/gdi32api.h Sun Aug 5 07:32:24 2007
@@ -1,0 +1,11 @@
+#ifndef _GDITEST_H
+#define _GDITEST_H
+
+#include "../apitest.h"
+#include "gdi.h"
+
+extern HINSTANCE g_hInstance;
+
+#endif /* _GDITEST_H */
+
+/* EOF */
Added: trunk/rostests/apitests/gdi32api/gdi32api.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/gdi32ap…
==============================================================================
--- trunk/rostests/apitests/gdi32api/gdi32api.rbuild (added)
+++ trunk/rostests/apitests/gdi32api/gdi32api.rbuild Sun Aug 5 07:32:24 2007
@@ -1,0 +1,12 @@
+<module name="gdi32api" type="win32cui">
+ <include base="gdi32api">.</include>
+ <define name="__USE_W32API" />
+ <define name="_WIN32_WINNT">0x0501</define>
+ <library>apitest</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>gdi32</library>
+ <library>shell32</library>
+ <file>gdi32api.c</file>
+ <file>testlist.c</file>
+</module>
Added: trunk/rostests/apitests/gdi32api/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/testlis…
==============================================================================
--- trunk/rostests/apitests/gdi32api/testlist.c (added)
+++ trunk/rostests/apitests/gdi32api/testlist.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,45 @@
+#ifndef _GDITESTLIST_H
+#define _GDITESTLIST_H
+
+#include "gdi32api.h"
+
+/* include the tests */
+#include "tests/CreateCompatibleDC.c"
+#include "tests/CreateFont.c"
+#include "tests/CreatePen.c"
+#include "tests/CreateRectRgn.c"
+#include "tests/ExtCreatePen.c"
+#include "tests/GetClipRgn.c"
+#include "tests/GetObject.c"
+#include "tests/GetStockObject.c"
+#include "tests/SelectObject.c"
+#include "tests/SetDCPenColor.c"
+#include "tests/SetSysColors.c"
+//#include "tests/SetWorldTransform.c"
+
+/* The List of tests */
+TESTENTRY TestList[] =
+{
+ { L"CreateCompatibleDC", Test_CreateCompatibleDC },
+ { L"CreateFont", Test_CreateFont },
+ { L"CreatePen", Test_CreatePen },
+ { L"CreateRectRgn", Test_CreateRectRgn },
+ { L"ExtCreatePen", Test_ExtCreatePen },
+ { L"GetClipRgn", Test_GetClipRgn },
+ { L"GetStockObject", Test_GetStockObject },
+ { L"SetSysColors", Test_SetSysColors },
+ { L"SelectObject", Test_SelectObject },
+ { L"SetDCPenColor", Test_SetDCPenColor },
+// { L"SetWorldTransform", Test_SetWorldTransform },
+ { L"GetObject", Test_GetObject }
+};
+
+/* The function that gives us the number of tests */
+INT NumTests(void)
+{
+ return sizeof(TestList) / sizeof(TESTENTRY);
+}
+
+#endif /* _GDITESTLIST_H */
+
+/* EOF */
Added: trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/C…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/CreateCompatibleDC.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,38 @@
+#include "../gdi32api.h"
+
+INT
+Test_CreateCompatibleDC(PTESTINFO pti)
+{
+ HDC hDCScreen, hOldDC, hDC, hDC2;
+
+ // Create a DC
+ hDCScreen = GetDC(NULL);
+ if (hDCScreen == NULL)
+ {
+ return FALSE;
+ }
+
+ hDC = CreateCompatibleDC(hDCScreen);
+ TEST(hDC != NULL);
+
+ // Test if first selected pen is BLACK_PEN (? or same as screen DC's pen?)
+ TEST(SelectObject(hDC, GetStockObject(DC_PEN)) == GetStockObject(BLACK_PEN));
+ TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
+
+ // Test for the starting Color == RGB(0,0,0)
+ TEST(SetDCPenColor(hDC, RGB(1,2,3)) == RGB(0,0,0));
+
+ // Check for reuse counter
+ hOldDC = hDC;
+ DeleteDC(hDC);
+ hDC = CreateCompatibleDC(hDCScreen);
+ hDC2 = CreateCompatibleDC(hOldDC);
+ TEST(hDC2 == NULL);
+ if (hDC2 != NULL) DeleteDC(hDC2);
+
+ // cleanup
+ DeleteDC(hDC);
+
+ ReleaseDC(NULL, hDCScreen);
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/gdi32api/tests/CreateFont.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/C…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/CreateFont.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/CreateFont.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,24 @@
+#include "..\gdi32api.h"
+
+#define INVALIDFONT "ThisFontDoesNotExist"
+
+INT
+Test_CreateFont(PTESTINFO pti)
+{
+ HFONT hFont;
+ LOGFONTA logfonta;
+
+ /* Test invalid font name */
+ hFont = CreateFontA(15, 0, 0, 0, FW_DONTCARE, FALSE, FALSE, FALSE,
+ DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
+ DEFAULT_QUALITY, DEFAULT_PITCH, INVALIDFONT);
+ TEST(hFont);
+ TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA));
+ TEST(memcmp(logfonta.lfFaceName, INVALIDFONT, strlen(INVALIDFONT)) == 0);
+ TEST(logfonta.lfWeight == FW_DONTCARE);
+
+
+ return APISTATUS_NORMAL;
+}
+
+
Added: trunk/rostests/apitests/gdi32api/tests/CreatePen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/C…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/CreatePen.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/CreatePen.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,58 @@
+#include "../gdi32api.h"
+
+INT
+Test_CreatePen(PTESTINFO pti)
+{
+ HPEN hPen;
+ LOGPEN logpen;
+
+ SetLastError(ERROR_SUCCESS);
+ hPen = CreatePen(PS_DASHDOT, 5, RGB(1,2,3));
+ TEST(hPen);
+
+ /* Test if we have a PEN */
+ TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_PEN);
+
+ GetObject(hPen, sizeof(logpen), &logpen);
+ TEST(logpen.lopnStyle == PS_DASHDOT);
+ TEST(logpen.lopnWidth.x == 5);
+ TEST(logpen.lopnColor == RGB(1,2,3));
+ DeleteObject(hPen);
+
+ /* PS_GEOMETRIC | PS_DASHDOT = 0x00001011 will become PS_SOLID */
+ logpen.lopnStyle = 22;
+ hPen = CreatePen(PS_GEOMETRIC | PS_DASHDOT, 5, RGB(1,2,3));
+ TEST(hPen);
+ GetObject(hPen, sizeof(logpen), &logpen);
+ TEST(logpen.lopnStyle == PS_SOLID);
+ DeleteObject(hPen);
+
+ /* PS_USERSTYLE will become PS_SOLID */
+ logpen.lopnStyle = 22;
+ hPen = CreatePen(PS_USERSTYLE, 5, RGB(1,2,3));
+ TEST(hPen);
+ GetObject(hPen, sizeof(logpen), &logpen);
+ TEST(logpen.lopnStyle == PS_SOLID);
+ DeleteObject(hPen);
+
+ /* PS_ALTERNATE will become PS_SOLID */
+ logpen.lopnStyle = 22;
+ hPen = CreatePen(PS_ALTERNATE, 5, RGB(1,2,3));
+ TEST(hPen);
+ GetObject(hPen, sizeof(logpen), &logpen);
+ TEST(logpen.lopnStyle == PS_SOLID);
+ DeleteObject(hPen);
+
+ /* PS_INSIDEFRAME is ok */
+ logpen.lopnStyle = 22;
+ hPen = CreatePen(PS_INSIDEFRAME, 5, RGB(1,2,3));
+ TEST(hPen);
+ GetObject(hPen, sizeof(logpen), &logpen);
+ TEST(logpen.lopnStyle == PS_INSIDEFRAME);
+ DeleteObject(hPen);
+
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ return APISTATUS_NORMAL;
+}
+
Added: trunk/rostests/apitests/gdi32api/tests/CreateRectRgn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/C…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/CreateRectRgn.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/CreateRectRgn.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,10 @@
+#include "..\gdi32api.h"
+
+INT
+Test_CreateRectRgn(PTESTINFO pti)
+{
+// HRGN hRgn;
+
+// hRgn = CreateRectRgn(
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/gdi32api/tests/ExtCreatePen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/E…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/ExtCreatePen.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/ExtCreatePen.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,31 @@
+#include "../gdi32api.h"
+
+INT
+Test_ExtCreatePen(PTESTINFO pti)
+{
+ HPEN hPen;
+ LOGBRUSH logbrush;
+ DWORD dwStyles[17] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};
+
+ logbrush.lbStyle = BS_SOLID;
+ logbrush.lbColor = RGB(1,2,3);
+ logbrush.lbHatch = 0;
+ hPen = ExtCreatePen(PS_COSMETIC, 1,&logbrush, 0, 0);
+ if (!hPen) return FALSE;
+
+ /* Test if we have an EXTPEN */
+ TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN);
+ DeleteObject(hPen);
+
+ /* test userstyles */
+ hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 17, (CONST
DWORD*)&dwStyles);
+ TEST(hPen == 0);
+ hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 16, (CONST
DWORD*)&dwStyles);
+ TEST(hPen != 0);
+
+ DeleteObject(hPen);
+
+ return APISTATUS_NORMAL;
+}
+
+
Added: trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/GetClipRgn.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,11 @@
+#include "../gdi32api.h"
+
+INT
+Test_GetClipRgn(PTESTINFO pti)
+{
+// HRGN hRgn;
+
+// hRgn = CreateRectRgn(
+ return APISTATUS_NORMAL;
+}
+
Added: trunk/rostests/apitests/gdi32api/tests/GetObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/GetObject.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/GetObject.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,446 @@
+#include "../gdi32api.h"
+
+static INT
+Test_General(PTESTINFO pti)
+{
+ struct
+ {
+ LOGBRUSH logbrush;
+ BYTE additional[5];
+ } TestStruct;
+ PLOGBRUSH plogbrush;
+ HBRUSH hBrush;
+
+ /* Test null pointer and invalid handles */
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA(0, 0, NULL) == 0);
+ TEST(GetObjectA((HANDLE)-1, 0, NULL) == 0);
+ TEST(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_REGION, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_METAFILE, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_ENHMETAFILE, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+
+ /* Test need of alignment */
+ hBrush = GetStockObject(WHITE_BRUSH);
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH));
+ plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0);
+
+ return TRUE;
+}
+
+static INT
+Test_Bitmap(PTESTINFO pti)
+{
+ HBITMAP hBitmap;
+ BITMAP bitmap;
+ DIBSECTION dibsection;
+ BYTE bData[100] = {0};
+ BYTE Buffer[100] = {48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0};
+
+ FillMemory(&bitmap, sizeof(BITMAP), 0x77);
+ hBitmap = CreateBitmap(10,10,1,8,bData);
+ if (!hBitmap) return FALSE;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP));
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) ==
sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP));
+ TEST(GetObjectA((HANDLE)((UINT)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, 0, Buffer) == 0);
+ TEST(GetObjectA(hBitmap, 5, Buffer) == 0);
+ TEST(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP));
+ TEST(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP));
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ // todo: test invalid handle + buffer
+
+ DeleteObject(hBitmap);
+ return TRUE;
+}
+
+static INT
+Test_Dibsection(PTESTINFO pti)
+{
+ BITMAPINFO bmi = {{sizeof(BITMAPINFOHEADER), 10, 10, 1, 8, BI_RGB, 0, 10, 10, 0,0}};
+ HBITMAP hBitmap;
+ DIBSECTION dibsection;
+ PVOID pData;
+
+ FillMemory(&dibsection, sizeof(DIBSECTION), 0x77);
+ HDC hDC = GetDC(0);
+ hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pData, NULL, 0);
+ if(!hBitmap) return FALSE;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, 0, NULL) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, 5, NULL) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, -5, NULL) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, 0, &dibsection) == 0);
+ TEST(GetObject(hBitmap, 5, &dibsection) == 0);
+ TEST(GetObject(hBitmap, sizeof(BITMAP), &dibsection) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, sizeof(BITMAP)+2, &dibsection) == sizeof(BITMAP));
+ TEST(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(DIBSECTION));
+ TEST(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection) == sizeof(DIBSECTION));
+ TEST(GetObject(hBitmap, -5, &dibsection) == sizeof(DIBSECTION));
+ TEST(GetLastError() == ERROR_SUCCESS);
+ DeleteObject(hBitmap);
+ ReleaseDC(0, hDC);
+
+ return TRUE;
+}
+
+static INT
+Test_Palette(PTESTINFO pti)
+{
+ LOGPALETTE logpal;
+ HPALETTE hPalette;
+ WORD wPalette;
+
+ FillMemory(&wPalette, sizeof(WORD), 0x77);
+ logpal.palVersion = 0x0300;
+ logpal.palNumEntries = 1;
+ logpal.palPalEntry[0].peRed = 0;
+ logpal.palPalEntry[0].peGreen = 0;
+ logpal.palPalEntry[0].peBlue = 0;
+ logpal.palPalEntry[0].peFlags = PC_EXPLICIT;
+ hPalette = CreatePalette(&logpal);
+ if (!hPalette) return FALSE;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD));
+ TEST(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD));
+ TEST(GetObject(hPalette, 0, NULL) == sizeof(WORD));
+ TEST(GetObject(hPalette, 5, NULL) == sizeof(WORD));
+ TEST(GetObject(hPalette, -5, NULL) == sizeof(WORD));
+ TEST(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD));
+ TEST(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD));
+ TEST(GetObject(hPalette, 0, &wPalette) == 0);
+ TEST(GetObject(hPalette, 1, &wPalette) == 0);
+ TEST(GetObject(hPalette, -1, &wPalette) == sizeof(WORD));
+ TEST(GetLastError() == ERROR_SUCCESS);
+ DeleteObject(hPalette);
+ return TRUE;
+}
+
+static INT
+Test_Brush(PTESTINFO pti)
+{
+ LOGBRUSH logbrush;
+ HBRUSH hBrush;
+
+ FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77);
+ hBrush = CreateSolidBrush(RGB(1,2,3));
+ if (!hBrush) return FALSE;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH));
+
+ TEST(GetObject(hBrush, 0, &logbrush) == 0);
+ TEST(logbrush.lbStyle == 0x77777777);
+ TEST(GetObject(hBrush, 5, &logbrush) == sizeof(LOGBRUSH));
+ TEST(logbrush.lbStyle == 0);
+ TEST(logbrush.lbColor == 0x77777701);
+
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, sizeof(LOGBRUSH)+2, &logbrush) == sizeof(LOGBRUSH));
+ TEST(GetObject(hBrush, -1, &logbrush) == sizeof(LOGBRUSH));
+ // TODO: test all members
+
+ TEST(GetLastError() == ERROR_SUCCESS);
+ DeleteObject(hBrush);
+ return TRUE;
+}
+
+static INT
+Test_Pen(PTESTINFO pti)
+{
+ LOGPEN logpen;
+ HPEN hPen;
+
+ FillMemory(&logpen, sizeof(LOGPEN), 0x77);
+ hPen = CreatePen(PS_SOLID, 3, RGB(4,5,6));
+ if (!hPen) return FALSE;
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN));
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, sizeof(BITMAP), NULL) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, 0, NULL) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, 5, NULL) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, -5, NULL) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, sizeof(LOGPEN), &logpen) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, sizeof(LOGPEN)-1, &logpen) == 0);
+ TEST(GetObject(hPen, sizeof(LOGPEN)+2, &logpen) == sizeof(LOGPEN));
+ TEST(GetObject(hPen, 0, &logpen) == 0);
+ TEST(GetObject(hPen, -5, &logpen) == sizeof(LOGPEN));
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* test if the fields are filled correctly */
+ TEST(logpen.lopnStyle == PS_SOLID);
+
+
+ DeleteObject(hPen);
+ return TRUE;
+}
+
+static INT
+Test_ExtPen(PTESTINFO pti)
+{
+ HPEN hPen;
+ EXTLOGPEN extlogpen;
+ LOGBRUSH logbrush;
+ DWORD dwStyles[17] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
+ struct
+ {
+ EXTLOGPEN extlogpen;
+ DWORD dwStyles[50];
+ } elpUserStyle;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_PARAMETER);
+
+ FillMemory(&extlogpen, sizeof(EXTLOGPEN), 0x77);
+ logbrush.lbStyle = BS_SOLID;
+ logbrush.lbColor = RGB(1,2,3);
+ logbrush.lbHatch = 22;
+ hPen = ExtCreatePen(PS_GEOMETRIC | PS_DASH, 5, &logbrush, 0, NULL);
+
+ TEST(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN);
+ TEST(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0);
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN), NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject((HANDLE)GDI_HANDLE_GET_INDEX(hPen), 0, NULL) ==
sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, 5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, -5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, 0, &extlogpen) == 0);
+ TEST(GetObject(hPen, 4, &extlogpen) == 0);
+
+ /* Nothing should be filled */
+ TEST(extlogpen.elpPenStyle == 0x77777777);
+ TEST(extlogpen.elpWidth == 0x77777777);
+
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN), &extlogpen) ==
sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN)-sizeof(DWORD), &extlogpen) ==
sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN)-sizeof(DWORD)-1, &extlogpen) == 0);
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN)+2, &extlogpen) ==
sizeof(EXTLOGPEN)-sizeof(DWORD));
+ TEST(GetObject(hPen, -5, &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD));
+
+ /* test if the fields are filled correctly */
+ TEST(extlogpen.elpPenStyle == (PS_GEOMETRIC | PS_DASH));
+ TEST(extlogpen.elpWidth == 5);
+ TEST(extlogpen.elpBrushStyle == 0);
+ TEST(extlogpen.elpColor == RGB(1,2,3));
+ TEST(extlogpen.elpHatch == 22);
+ TEST(extlogpen.elpNumEntries == 0);
+ DeleteObject(hPen);
+
+ /* A maximum of 16 Styles is allowed */
+ hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 16, (CONST
DWORD*)&dwStyles);
+ TEST(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN) + 15*sizeof(DWORD));
+ TEST(GetObject(hPen, sizeof(EXTLOGPEN) + 15*sizeof(DWORD), &elpUserStyle) ==
sizeof(EXTLOGPEN) + 15*sizeof(DWORD));
+ TEST(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[0] == 0);
+ TEST(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[1] == 1);
+ TEST(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[15] == 15);
+ DeleteObject(hPen);
+
+ return TRUE;
+}
+
+static INT
+Test_Font(PTESTINFO pti)
+{
+ HFONT hFont;
+ LOGFONTA logfonta;
+ LOGFONTW logfontw;
+ EXTLOGFONTA extlogfonta;
+ EXTLOGFONTW extlogfontw;
+ ENUMLOGFONTEXA enumlogfontexa;
+ ENUMLOGFONTEXW enumlogfontexw;
+ ENUMLOGFONTEXDVA enumlogfontexdva;
+ ENUMLOGFONTEXDVW enumlogfontexdvw;
+ ENUMLOGFONTA enumlogfonta;
+ ENUMLOGFONTW enumlogfontw;
+ BYTE bData[270];
+
+ FillMemory(&logfonta, sizeof(LOGFONTA), 0x77);
+ hFont = CreateFont(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
+ ANSI_CHARSET, OUT_CHARACTER_PRECIS, CLIP_CHARACTER_PRECIS,
+ ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont");
+ TEST(hFont);
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA));
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW));
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) ==
sizeof(LOGFONTA)); // 60
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) ==
sizeof(LOGFONTA)); // 156
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) ==
sizeof(LOGFONTA)); // 188
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) ==
sizeof(LOGFONTA)); // 192
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) ==
sizeof(LOGFONTA)); // 260
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) ==
sizeof(LOGFONTA)); // 260
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) ==
sizeof(LOGFONTW)); // 92
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) ==
sizeof(LOGFONTW)); // 284
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) ==
sizeof(LOGFONTW)); // 320
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) ==
sizeof(LOGFONTW)); // 348
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) ==
sizeof(LOGFONTW)); // 420
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) ==
sizeof(LOGFONTW)); // 356!
+
+ TEST(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA));
+ TEST(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA));
+ TEST(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA));
+ TEST(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA));
+ TEST(GetObjectA(hFont, 0, &logfonta) == 0);
+ TEST(logfonta.lfHeight == 0x77777777);
+
+ TEST(GetObjectA(hFont, 5, &logfonta) == 5);
+ TEST(logfonta.lfHeight == 8);
+ TEST(logfonta.lfWidth == 0x77777708);
+
+ TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
+ TEST(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA)); // 92
+ TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA));
// 192
+ TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) ==
sizeof(EXTLOGFONTA)+1); // 192
+ TEST(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) ==
sizeof(ENUMLOGFONTEXDVA)); // 320
+
+ TEST(GetObjectA(hFont, 261, &bData) == 260); // no
+
+ /* LOGFONT / GetObjectW */
+ FillMemory(&logfontw, sizeof(LOGFONTW), 0x77);
+
+ TEST(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW));
+ TEST(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW));
+ TEST(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW));
+ TEST(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW));
+ TEST(GetObjectW(hFont, 0, &logfontw) == 0);
+ TEST(logfontw.lfHeight == 0x77777777);
+
+ TEST(GetObjectW(hFont, 5, &logfontw) == 5);
+ TEST(logfontw.lfHeight == 8);
+ TEST(logfontw.lfWidth == 0x77777708);
+
+ TEST(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA)); // 60
+ TEST(logfonta.lfHeight == 8);
+ TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &enumlogfonta) ==
sizeof(ENUMLOGFONTA)); // 156
+ TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &enumlogfontexa) ==
sizeof(ENUMLOGFONTEXA)); // 188
+ TEST(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA));
// 192
+ TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdva) ==
sizeof(ENUMLOGFONTEXDVA)); // 260
+ TEST(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) ==
sizeof(ENUMLOGFONTEXDVA)); // 260
+
+ TEST(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW)); // 92
+ TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) ==
sizeof(ENUMLOGFONTW)); // 284
+ TEST(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW));
// 320
+ TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) ==
sizeof(ENUMLOGFONTEXW)); // 348
+ TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 420
+ TEST(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD)); // 356!
+
+ TEST(GetObjectW(hFont, 356, &bData) == 356);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ DeleteObject(hFont);
+
+ return TRUE;
+}
+
+static INT
+Test_Colorspace(PTESTINFO pti)
+{
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60);// FIXME: what
structure?
+ TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INSUFFICIENT_BUFFER);
+
+ return TRUE;
+}
+
+static INT
+Test_MetaDC(PTESTINFO pti)
+{
+ /* Windows does not SetLastError() on a metadc, but it doesn't seem to do anything
with it */
+ HDC hMetaDC;
+ BYTE buffer[100];
+
+ hMetaDC = CreateMetaFile(NULL);
+ if(!hMetaDC) return FALSE;
+ if(((UINT)hMetaDC & GDI_HANDLE_TYPE_MASK) != GDI_OBJECT_TYPE_METADC) return FALSE;
+
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0);
+ TEST(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0);
+ TEST(GetObjectA(hMetaDC, 0, NULL) == 0);
+ TEST(GetObjectA(hMetaDC, 100, &buffer) == 0);
+ TEST(GetLastError() == ERROR_SUCCESS);
+ return TRUE;
+}
+
+INT
+Test_GetObject(PTESTINFO pti)
+{
+
+ HRGN hRgn;
+ hRgn = CreateRectRgn(0,0,5,5);
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetObjectW(hRgn, 0, NULL) == 0);
+ TEST(GetLastError() == ERROR_INVALID_HANDLE);
+ DeleteObject(hRgn);
+
+ Test_Font(pti);
+ Test_Colorspace(pti);
+ Test_General(pti);
+ Test_Bitmap(pti);
+ Test_Dibsection(pti);
+ Test_Palette(pti);
+ Test_Brush(pti);
+ Test_Pen(pti);
+ Test_ExtPen(pti); // not implemented yet in ROS
+ Test_MetaDC(pti);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/gdi32api/tests/GetStockObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/G…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/GetStockObject.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/GetStockObject.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,27 @@
+#include "../gdi32api.h"
+
+INT
+Test_GetStockObject(PTESTINFO pti)
+{
+ /* Test limits and error */
+ SetLastError(ERROR_SUCCESS);
+ TEST(GetStockObject(0) != NULL);
+ TEST(GetStockObject(21) != NULL);
+ TEST(GetStockObject(-1) == NULL);
+ TEST(GetStockObject(9) == NULL);
+ TEST(GetStockObject(22) == NULL);
+ TEST(GetLastError() == ERROR_SUCCESS);
+
+ /* Test for the stock bit */
+ TEST((UINT)GetStockObject(WHITE_BRUSH) && GDI_HANDLE_STOCK_MASK);
+
+ /* Test for correct types */
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_BRUSH)) == GDI_OBJECT_TYPE_BRUSH);
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_BRUSH)) == GDI_OBJECT_TYPE_BRUSH);
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(WHITE_PEN)) == GDI_OBJECT_TYPE_PEN);
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DC_PEN)) == GDI_OBJECT_TYPE_PEN);
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(ANSI_VAR_FONT)) == GDI_OBJECT_TYPE_FONT);
+ TEST(GDI_HANDLE_GET_TYPE(GetStockObject(DEFAULT_PALETTE)) == GDI_OBJECT_TYPE_PALETTE);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/gdi32api/tests/SelectObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/SelectObject.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/SelectObject.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,8 @@
+#include "../gdi32api.h"
+
+INT
+Test_SelectObject(PTESTINFO pti)
+{
+ return APISTATUS_NORMAL;
+}
+
Added: trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/SetDCPenColor.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,43 @@
+#include "../gdi32api.h"
+
+INT
+Test_SetDCPenColor(PTESTINFO pti)
+{
+ HDC hScreenDC, hDC;
+
+ // Test an incorrect DC
+ TEST(SetDCPenColor(0, RGB(0,0,0)) == CLR_INVALID);
+
+ // Get the Screen DC
+ hScreenDC = GetDC(NULL);
+ if (hScreenDC == NULL) return FALSE;
+
+ // Test the screen DC
+ SetDCPenColor(hScreenDC, RGB(1,2,3));
+ TEST(SetDCPenColor(hScreenDC, RGB(4,5,6)) == RGB(1,2,3));
+
+ // Create a new DC
+ hDC = CreateCompatibleDC(hScreenDC);
+ ReleaseDC(0, hScreenDC);
+ if (hDC == NULL)
+ {
+ return FALSE;
+ }
+
+ // Select the DC_PEN and check if the pen returned by a new call is DC_PEN
+ SelectObject(hDC, GetStockObject(DC_PEN));
+ TEST(SelectObject(hDC, GetStockObject(BLACK_PEN)) == GetStockObject(DC_PEN));
+
+ // Test an incorrect color, yes windows sets the color!
+ SetDCPenColor(hDC, 0x21123456);
+ TEST(SetDCPenColor(hDC, RGB(0,0,0)) == 0x21123456);
+
+ // Test CLR_INVALID, it sets CLR_INVALID!
+ SetDCPenColor(hDC, CLR_INVALID);
+ TEST(SetDCPenColor(hDC, RGB(0,0,0)) == CLR_INVALID);
+
+ // Delete the DC
+ DeleteDC(hDC);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/gdi32api/tests/SetSysColors.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32api/tests/S…
==============================================================================
--- trunk/rostests/apitests/gdi32api/tests/SetSysColors.c (added)
+++ trunk/rostests/apitests/gdi32api/tests/SetSysColors.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,31 @@
+#include "../gdi32api.h"
+
+#define NUM_SYSCOLORS 31
+
+INT
+Test_SetSysColors(PTESTINFO pti)
+{
+ INT i;
+ INT nElements[NUM_SYSCOLORS];
+ COLORREF crOldColors[NUM_SYSCOLORS];
+ COLORREF crColors[3] = {RGB(212, 208, 200),2,3};
+
+ /* First save the Old colors */
+ for (i = 0; i < NUM_SYSCOLORS; i++)
+ {
+ nElements[i] = i;
+ crOldColors[i] = GetSysColor(i);
+ }
+
+ TEST((UINT)SetSysColors(0, nElements, crColors) == 1);
+ TEST((UINT)SetSysColors(1, nElements, crColors) == 1);
+ TEST((UINT)SetSysColors(2, nElements, crColors) == 1);
+
+ /* try more than NUM_SYSCOLORS */
+ TEST((UINT)SetSysColors(55, nElements, crColors) == 1);
+
+ /* restore old SysColors */
+ SetSysColors(NUM_SYSCOLORS, nElements, crOldColors);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/user32api/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/testli…
==============================================================================
--- trunk/rostests/apitests/user32api/testlist.c (added)
+++ trunk/rostests/apitests/user32api/testlist.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,25 @@
+#ifndef _USER32TESTLIST_H
+#define _USER32TESTLIST_H
+
+#include "user32api.h"
+
+/* include the tests */
+#include "tests/ScrollDC.c"
+#include "tests/ScrollWindowEx.c"
+
+/* The List of tests */
+TESTENTRY TestList[] =
+{
+ { L"ScrollDC", Test_ScrollDC },
+ { L"ScrollWindowEx", Test_ScrollWindowEx }
+};
+
+/* The function that gives us the number of tests */
+INT NumTests(void)
+{
+ return sizeof(TestList) / sizeof(TESTENTRY);
+}
+
+#endif /* _USER32TESTLIST_H */
+
+/* EOF */
Added: trunk/rostests/apitests/user32api/tests/ScrollDC.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/tests/…
==============================================================================
--- trunk/rostests/apitests/user32api/tests/ScrollDC.c (added)
+++ trunk/rostests/apitests/user32api/tests/ScrollDC.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,57 @@
+#include "../user32api.h"
+
+INT
+Test_ScrollDC(PTESTINFO pti)
+{
+ HWND hWnd, hWnd2;
+ HDC hDC;
+ HRGN hrgn;
+ RECT rcClip;
+
+ /* Create a window */
+ hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW |
WS_VISIBLE,
+ 100, 100, 100, 100,
+ NULL, NULL, g_hInstance, 0);
+ UpdateWindow(hWnd);
+ hDC = GetDC(hWnd);
+
+ /* Assert that no update region is there */
+ hrgn = CreateRectRgn(0,0,0,0);
+ ASSERT1(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ /* Test normal scrolling */
+ TEST(ScrollDC(hDC, 0, 0, NULL, NULL, hrgn, NULL) == TRUE);
+
+ /* Scroll with invalid update region */
+ DeleteObject(hrgn);
+ TEST(ScrollDC(hDC, 50, 0, NULL, NULL, hrgn, NULL) == FALSE);
+ hrgn = CreateRectRgn(0,0,0,0);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ /* Scroll with invalid update rect pointer */
+ TEST(ScrollDC(hDC, 50, 0, NULL, NULL, NULL, (PRECT)1) == 0);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ /* Scroll with a clip rect */
+ rcClip.left = 50; rcClip.top = 0; rcClip.right = 100; rcClip.bottom = 100;
+ TEST(ScrollDC(hDC, 50, 0, NULL, &rcClip, hrgn, NULL) == TRUE);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ /* Scroll with a clip rect */
+ rcClip.left = 50; rcClip.top = 0; rcClip.right = 100; rcClip.bottom = 100;
+ TEST(ScrollDC(hDC, 50, 50, NULL, &rcClip, hrgn, NULL) == TRUE);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ /* Overlap with another window */
+ hWnd2 = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW
| WS_VISIBLE,
+ 30, 160, 100, 100,
+ NULL, NULL, g_hInstance, 0);
+ UpdateWindow(hWnd2);
+
+ /* Cleanup */
+ ReleaseDC(hWnd, hDC);
+ DestroyWindow(hWnd);
+ DestroyWindow(hWnd2);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/user32api/tests/ScrollWindowEx.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/tests/…
==============================================================================
--- trunk/rostests/apitests/user32api/tests/ScrollWindowEx.c (added)
+++ trunk/rostests/apitests/user32api/tests/ScrollWindowEx.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,47 @@
+#include "../user32api.h"
+
+INT
+Test_ScrollWindowEx(PTESTINFO pti)
+{
+ HWND hWnd;
+ HRGN hrgn;
+ int Result;
+
+ /* Create a window */
+ hWnd = CreateWindowW(L"BUTTON", L"TestWindow", WS_OVERLAPPEDWINDOW |
WS_VISIBLE,
+ CW_USEDEFAULT, CW_USEDEFAULT, 100, 100,
+ NULL, NULL, g_hInstance, 0);
+ UpdateWindow(hWnd);
+
+ /* Assert that no update region is there */
+ hrgn = CreateRectRgn(0,0,0,0);
+ ASSERT1(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, 0);
+ TEST(Result == SIMPLEREGION);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == NULLREGION);
+
+ Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, NULL, SW_INVALIDATE);
+ TEST(Result == SIMPLEREGION);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == SIMPLEREGION);
+ UpdateWindow(hWnd);
+
+ // test invalid update region
+ DeleteObject(hrgn);
+ Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, hrgn, NULL, SW_INVALIDATE);
+ TEST(Result == ERROR);
+ hrgn = CreateRectRgn(0,0,0,0);
+ UpdateWindow(hWnd);
+
+ // Test invalid updaterect pointer
+ Result = ScrollWindowEx(hWnd, 20, 0, NULL, NULL, NULL, (LPRECT)1, SW_INVALIDATE);
+ TEST(Result == ERROR);
+ TEST(GetUpdateRgn(hWnd, hrgn, FALSE) == SIMPLEREGION);
+
+// test for alignment of rects
+
+ DeleteObject(hrgn);
+ DestroyWindow(hWnd);
+
+ return APISTATUS_NORMAL;
+}
Added: trunk/rostests/apitests/user32api/user32api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/user32…
==============================================================================
--- trunk/rostests/apitests/user32api/user32api.c (added)
+++ trunk/rostests/apitests/user32api/user32api.c Sun Aug 5 07:32:24 2007
@@ -1,0 +1,18 @@
+#include "user32api.h"
+
+HINSTANCE g_hInstance;
+
+BOOL
+IsFunctionPresent(LPWSTR lpszFunction)
+{
+ return TRUE;
+}
+
+int APIENTRY WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow)
+{
+ g_hInstance = hInstance;
+ return TestMain(L"user32api", L"user32.dll");
+}
Added: trunk/rostests/apitests/user32api/user32api.h
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/user32…
==============================================================================
--- trunk/rostests/apitests/user32api/user32api.h (added)
+++ trunk/rostests/apitests/user32api/user32api.h Sun Aug 5 07:32:24 2007
@@ -1,0 +1,10 @@
+#ifndef _USER32TEST_H
+#define _USER32TEST_H
+
+#include "../apitest.h"
+
+extern HINSTANCE g_hInstance;
+
+#endif /* _USER32TEST_H */
+
+/* EOF */
Added: trunk/rostests/apitests/user32api/user32api.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32api/user32…
==============================================================================
--- trunk/rostests/apitests/user32api/user32api.rbuild (added)
+++ trunk/rostests/apitests/user32api/user32api.rbuild Sun Aug 5 07:32:24 2007
@@ -1,0 +1,12 @@
+<module name="user32api" type="win32cui">
+ <include base="user32api">.</include>
+ <define name="__USE_W32API" />
+ <define name="_WIN32_WINNT">0x0501</define>
+ <library>apitest</library>
+ <library>kernel32</library>
+ <library>user32</library>
+ <library>gdi32</library>
+ <library>shell32</library>
+ <file>user32api.c</file>
+ <file>testlist.c</file>
+</module>
Modified: trunk/rostests/apitests/w32kdll/w32kdll.def
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32kdll/w32kdll.…
==============================================================================
--- trunk/rostests/apitests/w32kdll/w32kdll.def (original)
+++ trunk/rostests/apitests/w32kdll/w32kdll.def Sun Aug 5 07:32:24 2007
@@ -306,7 +306,7 @@
NtGdiStrokeAndFillPath@4
NtGdiStrokePath@4
NtGdiSwapBuffers@4
-;NtGdiTransformPoints@20
+NtGdiTransformPoints@20
NtGdiTransparentBlt@44
;NtGdiUnloadPrinterDriver@8
;NtGdiUMPDEngFreeUserMem@4
Modified: trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntdd/Nt…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c (original)
+++ trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdCreateDirectDrawObject.c Sun Aug 5
07:32:24 2007
@@ -13,13 +13,14 @@
INT
Test_NtGdiDdCreateDirectDrawObject(PTESTINFO pti)
{
- HDC hdc=CreateDCW(L"Display",NULL,NULL,NULL);
+ HDC hdc = CreateDCW(L"Display",NULL,NULL,NULL);
+ ASSERT1(hdc != NULL);
- RTEST(NtGdiDdCreateDirectDrawObject(NULL) == NULL);
+ RTEST(NtGdiDdCreateDirectDrawObject(NULL) == NULL);
- TEST(NtGdiDdCreateDirectDrawObject(hdc) != NULL);
+ TEST(NtGdiDdCreateDirectDrawObject(hdc) != NULL);
- DeleteDC(hdc);
+ DeleteDC(hdc);
- return APISTATUS_NORMAL;
+ return APISTATUS_NORMAL;
}
Modified: trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntdd/Nt…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c (original)
+++ trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdDeleteDirectDrawObject.c Sun Aug 5
07:32:24 2007
@@ -13,7 +13,7 @@
INT
Test_NtGdiDdDeleteDirectDrawObject(PTESTINFO pti)
{
- TEST(NtGdiDdDeleteDirectDrawObject(NULL) == 0);
+ TEST(NtGdiDdDeleteDirectDrawObject(NULL) == 0);
- return APISTATUS_NORMAL;
+ return APISTATUS_NORMAL;
}
Modified: trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdQueryDirectDrawObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/ntdd/Nt…
==============================================================================
--- trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdQueryDirectDrawObject.c (original)
+++ trunk/rostests/apitests/w32knapi/ntdd/NtGdiDdQueryDirectDrawObject.c Sun Aug 5
07:32:24 2007
@@ -1,5 +1,5 @@
#include "../w32knapi.h"
-#if 0
+
W32KAPI
BOOL STDCALL
NtGdiDdQueryDirectDrawObject(
@@ -16,9 +16,9 @@
DWORD *puFourCC
)
{
- return (HANDLE)Syscall("NtGdiDdQueryDirectDrawObject", 11,
&hDirectDrawLocal);
+ return (BOOL)Syscall(L"NtGdiDdQueryDirectDrawObject", 11,
&hDirectDrawLocal);
}
-#endif
+
INT
Test_NtGdiDdQueryDirectDrawObject(PTESTINFO pti)
{
Modified: trunk/rostests/apitests/w32knapi/w32knapi.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/w32knapi/w32knap…
==============================================================================
--- trunk/rostests/apitests/w32knapi/w32knapi.rbuild (original)
+++ trunk/rostests/apitests/w32knapi/w32knapi.rbuild Sun Aug 5 07:32:24 2007
@@ -2,6 +2,7 @@
<include base="w32knapi">.</include>
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x0501</define>
+ <library>apitest</library>
<library>kernel32</library>
<library>user32</library>
<library>gdi32</library>
@@ -9,5 +10,4 @@
<file>w32knapi.c</file>
<file>testlist.c</file>
<file>xp-2600.c</file>
- <file>..\apitest.c</file>
</module>