Alex Henrie : user32/tests: Drop nonsensical broadcast tests that fail on Windows 10.
Alexandre Julliard
julliard at winehq.org
Mon Apr 30 15:12:47 CDT 2018
Module: wine
Branch: master
Commit: 816b22a6507565ba7581ea9f0230f104a0620cba
URL: https://source.winehq.org/git/wine.git/?a=commit;h=816b22a6507565ba7581ea9f0230f104a0620cba
Author: Alex Henrie <alexhenrie24 at gmail.com>
Date: Mon Apr 30 00:01:28 2018 -0600
user32/tests: Drop nonsensical broadcast tests that fail on Windows 10.
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/user32/tests/broadcast.c | 107 ------------------------------------------
1 file changed, 107 deletions(-)
diff --git a/dlls/user32/tests/broadcast.c b/dlls/user32/tests/broadcast.c
index afdb536..1a21695 100644
--- a/dlls/user32/tests/broadcast.c
+++ b/dlls/user32/tests/broadcast.c
@@ -128,13 +128,6 @@ if (0) /* TODO: Check the hang flags */
ok(0, "Returned: %d\n", ret);
}
- recips = BSM_APPLICATIONS;
- ResetEvent(hevent);
- ret = broadcast( BSF_POSTMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, 0 );
- ok(ret==1, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
-
SetLastError( 0xdeadbeef );
recips = BSM_APPLICATIONS;
ret = broadcast( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0 );
@@ -147,18 +140,6 @@ if (0) /* TODO: Check the hang flags */
ok(ret==1, "Returned: %d\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
PulseEvent(hevent);
-
- recips = BSM_APPLICATIONS;
- ret = broadcast( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY );
- ok(!ret, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
-
- recips = BSM_APPLICATIONS;
- ret = broadcast( 0, &recips, WM_NULL, 100, 0 );
- ok(ret==1, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
}
/* BSF_SENDNOTIFYMESSAGE and BSF_QUERY are both synchronous within the same process
@@ -210,13 +191,6 @@ if (0) /* TODO: Check the hang flags */
}
recips = BSM_APPLICATIONS;
- ResetEvent(hevent);
- ret = broadcastex( BSF_POSTMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
- ok(ret==1, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
-
- recips = BSM_APPLICATIONS;
ret = broadcastex( BSF_POSTMESSAGE|BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, 0, NULL );
ok(ret==1, "Returned: %d\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n");
@@ -227,84 +201,6 @@ if (0) /* TODO: Check the hang flags */
ok(ret==1, "Returned: %d\n", ret);
ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
PulseEvent(hevent);
-
- recips = BSM_APPLICATIONS;
- ret = broadcastex( BSF_SENDNOTIFYMESSAGE|BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY, NULL );
- ok(!ret, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
-
- recips = BSM_APPLICATIONS;
- ret = broadcastex( 0, &recips, WM_NULL, 100, 0, NULL );
- ok(ret==1, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- PulseEvent(hevent);
-}
-
-static void test_noprivileges(void)
-{
- HANDLE token;
- DWORD recips;
- BOOL ret;
-
- static const DWORD BSM_ALL_RECIPS = BSM_VXDS | BSM_NETDRIVER |
- BSM_INSTALLABLEDRIVERS | BSM_APPLICATIONS;
-
- if (!OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
- {
- skip("Can't open security token for process\n");
- return;
- }
- if (!AdjustTokenPrivileges(token, TRUE, NULL, 0, NULL, NULL))
- {
- skip("Can't adjust security token for process\n");
- return;
- }
-
- trace("Trying privileged edition!\n");
- SetLastError(0xcafebabe);
- recips = BSM_ALLDESKTOPS;
- ResetEvent(hevent);
- ret = BroadcastSystemMessageExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
- ok(ret==1, "Returned: %d error %u\n", ret, GetLastError());
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- ok(recips == BSM_ALLDESKTOPS ||
- recips == BSM_ALL_RECIPS, /* win2k3 */
- "Received by: %08x\n", recips);
- PulseEvent(hevent);
-
- SetLastError(0xcafebabe);
- recips = BSM_ALLCOMPONENTS;
- ResetEvent(hevent);
- ret = BroadcastSystemMessageExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
- ok(ret==1, "Returned: %d error %u\n", ret, GetLastError());
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- ok(recips == BSM_ALLCOMPONENTS ||
- recips == BSM_ALL_RECIPS, /* win2k3 */
- "Received by: %08x\n", recips);
- PulseEvent(hevent);
-
- SetLastError(0xcafebabe);
- recips = BSM_ALLDESKTOPS|BSM_APPLICATIONS;
- ResetEvent(hevent);
- ret = BroadcastSystemMessageExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
- ok(ret==1, "Returned: %d error %u\n", ret, GetLastError());
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- ok(recips == (BSM_ALLDESKTOPS|BSM_APPLICATIONS) ||
- recips == BSM_APPLICATIONS, /* win2k3 */
- "Received by: %08x\n", recips);
- PulseEvent(hevent);
-
- SetLastError(0xcafebabe);
- recips = BSM_ALLDESKTOPS|BSM_APPLICATIONS;
- ResetEvent(hevent);
- ret = BroadcastSystemMessageExW( BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY, NULL );
- ok(!ret, "Returned: %d\n", ret);
- ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
- ok(recips == (BSM_ALLDESKTOPS|BSM_APPLICATIONS) ||
- recips == BSM_APPLICATIONS, /* win2k3 */
- "Received by: %08x\n", recips);
- PulseEvent(hevent);
}
START_TEST(broadcast)
@@ -323,7 +219,4 @@ START_TEST(broadcast)
trace("Running BroadcastSystemMessageExW tests\n");
test_parametersEx(BroadcastSystemMessageExW);
-
- trace("Attempting privileges checking tests\n");
- test_noprivileges();
}
More information about the wine-cvs
mailing list