mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +00:00
- update user32 winetest
svn path=/trunk/; revision=37702
This commit is contained in:
parent
017c4d5476
commit
acffd663c1
20 changed files with 4031 additions and 784 deletions
|
@ -108,14 +108,14 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname)
|
|||
skip("%s is not implemented\n", functionname);
|
||||
return;
|
||||
}
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError());
|
||||
ok(!ret, "Returned: %d\n", ret);
|
||||
ok(!ret || broken(ret), "Returned: %d\n", ret);
|
||||
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError());
|
||||
|
||||
SetLastError(0xcafebabe);
|
||||
recips = BSM_APPLICATIONS;
|
||||
ret = broadcast( 0x80000000, &recips, WM_NULL, 0, 0 );
|
||||
ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError());
|
||||
ok(!ret, "Returned: %d\n", ret);
|
||||
ok(!ret || broken(ret), "Returned: %d\n", ret);
|
||||
if (!ret) ok(GetLastError() == ERROR_INVALID_PARAMETER, "Last error: %08x\n", GetLastError());
|
||||
|
||||
#if 0 /* TODO: Check the hang flags */
|
||||
SetLastError(0xcafebabe);
|
||||
|
@ -150,23 +150,29 @@ static void test_parameters(PBROADCAST broadcast, const char *functionname)
|
|||
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 );
|
||||
ok(ret==1, "Returned: %d\n", ret);
|
||||
ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n");
|
||||
PulseEvent(hevent);
|
||||
if (ret)
|
||||
{
|
||||
ok(ret==1, "Returned: %d\n", ret);
|
||||
ok(WaitForSingleObject(hevent, 0) != WAIT_OBJECT_0, "Synchronous message sent instead\n");
|
||||
PulseEvent(hevent);
|
||||
|
||||
recips = BSM_APPLICATIONS;
|
||||
ret = broadcast( BSF_SENDNOTIFYMESSAGE, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY );
|
||||
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, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY );
|
||||
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( 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);
|
||||
}
|
||||
else /* BSF_SENDNOTIFYMESSAGE not supported on NT4 */
|
||||
ok( GetLastError() == ERROR_INVALID_PARAMETER, "failed with err %u\n", GetLastError() );
|
||||
|
||||
recips = BSM_APPLICATIONS;
|
||||
ret = broadcast( 0, &recips, WM_NULL, 100, 0 );
|
||||
|
@ -264,6 +270,9 @@ static void test_noprivileges(void)
|
|||
DWORD recips;
|
||||
BOOL ret;
|
||||
|
||||
static const DWORD BSM_ALL_RECIPS = BSM_VXDS | BSM_NETDRIVER |
|
||||
BSM_INSTALLABLEDRIVERS | BSM_APPLICATIONS;
|
||||
|
||||
pOpenProcessToken = (void *)GetProcAddress(advapi32, "OpenProcessToken");
|
||||
pAdjustTokenPrivileges = (void *)GetProcAddress(advapi32, "AdjustTokenPrivileges");
|
||||
if (!pOpenProcessToken || !pAdjustTokenPrivileges || !pOpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES, &token))
|
||||
|
@ -282,41 +291,44 @@ static void test_noprivileges(void)
|
|||
recips = BSM_ALLDESKTOPS;
|
||||
ResetEvent(hevent);
|
||||
ret = pBroadcastExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
|
||||
todo_wine ok(GetLastError() == ERROR_PRIVILEGE_NOT_HELD, "Last error: %08x\n", GetLastError());
|
||||
ok(ret==1, "Returned: %d\n", ret);
|
||||
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, "Received by: %08x\n", recips);
|
||||
ok(recips == BSM_ALLDESKTOPS ||
|
||||
recips == BSM_ALL_RECIPS, /* win2k3 */
|
||||
"Received by: %08x\n", recips);
|
||||
PulseEvent(hevent);
|
||||
|
||||
/* Wine sets last error to 0, so just use that one as token here so it doesn't fail */
|
||||
SetLastError(0);
|
||||
SetLastError(0xcafebabe);
|
||||
recips = BSM_ALLCOMPONENTS;
|
||||
ResetEvent(hevent);
|
||||
ret = pBroadcastExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
|
||||
ok(!GetLastError(), "Last error: %08x\n", GetLastError());
|
||||
ok(ret==1, "Returned: %d\n", ret);
|
||||
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, "Received by: %08x\n", recips);
|
||||
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 = pBroadcastExW( BSF_QUERY, &recips, WM_NULL, 100, 0, NULL );
|
||||
todo_wine ok(GetLastError() == ERROR_PRIVILEGE_NOT_HELD, "Last error: %08x\n", GetLastError());
|
||||
ok(ret==1, "Returned: %d\n", ret);
|
||||
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), "Received by: %08x\n", recips);
|
||||
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 = pBroadcastExW( BSF_QUERY, &recips, WM_NULL, 100, BROADCAST_QUERY_DENY, NULL );
|
||||
todo_wine ok(GetLastError() == ERROR_PRIVILEGE_NOT_HELD, "Last error: %08x\n", GetLastError());
|
||||
ok(!ret, "Returned: %d\n", ret);
|
||||
ok(WaitForSingleObject(hevent, 0) != WAIT_TIMEOUT, "Asynchronous message sent instead\n");
|
||||
ok(recips == (BSM_ALLDESKTOPS|BSM_APPLICATIONS), "Received by: %08x\n", recips);
|
||||
ok(recips == (BSM_ALLDESKTOPS|BSM_APPLICATIONS) ||
|
||||
recips == BSM_APPLICATIONS, /* win2k3 */
|
||||
"Received by: %08x\n", recips);
|
||||
PulseEvent(hevent);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue