https://git.reactos.org/?p=reactos.git;a=commitdiff;h=490362cc6783ffabdd98b…
commit 490362cc6783ffabdd98be7056a21c0a814509d3
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jan 4 13:14:28 2020 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Nov 7 18:34:10 2020 +0100
[WIN32NT_APITEST] Add tests for truncated and extended handle to NtGdiDeleteObjectApp
test
---
.../apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c
b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c
index fcc4041eb8a..a464f829d27 100644
--- a/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c
+++ b/modules/rostests/apitests/win32nt/ntgdi/NtGdiDeleteObjectApp.c
@@ -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);