[WIN32NT_APITEST] Add tests for truncated and extended handle to NtGdiDeleteObjectApp test

This commit is contained in:
Timo Kreuzer 2020-01-04 13:14:28 +01:00
parent 8df1bd612a
commit 490362cc67

View file

@ -32,6 +32,23 @@ START_TEST(NtGdiDeleteObjectApp)
ok_long(GetLastError(), 0);
ok_int(GdiIsHandleValid(hdc), 0);
#ifdef _WIN64
/* Test upper 32 bits */
SetLastError(0);
hdc = (HDC)((ULONG64)CreateCompatibleDC(NULL) | 0xFFFFFFFF00000000ULL);
ok_int(GdiIsHandleValid(hdc), 1);
ok_int(NtGdiDeleteObjectApp(hdc), 1);
ok_long(GetLastError(), 0);
ok_int(GdiIsHandleValid(hdc), 0);
SetLastError(0);
hdc = (HDC)((ULONG64)CreateCompatibleDC(NULL) | 0x537F9F2F00000000ULL);
ok_int(GdiIsHandleValid(hdc), 1);
ok_int(NtGdiDeleteObjectApp(hdc), 1);
ok_long(GetLastError(), 0);
ok_int(GdiIsHandleValid(hdc), 0);
#endif
/* Delete a display DC */
SetLastError(0);
hdc = CreateDC("DISPLAY", NULL, NULL, NULL);
@ -56,6 +73,7 @@ START_TEST(NtGdiDeleteObjectApp)
/* Make sure */
ok_ptr((void *)NtUserCallOneParam((DWORD_PTR)hdc, ONEPARAM_ROUTINE_RELEASEDC), NULL);
/* Delete a brush */
SetLastError(0);
hbrush = CreateSolidBrush(0x123456);