https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6b7efb331c0cd20c8610cd24d5e7221cff59969a

commit 6b7efb331c0cd20c8610cd24d5e7221cff59969a
Author:     Joachim Henze <[email protected]>
AuthorDate: Sun Jul 30 21:39:10 2023 +0200
Commit:     Joachim Henze <[email protected]>
CommitDate: Sun Jul 30 21:39:10 2023 +0200

    [NTUSER] co_IntSendMessageWithCallBack: Formatting only, no functional 
changes
    
    e.g. wrong indentation.
    Want to port something back here, and the slight tweaking allows master to 
remain
    in sync with previous releases.
---
 win32ss/user/ntuser/message.c | 76 ++++++++++++++++++++-----------------------
 1 file changed, 36 insertions(+), 40 deletions(-)

diff --git a/win32ss/user/ntuser/message.c b/win32ss/user/ntuser/message.c
index fbee45fec6b..78a7956d88b 100644
--- a/win32ss/user/ntuser/message.c
+++ b/win32ss/user/ntuser/message.c
@@ -2,7 +2,6 @@
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS Win32k subsystem
  * PURPOSE:          Messages
- * FILE:             win32ss/user/ntuser/message.c
  * PROGRAMER:        Casper S. Hornstrup ([email protected])
  */
 
@@ -1713,12 +1712,12 @@ co_IntSendMessageNoWait(HWND hWnd,
                         LPARAM lParam)
 {
     ULONG_PTR Result = 0;
-    return co_IntSendMessageWithCallBack( hWnd,
-                                          Msg,
-                                          wParam,
-                                          lParam,
-                                          NULL,
-                                          0,
+    return co_IntSendMessageWithCallBack(hWnd,
+                                         Msg,
+                                         wParam,
+                                         lParam,
+                                         NULL,
+                                         0,
                                          &Result);
 }
 /* MSDN:
@@ -1729,7 +1728,7 @@ co_IntSendMessageNoWait(HWND hWnd,
    process the message and the sender will free the memory before it is used.
 */
 LRESULT FASTCALL
-co_IntSendMessageWithCallBack( HWND hWnd,
+co_IntSendMessageWithCallBack(HWND hWnd,
                               UINT Msg,
                               WPARAM wParam,
                               LPARAM lParam,
@@ -1750,7 +1749,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
 
     if (!(Window = UserGetWindowObject(hWnd)))
     {
-        TRACE("SendMessageWithCallBack: Invalid handle 0x%p!\n",hWnd);
+        TRACE("SendMessageWithCallBack: Invalid handle 0x%p\n",hWnd);
         RETURN(FALSE);
     }
 
@@ -1759,29 +1758,26 @@ co_IntSendMessageWithCallBack( HWND hWnd,
     if (Window->state & WNDS_DESTROYED)
     {
         /* FIXME: last error? */
-        ERR("Attempted to send message to window %p that is being 
destroyed!\n", hWnd);
+        ERR("Attempted to send message to window %p that is being 
destroyed\n", hWnd);
         RETURN(FALSE);
     }
 
     Win32Thread = PsGetCurrentThreadWin32Thread();
 
-    if (Win32Thread == NULL ||
-        Win32Thread->TIF_flags & TIF_INCLEANUP)
-    {
+    if (Win32Thread == NULL || Win32Thread->TIF_flags & TIF_INCLEANUP)
         RETURN(FALSE);
-    }
 
     ptiSendTo = IntSendTo(Window, Win32Thread, Msg);
 
     if (Msg & 0x80000000 &&
         !ptiSendTo)
     {
-       if (Win32Thread->TIF_flags & TIF_INCLEANUP) RETURN( FALSE);
+        if (Win32Thread->TIF_flags & TIF_INCLEANUP) RETURN(FALSE);
 
-       TRACE("SMWCB: Internal Message!\n");
-       Result = (ULONG_PTR)handle_internal_message( Window, Msg, wParam, 
lParam );
-       if (uResult) *uResult = Result;
-       RETURN( TRUE);
+        TRACE("SMWCB: Internal Message\n");
+        Result = (ULONG_PTR)handle_internal_message(Window, Msg, wParam, 
lParam);
+        if (uResult) *uResult = Result;
+        RETURN(TRUE);
     }
 
     /* See if this message type is present in the table */
@@ -1796,14 +1792,14 @@ co_IntSendMessageWithCallBack( HWND hWnd,
         if (!lParamBufferSize) lParamBufferSize = -1;
     }
 
-    if (! NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, 
!!ptiSendTo)))
+    if (!NT_SUCCESS(PackParam(&lParamPacked, Msg, wParam, lParam, 
!!ptiSendTo)))
     {
         ERR("Failed to pack message parameters\n");
-        RETURN( FALSE);
+        RETURN(FALSE);
     }
 
     /* If it can be sent now, then send it. */
-    if ( !ptiSendTo )
+    if (!ptiSendTo)
     {
         if (Win32Thread->TIF_flags & TIF_INCLEANUP)
         {
@@ -1812,9 +1808,9 @@ co_IntSendMessageWithCallBack( HWND hWnd,
             RETURN(FALSE);
         }
 
-        IntCallWndProc( Window, hWnd, Msg, wParam, lParam);
+        IntCallWndProc(Window, hWnd, Msg, wParam, lParam);
 
-        if ( Window->state & WNDS_SERVERSIDEWINDOWPROC )
+        if (Window->state & WNDS_SERVERSIDEWINDOWPROC)
         {
            TRACE("SMWCB: Server Side Window Procedure\n");
            switch(Window->fnid)
@@ -1823,28 +1819,28 @@ co_IntSendMessageWithCallBack( HWND hWnd,
                 DoCallBack = !DesktopWindowProc(Window, Msg, wParam, 
lParamPacked, (LRESULT*)&Result);
                 break;
               case FNID_MESSAGEWND:
-                DoCallBack = !UserMessageWindowProc(Window, Msg, wParam, 
lParam,(LRESULT*)&Result);
+                DoCallBack = !UserMessageWindowProc(Window, Msg, wParam, 
lParam, (LRESULT*)&Result);
                 break;
               case FNID_MENU:
-                DoCallBack = !PopupMenuWndProc( Window, Msg, wParam, 
lParam,(LRESULT*)&Result);
+                DoCallBack = !PopupMenuWndProc(Window, Msg, wParam, lParam, 
(LRESULT*)&Result);
                 break;
            }
         }
 
         if (DoCallBack)
-        Result = (ULONG_PTR)co_IntCallWindowProc( Window->lpfnWndProc,
-                                                  !Window->Unicode,
-                                                  hWnd,
-                                                  Msg,
-                                                  wParam,
-                                                  lParamPacked,
-                                                  lParamBufferSize );
+        Result = (ULONG_PTR)co_IntCallWindowProc(Window->lpfnWndProc,
+                                                 !Window->Unicode,
+                                                 hWnd,
+                                                 Msg,
+                                                 wParam,
+                                                 lParamPacked,
+                                                 lParamBufferSize);
         if(uResult)
         {
             *uResult = Result;
         }
 
-        IntCallWndProcRet( Window, hWnd, Msg, wParam, lParam, (LRESULT 
*)uResult);
+        IntCallWndProcRet(Window, hWnd, Msg, wParam, lParam, (LRESULT 
*)uResult);
 
         if (CompletionCallback)
         {
@@ -1856,9 +1852,9 @@ co_IntSendMessageWithCallBack( HWND hWnd,
         }
     }
 
-    if ( !ptiSendTo)
+    if (!ptiSendTo)
     {
-        if (! NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, 
FALSE)))
+        if (!NT_SUCCESS(UnpackParam(lParamPacked, Msg, wParam, lParam, FALSE)))
         {
             ERR("Failed to unpack message parameters\n");
         }
@@ -1867,7 +1863,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
 
     if(!(Message = AllocateUserMessage(FALSE)))
     {
-        ERR("MsqSendMessage(): Not enough memory to allocate a message\n");
+        ERR("Failed to allocate message\n");
         RETURN(FALSE);
     }
 
@@ -1879,7 +1875,7 @@ co_IntSendMessageWithCallBack( HWND hWnd,
     Message->lResult = 0;
     Message->QS_Flags = 0;
     Message->ptiReceiver = ptiSendTo;
-    Message->ptiSender = NULL; // mjmartin, you are right! This is null.
+    Message->ptiSender = NULL;
     Message->ptiCallBackSender = Win32Thread;
     Message->CompletionCallback = CompletionCallback;
     Message->CompletionCallbackContext = CompletionCallbackContext;
@@ -1889,9 +1885,9 @@ co_IntSendMessageWithCallBack( HWND hWnd,
     Message->flags = SMF_RECEIVERFREE;
 
     if (Msg & 0x80000000) // Higher priority event message!
-       InsertHeadList(&ptiSendTo->SentMessagesListHead, &Message->ListEntry);
+        InsertHeadList(&ptiSendTo->SentMessagesListHead, &Message->ListEntry);
     else
-       InsertTailList(&ptiSendTo->SentMessagesListHead, &Message->ListEntry);
+        InsertTailList(&ptiSendTo->SentMessagesListHead, &Message->ListEntry);
     MsqWakeQueue(ptiSendTo, QS_SENDMESSAGE, TRUE);
 
     RETURN(TRUE);

Reply via email to