mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 14:39:46 +00:00
[USER32] Small fixes for messages carrying pointers
SendNotifyMessageW: It doesn't support messages with pointers so there is no need to call MsgiUMToKMMessage SendMessageTimeoutW, SendMessageTimeoutA: These two do support marshaling pointers so they need to use MsgiUMToKMMessage. This is actually a bug that happens only in the rare case where we send a WM_COPYDATA with a timeout.
This commit is contained in:
parent
ec91188fff
commit
e3610035ce
1 changed files with 32 additions and 24 deletions
|
@ -2587,7 +2587,7 @@ SendMessageTimeoutA(
|
||||||
UINT uTimeout,
|
UINT uTimeout,
|
||||||
PDWORD_PTR lpdwResult)
|
PDWORD_PTR lpdwResult)
|
||||||
{
|
{
|
||||||
MSG AnsiMsg, UcMsg;
|
MSG AnsiMsg, UcMsg, KMMsg;
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
DOSENDMESSAGE dsm;
|
DOSENDMESSAGE dsm;
|
||||||
|
|
||||||
|
@ -2618,14 +2618,21 @@ SendMessageTimeoutA(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!MsgiUMToKMMessage(&UcMsg, &KMMsg, FALSE))
|
||||||
|
{
|
||||||
|
MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
Result = NtUserMessageCall( hWnd,
|
Result = NtUserMessageCall( hWnd,
|
||||||
UcMsg.message,
|
KMMsg.message,
|
||||||
UcMsg.wParam,
|
KMMsg.wParam,
|
||||||
UcMsg.lParam,
|
KMMsg.lParam,
|
||||||
(ULONG_PTR)&dsm,
|
(ULONG_PTR)&dsm,
|
||||||
FNID_SENDMESSAGEWTOOPTION,
|
FNID_SENDMESSAGEWTOOPTION,
|
||||||
TRUE);
|
TRUE);
|
||||||
|
|
||||||
|
MsgiUMToKMCleanup(&UcMsg, &KMMsg);
|
||||||
MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
|
MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
|
||||||
|
|
||||||
if (lpdwResult) *lpdwResult = dsm.Result;
|
if (lpdwResult) *lpdwResult = dsm.Result;
|
||||||
|
@ -2652,6 +2659,7 @@ SendMessageTimeoutW(
|
||||||
{
|
{
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
DOSENDMESSAGE dsm;
|
DOSENDMESSAGE dsm;
|
||||||
|
MSG UMMsg, KMMsg;
|
||||||
|
|
||||||
if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
|
if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
|
||||||
{
|
{
|
||||||
|
@ -2667,14 +2675,28 @@ SendMessageTimeoutW(
|
||||||
dsm.uTimeout = uTimeout;
|
dsm.uTimeout = uTimeout;
|
||||||
dsm.Result = 0;
|
dsm.Result = 0;
|
||||||
|
|
||||||
|
UMMsg.hwnd = hWnd;
|
||||||
|
UMMsg.message = Msg;
|
||||||
|
UMMsg.wParam = wParam;
|
||||||
|
UMMsg.lParam = lParam;
|
||||||
|
UMMsg.time = 0;
|
||||||
|
UMMsg.pt.x = 0;
|
||||||
|
UMMsg.pt.y = 0;
|
||||||
|
if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, TRUE))
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
Result = NtUserMessageCall( hWnd,
|
Result = NtUserMessageCall( hWnd,
|
||||||
Msg,
|
KMMsg.message,
|
||||||
wParam,
|
KMMsg.wParam,
|
||||||
lParam,
|
KMMsg.lParam,
|
||||||
(ULONG_PTR)&dsm,
|
(ULONG_PTR)&dsm,
|
||||||
FNID_SENDMESSAGEWTOOPTION,
|
FNID_SENDMESSAGEWTOOPTION,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
|
MsgiUMToKMCleanup(&UMMsg, &KMMsg);
|
||||||
|
|
||||||
if (lpdwResult) *lpdwResult = dsm.Result;
|
if (lpdwResult) *lpdwResult = dsm.Result;
|
||||||
|
|
||||||
SPY_ExitMessage(SPY_RESULT_OK, hWnd, Msg, Result, wParam, lParam);
|
SPY_ExitMessage(SPY_RESULT_OK, hWnd, Msg, Result, wParam, lParam);
|
||||||
|
@ -2731,7 +2753,6 @@ SendNotifyMessageW(
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
MSG UMMsg, KMMsg;
|
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
|
|
||||||
if (is_pointer_message(Msg))
|
if (is_pointer_message(Msg))
|
||||||
|
@ -2740,27 +2761,14 @@ SendNotifyMessageW(
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
UMMsg.hwnd = hWnd;
|
|
||||||
UMMsg.message = Msg;
|
|
||||||
UMMsg.wParam = wParam;
|
|
||||||
UMMsg.lParam = lParam;
|
|
||||||
UMMsg.time = 0;
|
|
||||||
UMMsg.pt.x = 0;
|
|
||||||
UMMsg.pt.y = 0;
|
|
||||||
if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, TRUE))
|
|
||||||
{
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
Result = NtUserMessageCall( hWnd,
|
Result = NtUserMessageCall( hWnd,
|
||||||
KMMsg.message,
|
Msg,
|
||||||
KMMsg.wParam,
|
wParam,
|
||||||
KMMsg.lParam,
|
lParam,
|
||||||
0,
|
0,
|
||||||
FNID_SENDNOTIFYMESSAGE,
|
FNID_SENDNOTIFYMESSAGE,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
MsgiUMToKMCleanup(&UMMsg, &KMMsg);
|
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue