https://git.reactos.org/?p=reactos.git;a=commitdiff;h=993eb076549fba4dd3f2f…
commit 993eb076549fba4dd3f2f3761962e65c34eda21e
Author: James Tabor <james.tabor(a)reactos.org>
AuthorDate: Sat Nov 27 14:47:11 2021 -0600
Commit: James Tabor <james.tabor(a)reactos.org>
CommitDate: Sat Nov 27 14:47:11 2021 -0600
[User32|API_TEST] Add Get Window Ptr Test
Adding test to verify results from a foreign window process.
See CORE-17856.
---
modules/rostests/apitests/user32/WndProc.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/modules/rostests/apitests/user32/WndProc.c
b/modules/rostests/apitests/user32/WndProc.c
index c8a41fb0471..542d4b98dfe 100644
--- a/modules/rostests/apitests/user32/WndProc.c
+++ b/modules/rostests/apitests/user32/WndProc.c
@@ -135,6 +135,27 @@ static void test_wndproc(void)
"UnregisterClassA() failed: LastError = %lu\n", GetLastError());
}
+static void test_get_wndproc(void)
+{
+ LONG_PTR ret;
+ SetLastError(0xfeedf00d);
+ ret = GetWindowLongPtrA(GetShellWindow(), GWLP_WNDPROC);
+ ok (ret == 0, "Should return NULL\n");
+ ok (GetLastError() == ERROR_ACCESS_DENIED, "Wrong return error!\n");
+ SetLastError(0xfeedf00d);
+ ret = GetWindowLongPtrW(GetShellWindow(), GWLP_WNDPROC);
+ ok (ret == 0, "Should return NULL\n");
+ ok (GetLastError() == ERROR_ACCESS_DENIED, "Wrong return error!\n");
+ SetLastError(0xfeedf00d);
+ ret = GetWindowLongPtrA(GetShellWindow(), GWLP_WNDPROC);
+ ok (ret == 0, "Should return NULL\n");
+ ok (GetLastError() == ERROR_ACCESS_DENIED, "Wrong return error!\n");
+ SetLastError(0xfeedf00d);
+ ret = GetWindowLongPtrW(GetShellWindow(), GWLP_WNDPROC);
+ ok (ret == 0, "Should return NULL\n");
+ ok (GetLastError() == ERROR_ACCESS_DENIED, "Wrong return error!\n");
+}
+
START_TEST(WndProc)
{
#ifdef __RUNTIME_CHECKS__
@@ -142,5 +163,6 @@ START_TEST(WndProc)
return;
#endif /* __RUNTIME_CHECKS__ */
+ test_get_wndproc();
test_wndproc();
}