mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
fixed SendMessageTimeout() to return the correct result even when it timed out
svn path=/trunk/; revision=9462
This commit is contained in:
parent
a4931b6ee8
commit
4c8d47cc6b
1 changed files with 5 additions and 4 deletions
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: message.c,v 1.66 2004/05/16 18:33:40 weiden Exp $
|
/* $Id: message.c,v 1.67 2004/05/22 08:27:15 weiden Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -38,7 +38,6 @@ typedef struct
|
||||||
{
|
{
|
||||||
UINT uFlags;
|
UINT uFlags;
|
||||||
UINT uTimeout;
|
UINT uTimeout;
|
||||||
ULONG_PTR uResult;
|
|
||||||
} DOSENDMESSAGE, *PDOSENDMESSAGE;
|
} DOSENDMESSAGE, *PDOSENDMESSAGE;
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
@ -1216,6 +1215,8 @@ IntSendMessageTimeoutSingle(HWND hWnd,
|
||||||
if(Status == STATUS_TIMEOUT)
|
if(Status == STATUS_TIMEOUT)
|
||||||
{
|
{
|
||||||
IntReleaseWindowObject(Window);
|
IntReleaseWindowObject(Window);
|
||||||
|
if(uResult)
|
||||||
|
*uResult = Result;
|
||||||
SetLastWin32Error(ERROR_TIMEOUT);
|
SetLastWin32Error(ERROR_TIMEOUT);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -1406,7 +1407,7 @@ IntDoSendMessage(HWND Wnd,
|
||||||
{
|
{
|
||||||
Result = IntSendMessageTimeout(KernelModeMsg.hwnd, KernelModeMsg.message,
|
Result = IntSendMessageTimeout(KernelModeMsg.hwnd, KernelModeMsg.message,
|
||||||
KernelModeMsg.wParam, KernelModeMsg.lParam,
|
KernelModeMsg.wParam, KernelModeMsg.lParam,
|
||||||
dsm->uFlags, dsm->uTimeout, &dsm->uResult);
|
dsm->uFlags, dsm->uTimeout, &Result);
|
||||||
}
|
}
|
||||||
Status = CopyMsgToUserMem(&UserModeMsg, &KernelModeMsg);
|
Status = CopyMsgToUserMem(&UserModeMsg, &KernelModeMsg);
|
||||||
if (! NT_SUCCESS(Status))
|
if (! NT_SUCCESS(Status))
|
||||||
|
@ -1446,7 +1447,7 @@ NtUserSendMessageTimeout(HWND hWnd,
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
|
|
||||||
Status = MmCopyToCaller(uResult, &dsm.uResult, sizeof(ULONG_PTR));
|
Status = MmCopyToCaller(uResult, &Result, sizeof(ULONG_PTR));
|
||||||
if(!NT_SUCCESS(Status))
|
if(!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
|
|
Loading…
Reference in a new issue