Author: tkreuzer
Date: Mon Apr 23 19:02:51 2012
New Revision: 56397
URL:
http://svn.reactos.org/svn/reactos?rev=56397&view=rev
Log:
[GDI32_APITEST]
- Add more tests for GetCurrentObject and GetObject
- Comment out tests that fail on debug builds
Modified:
trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c
trunk/rostests/apitests/gdi32/GetCurrentObject.c
trunk/rostests/apitests/gdi32/GetObject.c
Modified: trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/EngDeleteS…
==============================================================================
--- trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/EngDeleteSemaphore.c [iso-8859-1] Mon Apr 23 19:02:51
2012
@@ -33,8 +33,8 @@
{
ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n",
lpcrit->DebugInfo->Type);
ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0,
"DebugInfo->CreatorBackTraceIndex=%d\n",
lpcrit->DebugInfo->CreatorBackTraceIndex);
- ok(lpcrit->DebugInfo->EntryCount != 0,
"DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
- ok(lpcrit->DebugInfo->ContentionCount != 0,
"DebugInfo->ContentionCount=%ld\n",
lpcrit->DebugInfo->ContentionCount);
+ //ok(lpcrit->DebugInfo->EntryCount != 0,
"DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
+ //ok(lpcrit->DebugInfo->ContentionCount != 0,
"DebugInfo->ContentionCount=%ld\n",
lpcrit->DebugInfo->ContentionCount);
}
/* test EngAcquireSemaphore and release it, then delete it */
@@ -58,8 +58,8 @@
{
ok(lpcrit->DebugInfo->Type != 0, "DebugInfo->Type=%d\n",
lpcrit->DebugInfo->Type);
ok(lpcrit->DebugInfo->CreatorBackTraceIndex != 0,
"DebugInfo->CreatorBackTraceIndex=%d\n",
lpcrit->DebugInfo->CreatorBackTraceIndex);
- ok(lpcrit->DebugInfo->EntryCount != 0,
"DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
- ok(lpcrit->DebugInfo->ContentionCount != 0,
"DebugInfo->ContentionCount=%ld\n",
lpcrit->DebugInfo->ContentionCount);
+ //ok(lpcrit->DebugInfo->EntryCount != 0,
"DebugInfo->EntryCount=%ld\n", lpcrit->DebugInfo->EntryCount);
+ //ok(lpcrit->DebugInfo->ContentionCount != 0,
"DebugInfo->ContentionCount=%ld\n",
lpcrit->DebugInfo->ContentionCount);
}
}
Modified: trunk/rostests/apitests/gdi32/GetCurrentObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetCurrent…
==============================================================================
--- trunk/rostests/apitests/gdi32/GetCurrentObject.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/GetCurrentObject.c [iso-8859-1] Mon Apr 23 19:02:51
2012
@@ -30,7 +30,7 @@
SetLastError(ERROR_SUCCESS);
hObj = GetCurrentObject(NULL, 0);
ok(hObj == 0, "Expected 0, got %p\n", hObj);
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_SUCCESS, got
%lu\n", GetLastError());
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
SetLastError(ERROR_SUCCESS);
hObj = GetCurrentObject(NULL, OBJ_BITMAP);
@@ -49,9 +49,9 @@
/* Test invalid DC handle */
SetLastError(ERROR_SUCCESS);
- hObj = GetCurrentObject((HDC)-123, 0);
+ hObj = GetCurrentObject((HDC)-123, OBJ_PEN);
ok(hObj == 0, "Expected 0, got %p\n", hObj);
- ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
+ ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %lu\n",
GetLastError());
SetLastError(ERROR_SUCCESS);
hObj = GetCurrentObject((HDC)-123, OBJ_BITMAP);
@@ -65,7 +65,17 @@
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
SetLastError(ERROR_SUCCESS);
+ hObj = GetCurrentObject((HDC)-123, 0);
+ ok(hObj == 0, "Expected 0, got %p\n", hObj);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
hObj = GetCurrentObject(hDC, 3);
+ ok(hObj == 0, "Expected 0, got %p\n", hObj);
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
+
+ SetLastError(ERROR_SUCCESS);
+ hObj = GetCurrentObject(NULL, 3);
ok(hObj == 0, "Expected 0, got %p\n", hObj);
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER,
got %lu\n", GetLastError());
Modified: trunk/rostests/apitests/gdi32/GetObject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/gdi32/GetObject.…
==============================================================================
--- trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/gdi32/GetObject.c [iso-8859-1] Mon Apr 23 19:02:51 2012
@@ -29,6 +29,60 @@
ok(GetObjectA((HANDLE)-1, 0, NULL) == 0, "\n");
ok(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0, "\n");
ok(GetLastError() == ERROR_SUCCESS, "\n");
+ ok(GetObjectA((HANDLE)0x00380000, 10, &TestStruct) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00010000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00020000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00030000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00040000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_HANDLE, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00060000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00070000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x000B0000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x000C0000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x000D0000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x000E0000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x000F0000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00110000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00120000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00130000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00140000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00150000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)0x00160000, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
SetLastError(ERROR_SUCCESS);
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0, "\n");
@@ -68,7 +122,7 @@
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n");
plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
- ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n");
+ //ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n"); // fails on
win7
}
void
@@ -89,18 +143,24 @@
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP),
"\n");
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP),
"\n");
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP),
"\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
ok(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n");
ok(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP), "\n");
ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP),
"\n");
+ ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP),
"\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
ok(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP), "\n");
ok(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP), "\n");
ok(GetObjectA(hBitmap, 0, Buffer) == 0, "\n");
ok(GetObjectA(hBitmap, 5, Buffer) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
ok(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP), "\n");
ok(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP),
"\n");
ok(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP),
"\n");
ok(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP), "\n");
ok(GetLastError() == ERROR_SUCCESS, "\n");
+ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), &bitmap) == 0,
"\n");
+ ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n",
GetLastError());
// todo: test invalid handle + buffer
@@ -120,8 +180,11 @@
FillMemory(&dibsection, sizeof(DIBSECTION), 0x77);
hDC = GetDC(0);
hBitmap = CreateDIBSection(hDC, &bmi, DIB_RGB_COLORS, &pData, NULL, 0);
- ok(hBitmap != 0, "CreateDIBSection failed, skipping tests.\n");
+ ok(hBitmap != 0, "CreateDIBSection failed with %ld, skipping tests.\n",
GetLastError());
if (!hBitmap) return;
+
+ ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP),
"\n");
+ ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP),
"\n");
SetLastError(ERROR_SUCCESS);
ok(GetObject(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n");
@@ -165,6 +228,9 @@
ok(hPalette != 0, "CreatePalette failed, skipping tests.\n");
if (!hPalette) return;
+ ok(GetObjectA((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD),
"\n");
+ ok(GetObjectW((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD),
"\n");
+
SetLastError(ERROR_SUCCESS);
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD),
"\n");
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD),
"\n");
@@ -179,6 +245,9 @@
ok(GetObject(hPalette, -1, &wPalette) == sizeof(WORD), "\n");
ok(GetLastError() == ERROR_SUCCESS, "\n");
DeleteObject(hPalette);
+ ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, sizeof(WORD), &wPalette) == 0,
"\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+
}
void
@@ -200,19 +269,24 @@
ok(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH), "\n");
ok(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH), "\n");
- ok(GetObject(hBrush, 0, &logbrush) == 0, "\n");
+ //ok(GetObject(hBrush, 0, &logbrush) == 0, "\n"); fails on win7
ok(logbrush.lbStyle == 0x77777777, "\n");
ok(GetObject(hBrush, 5, &logbrush) == sizeof(LOGBRUSH), "\n");
ok(logbrush.lbStyle == 0, "\n");
ok(logbrush.lbColor == 0x77777701, "\n");
ok(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
"\n");
+ ok(GetObject(hBrush, sizeof(LOGBRUSH) - 1, &logbrush) == sizeof(LOGBRUSH),
"\n");
+ ok(GetObject(hBrush, 1, &logbrush) == sizeof(LOGBRUSH), "\n");
ok(GetObject(hBrush, sizeof(LOGBRUSH)+2, &logbrush) == sizeof(LOGBRUSH),
"\n");
ok(GetObject(hBrush, -1, &logbrush) == sizeof(LOGBRUSH), "\n");
// TODO: test all members
ok(GetLastError() == ERROR_SUCCESS, "\n");
DeleteObject(hBrush);
+
+ ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, sizeof(LOGBRUSH), &logbrush) == 0,
"\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER,
got %ld\n", GetLastError());
}
void
@@ -237,11 +311,13 @@
ok(GetObject(hPen, sizeof(LOGPEN)+2, &logpen) == sizeof(LOGPEN), "\n");
ok(GetObject(hPen, 0, &logpen) == 0, "\n");
ok(GetObject(hPen, -5, &logpen) == sizeof(LOGPEN), "\n");
- ok(GetLastError() == ERROR_SUCCESS, "\n");
+ //ok(GetLastError() == ERROR_SUCCESS, "\n"); fails on win7
/* test if the fields are filled correctly */
ok(logpen.lopnStyle == PS_SOLID, "\n");
+ ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, sizeof(LOGPEN), &logpen) == 0,
"\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER,
got %ld\n", GetLastError());
DeleteObject(hPen);
}
@@ -261,6 +337,8 @@
SetLastError(ERROR_SUCCESS);
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "\n");
+ SetLastError(ERROR_SUCCESS);
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "\n");
@@ -270,15 +348,31 @@
logbrush.lbHatch = 22;
hPen = ExtCreatePen(PS_GEOMETRIC | PS_DASH, 5, &logbrush, 0, NULL);
+ SetLastError(ERROR_SUCCESS);
ok(GDI_HANDLE_GET_TYPE(hPen) == GDI_OBJECT_TYPE_EXTPEN, "\n");
- ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
ok(GetObject(hPen, sizeof(EXTLOGPEN), NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD),
"\n");
ok(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
ok(GetObject((HANDLE)GDI_HANDLE_GET_INDEX(hPen), 0, NULL) ==
sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
ok(GetObject(hPen, 5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
ok(GetObject(hPen, -5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "\n");
+ ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
+ SetLastError(ERROR_SUCCESS);
ok(GetObject(hPen, 0, &extlogpen) == 0, "\n");
+ ok(GetLastError() == ERROR_NOACCESS, "got %ld\n", GetLastError());
+ SetLastError(ERROR_SUCCESS);
ok(GetObject(hPen, 4, &extlogpen) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, &extlogpen) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 4, &extlogpen) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObject(hPen, sizeof(EXTLOGPEN) - 5, &extlogpen) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
/* Nothing should be filled */
ok(extlogpen.elpPenStyle == 0x77777777, "\n");
@@ -346,6 +440,7 @@
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) ==
sizeof(LOGFONTW), "\n"); // 348
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) ==
sizeof(LOGFONTW), "\n"); // 420
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) ==
sizeof(LOGFONTW), "\n"); // 356!
+ ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
ok(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA), "\n");
ok(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA), "\n");
@@ -358,20 +453,32 @@
ok(logfonta.lfHeight == 8, "\n");
ok(logfonta.lfWidth == 0x77777708, "\n");
- ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA),
"\n"); // 60
- ok(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA),
"\n"); // 92
- ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA),
"\n"); // 192
- ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1,
"\n"); // 192
- ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA),
"\n"); // 320
-
+ ok(GetObjectA(hFont, 0, &logfonta) == 0, "\n");
+ ok(GetObjectA(hFont, -1, &logfonta) == sizeof(ENUMLOGFONTEXDVA), "\n");
+ ok(GetObjectA(hFont, 1, &logfonta) == 1, "\n"); // 1 -> 1
+ ok(GetObjectA(hFont, sizeof(LOGFONTA) - 1, &logfonta) == sizeof(LOGFONTA) - 1,
"\n"); // 59 -> 59
+ ok(GetObjectA(hFont, sizeof(LOGFONTA), &logfonta) == sizeof(LOGFONTA),
"\n"); // 60 -> 60
+ ok(GetObjectA(hFont, sizeof(LOGFONTA) + 1, &logfonta) == sizeof(LOGFONTA) + 1,
"\n"); // 61 -> 61
+ ok(GetObjectA(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1,
"\n"); // 91 -> 91
+ ok(GetObjectA(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTA),
"\n"); // 92 -> 60
+ ok(GetObjectA(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1,
"\n"); // 93 -> 93
+ ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &extlogfonta) == sizeof(EXTLOGFONTA),
"\n"); // 192 -> 192
+ ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &extlogfonta) == sizeof(EXTLOGFONTA)+1,
"\n"); // 192+1 -> 192+1
+ ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+16*4, &extlogfonta) ==
sizeof(EXTLOGFONTA)+16*4, "\n"); // 192+1 -> 192+1
+ ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(ENUMLOGFONTEXDVA),
"\n"); // 320 -> 260
ok(GetObjectA(hFont, 261, &bData) == 260, "\n"); // no
+
+ ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA) - 1, &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXDVA) - 1, "\n"); // 419
+ ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXDVA), "\n"); // 420
+ ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXDVA), "\n"); // 356!
/* LOGFONT / GetObjectW */
FillMemory(&logfontw, sizeof(LOGFONTW), 0x77);
- ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "\n");
+ ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "1\n");
ok(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW), "\n");
ok(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW), "\n");
+ ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTW),
"\n");
ok(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW), "\n");
ok(GetObjectW(hFont, 0, &logfontw) == 0, "\n");
ok(logfontw.lfHeight == 0x77777777, "\n");
@@ -389,14 +496,21 @@
ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &enumlogfontexdva) ==
sizeof(ENUMLOGFONTEXDVA), "\n"); // 260
ok(GetObjectW(hFont, sizeof(LOGFONTW), &logfontw) == sizeof(LOGFONTW),
"\n"); // 92
+ ok(GetObjectW(hFont, sizeof(LOGFONTW) + 1, &logfontw) == sizeof(LOGFONTW) + 1,
"\n"); // 92
+ ok(GetObjectW(hFont, sizeof(LOGFONTW) - 1, &logfontw) == sizeof(LOGFONTW) - 1,
"\n"); // 92
ok(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &enumlogfontw) == sizeof(ENUMLOGFONTW),
"\n"); // 284
ok(GetObjectW(hFont, sizeof(EXTLOGFONTW), &extlogfontw) == sizeof(EXTLOGFONTW),
"\n"); // 320
ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &enumlogfontexw) ==
sizeof(ENUMLOGFONTEXW), "\n"); // 348
+ ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW) + 1, &enumlogfontexw) ==
sizeof(ENUMLOGFONTEXW) + 1, "\n"); // 348
+ ok(GetObjectW(hFont, 355, &enumlogfontexdvw) == 355, "\n"); // 419
+ ok(GetObjectW(hFont, 356, &enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) +
2*sizeof(DWORD), "\n"); // 419
+ ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW) - 1, &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419
ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 420
ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &enumlogfontexdvw) ==
sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 356!
ok(GetObjectW(hFont, 356, &bData) == 356, "\n");
- ok(GetLastError() == ERROR_SUCCESS, "\n");
+ ok(GetObjectW(hFont, 357, &bData) == 356, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
DeleteObject(hFont);
}
@@ -404,12 +518,25 @@
void
Test_Colorspace(void)
{
- SetLastError(ERROR_SUCCESS);
- ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60, "\n");//
FIXME: what structure?
+ UCHAR buffer[1000];
+ int ret = 0;
+
+ SetLastError(ERROR_SUCCESS);
+ GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL);
+ //ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60, "\n");//
FIXME: what structure? fails on win7
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "\n");
SetLastError(ERROR_SUCCESS);
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 0, "\n");
ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "\n");
+ SetLastError(ERROR_SUCCESS);
+ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 327, buffer) == 0, "\n");
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected
ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
+ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 328, buffer) == 0, "\n");
+ ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER,
got %ld\n", GetLastError());
+
+ ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 328, NULL) == 0, "\n");
+ //ok(ret == 0, "Expected ... got %d\n", ret);
+ ok(GetLastError() == ERROR_INSUFFICIENT_BUFFER, "expected
ERROR_INSUFFICIENT_BUFFER, got %ld\n", GetLastError());
}
void
@@ -417,7 +544,7 @@
{
/* Windows does not SetLastError() on a metadc, but it doesn't seem to do anything
with it */
HDC hMetaDC;
- BYTE buffer[100];
+ BYTE buffer[1000];
hMetaDC = CreateMetaFile(NULL);
ok(hMetaDC != 0, "CreateMetaFile failed, skipping tests.\n");
@@ -429,8 +556,8 @@
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0, "\n");
ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0, "\n");
ok(GetObjectA(hMetaDC, 0, NULL) == 0, "\n");
- ok(GetObjectA(hMetaDC, 100, &buffer) == 0, "\n");
- ok(GetLastError() == ERROR_SUCCESS, "\n");
+ ok(GetObjectA(hMetaDC, 1000, &buffer) == 0, "\n");
+ ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
}
void