1 /*
2  * PROJECT:         ReactOS api tests
3  * LICENSE:         GPL - See COPYING in the top level directory
4  * PURPOSE:         Test for CreateBitmapIndirect
5  * PROGRAMMERS:     Magnus Olsen
6  */
7 
8 #include <apitest.h>
9 
10 #include <wingdi.h>
11 
12 void Test_CreateBitmapIndirect()
13 {
14     HBITMAP win_hBmp;
15     BITMAP win_bitmap;
16 
17     win_bitmap.bmBits = 0;
18     win_bitmap.bmBitsPixel = 1;
19     win_bitmap.bmHeight = 0;
20     win_bitmap.bmPlanes = 1;
21     win_bitmap.bmType = 1;
22     win_bitmap.bmWidth = 0;
23     win_bitmap.bmWidthBytes = 2;
24     win_hBmp = CreateBitmapIndirect(&win_bitmap);
25     ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
26 
27     DeleteObject(win_hBmp);
28 
29     RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
30     win_bitmap.bmBits = 0;
31     win_bitmap.bmBitsPixel = 1;
32     win_bitmap.bmHeight = 0;
33     win_bitmap.bmPlanes = 1;
34     win_bitmap.bmType = 1;
35     win_bitmap.bmWidth = 0;
36     win_bitmap.bmWidthBytes = 1;
37     win_hBmp = CreateBitmapIndirect(&win_bitmap);
38     ok(win_hBmp == 0, "CreateBitmapIndirect succeeded\n");
39 
40     RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
41     win_bitmap.bmBits = 0;
42     win_bitmap.bmBitsPixel = 1;
43     win_bitmap.bmHeight = 0;
44     win_bitmap.bmPlanes = 1;
45     win_bitmap.bmType = 1;
46     win_bitmap.bmWidth = 0;
47     win_bitmap.bmWidthBytes = 3;
48     win_hBmp = CreateBitmapIndirect(&win_bitmap);
49     ok(win_hBmp == 0, "CreateBitmapIndirect succeeded\n");
50 
51     RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
52     win_bitmap.bmBits = 0;
53     win_bitmap.bmBitsPixel = 1;
54     win_bitmap.bmHeight = 0;
55     win_bitmap.bmPlanes = 1;
56     win_bitmap.bmType = 1;
57     win_bitmap.bmWidth = 0;
58     win_bitmap.bmWidthBytes = 4;
59     win_hBmp = CreateBitmapIndirect(&win_bitmap);
60     ok(win_hBmp != 0, "CreateBitmapIndirect failed\n");
61 
62     RtlZeroMemory(&win_bitmap,sizeof(BITMAP));
63     win_bitmap.bmBits = 0;
64     win_bitmap.bmBitsPixel = 8;
65     win_bitmap.bmHeight = 0xF000;
66     win_bitmap.bmPlanes = 1;
67     win_bitmap.bmType = 1;
68     win_bitmap.bmWidth = 0x8000;
69     win_bitmap.bmWidthBytes = win_bitmap.bmWidth;
70     win_hBmp = CreateBitmapIndirect(&win_bitmap);
71     //ok(win_hBmp != 0, "CreateBitmapIndirect failed\n"); // fails on win 2003
72 
73     DeleteObject(win_hBmp);
74 }
75 
76 START_TEST(CreateBitmapIndirect)
77 {
78     Test_CreateBitmapIndirect();
79 }
80 
81