https://git.reactos.org/?p=reactos.git;a=commitdiff;h=40489359883ab583a5424…
commit 40489359883ab583a54246b0733df3596961140a
Author: Timo Kreuzer <timo.kreuzer(a)reactos.org>
AuthorDate: Sat Jan 4 13:13:45 2020 +0100
Commit: Timo Kreuzer <timo.kreuzer(a)reactos.org>
CommitDate: Sat Oct 31 14:24:09 2020 +0100
[GDI32_APITEST] Add tests for truncated and extended handle to GetObject test
---
modules/rostests/apitests/gdi32/GetObject.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/modules/rostests/apitests/gdi32/GetObject.c
b/modules/rostests/apitests/gdi32/GetObject.c
index 6ac232b78a7..df2a87170f7 100644
--- a/modules/rostests/apitests/gdi32/GetObject.c
+++ b/modules/rostests/apitests/gdi32/GetObject.c
@@ -344,6 +344,21 @@ Test_Brush(void)
ok(GetObjectW((HANDLE)GDI_OBJECT_TYPE_BRUSH, sizeof(LOGBRUSH), &logbrush) == 0,
"\n");
ok(GetLastError() == ERROR_INVALID_PARAMETER, "expected ERROR_INVALID_PARAMETER,
got %ld\n", GetLastError());
+
+ /* Test handle fixup */
+ hBrush = (HBRUSH)((ULONG_PTR)GetStockObject(WHITE_BRUSH) & 0xFFFF);
+ ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
+ "GetObject(0x%p, ...) failed.\n", hBrush);
+
+#ifdef _WIN64
+ /* Test upper 32 bits */
+ hBrush = (HBRUSH)((ULONG64)GetStockObject(WHITE_BRUSH) | 0xFFFFFFFF00000000ULL);
+ ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
+ "GetObject(0x%p, ...) failed.\n", hBrush);
+ hBrush = (HBRUSH)((ULONG64)GetStockObject(WHITE_BRUSH) | 0x537F9F2F00000000ULL);
+ ok(GetObjectW(hBrush, sizeof(LOGBRUSH), &logbrush) == sizeof(LOGBRUSH),
+ "GetObject(0x%p, ...) failed.\n", hBrush);
+#endif
}
void