@@ -16,14 +16,34 @@ Test_NtGdiDeleteObjectApp(PTESTINFO pti)
16
16
TEST (NtGdiDeleteObjectApp ((PVOID )(GDI_HANDLE_STOCK_MASK | 0x1234 )) == 1 );
17
17
TEST (GetLastError () == 0 );
18
18
19
- /* Delete a DC */
19
+ /* Delete a compatible DC */
20
20
SetLastError (0 );
21
21
hdc = CreateCompatibleDC (NULL );
22
22
ASSERT (IsHandleValid (hdc ) == 1 );
23
23
TEST (NtGdiDeleteObjectApp (hdc ) == 1 );
24
24
TEST (GetLastError () == 0 );
25
25
TEST (IsHandleValid (hdc ) == 0 );
26
26
27
+ /* Delete a display DC */
28
+ SetLastError (0 );
29
+ hdc = CreateDC ("DISPLAY" , NULL , NULL , NULL );
30
+ ASSERT (IsHandleValid (hdc ) == 1 );
31
+ TEST (NtGdiDeleteObjectApp (hdc ) != 0 );
32
+ TEST (GetLastError () == 0 );
33
+ TEST (IsHandleValid (hdc ) == 1 );
34
+ TEST (SelectObject (hdc , GetStockObject (WHITE_PEN )) == NULL );
35
+ TESTX (GetLastError () == ERROR_INVALID_PARAMETER , "GetLasterror returned 0x%08x\n" , (unsigned int )GetLastError ());
36
+
37
+ /* Once more */
38
+ SetLastError (0 );
39
+ hdc = GetDC (0 );
40
+ ASSERT (IsHandleValid (hdc ) == 1 );
41
+ TEST (NtGdiDeleteObjectApp (hdc ) != 0 );
42
+ TEST (GetLastError () == 0 );
43
+ TEST (IsHandleValid (hdc ) == 1 );
44
+ TEST (SelectObject (hdc , GetStockObject (WHITE_PEN )) == NULL );
45
+ TESTX (GetLastError () == ERROR_INVALID_PARAMETER , "GetLasterror returned 0x%08x\n" , (unsigned int )GetLastError ());
46
+
27
47
/* Delete a brush */
28
48
SetLastError (0 );
29
49
hbrush = CreateSolidBrush (0x123456 );
0 commit comments