ReactOS  0.4.14-dev-323-g6fe6a88
NtGdiGetStockObject.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 NtGdiGetStockObject
5  * PROGRAMMERS:
6  */
7 
8 #include <win32nt.h>
9 
11 {
12  HANDLE handle = NULL;
13  BITMAP bitmap;
14 
15  /* BRUSH testing */
17  RTEST(handle != 0);
20 
22  RTEST(handle != 0);
25 
27  RTEST(handle != 0);
30 
32  RTEST(handle != 0);
35 
37  RTEST(handle != 0);
40 
42  RTEST(handle != 0);
45 
46  /* PEN testing */
48  RTEST(handle != 0);
51 
53  RTEST(handle != 0);
56 
58  RTEST(handle != 0);
61 
62  /* Not inuse ? */
63  RTEST(NtGdiGetStockObject(9) == 0);
64 
65  /* FONT testing */
67  RTEST(handle != 0);
70 
72  RTEST(handle != 0);
75 
77  RTEST(handle != 0);
80 
82  RTEST(handle != 0);
85 
87  RTEST(handle != 0);
90 
92  RTEST(handle != 0);
95 
97  RTEST(handle != 0);
100 
101  /* PALETTE testing */
103  RTEST(handle != 0);
106 
107  /* DC testing */
108  handle = (HANDLE) NtGdiGetStockObject(DC_BRUSH);
109  RTEST(handle != 0);
112 
113  handle = (HANDLE) NtGdiGetStockObject(DC_PEN);
114  RTEST(handle != 0);
117 
118 
119  /* ? testing */
121  RTEST(handle != 0);
124 
125  /* value 21 is getting back 1x1 1Bpp Bitmap */
127  RTEST(handle != 0);
130 
131  RTEST(GetObject(handle, sizeof(BITMAP), &bitmap) == sizeof(BITMAP));
132  RTEST(bitmap.bmType == 0);
133  RTEST(bitmap.bmWidth == 1);
134  RTEST(bitmap.bmHeight == 1);
135  RTEST(bitmap.bmWidthBytes == 2);
136  RTEST(bitmap.bmPlanes == 1);
137  RTEST(bitmap.bmBitsPixel == 1);
138  RTEST(bitmap.bmBits == 0);
139 
140 
141  RTEST(NtGdiGetStockObject(22) == 0);
142  RTEST(NtGdiGetStockObject(23) == 0);
143 
144 }
#define TRUE
Definition: types.h:120
#define WHITE_PEN
Definition: wingdi.h:904
#define NULL_BRUSH
Definition: wingdi.h:900
__kernel_entry W32KAPI HANDLE APIENTRY NtGdiGetStockObject(_In_ INT iObject)
#define WHITE_BRUSH
Definition: wingdi.h:901
#define GDI_OBJECT_TYPE_COLORSPACE
Definition: gdi.h:56
#define OEM_FIXED_FONT
Definition: wingdi.h:909
START_TEST(NtGdiGetStockObject)
#define GDI_OBJECT_TYPE_BRUSH
Definition: gdi.h:52
#define DEVICE_DEFAULT_FONT
Definition: wingdi.h:907
#define NULL_PEN
Definition: wingdi.h:903
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_IS_STOCKOBJ(h)
Definition: gdi.h:37
#define SYSTEM_FONT
Definition: wingdi.h:910
#define LTGRAY_BRUSH
Definition: wingdi.h:899
#define GRAY_BRUSH
Definition: wingdi.h:897
#define GDI_OBJECT_TYPE_PALETTE
Definition: gdi.h:49
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define BLACK_BRUSH
Definition: wingdi.h:895
Definition: uimain.c:88
#define DEFAULT_PALETTE
Definition: wingdi.h:912
#define GDI_OBJECT_TYPE_PEN
Definition: gdi.h:54
PVOID HANDLE
Definition: typedefs.h:71
#define GetObject
Definition: wingdi.h:4463
#define DEFAULT_GUI_FONT
Definition: wingdi.h:908
#define DKGRAY_BRUSH
Definition: wingdi.h:896
#define GDI_OBJECT_TYPE_BITMAP
Definition: gdi.h:48
#define ANSI_VAR_FONT
Definition: wingdi.h:906
#define BLACK_PEN
Definition: wingdi.h:902
Definition: bl.h:1331
#define ANSI_FIXED_FONT
Definition: wingdi.h:905
static HBITMAP bitmap
Definition: clipboard.c:1344
#define GDI_OBJECT_TYPE_FONT
Definition: gdi.h:50
#define RTEST(x)
Definition: precomp.h:21
#define SYSTEM_FIXED_FONT
Definition: wingdi.h:911