[ros-diffs] [jimtabor] 32874: BroadcastSystemMessage: - Implement User half only. - Introduce example use for NtUserMessageCall. - IntBroadcastSystemMessage is based on Wine LGPL implementation http://www.winehq.org/pipermail/wine-cvs/2008-April/042051.html . - Wine testing needed to be change by adding message range parameter check. The range was from 0 to -1 and check for resulting errors that conformed to XP. - Need to move BROADCASTPARM to include/X/X/ntuser.h or other after Dr. Timo finishes header realignment.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Sat Apr 5 20:05:11 CEST 2008


Author: jimtabor
Date: Sat Apr  5 13:05:11 2008
New Revision: 32874

URL: http://svn.reactos.org/svn/reactos?rev=32874&view=rev
Log:
BroadcastSystemMessage:
- Implement User half only.
- Introduce example use for NtUserMessageCall.
- IntBroadcastSystemMessage is based on Wine LGPL implementation http://www.winehq.org/pipermail/wine-cvs/2008-April/042051.html .
- Wine testing needed to be change by adding message range parameter check. The range was from 0 to -1 and check for resulting errors that conformed to XP.
- Need to move BROADCASTPARM to include/X/X/ntuser.h or other after Dr. Timo finishes header realignment.

Modified:
    trunk/reactos/dll/win32/user32/misc/stubs.c
    trunk/reactos/dll/win32/user32/windows/message.c

Modified: trunk/reactos/dll/win32/user32/misc/stubs.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/stubs.c?rev=32874&r1=32873&r2=32874&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/stubs.c [iso-8859-1] Sat Apr  5 13:05:11 2008
@@ -34,40 +34,6 @@
 /*
  * @unimplemented
  */
-long
-STDCALL
-BroadcastSystemMessageA(
-  DWORD dwFlags,
-  LPDWORD lpdwRecipients,
-  UINT uiMessage,
-  WPARAM wParam,
-  LPARAM lParam)
-{
-  UNIMPLEMENTED;
-  return 0;
-}
-
-
-/*
- * @unimplemented
- */
-long
-STDCALL
-BroadcastSystemMessageW(
-  DWORD dwFlags,
-  LPDWORD lpdwRecipients,
-  UINT uiMessage,
-  WPARAM wParam,
-  LPARAM lParam)
-{
-  UNIMPLEMENTED;
-  return 0;
-}
-
-
-/*
- * @unimplemented
- */
 int
 STDCALL
 GetMouseMovePointsEx(
@@ -357,23 +323,6 @@
  */
 LONG
 STDCALL
-BroadcastSystemMessageExW(
-    DWORD dwflags,
-    LPDWORD lpdwRecipients,
-    UINT uiMessage,
-    WPARAM wParam,
-    LPARAM lParam,
-    PBSMINFO pBSMInfo)
-{
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-/*
- * @unimplemented
- */
-LONG
-STDCALL
 CsrBroadcastSystemMessageExW(
     DWORD dwflags,
     LPDWORD lpdwRecipients,
@@ -404,23 +353,6 @@
 /*
  * @unimplemented
  */
-LONG
-STDCALL
-BroadcastSystemMessageExA(
-    DWORD dwflags,
-    LPDWORD lpdwRecipients,
-    UINT uiMessage,
-    WPARAM wParam,
-    LPARAM lParam,
-    PBSMINFO pBSMInfo)
-{
-  UNIMPLEMENTED;
-  return FALSE;
-}
-
-/*
- * @unimplemented
- */
 BOOL
 STDCALL
 AlignRects(LPRECT rect, DWORD b, DWORD c, DWORD d)

Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/message.c?rev=32874&r1=32873&r2=32874&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Sat Apr  5 13:05:11 2008
@@ -2559,3 +2559,136 @@
     msg.wParam = map_wparam_AtoW( msg.message, msg.wParam );
     return IsDialogMessageW( hwndDlg, &msg );
 }
+
+typedef struct _BROADCASTPARM
+{
+    DWORD flags;
+    LPDWORD recipients;
+} BROADCASTPARM, *PBROADCASTPARM;
+
+LONG
+STDCALL
+IntBroadcastSystemMessage(
+    DWORD dwflags,
+    LPDWORD lpdwRecipients,
+    UINT uiMessage,
+    WPARAM wParam,
+    LPARAM lParam,
+    PBSMINFO pBSMInfo,
+    BOOL Ansi)
+{
+    BROADCASTPARM parm;
+    DWORD recips = BSM_ALLCOMPONENTS;
+    BOOL ret = TRUE;
+    static const DWORD all_flags = ( BSF_QUERY | BSF_IGNORECURRENTTASK | BSF_FLUSHDISK | BSF_NOHANG
+                                   | BSF_POSTMESSAGE | BSF_FORCEIFHUNG | BSF_NOTIMEOUTIFNOTHUNG
+                                   | BSF_ALLOWSFW | BSF_SENDNOTIFYMESSAGE | BSF_RETURNHDESK | BSF_LUID );
+
+    if (dwflags & ~all_flags)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return 0;
+    }
+
+    if(uiMessage >= WM_USER && uiMessage < 0xC000)
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+        return 0;
+    }
+
+    if (!lpdwRecipients)
+        lpdwRecipients = &recips;
+
+    if ( pBSMInfo && dwflags & BSF_QUERY )
+    {
+       if (pBSMInfo->cbSize != sizeof(BSMINFO))
+       {
+           SetLastError(ERROR_INVALID_PARAMETER);
+           return 0;
+       }
+       FIXME("Not returning PBSMINFO information yet\n");
+    }
+
+    parm.flags = dwflags;
+    parm.recipients = lpdwRecipients;
+
+    if (*lpdwRecipients & BSM_APPLICATIONS)
+    {
+        return NtUserMessageCall(GetDesktopWindow(),
+                                          uiMessage,
+                                             wParam,
+                                             lParam,
+                                   (ULONG_PTR)&parm,
+                        NUMC_BROADCASTSYSTEMMESSAGE,
+                                               Ansi);
+    }
+    else
+    {
+       FIXME("Recipients %08x not supported!\n", *lpdwRecipients);
+    }
+
+    return ret;
+}
+
+/*
+ * @implemented
+ */
+LONG
+STDCALL
+BroadcastSystemMessageA(
+  DWORD dwFlags,
+  LPDWORD lpdwRecipients,
+  UINT uiMessage,
+  WPARAM wParam,
+  LPARAM lParam)
+{
+  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, TRUE );
+}
+
+/*
+ * @implemented
+ */
+LONG
+STDCALL
+BroadcastSystemMessageW(
+  DWORD dwFlags,
+  LPDWORD lpdwRecipients,
+  UINT uiMessage,
+  WPARAM wParam,
+  LPARAM lParam)
+{
+  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, FALSE );
+}
+
+/*
+ * @implemented
+ */
+LONG
+STDCALL
+BroadcastSystemMessageExA(
+    DWORD dwflags,
+    LPDWORD lpdwRecipients,
+    UINT uiMessage,
+    WPARAM wParam,
+    LPARAM lParam,
+    PBSMINFO pBSMInfo)
+{
+  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, TRUE );
+}
+
+/*
+ * @implemented
+ */
+LONG
+STDCALL
+BroadcastSystemMessageExW(
+    DWORD dwflags,
+    LPDWORD lpdwRecipients,
+    UINT uiMessage,
+    WPARAM wParam,
+    LPARAM lParam,
+    PBSMINFO pBSMInfo)
+{
+  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, FALSE );
+}
+



More information about the Ros-diffs mailing list