[User32|API_TEST] Add Get Window Ptr Test

Adding test to verify results from a foreign window process.
See CORE-17856.
This commit is contained in:
James Tabor 2021-11-27 14:47:11 -06:00
parent 9cff384c22
commit 993eb07654

View file

@ -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();
}