ReactOS  0.4.15-dev-2993-g14fbe80
GetObject.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS api tests
3  * LICENSE: GPL - See COPYING in the top level directory
4  * PURPOSE: Test for GetObject
5  * PROGRAMMERS: Timo Kreuzer
6  */
7 
8 #include "precomp.h"
9 
10 #include <pseh/pseh2.h>
11 
12 #define INVALID_POINTER ((PVOID)(ULONG_PTR)0xdeadbeefdeadbeefULL)
13 
14 void
16 {
17  struct
18  {
19  LOGBRUSH logbrush;
20  BYTE additional[600];
21  } TestStruct;
22  PLOGBRUSH plogbrush;
23  HBRUSH hBrush;
24  HPEN hpen;
25  INT ret;
26 
27  /* Test null pointer and invalid handles */
29  ok(GetObjectA(0, 0, NULL) == 0, "\n");
30  ok(GetObjectA((HANDLE)-1, 0, NULL) == 0, "\n");
31 
32  /* Test invalid habdles of different types */
33  ok(GetObjectA((HANDLE)0x00380000, 0, NULL) == 0, "\n");
34  ok(GetLastError() == ERROR_SUCCESS, "\n");
35  ok(GetObjectA((HANDLE)0x00380000, 10, &TestStruct) == 0, "\n");
36  ok(GetLastError() == ERROR_SUCCESS, "\n");
38  ok(GetObjectA((HANDLE)0x00010000, 0, NULL) == 0, "\n");
41  ok(GetObjectA((HANDLE)0x00020000, 0, NULL) == 0, "\n");
42  ok(GetLastError() == ERROR_SUCCESS, "\n");
44  ok(GetObjectA((HANDLE)0x00030000, 0, NULL) == 0, "\n");
45  ok(GetLastError() == ERROR_SUCCESS, "\n");
47  ok(GetObjectA((HANDLE)0x00040000, 0, NULL) == 0, "\n");
50  ok(GetObjectA((HANDLE)0x00060000, 0, NULL) == 0, "\n");
51  ok(GetLastError() == ERROR_SUCCESS, "\n");
53  ok(GetObjectA((HANDLE)0x00070000, 0, NULL) == 0, "\n");
54  ok(GetLastError() == ERROR_SUCCESS, "\n");
56  ok(GetObjectA((HANDLE)0x000B0000, 0, NULL) == 0, "\n");
57  ok(GetLastError() == ERROR_SUCCESS, "\n");
59  ok(GetObjectA((HANDLE)0x000C0000, 0, NULL) == 0, "\n");
60  ok(GetLastError() == ERROR_SUCCESS, "\n");
62  ok(GetObjectA((HANDLE)0x000D0000, 0, NULL) == 0, "\n");
63  ok(GetLastError() == ERROR_SUCCESS, "\n");
65  ok(GetObjectA((HANDLE)0x000E0000, 0, NULL) == 0, "\n");
66  ok(GetLastError() == ERROR_SUCCESS, "\n");
68  ok(GetObjectA((HANDLE)0x000F0000, 0, NULL) == 0, "\n");
69  ok(GetLastError() == ERROR_SUCCESS, "\n");
71  ok(GetObjectA((HANDLE)0x00110000, 0, NULL) == 0, "\n");
72  ok(GetLastError() == ERROR_SUCCESS, "\n");
74  ok(GetObjectA((HANDLE)0x00120000, 0, NULL) == 0, "\n");
75  ok(GetLastError() == ERROR_SUCCESS, "\n");
77  ok(GetObjectA((HANDLE)0x00130000, 0, NULL) == 0, "\n");
78  ok(GetLastError() == ERROR_SUCCESS, "\n");
80  ok(GetObjectA((HANDLE)0x00140000, 0, NULL) == 0, "\n");
81  ok(GetLastError() == ERROR_SUCCESS, "\n");
83  ok(GetObjectA((HANDLE)0x00150000, 0, NULL) == 0, "\n");
84  ok(GetLastError() == ERROR_SUCCESS, "\n");
86  ok(GetObjectA((HANDLE)0x00160000, 0, NULL) == 0, "\n");
87  ok(GetLastError() == ERROR_SUCCESS, "\n");
89  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0, "\n");
92  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_DC, 0, NULL) == 0, "\n");
101  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0, "\n");
104  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EMF, 0, NULL) == 0, "\n");
118 
119  /* Test need of alignment */
121  hBrush = GetStockObject(WHITE_BRUSH);
122  plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush);
123  ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n");
124  plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 2);
125  ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == sizeof(LOGBRUSH), "\n");
126  plogbrush = (PVOID)((ULONG_PTR)&TestStruct.logbrush + 1);
127  //ok(GetObject(hBrush, sizeof(LOGBRUSH), plogbrush) == 0, "\n"); // fails on win7
128 
129  /* Test invalid buffer */
130  SetLastError(0xbadbad00);
132  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
133  SetLastError(0xbadbad00);
135  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
136  SetLastError(0xbadbad00);
137  ok(GetObjectW(GetStockObject(21), sizeof(BITMAP), INVALID_POINTER) == 0, "\n");
138  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
139  SetLastError(0xbadbad00);
141  ok(GetLastError() == 0xbadbad00, "wrong error: %ld\n", GetLastError());
143  _SEH2_TRY
144  {
146  }
148  {
149  ret = -1;
150  }
151  _SEH2_END
152  ok(ret == -1, "should have got an exception\n");
153 
154  ok(GetObjectW(GetStockObject(SYSTEM_FONT), 0x50000000, &TestStruct) == 356, "\n");
155  ok(GetObjectW(GetStockObject(WHITE_BRUSH), 0x50000000, &TestStruct) == sizeof(LOGBRUSH), "\n");
156 
157 
158  /* Test buffer size of 0 */
159  SetLastError(0xbadbad00);
160  hBrush = CreateSolidBrush(123);
161  ok(hBrush != NULL, "Failed to create brush\n");
162  ok_long(GetObjectA(hBrush, 0, &TestStruct), 0);
163  ok_err(0xbadbad00);
164  DeleteObject(hBrush);
165  SetLastError(0xbadbad00);
166  hpen = CreatePen(PS_SOLID, 1, 123);
167  ok(hpen != NULL, "Failed to create pen\n");
168  ok_long(GetObjectA(hpen, 0, &TestStruct), 0);
169  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
170  SetLastError(0xbadbad00);
171  TestStruct.logbrush.lbStyle = BS_SOLID;
172  TestStruct.logbrush.lbColor = RGB(1,2,3);
173  TestStruct.logbrush.lbHatch = 0;
174  hpen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID, 1, &TestStruct.logbrush, 0, NULL);
175  ok(hpen != NULL, "Failed to create pen\n");
176  ok_long(GetObjectA(hpen, 0, &TestStruct), 0);
177  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
178  SetLastError(0xbadbad00);
180  ok_err(0xbadbad00);
181  SetLastError(0xbadbad00);
182  ok(GetObjectW(GetStockObject(21), 0, &TestStruct) == 0, "\n");
183  ok_err(0xbadbad00);
184 
185 }
186 
187 void
189 {
191  BITMAP bitmap;
192  DIBSECTION dibsection;
193  BYTE bData[100] = {0};
194  BYTE Buffer[100] = {48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,0};
195 
196  FillMemory(&bitmap, sizeof(BITMAP), 0x77);
197  hBitmap = CreateBitmap(10,10,1,8,bData);
198  ok(hBitmap != 0, "CreateBitmap failed, skipping tests.\n");
199  if (!hBitmap) return;
200 
202  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP), "\n");
203  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BITMAP, 0, NULL) == sizeof(BITMAP), "\n");
204  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), NULL) == sizeof(BITMAP), "\n");
205  ok(GetLastError() == ERROR_SUCCESS, "\n");
206  ok(GetObjectA(hBitmap, sizeof(DIBSECTION), NULL) == sizeof(BITMAP), "\n");
207  ok(GetObjectA(hBitmap, 0, NULL) == sizeof(BITMAP), "\n");
208  ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n");
209  ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n");
210  ok(GetLastError() == ERROR_SUCCESS, "\n");
211  ok(GetObjectA(hBitmap, 5, NULL) == sizeof(BITMAP), "\n");
212  ok(GetObjectA(hBitmap, -5, NULL) == sizeof(BITMAP), "\n");
213  ok(GetObjectA(hBitmap, 0, Buffer) == 0, "\n");
214  ok(GetObjectA(hBitmap, 5, Buffer) == 0, "\n");
215  ok(GetLastError() == ERROR_SUCCESS, "\n");
216  ok(GetObjectA(hBitmap, sizeof(BITMAP), &bitmap) == sizeof(BITMAP), "\n");
217  ok(GetObjectA(hBitmap, sizeof(BITMAP)+2, &bitmap) == sizeof(BITMAP), "\n");
218  ok(GetObjectA(hBitmap, sizeof(DIBSECTION), &dibsection) == sizeof(BITMAP), "\n");
219  ok(GetObjectA(hBitmap, -5, &bitmap) == sizeof(BITMAP), "\n");
220  ok(GetLastError() == ERROR_SUCCESS, "\n");
221  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BITMAP, sizeof(BITMAP), &bitmap) == 0, "\n");
222  ok(GetLastError() == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %ld\n", GetLastError());
223 
224  // todo: test invalid handle + buffer
225 
227 }
228 
229 void
231 {
232  BITMAPINFO bmi = {{sizeof(BITMAPINFOHEADER), 10, 9, 1, 16, BI_RGB, 0, 10, 10, 0,0}};
234  BITMAP bitmap;
235  DIBSECTION dibsection;
236  PVOID pData;
237  HDC hDC;
238 
239  FillMemory(&dibsection, sizeof(DIBSECTION), 0x77);
240  hDC = GetDC(0);
242  ok(hBitmap != 0, "CreateDIBSection failed with %ld, skipping tests.\n", GetLastError());
243  if (!hBitmap) return;
244 
245  ok(GetObjectA((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n");
246  ok(GetObjectW((HANDLE)((UINT_PTR)hBitmap & 0x0000ffff), 0, NULL) == sizeof(BITMAP), "\n");
247 
249  ok_long(GetObject(hBitmap, sizeof(DIBSECTION), NULL), sizeof(BITMAP));
250  ok_long(GetObject(hBitmap, 0, NULL), sizeof(BITMAP));
251  ok_long(GetObject(hBitmap, 5, NULL), sizeof(BITMAP));
252  ok_long(GetObject(hBitmap, -5, NULL), sizeof(BITMAP));
253  ok_long(GetObject(hBitmap, 0, &dibsection), 0);
254  ok_long(GetObject(hBitmap, 5, &dibsection), 0);
255  ok_long(GetObject(hBitmap, sizeof(BITMAP), &bitmap), sizeof(BITMAP));
256  ok_long(GetObject(hBitmap, sizeof(BITMAP)+2, &bitmap), sizeof(BITMAP));
257  ok_long(bitmap.bmType, 0);
258  ok_long(bitmap.bmWidth, 10);
259  ok_long(bitmap.bmHeight, 9);
260  ok_long(bitmap.bmWidthBytes, 20);
261  ok_long(bitmap.bmPlanes, 1);
262  ok_long(bitmap.bmBitsPixel, 16);
263  ok(bitmap.bmBits == pData, "\n");
264  ok_long(GetObject(hBitmap, sizeof(DIBSECTION), &dibsection), sizeof(DIBSECTION));
265  ok_long(GetObject(hBitmap, sizeof(DIBSECTION)+2, &dibsection), sizeof(DIBSECTION));
266  ok_long(GetObject(hBitmap, -5, &dibsection), sizeof(DIBSECTION));
269  ReleaseDC(0, hDC);
270 }
271 
272 void
274 {
275  LOGPALETTE logpal;
276  HPALETTE hPalette;
277  WORD wPalette;
278 
279  FillMemory(&wPalette, sizeof(WORD), 0x77);
280  logpal.palVersion = 0x0300;
281  logpal.palNumEntries = 1;
282  logpal.palPalEntry[0].peRed = 0;
283  logpal.palPalEntry[0].peGreen = 0;
284  logpal.palPalEntry[0].peBlue = 0;
285  logpal.palPalEntry[0].peFlags = PC_EXPLICIT;
286  hPalette = CreatePalette(&logpal);
287  ok(hPalette != 0, "CreatePalette failed, skipping tests.\n");
288  if (!hPalette) return;
289 
290  ok(GetObjectA((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD), "\n");
291  ok(GetObjectW((HANDLE)((UINT_PTR)hPalette & 0x0000ffff), 0, NULL) == sizeof(WORD), "\n");
292 
294  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD), "\n");
295  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, 0, NULL) == sizeof(WORD), "\n");
296  ok(GetObject(hPalette, sizeof(WORD), NULL) == sizeof(WORD), "\n");
297  ok(GetObject(hPalette, 0, NULL) == sizeof(WORD), "\n");
298  ok(GetObject(hPalette, 5, NULL) == sizeof(WORD), "\n");
299  ok(GetObject(hPalette, -5, NULL) == sizeof(WORD), "\n");
300  ok(GetObject(hPalette, sizeof(WORD), &wPalette) == sizeof(WORD), "\n");
301  ok(GetObject(hPalette, sizeof(WORD)+2, &wPalette) == sizeof(WORD), "\n");
302  ok(GetObject(hPalette, 0, &wPalette) == 0, "\n");
303  ok(GetObject(hPalette, 1, &wPalette) == 0, "\n");
304  ok(GetObject(hPalette, -1, &wPalette) == sizeof(WORD), "\n");
305  ok(GetLastError() == ERROR_SUCCESS, "\n");
306  DeleteObject(hPalette);
307  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PALETTE, sizeof(WORD), &wPalette) == 0, "\n");
308  ok(GetLastError() == ERROR_SUCCESS, "\n");
309 
310 }
311 
312 void
314 {
315  LOGBRUSH logbrush;
316  HBRUSH hBrush;
317 
318  FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77);
319  hBrush = CreateSolidBrush(RGB(1,2,3));
320  ok(hBrush != 0, "CreateSolidBrush failed, skipping tests.\n");
321  if (!hBrush) return;
322 
324  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH), "\n");
325  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, 0, NULL) == sizeof(LOGBRUSH), "\n");
326  ok(GetObject(hBrush, sizeof(WORD), NULL) == sizeof(LOGBRUSH), "\n");
327  ok(GetObject(hBrush, 0, NULL) == sizeof(LOGBRUSH), "\n");
328  ok(GetObject(hBrush, 5, NULL) == sizeof(LOGBRUSH), "\n");
329  ok(GetObject(hBrush, -5, NULL) == sizeof(LOGBRUSH), "\n");
330 
331  //ok(GetObject(hBrush, 0, &logbrush) == 0, "\n"); fails on win7
332  ok(logbrush.lbStyle == 0x77777777, "\n");
333  ok(GetObject(hBrush, 5, &logbrush) == sizeof(LOGBRUSH), "\n");
334  ok(logbrush.lbStyle == 0, "\n");
335  ok(logbrush.lbColor == 0x77777701, "\n");
336 
337  ok(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH), "\n");
338  ok(GetObject(hBrush, sizeof(LOGBRUSH) - 1, &logbrush) == sizeof(LOGBRUSH), "\n");
339  ok(GetObject(hBrush, 1, &logbrush) == sizeof(LOGBRUSH), "\n");
340  ok(GetObject(hBrush, sizeof(LOGBRUSH)+2, &logbrush) == sizeof(LOGBRUSH), "\n");
341  ok(GetObject(hBrush, -1, &logbrush) == sizeof(LOGBRUSH), "\n");
342  // TODO: test all members
343 
344  ok(GetLastError() == ERROR_SUCCESS, "\n");
345  DeleteObject(hBrush);
346 
347  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, sizeof(LOGBRUSH), &logbrush) == 0, "\n");
348  ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
349 
350  /* Test handle fixup */
351  hBrush = (HBRUSH)((ULONG_PTR)GetStockObject(WHITE_BRUSH) & 0xFFFF);
352  ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
353  "GetObject(0x%p, ...) failed.\n", hBrush);
354 
355 #ifdef _WIN64
356  /* Test upper 32 bits */
357  hBrush = (HBRUSH)((ULONG64)GetStockObject(WHITE_BRUSH) | 0xFFFFFFFF00000000ULL);
358  ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
359  "GetObject(0x%p, ...) failed.\n", hBrush);
360  hBrush = (HBRUSH)((ULONG64)GetStockObject(WHITE_BRUSH) | 0x537F9F2F00000000ULL);
361  ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
362  "GetObject(0x%p, ...) failed.\n", hBrush);
363 #endif
364 }
365 
366 void
368 {
369  struct
370  {
371  BITMAPINFOHEADER bmiHeader;
372  WORD wColors[4];
373  BYTE jBuffer[16];
374  } PackedDIB =
375  {
376  {sizeof(BITMAPINFOHEADER), 4, 4, 1, 8, BI_RGB, 0, 1, 1, 4, 0},
377  {1, 7, 3, 1},
378  {0,1,2,3, 1,2,3,0, 2,3,0,1, 3,0,1,2},
379  };
380  LOGBRUSH logbrush;
381  HBRUSH hBrush;
382 
383  /* Create a DIB brush */
384  hBrush = CreateDIBPatternBrushPt(&PackedDIB, DIB_PAL_COLORS);
385  ok(hBrush != 0, "CreateSolidBrush failed, skipping tests.\n");
386  if (!hBrush) return;
387 
388  FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77);
390 
391  ok_long(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush), sizeof(LOGBRUSH));
392  ok_long(logbrush.lbStyle, BS_DIBPATTERN);
393  ok_long(logbrush.lbColor, 0);
394  ok_long(logbrush.lbHatch, (ULONG_PTR)&PackedDIB);
395 
397  DeleteObject(hBrush);
398 
399 
400  /* Create a DIB brush with undocumented iUsage 2 */
401  hBrush = CreateDIBPatternBrushPt(&PackedDIB, 2);
402  ok(hBrush != 0, "CreateSolidBrush failed, skipping tests.\n");
403  if (!hBrush) return;
404 
405  FillMemory(&logbrush, sizeof(LOGBRUSH), 0x77);
407 
408  ok_long(GetObject(hBrush, sizeof(LOGBRUSH), &logbrush), sizeof(LOGBRUSH));
409  ok_long(logbrush.lbStyle, BS_DIBPATTERN);
410  ok_long(logbrush.lbColor, 0);
411  ok_long(logbrush.lbHatch, (ULONG_PTR)&PackedDIB);
412 
414  DeleteObject(hBrush);
415 
416 }
417 
418 void
419 Test_Pen(void)
420 {
421  LOGPEN logpen;
422  HPEN hPen;
423 
424  FillMemory(&logpen, sizeof(LOGPEN), 0x77);
425  hPen = CreatePen(PS_SOLID, 3, RGB(4,5,6));
426  ok(hPen != 0, "CreatePen failed, skipping tests.\n");
427  if (!hPen) return;
429  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN), "\n");
430  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, 0, NULL) == sizeof(LOGPEN), "\n");
431  ok(GetObject(hPen, sizeof(BITMAP), NULL) == sizeof(LOGPEN), "\n");
432  ok(GetObject(hPen, 0, NULL) == sizeof(LOGPEN), "\n");
433  ok(GetObject(hPen, 5, NULL) == sizeof(LOGPEN), "\n");
434  ok(GetObject(hPen, -5, NULL) == sizeof(LOGPEN), "\n");
435  ok(GetObject(hPen, sizeof(LOGPEN), &logpen) == sizeof(LOGPEN), "\n");
436  ok(GetObject(hPen, sizeof(LOGPEN)-1, &logpen) == 0, "\n");
437  ok(GetObject(hPen, sizeof(LOGPEN)+2, &logpen) == sizeof(LOGPEN), "\n");
438  ok(GetObject(hPen, 0, &logpen) == 0, "\n");
439  ok(GetObject(hPen, -5, &logpen) == sizeof(LOGPEN), "\n");
440  //ok(GetLastError() == ERROR_SUCCESS, "\n"); fails on win7
441 
442  /* test if the fields are filled correctly */
443  ok(logpen.lopnStyle == PS_SOLID, "\n");
444 
445  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_PEN, sizeof(LOGPEN), &logpen) == 0, "\n");
446  ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER, got %ld\n", GetLastError());
447 
448  DeleteObject(hPen);
449 }
450 
451 void
453 {
454  HPEN hPen;
455  EXTLOGPEN extlogpen;
456  LOGBRUSH logbrush;
457  DWORD dwStyles[17] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
458  struct
459  {
460  EXTLOGPEN extlogpen;
461  DWORD dwStyles[50];
462  } elpUserStyle;
463  int i;
464 
466  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
469  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
471 
472  FillMemory(&extlogpen, sizeof(EXTLOGPEN), 0x77);
473  logbrush.lbStyle = BS_SOLID;
474  logbrush.lbColor = RGB(1,2,3);
475  logbrush.lbHatch = 22;
476  hPen = ExtCreatePen(PS_GEOMETRIC | PS_DASH, 5, &logbrush, 0, NULL);
477 
480  ok(GetObject(hPen, sizeof(EXTLOGPEN), NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
481  ok(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
482  ok(GetObject((HANDLE)GDI_HANDLE_GET_INDEX(hPen), 0, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
483  ok(GetObject(hPen, 5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
484  ok(GetObject(hPen, -5, NULL) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
485  ok(GetLastError() == ERROR_SUCCESS, "\n");
486  ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, NULL) == 0, "\n");
487  ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
488  SetLastError(0xbadbad00);
489  ok(GetObject(hPen, 0, &extlogpen) == 0, "\n");
490  ok((GetLastError() == 0xbadbad00) || (GetLastError() == ERROR_NOACCESS), "wrong error: %ld\n", GetLastError());
492  ok(GetObject(hPen, 4, &extlogpen) == 0, "\n");
493  ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
495  ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 0, &extlogpen) == 0, "\n");
496  ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
498  ok(GetObject((HANDLE)GDI_OBJECT_TYPE_EXTPEN, 4, &extlogpen) == 0, "\n");
499  ok(GetLastError() == ERROR_INVALID_PARAMETER, "got %ld\n", GetLastError());
501  ok(GetObject(hPen, sizeof(EXTLOGPEN) - 5, &extlogpen) == 0, "\n");
502  ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
503 
504  /* Nothing should be filled */
505  ok(extlogpen.elpPenStyle == 0x77777777, "\n");
506  ok(extlogpen.elpWidth == 0x77777777, "\n");
507 
508  ok(GetObject(hPen, sizeof(EXTLOGPEN), &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
509  ok(GetObject(hPen, sizeof(EXTLOGPEN)-sizeof(DWORD), &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
510  ok(GetObject(hPen, sizeof(EXTLOGPEN)-sizeof(DWORD)-1, &extlogpen) == 0, "\n");
511  ok(GetObject(hPen, sizeof(EXTLOGPEN)+2, &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
512  ok(GetObject(hPen, -5, &extlogpen) == sizeof(EXTLOGPEN)-sizeof(DWORD), "\n");
513 
514  /* test if the fields are filled correctly */
515  ok(extlogpen.elpPenStyle == (PS_GEOMETRIC | PS_DASH), "\n");
516  ok(extlogpen.elpWidth == 5, "\n");
517  ok(extlogpen.elpBrushStyle == 0, "\n");
518  ok(extlogpen.elpColor == RGB(1,2,3), "\n");
519  ok(extlogpen.elpHatch == 22, "\n");
520  ok(extlogpen.elpNumEntries == 0, "\n");
521  DeleteObject(hPen);
522 
523  /* A maximum of 16 Styles is allowed */
524  hPen = ExtCreatePen(PS_GEOMETRIC | PS_USERSTYLE, 5, &logbrush, 16, (CONST DWORD*)&dwStyles);
525  ok(GetObject(hPen, 0, NULL) == sizeof(EXTLOGPEN) + 15*sizeof(DWORD), "\n");
526  ok(GetObject(hPen, sizeof(EXTLOGPEN) + 15*sizeof(DWORD), &elpUserStyle) == sizeof(EXTLOGPEN) + 15*sizeof(DWORD), "\n");
527  for (i = 0; i <= 15; i++)
528  ok(((EXTLOGPEN*)&elpUserStyle)->elpStyleEntry[i] == i, "%d\n", i);
529  DeleteObject(hPen);
530 }
531 
532 void
534 {
535  HFONT hFont;
536  union
537  {
538  LOGFONTA logfonta;
539  LOGFONTW logfontw;
540  EXTLOGFONTA extlogfonta;
541  EXTLOGFONTW extlogfontw;
542  ENUMLOGFONTEXA enumlogfontexa;
543  ENUMLOGFONTEXW enumlogfontexw;
544  ENUMLOGFONTEXDVA enumlogfontexdva;
545  ENUMLOGFONTEXDVW enumlogfontexdvw;
546  ENUMLOGFONTA enumlogfonta;
547  ENUMLOGFONTW enumlogfontw;
548  BYTE bData[270];
549  } u;
550  int ret;
551 
552  FillMemory(&u, sizeof(u), 0x77);
553  hFont = CreateFontA(8, 8, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
555  ANTIALIASED_QUALITY, DEFAULT_PITCH, "testfont");
556  ok(hFont != 0, "\n");
557 
559  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTA), "\n");
560  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, 0, NULL) == sizeof(LOGFONTW), "\n");
561  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA), "\n"); // 60
562  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTA), NULL) == sizeof(LOGFONTA), "\n"); // 156
563  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTA), "\n"); // 188
564  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTA), NULL) == sizeof(LOGFONTA), "\n"); // 192
565  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA), NULL) == sizeof(LOGFONTA), "\n"); // 260
566  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVA)+1, NULL) == sizeof(LOGFONTA), "\n"); // 260
567  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "\n"); // 92
568  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTW), NULL) == sizeof(LOGFONTW), "\n"); // 284
569  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(EXTLOGFONTW), NULL) == sizeof(LOGFONTW), "\n"); // 320
570  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXW), NULL) == sizeof(LOGFONTW), "\n"); // 348
571  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW), NULL) == sizeof(LOGFONTW), "\n"); // 420
572  ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_FONT, sizeof(ENUMLOGFONTEXDVW)+1, NULL) == sizeof(LOGFONTW), "\n"); // 356!
573  ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
574 
575  ok(GetObjectA(hFont, sizeof(LOGFONTA), NULL) == sizeof(LOGFONTA), "\n");
576  ok(GetObjectA(hFont, 0, NULL) == sizeof(LOGFONTA), "\n");
577  ok(GetObjectA(hFont, 5, NULL) == sizeof(LOGFONTA), "\n");
578  ok(GetObjectA(hFont, -5, NULL) == sizeof(LOGFONTA), "\n");
579  ok(GetObjectA(hFont, 0, &u.logfonta) == 0, "\n");
580  ok(u.logfonta.lfHeight == 0x77777777, "\n");
581 
582  ok(GetObjectA(hFont, 5, &u.logfonta) == 5, "\n");
583  ok(u.logfonta.lfHeight == 8, "\n");
584  ok(u.logfonta.lfWidth == 0x77777708, "\n");
585 
586  ok(GetObjectA(hFont, 0, &u.logfonta) == 0, "\n");
587  ok(GetObjectA(hFont, -1, &u.logfonta) == sizeof(ENUMLOGFONTEXDVA), "\n");
588  ok(GetObjectA(hFont, 1, &u.logfonta) == 1, "\n"); // 1 -> 1
589  ok(GetObjectA(hFont, sizeof(LOGFONTA) - 1, &u.logfonta) == sizeof(LOGFONTA) - 1, "\n"); // 59 -> 59
590  ok(GetObjectA(hFont, sizeof(LOGFONTA), &u.logfonta) == sizeof(LOGFONTA), "\n"); // 60 -> 60
591  ok(GetObjectA(hFont, sizeof(LOGFONTA) + 1, &u.logfonta) == sizeof(LOGFONTA) + 1, "\n"); // 61 -> 61
592  ok(GetObjectA(hFont, sizeof(LOGFONTW) - 1, &u.logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 91 -> 91
593  ok(GetObjectA(hFont, sizeof(LOGFONTW), &u.logfontw) == sizeof(LOGFONTA), "\n"); // 92 -> 60
594  ok(GetObjectA(hFont, sizeof(LOGFONTW) + 1, &u.logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 93 -> 93
595  ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &u.extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192 -> 192
596  ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+1, &u.extlogfonta) == sizeof(EXTLOGFONTA)+1, "\n"); // 192+1 -> 192+1
597  ok(GetObjectA(hFont, sizeof(EXTLOGFONTA)+16*4, &u.extlogfonta) == sizeof(EXTLOGFONTA)+16*4, "\n"); // 192+1 -> 192+1
598  ok(GetObjectA(hFont, sizeof(EXTLOGFONTW), &u.extlogfontw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 320 -> 260
599  ok(GetObjectA(hFont, 261, &u.bData) == 260, "\n"); // no
600 
601  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA) - 1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA) - 1, "\n"); // 419
602  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 420
603  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 356!
604 
605  /* LOGFONT / GetObjectW */
606  FillMemory(&u.logfontw, sizeof(LOGFONTW), 0x77);
607 
608  ok(GetObjectW(hFont, sizeof(LOGFONTW), NULL) == sizeof(LOGFONTW), "1\n");
609  ok(GetObjectW(hFont, 0, NULL) == sizeof(LOGFONTW), "\n");
610  ok(GetObjectW(hFont, 5, NULL) == sizeof(LOGFONTW), "\n");
611  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXA), NULL) == sizeof(LOGFONTW), "\n");
612  ok(GetObjectW(hFont, -5, NULL) == sizeof(LOGFONTW), "\n");
613  ok(GetObjectW(hFont, 0, &u.logfontw) == 0, "\n");
614  ok(u.logfontw.lfHeight == 0x77777777, "\n");
615 
616  ok(GetObjectW(hFont, 5, &u.logfontw) == 5, "\n");
617  ok(u.logfontw.lfHeight == 8, "\n");
618  ok(u.logfontw.lfWidth == 0x77777708, "\n");
619 
620  ok(GetObjectA(hFont, sizeof(LOGFONTA), &u.logfonta) == sizeof(LOGFONTA), "\n"); // 60
621  ok(u.logfonta.lfHeight == 8, "\n");
622  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTA), &u.enumlogfonta) == sizeof(ENUMLOGFONTA), "\n"); // 156
623  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXA), &u.enumlogfontexa) == sizeof(ENUMLOGFONTEXA), "\n"); // 188
624  ok(GetObjectA(hFont, sizeof(EXTLOGFONTA), &u.extlogfonta) == sizeof(EXTLOGFONTA), "\n"); // 192
625  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA), &u.enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260
626  ok(GetObjectA(hFont, sizeof(ENUMLOGFONTEXDVA)+1, &u.enumlogfontexdva) == sizeof(ENUMLOGFONTEXDVA), "\n"); // 260
627 
628  ok(GetObjectW(hFont, sizeof(LOGFONTW), &u.logfontw) == sizeof(LOGFONTW), "\n"); // 92
629  ok(GetObjectW(hFont, sizeof(LOGFONTW) + 1, &u.logfontw) == sizeof(LOGFONTW) + 1, "\n"); // 92
630  ok(GetObjectW(hFont, sizeof(LOGFONTW) - 1, &u.logfontw) == sizeof(LOGFONTW) - 1, "\n"); // 92
631  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTW), &u.enumlogfontw) == sizeof(ENUMLOGFONTW), "\n"); // 284
632  ok(GetObjectW(hFont, sizeof(EXTLOGFONTW), &u.extlogfontw) == sizeof(EXTLOGFONTW), "\n"); // 320
633  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW), &u.enumlogfontexw) == sizeof(ENUMLOGFONTEXW), "\n"); // 348
634  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXW) + 1, &u.enumlogfontexw) == sizeof(ENUMLOGFONTEXW) + 1, "\n"); // 348
635  ok(GetObjectW(hFont, 355, &u.enumlogfontexdvw) == 355, "\n"); // 419
636 
637  ok(GetObjectW(hFont, 356, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419
638  ret = sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD);
639  ret = GetObjectW(hFont, 357, &u.enumlogfontexdvw);
640  ok(ret == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n");
641  ok(GetObjectW(hFont, 357, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419
642  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW) - 1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 419
643  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW), &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 420
644  ok(GetObjectW(hFont, sizeof(ENUMLOGFONTEXDVW)+1, &u.enumlogfontexdvw) == sizeof(ENUMLOGFONTEXW) + 2*sizeof(DWORD), "\n"); // 356!
645  ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
646 
648 }
649 
650 void
652 {
653  UCHAR buffer[1000];
654 
657  //ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 0, NULL) == 60, "\n");// FIXME: what structure? fails on win7
667 
668  //ok_long(GetObjectA((HANDLE)GDI_OBJECT_TYPE_COLORSPACE, 328, NULL), 0); // FIXME: fails on WHS
669  //ok_err(ERROR_INSUFFICIENT_BUFFER);
670 }
671 
672 void
674 {
675  /* Windows does not SetLastError() on a metadc, but it doesn't seem to do anything with it */
676  HDC hMetaDC;
677  BYTE buffer[1000];
678 
679  hMetaDC = CreateMetaFile(NULL);
680  ok(hMetaDC != 0, "CreateMetaFile failed, skipping tests.\n");
681  if(!hMetaDC) return;
682 
684 
686  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 0, NULL) == 0, "\n");
687  ok(GetObjectA((HANDLE)GDI_OBJECT_TYPE_METADC, 100, &buffer) == 0, "\n");
688  ok(GetObjectA(hMetaDC, 0, NULL) == 0, "\n");
689  ok(GetObjectA(hMetaDC, 1000, &buffer) == 0, "\n");
690  ok(GetLastError() == ERROR_SUCCESS, "got %ld\n", GetLastError());
691 }
692 
693 void
695 {
696  HRGN hRgn;
697  hRgn = CreateRectRgn(0,0,5,5);
699  ok(GetObjectW(hRgn, 0, NULL) == 0, "\n");
702 }
703 
705 {
706 
707  Test_Font();
708  Test_Colorspace();
709  Test_General();
710  Test_Bitmap();
711  Test_Dibsection();
712  Test_Palette();
713  Test_Brush();
714  Test_DIBBrush();
715  Test_Pen();
716  Test_ExtPen(); // not implemented yet in ROS
717  Test_MetaDC();
718  Test_Region();
719 }
720 
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI GetObjectA(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
COLORREF elpColor
Definition: wingdi.h:1944
#define GDI_HANDLE_GET_INDEX(h)
Definition: gdi.h:28
struct tagENUMLOGFONTEXW ENUMLOGFONTEXW
void Test_Dibsection(void)
Definition: GetObject.c:230
#define ANTIALIASED_QUALITY
Definition: wingdi.h:439
#define BS_DIBPATTERN
Definition: wingdi.h:1091
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define ERROR_SUCCESS
Definition: deptool.c:10
DWORD elpWidth
Definition: wingdi.h:1942
#define RGB(r, g, b)
Definition: precomp.h:62
#define DIB_PAL_COLORS
Definition: wingdi.h:365
UINT lbStyle
Definition: wingdi.h:1746
HDC WINAPI GetDC(_In_opt_ HWND)
#define GDI_OBJECT_TYPE_ENHMETAFILE
Definition: gdi.h:59
void Test_Colorspace(void)
Definition: GetObject.c:651
struct tagBITMAPINFOHEADER BITMAPINFOHEADER
ULONG_PTR lbHatch
Definition: wingdi.h:1748
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static HDC
Definition: imagelist.c:92
void Test_General(void)
Definition: GetObject.c:15
void Test_Region(void)
Definition: GetObject.c:694
static HRGN hRgn
Definition: mapping.c:33
void Test_ExtPen(void)
Definition: GetObject.c:452
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1040
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
GLuint buffer
Definition: glext.h:5915
#define WHITE_BRUSH
Definition: wingdi.h:901
#define GDI_OBJECT_TYPE_REGION
Definition: gdi.h:47
#define OUT_CHARACTER_PRECIS
Definition: wingdi.h:416
static HPEN hpen
#define ok_long(expression, result)
Definition: atltest.h:133
#define PS_GEOMETRIC
Definition: wingdi.h:582
ULONG_PTR elpHatch
Definition: wingdi.h:1945
int32_t INT
Definition: typedefs.h:58
HFONT hFont
Definition: main.c:53
#define GDI_OBJECT_TYPE_EXTPEN
Definition: gdi.h:55
DWORD elpNumEntries
Definition: wingdi.h:1946
_SEH2_TRY
Definition: create.c:4226
uint32_t ULONG_PTR
Definition: typedefs.h:65
WORD palVersion
Definition: wingdi.h:1832
#define GDI_OBJECT_TYPE_COLORSPACE
Definition: gdi.h:56
#define PS_SOLID
Definition: wingdi.h:585
#define ERROR_NOACCESS
Definition: winerror.h:578
void Test_Palette(void)
Definition: GetObject.c:273
#define FALSE
Definition: types.h:117
#define GDI_OBJECT_TYPE_BRUSH
Definition: gdi.h:52
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD elpPenStyle
Definition: wingdi.h:1941
UINT lopnStyle
Definition: wingdi.h:1844
#define CLIP_CHARACTER_PRECIS
Definition: wingdi.h:426
#define SYSTEM_FONT
Definition: wingdi.h:910
void Test_Pen(void)
Definition: GetObject.c:419
Definition: bufpool.h:45
void * PVOID
Definition: retypes.h:9
#define GDI_OBJECT_TYPE_PALETTE
Definition: gdi.h:49
#define ULL(a, b)
Definition: format_msg.c:27
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
HRGN WINAPI CreateRectRgn(_In_ int, _In_ int, _In_ int, _In_ int)
Definition: uimain.c:88
#define DEFAULT_PITCH
Definition: wingdi.h:442
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)
COLORREF lbColor
Definition: wingdi.h:1747
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
#define FillMemory(BUF, SIZ, MASK)
Definition: strucsup.c:31
#define SetLastError(x)
Definition: compat.h:611
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define GDI_OBJECT_TYPE_METADC
Definition: gdi.h:57
#define GetObject
Definition: wingdi.h:4467
unsigned __int64 ULONG64
Definition: imports.h:198
unsigned char UCHAR
Definition: xmlstorage.h:181
int ret
#define GDI_OBJECT_TYPE_DC
Definition: gdi.h:46
#define GDI_OBJECT_TYPE_METAFILE
Definition: gdi.h:58
#define GDI_OBJECT_TYPE_BITMAP
Definition: gdi.h:48
#define ok_err(error)
Definition: atltest.h:124
#define CreateMetaFile
Definition: wingdi.h:4446
#define PS_DASH
Definition: wingdi.h:586
unsigned char BYTE
Definition: xxhash.c:193
HFONT WINAPI CreateFontA(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCSTR)
static HDC hDC
Definition: 3dtext.c:33
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
START_TEST(GetObject)
Definition: GetObject.c:704
_SEH2_END
Definition: create.c:4400
#define INVALID_POINTER
Definition: GetObject.c:12
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT elpBrushStyle
Definition: wingdi.h:1943
#define BLACK_PEN
Definition: wingdi.h:902
#define GDI_OBJECT_TYPE_EMF
Definition: gdi.h:53
HBITMAP WINAPI CreateDIBSection(HDC hDC, CONST BITMAPINFO *BitmapInfo, UINT Usage, VOID **Bits, HANDLE hSection, DWORD dwOffset)
Definition: bitmap.c:199
#define ok(value,...)
Definition: atltest.h:57
Definition: bl.h:1331
void Test_Brush(void)
Definition: GetObject.c:313
void Test_Font(void)
Definition: GetObject.c:533
#define NULL
Definition: types.h:112
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define FW_NORMAL
Definition: wingdi.h:372
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
void Test_MetaDC(void)
Definition: GetObject.c:673
void Test_Bitmap(void)
Definition: GetObject.c:188
HPEN WINAPI ExtCreatePen(_In_ DWORD iPenStyle, _In_ DWORD cWidth, _In_ const LOGBRUSH *plbrush, _In_ DWORD cStyle, _In_reads_opt_(cStyle) const DWORD *pstyle)
static HBITMAP bitmap
Definition: clipboard.c:1344
WORD palNumEntries
Definition: wingdi.h:1833
static HBITMAP
Definition: button.c:44
#define BS_SOLID
Definition: wingdi.h:1085
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
void Test_DIBBrush(void)
Definition: GetObject.c:367
#define GDI_HANDLE_TYPE_MASK
Definition: gdi.h:17
#define ANSI_CHARSET
Definition: wingdi.h:382
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1827
#define DIB_RGB_COLORS
Definition: wingdi.h:366
#define PC_EXPLICIT
Definition: wingdi.h:879
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
#define PS_USERSTYLE
Definition: wingdi.h:591
#define GDI_OBJECT_TYPE_FONT
Definition: gdi.h:50
#define BI_RGB
Definition: precomp.h:47
static HBITMAP hBitmap
Definition: timezone.c:26
#define CONST
Definition: pedump.c:81
HBITMAP WINAPI CreateBitmap(_In_ INT cx, _In_ INT cy, _In_ UINT cPlanes, _In_ UINT cBitsPerPel, _In_opt_ const VOID *pvBits)
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10