mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:25:45 +00:00
[FORMATTING]
- Fix formatting in message.c svn path=/trunk/; revision=49313
This commit is contained in:
parent
8e45fe3079
commit
97a11cb468
1 changed files with 2040 additions and 2069 deletions
|
@ -1,12 +1,12 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Messages
|
||||
* FILE: subsys/win32k/ntuser/message.c
|
||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||
* REVISION HISTORY:
|
||||
* 06-06-2001 CSH Created
|
||||
*/
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
* PURPOSE: Messages
|
||||
* FILE: subsys/win32k/ntuser/message.c
|
||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||
* REVISION HISTORY:
|
||||
* 06-06-2001 CSH Created
|
||||
*/
|
||||
|
||||
/* INCLUDES ******************************************************************/
|
||||
|
||||
|
@ -55,7 +55,7 @@ typedef struct tagMSGMEMORY
|
|||
MSGMEMORY, *PMSGMEMORY;
|
||||
|
||||
static MSGMEMORY MsgMemory[] =
|
||||
{
|
||||
{
|
||||
{ WM_CREATE, MMS_SIZE_SPECIAL, MMS_FLAG_READWRITE },
|
||||
{ WM_DDE_ACK, sizeof(KMDDELPARAM), MMS_FLAG_READ },
|
||||
{ WM_DDE_EXECUTE, MMS_SIZE_WPARAM, MMS_FLAG_READ },
|
||||
|
@ -69,7 +69,7 @@ static MSGMEMORY MsgMemory[] =
|
|||
{ WM_COPYDATA, MMS_SIZE_SPECIAL, MMS_FLAG_READ },
|
||||
{ WM_WINDOWPOSCHANGED, sizeof(WINDOWPOS), MMS_FLAG_READ },
|
||||
{ WM_WINDOWPOSCHANGING, sizeof(WINDOWPOS), MMS_FLAG_READWRITE },
|
||||
};
|
||||
};
|
||||
|
||||
static PMSGMEMORY FASTCALL
|
||||
FindMsgMemory(UINT Msg)
|
||||
|
@ -323,11 +323,8 @@ UnpackParam(LPARAM lParamPacked, UINT Msg, WPARAM wParam, LPARAM lParam, BOOL No
|
|||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
FASTCALL
|
||||
IntCallWndProc
|
||||
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
static VOID FASTCALL
|
||||
IntCallWndProc( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
BOOL SameThread = FALSE;
|
||||
CWPSTRUCT CWP;
|
||||
|
@ -342,11 +339,8 @@ IntCallWndProc
|
|||
co_HOOK_CallHooks( WH_CALLWNDPROC, HC_ACTION, SameThread, (LPARAM)&CWP );
|
||||
}
|
||||
|
||||
static
|
||||
VOID
|
||||
FASTCALL
|
||||
IntCallWndProcRet
|
||||
( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
|
||||
static VOID FASTCALL
|
||||
IntCallWndProcRet ( PWND Window, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, LRESULT *uResult)
|
||||
{
|
||||
BOOL SameThread = FALSE;
|
||||
CWPRETSTRUCT CWPR;
|
||||
|
@ -362,8 +356,7 @@ IntCallWndProcRet
|
|||
co_HOOK_CallHooks( WH_CALLWNDPROCRET, HC_ACTION, SameThread, (LPARAM)&CWPR );
|
||||
}
|
||||
|
||||
LRESULT
|
||||
FASTCALL
|
||||
LRESULT FASTCALL
|
||||
IntDispatchMessage(PMSG pMsg)
|
||||
{
|
||||
LARGE_INTEGER TickCount;
|
||||
|
@ -517,8 +510,7 @@ co_IntSendHitTestMessages(PUSER_MESSAGE_QUEUE ThreadQueue, LPMSG Msg)
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
co_IntActivateWindowMouse(
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
co_IntActivateWindowMouse( PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
LPMSG Msg,
|
||||
PWND MsgWindow,
|
||||
USHORT *HitTest)
|
||||
|
@ -562,8 +554,7 @@ co_IntActivateWindowMouse(
|
|||
}
|
||||
|
||||
BOOL FASTCALL
|
||||
co_IntTranslateMouseMessage(
|
||||
PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
co_IntTranslateMouseMessage( PUSER_MESSAGE_QUEUE ThreadQueue,
|
||||
LPMSG Msg,
|
||||
USHORT *HitTest,
|
||||
BOOL Remove)
|
||||
|
@ -632,7 +623,7 @@ co_IntTranslateMouseMessage(
|
|||
}
|
||||
|
||||
if ( gspv.bMouseClickLock &&
|
||||
( (Msg->message == WM_LBUTTONUP) ||
|
||||
((Msg->message == WM_LBUTTONUP) ||
|
||||
(Msg->message == WM_LBUTTONDOWN) ) )
|
||||
{
|
||||
if (MsqIsClkLck(Msg, Remove))
|
||||
|
@ -845,8 +836,8 @@ BOOL ProcessHardwareMessage(MSG* Msg, BOOLEAN RemoveMessages)
|
|||
return TRUE;
|
||||
}
|
||||
/*
|
||||
* Internal version of PeekMessage() doing all the work
|
||||
*/
|
||||
* Internal version of PeekMessage() doing all the work
|
||||
*/
|
||||
BOOL FASTCALL
|
||||
co_IntPeekMessage( PUSER_MESSAGE Msg,
|
||||
PWND Window,
|
||||
|
@ -871,8 +862,7 @@ co_IntPeekMessage( PUSER_MESSAGE Msg,
|
|||
ThreadQueue->LastMsgRead = LargeTickCount.u.LowPart;
|
||||
|
||||
/* Dispatch sent messages here. */
|
||||
while (co_MsqDispatchOneSentMessage(ThreadQueue))
|
||||
;
|
||||
while (co_MsqDispatchOneSentMessage(ThreadQueue)) ;
|
||||
|
||||
/* Now look for a quit message. */
|
||||
|
||||
|
@ -1108,8 +1098,7 @@ co_IntGetPeekMessage( PMSG pMsg,
|
|||
PWND Window;
|
||||
USER_MESSAGE Msg;
|
||||
|
||||
if ( hWnd == HWND_TOPMOST ||
|
||||
hWnd == HWND_BROADCAST )
|
||||
if ( hWnd == HWND_TOPMOST || hWnd == HWND_BROADCAST )
|
||||
hWnd = HWND_BOTTOM;
|
||||
|
||||
/* Validate input */
|
||||
|
@ -1241,11 +1230,12 @@ UserPostMessage( HWND Wnd,
|
|||
}
|
||||
|
||||
if (!Wnd)
|
||||
{
|
||||
return UserPostThreadMessage( PtrToInt(PsGetCurrentThreadId()),
|
||||
Msg,
|
||||
wParam,
|
||||
lParam);
|
||||
|
||||
}
|
||||
if (Wnd == HWND_BROADCAST)
|
||||
{
|
||||
HWND *List;
|
||||
|
@ -1259,7 +1249,9 @@ UserPostMessage( HWND Wnd,
|
|||
{
|
||||
UserPostMessage(DesktopWindow->head.h, Msg, wParam, lParam);
|
||||
for (i = 0; List[i]; i++)
|
||||
{
|
||||
UserPostMessage(List[i], Msg, wParam, lParam);
|
||||
}
|
||||
ExFreePool(List);
|
||||
}
|
||||
}
|
||||
|
@ -1321,8 +1313,7 @@ co_IntSendMessage( HWND hWnd,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static
|
||||
LRESULT FASTCALL
|
||||
static LRESULT FASTCALL
|
||||
co_IntSendMessageTimeoutSingle( HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
|
@ -1437,14 +1428,14 @@ co_IntSendMessageTimeoutSingle( HWND hWnd,
|
|||
|
||||
if (STATUS_TIMEOUT == Status)
|
||||
{
|
||||
/*
|
||||
MSDN says:
|
||||
/*
|
||||
MSDN says:
|
||||
Microsoft Windows 2000: If GetLastError returns zero, then the function
|
||||
timed out.
|
||||
XP+ : If the function fails or times out, the return value is zero.
|
||||
To get extended error information, call GetLastError. If GetLastError
|
||||
returns ERROR_TIMEOUT, then the function timed out.
|
||||
*/
|
||||
*/
|
||||
SetLastWin32Error(ERROR_TIMEOUT);
|
||||
RETURN( FALSE);
|
||||
}
|
||||
|
@ -1505,7 +1496,8 @@ co_IntSendMessageTimeout( HWND hWnd,
|
|||
return (LRESULT) TRUE;
|
||||
}
|
||||
|
||||
LRESULT FASTCALL co_IntSendMessageNoWait(HWND hWnd,
|
||||
LRESULT FASTCALL
|
||||
co_IntSendMessageNoWait(HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
|
@ -1647,8 +1639,8 @@ CLEANUP:
|
|||
}
|
||||
|
||||
/* This function posts a message if the destination's message queue belongs to
|
||||
another thread, otherwise it sends the message. It does not support broadcast
|
||||
messages! */
|
||||
another thread, otherwise it sends the message. It does not support broadcast
|
||||
messages! */
|
||||
LRESULT FASTCALL
|
||||
co_IntPostOrSendMessage( HWND hWnd,
|
||||
UINT Msg,
|
||||
|
@ -1739,8 +1731,7 @@ co_IntDoSendMessage( HWND hWnd,
|
|||
/* Gather the information usermode needs to call the window proc directly */
|
||||
Info.HandledByKernel = FALSE;
|
||||
|
||||
Status = MmCopyFromCaller(&(Info.Ansi), &(UnsafeInfo->Ansi),
|
||||
sizeof(BOOL));
|
||||
Status = MmCopyFromCaller(&(Info.Ansi), &(UnsafeInfo->Ansi), sizeof(BOOL));
|
||||
if (! NT_SUCCESS(Status))
|
||||
{
|
||||
Info.Ansi = ! Window->Unicode;
|
||||
|
@ -1752,10 +1743,10 @@ co_IntDoSendMessage( HWND hWnd,
|
|||
else
|
||||
{
|
||||
/* Must be handled by other thread */
|
||||
// if (HWND_BROADCAST != hWnd)
|
||||
// {
|
||||
// UserDereferenceObject(Window);
|
||||
// }
|
||||
// if (HWND_BROADCAST != hWnd)
|
||||
// {
|
||||
// UserDereferenceObject(Window);
|
||||
// }
|
||||
Info.HandledByKernel = TRUE;
|
||||
UserModeMsg.hwnd = hWnd;
|
||||
UserModeMsg.message = Msg;
|
||||
|
@ -2059,15 +2050,15 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax )
|
||||
/*
|
||||
* FUNCTION: Get a message from the calling thread's message queue.
|
||||
* ARGUMENTS:
|
||||
* UnsafeMsg - Pointer to the structure which receives the returned message.
|
||||
* Wnd - Window whose messages are to be retrieved.
|
||||
* MsgFilterMin - Integer value of the lowest message value to be
|
||||
* retrieved.
|
||||
* MsgFilterMax - Integer value of the highest message value to be
|
||||
* retrieved.
|
||||
*/
|
||||
* FUNCTION: Get a message from the calling thread's message queue.
|
||||
* ARGUMENTS:
|
||||
* UnsafeMsg - Pointer to the structure which receives the returned message.
|
||||
* Wnd - Window whose messages are to be retrieved.
|
||||
* MsgFilterMin - Integer value of the lowest message value to be
|
||||
* retrieved.
|
||||
* MsgFilterMax - Integer value of the highest message value to be
|
||||
* retrieved.
|
||||
*/
|
||||
{
|
||||
BOOL GotMessage;
|
||||
NTUSERGETMESSAGEINFO Info;
|
||||
|
@ -2079,7 +2070,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
UINT Size;
|
||||
USER_MESSAGE Msg;
|
||||
DECLARE_RETURN(BOOL);
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
// USER_REFERENCE_ENTRY Ref;
|
||||
|
||||
DPRINT("Enter NtUserGetMessage\n");
|
||||
UserEnterExclusive();
|
||||
|
@ -2090,7 +2081,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
RETURN(-1);
|
||||
}
|
||||
|
||||
// if (Window) UserRefObjectCo(Window, &Ref);
|
||||
// if (Window) UserRefObjectCo(Window, &Ref);
|
||||
|
||||
if (MsgFilterMax < MsgFilterMin)
|
||||
{
|
||||
|
@ -2155,7 +2146,7 @@ NtUserGetMessage( PNTUSERGETMESSAGEINFO UnsafeInfo,
|
|||
RETURN( WM_QUIT != Info.Msg.message);
|
||||
|
||||
CLEANUP:
|
||||
// if (Window) UserDerefObjectCo(Window);
|
||||
// if (Window) UserDerefObjectCo(Window);
|
||||
|
||||
DPRINT("Leave NtUserGetMessage\n");
|
||||
UserLeave();
|
||||
|
@ -2163,10 +2154,8 @@ CLEANUP:
|
|||
}
|
||||
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserGetMessageX(
|
||||
PMSG pMsg,
|
||||
BOOL APIENTRY
|
||||
NtUserGetMessageX(PMSG pMsg,
|
||||
HWND hWnd,
|
||||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax)
|
||||
|
@ -2306,10 +2295,8 @@ CLEANUP:
|
|||
END_CLEANUP;
|
||||
}
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserPeekMessageX(
|
||||
PMSG pMsg,
|
||||
BOOL APIENTRY
|
||||
NtUserPeekMessageX( PMSG pMsg,
|
||||
HWND hWnd,
|
||||
UINT MsgFilterMin,
|
||||
UINT MsgFilterMax,
|
||||
|
@ -2354,11 +2341,8 @@ CLEANUP:
|
|||
END_CLEANUP;
|
||||
}
|
||||
|
||||
BOOL
|
||||
APIENTRY
|
||||
NtUserCallMsgFilter(
|
||||
LPMSG lpmsg,
|
||||
INT code)
|
||||
BOOL APIENTRY
|
||||
NtUserCallMsgFilter( LPMSG lpmsg, INT code)
|
||||
{
|
||||
BOOL BadChk = FALSE, Ret = FALSE;
|
||||
MSG Msg;
|
||||
|
@ -2370,12 +2354,8 @@ NtUserCallMsgFilter(
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForRead((PVOID)lpmsg,
|
||||
sizeof(MSG),
|
||||
1);
|
||||
RtlCopyMemory( &Msg,
|
||||
(PVOID)lpmsg,
|
||||
sizeof(MSG));
|
||||
ProbeForRead(lpmsg, sizeof(MSG), 1);
|
||||
RtlCopyMemory( &Msg, lpmsg, sizeof(MSG));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -2399,12 +2379,8 @@ NtUserCallMsgFilter(
|
|||
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite((PVOID)lpmsg,
|
||||
sizeof(MSG),
|
||||
1);
|
||||
RtlCopyMemory((PVOID)lpmsg,
|
||||
&Msg,
|
||||
sizeof(MSG));
|
||||
ProbeForWrite(lpmsg, sizeof(MSG), 1);
|
||||
RtlCopyMemory(lpmsg, &Msg, sizeof(MSG));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
@ -2448,8 +2424,7 @@ NtUserDispatchMessage(PMSG UnsafeMsgInfo)
|
|||
|
||||
|
||||
BOOL APIENTRY
|
||||
NtUserTranslateMessage(LPMSG lpMsg,
|
||||
UINT flags)
|
||||
NtUserTranslateMessage(LPMSG lpMsg, UINT flags)
|
||||
{
|
||||
NTSTATUS Status;
|
||||
MSG SafeMsg;
|
||||
|
@ -2474,8 +2449,7 @@ CLEANUP:
|
|||
}
|
||||
|
||||
BOOL APIENTRY
|
||||
NtUserMessageCall(
|
||||
HWND hWnd,
|
||||
NtUserMessageCall( HWND hWnd,
|
||||
UINT Msg,
|
||||
WPARAM wParam,
|
||||
LPARAM lParam,
|
||||
|
@ -2522,9 +2496,7 @@ NtUserMessageCall(
|
|||
{
|
||||
_SEH2_TRY
|
||||
{
|
||||
ProbeForWrite((PVOID)ResultInfo,
|
||||
sizeof(BROADCASTPARM),
|
||||
1);
|
||||
ProbeForWrite((PVOID)ResultInfo, sizeof(BROADCASTPARM), 1);
|
||||
RtlCopyMemory(&parm, (PVOID)ResultInfo, sizeof(BROADCASTPARM));
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
|
@ -2704,8 +2676,7 @@ NtUserMessageCall(
|
|||
|
||||
DWORD
|
||||
APIENTRY
|
||||
NtUserWaitForInputIdle(
|
||||
IN HANDLE hProcess,
|
||||
NtUserWaitForInputIdle( IN HANDLE hProcess,
|
||||
IN DWORD dwMilliseconds,
|
||||
IN BOOL Unknown2)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue