Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
7594afeb
Commit
7594afeb
authored
Aug 30, 2016
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix InSendMessage return value.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
69f571db
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
94 additions
and
1 deletion
+94
-1
message.c
dlls/user32/message.c
+1
-1
msg.c
dlls/user32/tests/msg.c
+93
-0
No files found.
dlls/user32/message.c
View file @
7594afeb
...
...
@@ -3612,7 +3612,7 @@ BOOL WINAPI ReplyMessage( LRESULT result )
*/
BOOL
WINAPI
InSendMessage
(
void
)
{
return
(
InSendMessageEx
(
NULL
)
&
(
ISMEX_SEND
|
ISMEX_REPLIED
))
==
ISMEX_SEND
;
return
(
InSendMessageEx
(
NULL
)
&
(
ISMEX_SEND
|
ISMEX_NOTIFY
|
ISMEX_CALLBACK
))
!=
0
;
}
...
...
dlls/user32/tests/msg.c
View file @
7594afeb
...
...
@@ -15822,6 +15822,98 @@ todo_wine_if (thread_n == 2)
flush_sequence
();
}
static
LRESULT
CALLBACK
insendmessage_wnd_proc
(
HWND
hwnd
,
UINT
msg
,
WPARAM
wp
,
LPARAM
lp
)
{
DWORD
flags
=
InSendMessageEx
(
NULL
);
BOOL
ret
;
switch
(
msg
)
{
case
WM_USER
:
ok
(
flags
==
ISMEX_SEND
,
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
ret
=
ReplyMessage
(
msg
);
ok
(
ret
,
"ReplyMessage failed err %u
\n
"
,
GetLastError
()
);
flags
=
InSendMessageEx
(
NULL
);
ok
(
flags
==
(
ISMEX_SEND
|
ISMEX_REPLIED
),
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
break
;
case
WM_USER
+
1
:
ok
(
flags
==
ISMEX_NOTIFY
,
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
ret
=
ReplyMessage
(
msg
);
ok
(
ret
,
"ReplyMessage failed err %u
\n
"
,
GetLastError
()
);
flags
=
InSendMessageEx
(
NULL
);
ok
(
flags
==
ISMEX_NOTIFY
,
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
break
;
case
WM_USER
+
2
:
ok
(
flags
==
ISMEX_CALLBACK
,
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
ret
=
ReplyMessage
(
msg
);
ok
(
ret
,
"ReplyMessage failed err %u
\n
"
,
GetLastError
()
);
flags
=
InSendMessageEx
(
NULL
);
ok
(
flags
==
(
ISMEX_CALLBACK
|
ISMEX_REPLIED
)
||
flags
==
ISMEX_SEND
,
"wrong flags %x
\n
"
,
flags
);
ok
(
InSendMessage
(),
"InSendMessage returned false
\n
"
);
break
;
case
WM_USER
+
3
:
ok
(
flags
==
ISMEX_NOSEND
,
"wrong flags %x
\n
"
,
flags
);
ok
(
!
InSendMessage
(),
"InSendMessage returned true
\n
"
);
ret
=
ReplyMessage
(
msg
);
ok
(
!
ret
,
"ReplyMessage succeeded
\n
"
);
break
;
}
return
DefWindowProcA
(
hwnd
,
msg
,
wp
,
lp
);
}
static
void
CALLBACK
msg_callback
(
HWND
hwnd
,
UINT
msg
,
ULONG_PTR
arg
,
LRESULT
result
)
{
ok
(
msg
==
WM_USER
+
2
,
"wrong msg %x
\n
"
,
msg
);
ok
(
result
==
WM_USER
+
2
,
"wrong result %lx
\n
"
,
result
);
}
static
DWORD
WINAPI
send_message_thread
(
void
*
arg
)
{
HWND
win
=
arg
;
SendMessageA
(
win
,
WM_USER
,
0
,
0
);
SendNotifyMessageA
(
win
,
WM_USER
+
1
,
0
,
0
);
SendMessageCallbackA
(
win
,
WM_USER
+
2
,
0
,
0
,
msg_callback
,
0
);
PostMessageA
(
win
,
WM_USER
+
3
,
0
,
0
);
PostMessageA
(
win
,
WM_QUIT
,
0
,
0
);
return
0
;
}
static
void
test_InSendMessage
(
void
)
{
WNDCLASSA
cls
;
HWND
win
;
MSG
msg
;
HANDLE
thread
;
DWORD
tid
;
memset
(
&
cls
,
0
,
sizeof
(
cls
));
cls
.
lpfnWndProc
=
insendmessage_wnd_proc
;
cls
.
hInstance
=
GetModuleHandleA
(
NULL
);
cls
.
lpszClassName
=
"InSendMessage_test"
;
RegisterClassA
(
&
cls
);
win
=
CreateWindowA
(
"InSendMessage_test"
,
NULL
,
0
,
0
,
0
,
0
,
0
,
NULL
,
0
,
NULL
,
0
);
ok
(
win
!=
NULL
,
"CreateWindow failed: %d
\n
"
,
GetLastError
()
);
thread
=
CreateThread
(
NULL
,
0
,
send_message_thread
,
win
,
0
,
&
tid
);
ok
(
thread
!=
NULL
,
"CreateThread failed: %d
\n
"
,
GetLastError
()
);
while
(
GetMessageA
(
&
msg
,
NULL
,
0
,
0
))
DispatchMessageA
(
&
msg
);
ok
(
WaitForSingleObject
(
thread
,
30000
)
==
WAIT_OBJECT_0
,
"WaitForSingleObject failed
\n
"
);
CloseHandle
(
thread
);
DestroyWindow
(
win
);
UnregisterClassA
(
"InSendMessage_test"
,
GetModuleHandleA
(
NULL
)
);
}
static
const
struct
message
DoubleSetCaptureSeq
[]
=
{
{
WM_CAPTURECHANGED
,
sent
},
...
...
@@ -15930,6 +16022,7 @@ START_TEST(msg)
test_SendMessage_other_thread
(
1
);
test_SendMessage_other_thread
(
2
);
test_InSendMessage
();
test_SetFocus
();
test_SetParent
();
test_PostMessage
();
...
...
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