Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
e1c2a870
Commit
e1c2a870
authored
Feb 21, 2018
by
Alex Henrie
Committed by
Alexandre Julliard
Feb 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32/tests: Drop broadcast test workarounds for Windows <= 2000.
Signed-off-by:
Alex Henrie
<
alexhenrie24@gmail.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
29e0230a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
54 deletions
+19
-54
broadcast.c
dlls/user32/tests/broadcast.c
+19
-54
No files found.
dlls/user32/tests/broadcast.c
View file @
e1c2a870
...
...
@@ -33,10 +33,6 @@
typedef
LONG
(
WINAPI
*
PBROADCAST
)(
DWORD
,
LPDWORD
,
UINT
,
WPARAM
,
LPARAM
);
typedef
LONG
(
WINAPI
*
PBROADCASTEX
)(
DWORD
,
LPDWORD
,
UINT
,
WPARAM
,
LPARAM
,
PBSMINFO
);
static
PBROADCAST
pBroadcastA
;
static
PBROADCAST
pBroadcastW
;
static
PBROADCASTEX
pBroadcastExA
;
static
PBROADCASTEX
pBroadcastExW
;
static
HANDLE
hevent
;
static
LRESULT
WINAPI
main_window_procA
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wparam
,
LPARAM
lparam
)
...
...
@@ -59,20 +55,6 @@ static LRESULT WINAPI main_window_procA(HWND hwnd, UINT msg, WPARAM wparam, LPAR
static
BOOL
init_procs
(
void
)
{
WNDCLASSA
cls
;
HANDLE
user32
=
GetModuleHandleA
(
"user32.dll"
);
pBroadcastA
=
(
PBROADCAST
)
GetProcAddress
(
user32
,
"BroadcastSystemMessageA"
);
if
(
!
pBroadcastA
)
pBroadcastA
=
(
PBROADCAST
)
GetProcAddress
(
user32
,
"BroadcastSystemMessage"
);
ok
(
pBroadcastA
!=
NULL
,
"No BroadcastSystemMessage found
\n
"
);
if
(
!
pBroadcastA
)
{
win_skip
(
"BroadcastA is not available
\n
"
);
return
FALSE
;
}
pBroadcastW
=
(
PBROADCAST
)
GetProcAddress
(
user32
,
"BroadcastSystemMessageW"
);
pBroadcastExA
=
(
PBROADCASTEX
)
GetProcAddress
(
user32
,
"BroadcastSystemMessageExA"
);
pBroadcastExW
=
(
PBROADCASTEX
)
GetProcAddress
(
user32
,
"BroadcastSystemMessageExW"
);
hevent
=
CreateEventA
(
NULL
,
TRUE
,
FALSE
,
"Asynchronous checking event"
);
...
...
@@ -264,12 +246,8 @@ if (0) /* TODO: Check the hang flags */
PulseEvent
(
hevent
);
}
static
BOOL
(
WINAPI
*
pOpenProcessToken
)(
HANDLE
,
DWORD
,
HANDLE
*
);
static
BOOL
(
WINAPI
*
pAdjustTokenPrivileges
)(
HANDLE
,
BOOL
,
PTOKEN_PRIVILEGES
,
DWORD
,
PTOKEN_PRIVILEGES
,
PDWORD
);
static
void
test_noprivileges
(
void
)
{
HANDLE
advapi32
=
GetModuleHandleA
(
"advapi32"
);
HANDLE
token
;
DWORD
recips
;
BOOL
ret
;
...
...
@@ -277,14 +255,12 @@ static void test_noprivileges(void)
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
))
if
(
!
OpenProcessToken
(
GetCurrentProcess
(),
TOKEN_ADJUST_PRIVILEGES
,
&
token
))
{
skip
(
"Can't open security token for process
\n
"
);
return
;
}
if
(
!
p
AdjustTokenPrivileges
(
token
,
TRUE
,
NULL
,
0
,
NULL
,
NULL
))
if
(
!
AdjustTokenPrivileges
(
token
,
TRUE
,
NULL
,
0
,
NULL
,
NULL
))
{
skip
(
"Can't adjust security token for process
\n
"
);
return
;
...
...
@@ -294,7 +270,7 @@ static void test_noprivileges(void)
SetLastError
(
0xcafebabe
);
recips
=
BSM_ALLDESKTOPS
;
ResetEvent
(
hevent
);
ret
=
pBroadcast
ExW
(
BSF_QUERY
,
&
recips
,
WM_NULL
,
100
,
0
,
NULL
);
ret
=
BroadcastSystemMessage
ExW
(
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
||
...
...
@@ -305,7 +281,7 @@ static void test_noprivileges(void)
SetLastError
(
0xcafebabe
);
recips
=
BSM_ALLCOMPONENTS
;
ResetEvent
(
hevent
);
ret
=
pBroadcast
ExW
(
BSF_QUERY
,
&
recips
,
WM_NULL
,
100
,
0
,
NULL
);
ret
=
BroadcastSystemMessage
ExW
(
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
||
...
...
@@ -316,7 +292,7 @@ static void test_noprivileges(void)
SetLastError
(
0xcafebabe
);
recips
=
BSM_ALLDESKTOPS
|
BSM_APPLICATIONS
;
ResetEvent
(
hevent
);
ret
=
pBroadcast
ExW
(
BSF_QUERY
,
&
recips
,
WM_NULL
,
100
,
0
,
NULL
);
ret
=
BroadcastSystemMessage
ExW
(
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
)
||
...
...
@@ -327,7 +303,7 @@ static void test_noprivileges(void)
SetLastError
(
0xcafebabe
);
recips
=
BSM_ALLDESKTOPS
|
BSM_APPLICATIONS
;
ResetEvent
(
hevent
);
ret
=
pBroadcast
ExW
(
BSF_QUERY
,
&
recips
,
WM_NULL
,
100
,
BROADCAST_QUERY_DENY
,
NULL
);
ret
=
BroadcastSystemMessage
ExW
(
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
)
||
...
...
@@ -342,28 +318,17 @@ START_TEST(broadcast)
return
;
trace
(
"Running BroadcastSystemMessageA tests
\n
"
);
test_parameters
(
pBroadcastA
,
"BroadcastSystemMessageA"
);
if
(
pBroadcastW
)
{
trace
(
"Running BroadcastSystemMessageW tests
\n
"
);
test_parameters
(
pBroadcastW
,
"BroadcastSystemMessageW"
);
}
else
win_skip
(
"No BroadcastSystemMessageW, skipping
\n
"
);
if
(
pBroadcastExA
)
{
trace
(
"Running BroadcastSystemMessageExA tests
\n
"
);
test_parametersEx
(
pBroadcastExA
);
}
else
win_skip
(
"No BroadcastSystemMessageExA, skipping
\n
"
);
if
(
pBroadcastExW
)
{
trace
(
"Running BroadcastSystemMessageExW tests
\n
"
);
test_parametersEx
(
pBroadcastExW
);
trace
(
"Attempting privileges checking tests
\n
"
);
test_noprivileges
();
}
else
win_skip
(
"No BroadcastSystemMessageExW, skipping
\n
"
);
test_parameters
(
BroadcastSystemMessageA
,
"BroadcastSystemMessageA"
);
trace
(
"Running BroadcastSystemMessageW tests
\n
"
);
test_parameters
(
BroadcastSystemMessageW
,
"BroadcastSystemMessageW"
);
trace
(
"Running BroadcastSystemMessageExA tests
\n
"
);
test_parametersEx
(
BroadcastSystemMessageExA
);
trace
(
"Running BroadcastSystemMessageExW tests
\n
"
);
test_parametersEx
(
BroadcastSystemMessageExW
);
trace
(
"Attempting privileges checking tests
\n
"
);
test_noprivileges
();
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment