ReactOS 0.4.16-dev-336-gb667d82
message.c File Reference
#include <user32.h>
Include dependency graph for message.c:

Go to the source code of this file.

Classes

struct  tagDDEPAIR
 
struct  _USER_MESSAGE_PUMP_ADDRESSES
 

Macros

#define CALL_EXTERN_WNDPROC(proc, h, m, w, l)   proc(h, m, w, l)
 
#define SET(msg)   (1 << ((msg) & 31))
 
#define GROWBY   4
 

Typedefs

typedef struct tagDDEPAIR DDEPAIR
 
typedef struct tagDDEPAIRPDDEPAIR
 
typedef DWORD(WINAPIRealGetQueueStatusProc) (UINT flags)
 
typedef DWORD(WINAPIRealMsgWaitForMultipleObjectsExProc) (DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
 
typedef BOOL(WINAPIRealInternalGetMessageProc) (LPMSG, HWND, UINT, UINT, UINT, BOOL)
 
typedef BOOL(WINAPIRealWaitMessageExProc) (DWORD, UINT)
 
typedef struct _USER_MESSAGE_PUMP_ADDRESSES USER_MESSAGE_PUMP_ADDRESSES
 
typedef struct _USER_MESSAGE_PUMP_ADDRESSESPUSER_MESSAGE_PUMP_ADDRESSES
 
typedef BOOL(WINAPIMESSAGEPUMPHOOKPROC) (BOOL Unregistering, PUSER_MESSAGE_PUMP_ADDRESSES MessagePumpAddresses)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (user32)
 
static int is_pointer_message (UINT message, WPARAM wparam)
 
static BOOL FASTCALL combobox_has_strings (HWND hwnd)
 
static BOOL FASTCALL listbox_has_strings (HWND hwnd)
 
BOOL FASTCALL DdeAddPair (HGLOBAL ClientMem, HGLOBAL ServerMem)
 
HGLOBAL FASTCALL DdeGetPair (HGLOBAL ServerMem)
 
DWORD FASTCALL get_input_codepage (void)
 
static WPARAM FASTCALL map_wparam_char_WtoA (WPARAM wParam, DWORD len)
 
static WPARAM FASTCALL map_wparam_AtoW (UINT message, WPARAM wparam)
 
static BOOL FASTCALL MsgiUMToKMMessage (PMSG UMMsg, PMSG KMMsg, BOOL Posted)
 
static VOID FASTCALL MsgiUMToKMCleanup (PMSG UMMsg, PMSG KMMsg)
 
static BOOL FASTCALL MsgiKMToUMMessage (PMSG KMMsg, PMSG UMMsg)
 
static VOID FASTCALL MsgiKMToUMCleanup (PMSG KMMsg, PMSG UMMsg)
 
static BOOL FASTCALL MsgiKMToUMReply (PMSG KMMsg, PMSG UMMsg, LRESULT *Result)
 
static BOOL FASTCALL MsgiAnsiToUnicodeMessage (HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
 
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup (LPMSG UnicodeMsg, LPMSG AnsiMsg)
 
static BOOL FASTCALL MsgiAnsiToUnicodeReply (LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT *Result)
 
static BOOL FASTCALL MsgiUnicodeToAnsiMessage (HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg)
 
static BOOL FASTCALL MsgiUnicodeToAnsiCleanup (LPMSG AnsiMsg, LPMSG UnicodeMsg)
 
static BOOL FASTCALL MsgiUnicodeToAnsiReply (LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result)
 
LRESULT WINAPI DesktopWndProcA (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
 
LPARAM WINAPI GetMessageExtraInfo (VOID)
 
DWORD WINAPI GetMessagePos (VOID)
 
LONG WINAPI GetMessageTime (VOID)
 
BOOL WINAPI InSendMessage (VOID)
 
DWORD WINAPI InSendMessageEx (LPVOID lpReserved)
 
BOOL WINAPI ReplyMessage (LRESULT lResult)
 
LPARAM WINAPI SetMessageExtraInfo (LPARAM lParam)
 
LRESULT FASTCALL IntCallWindowProcW (BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT FASTCALL IntCallWindowProcA (BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
static LRESULT WINAPI IntCallMessageProc (IN PWND Wnd, IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam, IN BOOL Ansi)
 
LRESULT WINAPI CallWindowProcA (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI CallWindowProcW (WNDPROC lpPrevWndFunc, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageA (CONST MSG *lpmsg)
 
LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageW (CONST MSG *lpmsg)
 
static VOID IntConvertMsgToAnsi (LPMSG lpMsg)
 
BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
 
BOOL WINAPI DECLSPEC_HOTPATCH GetMessageW (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax)
 
BOOL WINAPI PeekMessageWorker (PMSG pMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 
BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageA (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 
BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW (LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
 
BOOL WINAPI PostMessageA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI PostMessageW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
VOID WINAPI PostQuitMessage (int nExitCode)
 
BOOL WINAPI PostThreadMessageA (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI PostThreadMessageW (DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SendMessageW (HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
LRESULT WINAPI SendMessageA (HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI SendMessageCallbackA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpCallBack, ULONG_PTR dwData)
 
BOOL WINAPI SendMessageCallbackW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpCallBack, ULONG_PTR dwData)
 
LRESULT WINAPI SendMessageTimeoutA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult)
 
LRESULT WINAPI SendMessageTimeoutW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PDWORD_PTR lpdwResult)
 
BOOL WINAPI SendNotifyMessageA (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI SendNotifyMessageW (HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
 
BOOL WINAPI TranslateMessageEx (CONST MSG *lpMsg, UINT Flags)
 
BOOL WINAPI TranslateMessage (CONST MSG *lpMsg)
 
UINT WINAPI RegisterWindowMessageA (LPCSTR lpString)
 
UINT WINAPI RegisterWindowMessageW (LPCWSTR lpString)
 
HWND WINAPI GetCapture (VOID)
 
BOOL WINAPI ReleaseCapture (VOID)
 
DWORD WINAPI RealGetQueueStatus (UINT flags)
 
BOOL WINAPI GetInputState (VOID)
 
NTSTATUS WINAPI User32CallWindowProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
BOOL WINAPI SetMessageQueue (int cMessagesMax)
 
DWORD WINAPI RealMsgWaitForMultipleObjectsEx (DWORD nCount, CONST HANDLE *pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
 
BOOL WINAPI IsInsideMessagePumpHook ()
 
void WINAPI ResetMessagePumpHook (PUSER_MESSAGE_PUMP_ADDRESSES Addresses)
 
BOOL WINAPI RegisterMessagePumpHook (MESSAGEPUMPHOOKPROC Hook)
 
BOOL WINAPI UnregisterMessagePumpHook (VOID)
 
DWORD WINAPI GetQueueStatus (UINT flags)
 
RealMsgWaitForMultipleObjectsEx

Wait either for either message arrival or for one of the passed events to be signalled.

Parameters
nCountNumber of handles in the pHandles array.
pHandlesHandles of events to wait for.
dwMillisecondsTimeout interval.
dwWakeMaskMask specifying on which message events we should wakeup.
dwFlagsWait type (see MWMO_* constants).

@implemented

DWORD WINAPI RealMsgWaitForMultipleObjectsEx (DWORD nCount, const HANDLE *pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
 
DWORD WINAPI MsgWaitForMultipleObjectsEx (DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
 
DWORD WINAPI MsgWaitForMultipleObjects (DWORD nCount, CONST HANDLE *lpHandles, BOOL fWaitAll, DWORD dwMilliseconds, DWORD dwWakeMask)
 
BOOL FASTCALL MessageInit (VOID)
 
VOID FASTCALL MessageCleanup (VOID)
 
BOOL WINAPI IsDialogMessageA (HWND hwndDlg, LPMSG pmsg)
 
LONG WINAPI IntBroadcastSystemMessage (DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
 
LONG WINAPI BroadcastSystemMessageA (DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
 
LONG WINAPI BroadcastSystemMessageW (DWORD dwFlags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam)
 
LONG WINAPI BroadcastSystemMessageExA (DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo)
 
LONG WINAPI BroadcastSystemMessageExW (DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo)
 

Variables

static const unsigned int message_pointer_flags []
 
static PDDEPAIR DdePairs = NULL
 
static unsigned DdeNumAlloc = 0
 
static unsigned DdeNumUsed = 0
 
static CRITICAL_SECTION DdeCrst
 
CRITICAL_SECTION gcsMPH
 
MESSAGEPUMPHOOKPROC gpfnInitMPH
 
DWORD gcLoadMPH = 0
 
USER_MESSAGE_PUMP_ADDRESSES gmph
 
DWORD gfMessagePumpHook = 0
 

Macro Definition Documentation

◆ CALL_EXTERN_WNDPROC

#define CALL_EXTERN_WNDPROC (   proc,
  h,
  m,
  w,
  l 
)    proc(h, m, w, l)

Definition at line 27 of file message.c.

◆ GROWBY

#define GROWBY   4

◆ SET

#define SET (   msg)    (1 << ((msg) & 31))

Definition at line 34 of file message.c.

Typedef Documentation

◆ DDEPAIR

◆ MESSAGEPUMPHOOKPROC

typedef BOOL(WINAPI * MESSAGEPUMPHOOKPROC) (BOOL Unregistering, PUSER_MESSAGE_PUMP_ADDRESSES MessagePumpAddresses)

Definition at line 3074 of file message.c.

◆ PDDEPAIR

◆ PUSER_MESSAGE_PUMP_ADDRESSES

◆ RealGetQueueStatusProc

typedef DWORD(WINAPI * RealGetQueueStatusProc) (UINT flags)

Definition at line 3052 of file message.c.

◆ RealInternalGetMessageProc

typedef BOOL(WINAPI * RealInternalGetMessageProc) (LPMSG, HWND, UINT, UINT, UINT, BOOL)

Definition at line 3054 of file message.c.

◆ RealMsgWaitForMultipleObjectsExProc

typedef DWORD(WINAPI * RealMsgWaitForMultipleObjectsExProc) (DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)

Definition at line 3053 of file message.c.

◆ RealWaitMessageExProc

typedef BOOL(WINAPI * RealWaitMessageExProc) (DWORD, UINT)

Definition at line 3055 of file message.c.

◆ USER_MESSAGE_PUMP_ADDRESSES

Function Documentation

◆ BroadcastSystemMessageA()

LONG WINAPI BroadcastSystemMessageA ( DWORD  dwFlags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 3393 of file message.c.

3399{
3400 return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, TRUE );
3401}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3311
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176

Referenced by START_TEST().

◆ BroadcastSystemMessageExA()

LONG WINAPI BroadcastSystemMessageExA ( DWORD  dwflags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam,
PBSMINFO  pBSMInfo 
)

Definition at line 3423 of file message.c.

3430{
3431 return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, TRUE );
3432}
static _In_ DWORD dwflags
Definition: dispmode.c:64

Referenced by START_TEST().

◆ BroadcastSystemMessageExW()

LONG WINAPI BroadcastSystemMessageExW ( DWORD  dwflags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam,
PBSMINFO  pBSMInfo 
)

Definition at line 3439 of file message.c.

3446{
3447 return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, FALSE );
3448}
#define FALSE
Definition: types.h:117

Referenced by START_TEST().

◆ BroadcastSystemMessageW()

LONG WINAPI BroadcastSystemMessageW ( DWORD  dwFlags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 3408 of file message.c.

3414{
3415 return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, FALSE );
3416}

Referenced by InputList_Process(), and START_TEST().

◆ CallWindowProcA()

LRESULT WINAPI CallWindowProcA ( WNDPROC  lpPrevWndFunc,
HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1808 of file message.c.

1813{
1814 PWND pWnd;
1815 PCALLPROCDATA CallProc;
1816
1817 if (lpPrevWndFunc == NULL)
1818 {
1819 WARN("CallWindowProcA: lpPrevWndFunc == NULL!\n");
1820 return 0;
1821 }
1822
1823 pWnd = ValidateHwnd(hWnd);
1824
1825 if (!IsCallProcHandle(lpPrevWndFunc))
1826 return IntCallWindowProcA(TRUE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam);
1827 else
1828 {
1829 CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
1830 if (CallProc != NULL)
1831 {
1832 return IntCallWindowProcA(!(CallProc->wType & UserGetCPDA2U),
1833 CallProc->pfnClientPrevious,
1834 pWnd,
1835 hWnd,
1836 Msg,
1837 wParam,
1838 lParam);
1839 }
1840 else
1841 {
1842 WARN("CallWindowProcA: can not dereference WndProcHandle\n");
1843 return 0;
1844 }
1845 }
1846}
HWND hWnd
Definition: settings.c:17
#define WARN(fmt,...)
Definition: precomp.h:61
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
struct @1642 Msg[]
#define ValidateHwnd(hwnd)
Definition: precomp.h:85
@ UserGetCPDA2U
Definition: ntuser.h:540
GETCPD wType
Definition: ntuser.h:553
WNDPROC pfnClientPrevious
Definition: ntuser.h:552
Definition: ntuser.h:694
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc)
Definition: misc.c:339
static LRESULT FASTCALL IntCallWindowProcA(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1584

◆ CallWindowProcW()

LRESULT WINAPI CallWindowProcW ( WNDPROC  lpPrevWndFunc,
HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1853 of file message.c.

1858{
1859 PWND pWnd;
1860 PCALLPROCDATA CallProc;
1861
1862 /* FIXME - can the first parameter be NULL? */
1863 if (lpPrevWndFunc == NULL)
1864 {
1865 WARN("CallWindowProcA: lpPrevWndFunc == NULL!\n");
1866 return 0;
1867 }
1868
1869 pWnd = ValidateHwnd(hWnd);
1870
1871 if (!IsCallProcHandle(lpPrevWndFunc))
1872 return IntCallWindowProcW(FALSE, lpPrevWndFunc, pWnd, hWnd, Msg, wParam, lParam);
1873 else
1874 {
1875 CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
1876 if (CallProc != NULL)
1877 {
1878 return IntCallWindowProcW(!(CallProc->wType & UserGetCPDA2U),
1879 CallProc->pfnClientPrevious,
1880 pWnd,
1881 hWnd,
1882 Msg,
1883 wParam,
1884 lParam);
1885 }
1886 else
1887 {
1888 WARN("CallWindowProcW: can not dereference WndProcHandle\n");
1889 return 0;
1890 }
1891 }
1892}
LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1425

◆ combobox_has_strings()

static BOOL FASTCALL combobox_has_strings ( HWND  hwnd)
static

Definition at line 108 of file message.c.

109{
112}
Arabic default style
Definition: afstyles.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define CBS_OWNERDRAWFIXED
Definition: winuser.h:289
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define CBS_OWNERDRAWVARIABLE
Definition: winuser.h:290
#define CBS_HASSTRINGS
Definition: winuser.h:285
#define GWL_STYLE
Definition: winuser.h:855

Referenced by MsgiAnsiToUnicodeCleanup(), MsgiAnsiToUnicodeMessage(), MsgiAnsiToUnicodeReply(), MsgiUnicodeToAnsiCleanup(), MsgiUnicodeToAnsiMessage(), and MsgiUnicodeToAnsiReply().

◆ DdeAddPair()

BOOL FASTCALL DdeAddPair ( HGLOBAL  ClientMem,
HGLOBAL  ServerMem 
)

Definition at line 181 of file message.c.

182{
183 unsigned i;
184
186
187 /* now remember the pair of hMem on both sides */
188 if (DdeNumUsed == DdeNumAlloc)
189 {
190#define GROWBY 4
192 if (NULL != DdePairs)
193 {
195 (DdeNumAlloc + GROWBY) * sizeof(DDEPAIR));
196 }
197 else
198 {
200 (DdeNumAlloc + GROWBY) * sizeof(DDEPAIR));
201 }
202
203 if (NULL == New)
204 {
206 return FALSE;
207 }
208 DdePairs = New;
209 /* zero out newly allocated part */
210 memset(&DdePairs[DdeNumAlloc], 0, GROWBY * sizeof(DDEPAIR));
212#undef GROWBY
213 }
214
215 for (i = 0; i < DdeNumAlloc; i++)
216 {
217 if (NULL == DdePairs[i].ServerMem)
218 {
219 DdePairs[i].ClientMem = ClientMem;
220 DdePairs[i].ServerMem = ServerMem;
221 DdeNumUsed++;
222 break;
223 }
224 }
226
227 return TRUE;
228}
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapReAlloc
Definition: compat.h:734
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define New(t)
Definition: rtf.h:1086
#define memset(x, y, z)
Definition: compat.h:39
HGLOBAL ServerMem
Definition: message.c:172
HGLOBAL ClientMem
Definition: message.c:171
static unsigned DdeNumAlloc
Definition: message.c:176
static PDDEPAIR DdePairs
Definition: message.c:175
#define GROWBY
static unsigned DdeNumUsed
Definition: message.c:177
static CRITICAL_SECTION DdeCrst
Definition: message.c:178
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

Referenced by unpack_dde_message().

◆ DdeGetPair()

HGLOBAL FASTCALL DdeGetPair ( HGLOBAL  ServerMem)

Definition at line 231 of file message.c.

232{
233 unsigned i;
234 HGLOBAL Ret = NULL;
235
237 for (i = 0; i < DdeNumAlloc; i++)
238 {
239 if (DdePairs[i].ServerMem == ServerMem)
240 {
241 /* free this pair */
242 DdePairs[i].ServerMem = 0;
243 DdeNumUsed--;
244 Ret = DdePairs[i].ClientMem;
245 break;
246 }
247 }
249
250 return Ret;
251}

Referenced by post_dde_message().

◆ DesktopWndProcA()

LRESULT WINAPI DesktopWndProcA ( HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1307 of file message.c.

1308{
1310 MSG AnsiMsg, UcMsg;
1311
1312 TRACE("Desktop A Class Atom! hWnd 0x%x, Msg %d\n", hwnd, message);
1313
1314 AnsiMsg.hwnd = hwnd;
1315 AnsiMsg.message = message;
1316 AnsiMsg.wParam = wParam;
1317 AnsiMsg.lParam = lParam;
1318 AnsiMsg.time = 0;
1319 AnsiMsg.pt.x = 0;
1320 AnsiMsg.pt.y = 0;
1321
1322 // Desktop is always Unicode so convert Ansi here.
1323 if (!MsgiAnsiToUnicodeMessage(hwnd, &UcMsg, &AnsiMsg))
1324 {
1325 return FALSE;
1326 }
1327
1328 Result = DesktopWndProcW(hwnd, message, UcMsg.wParam, UcMsg.lParam);
1329
1330 MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
1331
1332 return Result;
1333 }
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
#define TRACE(s)
Definition: solgame.cpp:4
Definition: tftpd.h:60
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:709
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
LONG_PTR LRESULT
Definition: windef.h:209
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by RegisterClientPFN().

◆ DispatchMessageA()

LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageA ( CONST MSG lpmsg)

Definition at line 1901 of file message.c.

1902{
1903 LRESULT Ret = 0;
1904 MSG UnicodeMsg;
1905 PWND Wnd;
1906
1907 if ( lpmsg->message & ~WM_MAXIMUM )
1908 {
1910 return 0;
1911 }
1912
1913 if (lpmsg->hwnd != NULL)
1914 {
1915 Wnd = ValidateHwnd(lpmsg->hwnd);
1916 if (!Wnd) return 0;
1917 }
1918 else
1919 Wnd = NULL;
1920
1921 if (is_pointer_message(lpmsg->message, lpmsg->wParam))
1922 {
1924 return 0;
1925 }
1926
1927 if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) && lpmsg->lParam != 0)
1928 {
1929 WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
1930
1931 if ( lpmsg->message == WM_SYSTIMER )
1932 return NtUserDispatchMessage( (PMSG)lpmsg );
1933
1934 if (!NtUserValidateTimerCallback(lpmsg->lParam))
1935 {
1936 WARN("Validating Timer Callback failed!\n");
1937 return 0;
1938 }
1939
1940 _SEH2_TRY // wine does this. Hint: Prevents call to another thread....
1941 {
1942 Ret = WndProc(lpmsg->hwnd,
1943 lpmsg->message,
1944 lpmsg->wParam,
1945 GetTickCount());
1946 }
1948 {
1949 ERR("Exception in Timer Callback!\n");
1950 }
1951 _SEH2_END;
1952 }
1953 else if (Wnd != NULL)
1954 {
1955 if ( (lpmsg->message != WM_PAINT) && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
1956 {
1957 Ret = IntCallMessageProc(Wnd,
1958 lpmsg->hwnd,
1959 lpmsg->message,
1960 lpmsg->wParam,
1961 lpmsg->lParam,
1962 TRUE);
1963 }
1964 else
1965 {
1966 if (!MsgiAnsiToUnicodeMessage(lpmsg->hwnd, &UnicodeMsg, (LPMSG)lpmsg))
1967 {
1968 return FALSE;
1969 }
1970
1971 Ret = NtUserDispatchMessage(&UnicodeMsg);
1972
1973 if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, (LPMSG)lpmsg, &Ret))
1974 {
1975 return FALSE;
1976 }
1977 }
1978 }
1979
1980 return Ret;
1981}
#define ERR(fmt,...)
Definition: precomp.h:57
#define WM_SYSTIMER
Definition: comctl32.h:125
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define SetLastError(x)
Definition: compat.h:752
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:623
BOOL APIENTRY NtUserValidateTimerCallback(LPARAM lParam)
Definition: timer.c:707
LRESULT NTAPI NtUserDispatchMessage(PMSG pMsg)
Definition: message.c:2477
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
if(dx< 0)
Definition: linetemp.h:194
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_END
Definition: pseh2_64.h:155
#define _SEH2_TRY
Definition: pseh2_64.h:55
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:614
DWORD state
Definition: ntuser.h:701
#define WM_MAXIMUM
Definition: undocuser.h:64
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:120
static BOOL FASTCALL MsgiAnsiToUnicodeReply(LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT *Result)
Definition: message.c:821
static LRESULT WINAPI IntCallMessageProc(IN PWND Wnd, IN HWND hWnd, IN UINT Msg, IN WPARAM wParam, IN LPARAM lParam, IN BOOL Ansi)
Definition: message.c:1747
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
#define WM_PAINT
Definition: winuser.h:1623
#define WM_TIMER
Definition: winuser.h:1745
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2909

◆ DispatchMessageW()

LRESULT WINAPI DECLSPEC_HOTPATCH DispatchMessageW ( CONST MSG lpmsg)

Definition at line 1990 of file message.c.

1991{
1992 LRESULT Ret = 0;
1993 PWND Wnd;
1994 BOOL Hit = FALSE;
1995
1996 if ( lpmsg->message & ~WM_MAXIMUM )
1997 {
1999 return 0;
2000 }
2001
2002 if (lpmsg->hwnd != NULL)
2003 {
2004 Wnd = ValidateHwnd(lpmsg->hwnd);
2005 if (!Wnd) return 0;
2006 }
2007 else
2008 Wnd = NULL;
2009
2010 if (is_pointer_message(lpmsg->message, lpmsg->wParam))
2011 {
2013 return 0;
2014 }
2015
2016 if ((lpmsg->message == WM_TIMER || lpmsg->message == WM_SYSTIMER) && lpmsg->lParam != 0)
2017 {
2018 WNDPROC WndProc = (WNDPROC)lpmsg->lParam;
2019
2020 if ( lpmsg->message == WM_SYSTIMER )
2021 return NtUserDispatchMessage( (PMSG) lpmsg );
2022
2023 if (!NtUserValidateTimerCallback(lpmsg->lParam))
2024 {
2025 WARN("Validating Timer Callback failed!\n");
2026 return 0;
2027 }
2028
2029 _SEH2_TRY
2030 {
2031 Ret = WndProc(lpmsg->hwnd,
2032 lpmsg->message,
2033 lpmsg->wParam,
2034 GetTickCount());
2035 }
2037 {
2038 Hit = TRUE;
2039 }
2040 _SEH2_END;
2041 }
2042 else if (Wnd != NULL)
2043 {
2044 if ( (lpmsg->message != WM_PAINT) && !(Wnd->state & WNDS_SERVERSIDEWINDOWPROC) )
2045 {
2046 Ret = IntCallMessageProc(Wnd,
2047 lpmsg->hwnd,
2048 lpmsg->message,
2049 lpmsg->wParam,
2050 lpmsg->lParam,
2051 FALSE);
2052 }
2053 else
2054 Ret = NtUserDispatchMessage( (PMSG) lpmsg );
2055 }
2056
2057 if (Hit)
2058 {
2059 WARN("Exception in Timer Callback WndProcW!\n");
2060 }
2061 return Ret;
2062}
unsigned int BOOL
Definition: ntddk_ex.h:94

◆ get_input_codepage()

DWORD FASTCALL get_input_codepage ( void  )

Definition at line 253 of file message.c.

254{
255 DWORD cp;
256 int ret;
258 ret = GetLocaleInfoW( LOWORD(hkl), LOCALE_IDEFAULTANSICODEPAGE | LOCALE_RETURN_NUMBER, (WCHAR *)&cp, sizeof(cp) / sizeof(WCHAR) );
259 if (!ret) cp = CP_ACP;
260 return cp;
261}
#define CP_ACP
Definition: compat.h:109
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: locale.c:1666
POINT cp
Definition: magnifier.c:59
HKL hkl
Definition: msctf.idl:650
UINT_PTR HKL
Definition: msctf.idl:143
#define LOWORD(l)
Definition: pedump.c:82
int ret
#define LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:40
HKL WINAPI GetKeyboardLayout(_In_ DWORD)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by map_wparam_char_WtoA(), and MsgiUnicodeToAnsiMessage().

◆ GetCapture()

HWND WINAPI GetCapture ( VOID  )

Definition at line 2881 of file message.c.

2882{
2884}
@ THREADSTATE_CAPTUREWINDOW
Definition: ntuser.h:2474
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:240

Referenced by button_hook_proc(), button_subclass_proc(), BUTTON_WindowProc(), ButtonWndProc_common(), cancel_popup_proc(), CBDropDown(), CBRollUp(), check_wnd_state_(), CheckListWndProc(), ChildWndProc(), DIALOG_CreateIndirect(), EDIT_WM_LButtonUp(), EDIT_WM_MouseMove(), HEXEDIT_WM_LBUTTONUP(), HEXEDIT_WM_MOUSEMOVE(), IntScrollHandleScrollEvent(), LISTBOX_HandleLButtonDownCombo(), LISTBOX_HandleLButtonUp(), LISTBOX_WindowProc(), ListBoxWndProc_common(), LISTVIEW_TrackMouse(), MouseProc(), MsgCheckProc(), CMainWindow::OnCommand(), CPaletteWindow::OnLButtonUp(), CToolBox::OnLButtonUp(), CCanvasWindow::OnMouseMove(), CPaletteWindow::OnMouseMove(), CToolBox::OnMouseMove(), OwnerDrawButtonSubclass(), PAGER_MouseMove(), CMenuFocusManager::ProcessMouseDown(), CMenuFocusManager::ProcessMouseMove(), CMenuFocusManager::ProcessMouseUp(), CUiSplitPanel::ProcessWindowMessage(), REBAR_MouseMove(), SCROLL_TrackScrollBar(), ScrollTrackScrollBar(), subpopuplocked_wnd_proc(), T1_OnButtonUp(), test_button_messages(), test_capture_1(), test_capture_4_proc(), test_DestroyWindow(), test_missing_lbuttonup(), test_showwindow(), ToolTipProc(), TREEVIEW_TrackMouse(), UPDOWN_CancelMode(), UpDownWindowProc(), WndProc(), SDIMainFrame::WndProc(), StartButton::WndProc(), and ChildWindow::WndProc().

◆ GetInputState()

BOOL WINAPI GetInputState ( VOID  )

Definition at line 2925 of file message.c.

2926{
2927 PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
2928
2929 if ((!pcti) || (pcti->fsChangeBits & (QS_KEY|QS_MOUSEBUTTON)))
2931
2932 return FALSE;
2933}
@ THREADSTATE_GETINPUTSTATE
Definition: ntuser.h:2477
#define GetWin32ClientInfo()
Definition: ntuser.h:352
WORD fsChangeBits
Definition: ntuser.h:171
#define QS_KEY
Definition: winuser.h:877
#define QS_MOUSEBUTTON
Definition: winuser.h:879

◆ GetMessageA()

BOOL WINAPI DECLSPEC_HOTPATCH GetMessageA ( LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax 
)

Definition at line 2092 of file message.c.

2096{
2097 BOOL Res;
2098
2099 if ( (wMsgFilterMin|wMsgFilterMax) & ~WM_MAXIMUM )
2100 {
2102 return FALSE;
2103 }
2104
2105 Res = NtUserGetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
2106 if (-1 == (int) Res)
2107 {
2108 return Res;
2109 }
2110
2111 IntConvertMsgToAnsi(lpMsg);
2112
2113 return Res;
2114}
BOOL APIENTRY NtUserGetMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax)
Definition: message.c:2347
static VOID IntConvertMsgToAnsi(LPMSG lpMsg)
Definition: message.c:2065

◆ GetMessageExtraInfo()

LPARAM WINAPI GetMessageExtraInfo ( VOID  )

Definition at line 1340 of file message.c.

1341{
1343}
EXTINLINE LPARAM NtUserxGetMessageExtraInfo(VOID)
Definition: ntwrapper.h:796

Referenced by DoTest_BUTTON(), DoTest_EDIT(), OSK_Command(), and OSK_ReleaseKey().

◆ GetMessagePos()

◆ GetMessageTime()

◆ GetMessageW()

BOOL WINAPI DECLSPEC_HOTPATCH GetMessageW ( LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax 
)

Definition at line 2122 of file message.c.

2126{
2127 BOOL Res;
2128
2129 if ( (wMsgFilterMin|wMsgFilterMax) & ~WM_MAXIMUM )
2130 {
2132 return FALSE;
2133 }
2134
2135 Res = NtUserGetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
2136 if (-1 == (int) Res)
2137 {
2138 return Res;
2139 }
2140
2141 return Res;
2142}

◆ GetQueueStatus()

DWORD WINAPI GetQueueStatus ( UINT  flags)

Definition at line 3157 of file message.c.

3158{
3160}
GLbitfield flags
Definition: glext.h:7161
RealGetQueueStatusProc RealGetQueueStatus
Definition: message.c:3061
DWORD WINAPI RealGetQueueStatus(UINT flags)
Definition: message.c:2901
USER_MESSAGE_PUMP_ADDRESSES gmph
Definition: message.c:3079
BOOL WINAPI IsInsideMessagePumpHook()
Definition: message.c:3088

◆ InSendMessage()

BOOL WINAPI InSendMessage ( VOID  )

Definition at line 1372 of file message.c.

1373{
1374 PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
1375 if ( pcti )
1376 {
1377 if (pcti->CTI_flags & CTI_INSENDMESSAGE)
1378 {
1379 return TRUE;
1380 }
1381 }
1382 return(NtUserGetThreadState(THREADSTATE_INSENDMESSAGE) != ISMEX_NOSEND);
1383}
@ THREADSTATE_INSENDMESSAGE
Definition: ntuser.h:2482
#define CTI_INSENDMESSAGE
Definition: ntuser.h:162
DWORD CTI_flags
Definition: ntuser.h:170

Referenced by ClientRpcChannelBuffer_SendReceive(), co_IntCallWindowProc(), DoMessage(), SEALED_::HandleEvent(), and insendmessage_wnd_proc().

◆ InSendMessageEx()

DWORD WINAPI InSendMessageEx ( LPVOID  lpReserved)

Definition at line 1391 of file message.c.

1393{
1394 PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
1395 if (pcti && !(pcti->CTI_flags & CTI_INSENDMESSAGE))
1396 return ISMEX_NOSEND;
1397 else
1399}

Referenced by clipboard_wnd_proc(), DoMessage(), DumpInSMEX(), insendmessage_wnd_proc(), MD_build_prefix(), and winproc_wrapper().

◆ IntBroadcastSystemMessage()

LONG WINAPI IntBroadcastSystemMessage ( DWORD  dwflags,
LPDWORD  lpdwRecipients,
UINT  uiMessage,
WPARAM  wParam,
LPARAM  lParam,
PBSMINFO  pBSMInfo,
BOOL  Ansi 
)

Definition at line 3311 of file message.c.

3319{
3320 BROADCASTPARM parm;
3321 DWORD recips = BSM_ALLCOMPONENTS;
3322 BOOL ret = -1; // Set to return fail
3323 static const DWORD all_flags = ( BSF_QUERY | BSF_IGNORECURRENTTASK | BSF_FLUSHDISK | BSF_NOHANG
3325 | BSF_ALLOWSFW | BSF_SENDNOTIFYMESSAGE | BSF_RETURNHDESK | BSF_LUID );
3326
3327 if ((dwflags & ~all_flags) ||
3328 (!pBSMInfo && (dwflags & (BSF_RETURNHDESK|BSF_LUID))) )
3329 {
3331 return 0;
3332 }
3333
3334 if(uiMessage >= WM_USER && uiMessage < 0xC000)
3335 {
3337 return 0;
3338 }
3339
3341
3342 if (dwflags & BSF_QUERY) dwflags &= ~BSF_SENDNOTIFYMESSAGE|BSF_POSTMESSAGE;
3343
3344 if (!lpdwRecipients)
3345 lpdwRecipients = &recips;
3346
3348 {
3350 return 0;
3351 }
3352
3353 if ( pBSMInfo && (dwflags & BSF_QUERY) )
3354 {
3355 if (pBSMInfo->cbSize != sizeof(BSMINFO))
3356 {
3358 return 0;
3359 }
3360 }
3361
3362 parm.hDesk = NULL;
3363 parm.hWnd = NULL;
3364 parm.flags = dwflags;
3365 parm.recipients = *lpdwRecipients;
3366
3367 if (dwflags & BSF_LUID) parm.luid = pBSMInfo->luid;
3368
3370 uiMessage,
3371 wParam,
3372 lParam,
3373 (ULONG_PTR)&parm,
3375 Ansi);
3376
3377 if (!ret)
3378 {
3379 if ( pBSMInfo && (dwflags & BSF_QUERY) )
3380 {
3381 pBSMInfo->hdesk = parm.hDesk;
3382 pBSMInfo->hwnd = parm.hWnd;
3383 }
3384 }
3385 return ret;
3386}
#define BSF_FLUSHDISK
Definition: dbt.h:53
#define BSF_POSTMESSAGE
Definition: dbt.h:58
#define BSF_NOTIMEOUTIFNOTHUNG
Definition: dbt.h:57
#define BSF_NOHANG
Definition: dbt.h:56
#define BSF_IGNORECURRENTTASK
Definition: dbt.h:55
#define BSF_QUERY
Definition: dbt.h:59
#define BSM_VXDS
Definition: dbt.h:52
#define BSM_APPLICATIONS
Definition: dbt.h:48
#define BSF_FORCEIFHUNG
Definition: dbt.h:54
#define BSM_NETDRIVER
Definition: dbt.h:51
#define BSM_ALLDESKTOPS
Definition: dbt.h:49
#define BSM_INSTALLABLEDRIVERS
Definition: dbt.h:50
#define BSM_ALLCOMPONENTS
Definition: dbt.h:47
BOOL NTAPI NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2540
#define FNID_BROADCASTSYSTEMMESSAGE
Definition: ntuser.h:887
DWORD recipients
Definition: ntuser.h:1109
DWORD flags
Definition: ntuser.h:1108
HDESK hDesk
Definition: ntuser.h:1110
uint32_t ULONG_PTR
Definition: typedefs.h:65
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:628
#define WM_USER
Definition: winuser.h:1898

Referenced by BroadcastSystemMessageA(), BroadcastSystemMessageExA(), BroadcastSystemMessageExW(), and BroadcastSystemMessageW().

◆ IntCallMessageProc()

static LRESULT WINAPI IntCallMessageProc ( IN PWND  Wnd,
IN HWND  hWnd,
IN UINT  Msg,
IN WPARAM  wParam,
IN LPARAM  lParam,
IN BOOL  Ansi 
)
static

Definition at line 1747 of file message.c.

1748{
1750 BOOL IsAnsi;
1751 PCLS Class;
1752
1753 Class = DesktopPtrToUser(Wnd->pcls);
1754 WndProc = NULL;
1755
1756 if ( Wnd->head.pti != GetW32ThreadInfo())
1757 { // Must be inside the same thread!
1759 return 0;
1760 }
1761 /*
1762 This is the message exchange for user32. If there's a need to monitor messages,
1763 do it here!
1764 */
1765 TRACE("HWND %p, MSG %u, WPARAM %p, LPARAM %p, Ansi %d\n", hWnd, Msg, wParam, lParam, Ansi);
1766// if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_BUTTON )
1767 if (Class->fnid <= FNID_GHOST && Class->fnid >= FNID_FIRST )
1768 {
1769 if (Ansi)
1770 {
1771 if (GETPFNCLIENTW(Class->fnid) == Wnd->lpfnWndProc)
1772 WndProc = GETPFNCLIENTA(Class->fnid);
1773 }
1774 else
1775 {
1776 if (GETPFNCLIENTA(Class->fnid) == Wnd->lpfnWndProc)
1777 WndProc = GETPFNCLIENTW(Class->fnid);
1778 }
1779
1780 IsAnsi = Ansi;
1781
1782 if (!WndProc)
1783 {
1784 IsAnsi = !Wnd->Unicode;
1785 WndProc = Wnd->lpfnWndProc;
1786 }
1787 }
1788 else
1789 {
1790 IsAnsi = !Wnd->Unicode;
1791 WndProc = Wnd->lpfnWndProc;
1792 }
1793/*
1794 Message caller can be Ansi/Unicode and the receiver can be Unicode/Ansi or
1795 the same.
1796 */
1797 if (!Ansi)
1798 return IntCallWindowProcW(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam);
1799 else
1800 return IntCallWindowProcA(IsAnsi, WndProc, Wnd, hWnd, Msg, wParam, lParam);
1801}
static PVOID FASTCALL DesktopPtrToUser(PVOID ptr)
Definition: utils.c:324
#define GETPFNCLIENTW(fnid)
Definition: ntuser.h:906
#define GETPFNCLIENTA(fnid)
Definition: ntuser.h:904
#define FNID_FIRST
Definition: ntuser.h:858
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:807
#define FNID_GHOST
Definition: ntuser.h:875
Definition: ntuser.h:566

Referenced by DispatchMessageA(), DispatchMessageW(), SendMessageA(), and SendMessageW().

◆ IntCallWindowProcA()

static LRESULT FASTCALL IntCallWindowProcA ( BOOL  IsAnsiProc,
WNDPROC  WndProc,
PWND  pWnd,
HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 1584 of file message.c.

1591{
1592 MSG AnsiMsg;
1593 MSG UnicodeMsg;
1594 BOOL Hook = FALSE, MsgOverride = FALSE, Dialog, DlgOverride = FALSE;
1595 LRESULT Result = 0, PreResult = 0;
1596 DWORD Data = 0;
1597
1598 TRACE("IntCallWindowProcA: IsAnsiProc : %s, WndProc %p, pWnd %p, hWnd %p, Msg %u, wParam %Iu, lParam %Iu.\n",
1599 IsAnsiProc ? "TRUE" : "FALSE", WndProc, pWnd, hWnd, Msg, wParam, lParam);
1600
1601 if (WndProc == NULL)
1602 {
1603 WARN("IntCallWindowsProcA() called with WndProc = NULL!\n");
1604 return FALSE;
1605 }
1606
1607 if (pWnd)
1608 Dialog = (pWnd->fnid == FNID_DIALOG);
1609 else
1610 Dialog = FALSE;
1611
1612 Hook = BeginIfHookedUserApiHook();
1613 if (Hook)
1614 {
1615 if (Dialog)
1616 DlgOverride = IsMsgOverride( Msg, &guah.DlgProcArray);
1617 MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray);
1618 }
1619
1620 if (IsAnsiProc)
1621 {
1622 if (Hook && (MsgOverride || DlgOverride))
1623 {
1624 _SEH2_TRY
1625 {
1626 if (!DlgOverride)
1627 PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1628 else
1629 PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1630 }
1632 {
1633 ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1634 }
1635 _SEH2_END;
1636 }
1637
1638 if (PreResult) goto Exit;
1639
1640 if (!Dialog)
1642 else
1643 {
1644 _SEH2_TRY
1645 {
1647 }
1649 {
1650 ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
1651 }
1652 _SEH2_END;
1653 }
1654
1655 if (Hook && (MsgOverride || DlgOverride))
1656 {
1657 _SEH2_TRY
1658 {
1659 if (!DlgOverride)
1661 else
1663 }
1665 {
1666 ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1667 }
1668 _SEH2_END;
1669 }
1670 }
1671 else
1672 {
1673 AnsiMsg.hwnd = hWnd;
1674 AnsiMsg.message = Msg;
1675 AnsiMsg.wParam = wParam;
1676 AnsiMsg.lParam = lParam;
1677 AnsiMsg.time = 0;
1678 AnsiMsg.pt.x = 0;
1679 AnsiMsg.pt.y = 0;
1680 if (! MsgiAnsiToUnicodeMessage(hWnd, &UnicodeMsg, &AnsiMsg))
1681 {
1682 goto Exit;
1683 }
1684
1685 if (Hook && (MsgOverride || DlgOverride))
1686 {
1687 _SEH2_TRY
1688 {
1689 if (!DlgOverride)
1690 PreResult = guah.PreWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1691 else
1692 PreResult = guah.PreDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1693 }
1695 {
1696 ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1697 }
1698 _SEH2_END;
1699 }
1700
1701 if (PreResult) goto Exit;
1702
1703 if (!Dialog)
1704 Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
1705 else
1706 {
1707 _SEH2_TRY
1708 {
1709 Result = CALL_EXTERN_WNDPROC(WndProc, UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam);
1710 }
1712 {
1713 ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
1714 }
1715 _SEH2_END;
1716 }
1717
1718 if (Hook && (MsgOverride || DlgOverride))
1719 {
1720 _SEH2_TRY
1721 {
1722 if (!DlgOverride)
1723 guah.PostWndProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1724 else
1725 guah.PostDefDlgProc(UnicodeMsg.hwnd, UnicodeMsg.message, UnicodeMsg.wParam, UnicodeMsg.lParam, (ULONG_PTR)&Result, &Data );
1726 }
1728 {
1729 ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1730 }
1731 _SEH2_END;
1732 }
1733
1734 if (! MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result))
1735 {
1736 goto Exit;
1737 }
1738 }
1739
1740Exit:
1741 if (Hook) EndUserApiHook();
1742 return Result;
1743}
#define FNID_DIALOG
Definition: ntuser.h:869
static void Exit(void)
Definition: sock.c:1330
Definition: window.h:372
THRDESKHEAD head
Definition: ntuser.h:695
DWORD fnid
Definition: ntuser.h:709
WNDPROC_OWP PostWndProc
Definition: undocuser.h:354
WNDPROC_OWP PreWndProc
Definition: undocuser.h:353
UAHOWP WndProcArray
Definition: undocuser.h:355
UAHOWP DlgProcArray
Definition: undocuser.h:358
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:356
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:357
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
USERAPIHOOK guah
Definition: usrapihk.c:344
#define CALL_EXTERN_WNDPROC(proc, h, m, w, l)
Definition: message.c:27

Referenced by CallWindowProcA(), and IntCallMessageProc().

◆ IntCallWindowProcW()

LRESULT FASTCALL IntCallWindowProcW ( BOOL  IsAnsiProc,
WNDPROC  WndProc,
PWND  pWnd,
HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 1425 of file message.c.

1432{
1433 MSG AnsiMsg;
1434 MSG UnicodeMsg;
1435 BOOL Hook = FALSE, MsgOverride = FALSE, Dialog, DlgOverride = FALSE;
1436 LRESULT Result = 0, PreResult = 0;
1437 DWORD Data = 0;
1438
1439 if (WndProc == NULL)
1440 {
1441 WARN("IntCallWindowsProcW() called with WndProc = NULL!\n");
1442 return FALSE;
1443 }
1444
1445 if (pWnd)
1446 Dialog = (pWnd->fnid == FNID_DIALOG);
1447 else
1448 Dialog = FALSE;
1449
1450 Hook = BeginIfHookedUserApiHook();
1451 if (Hook)
1452 {
1453 if (Dialog)
1454 DlgOverride = IsMsgOverride( Msg, &guah.DlgProcArray);
1455 MsgOverride = IsMsgOverride( Msg, &guah.WndProcArray);
1456 }
1457
1458 if (IsAnsiProc)
1459 {
1460 UnicodeMsg.hwnd = hWnd;
1461 UnicodeMsg.message = Msg;
1462 UnicodeMsg.wParam = wParam;
1463 UnicodeMsg.lParam = lParam;
1464 UnicodeMsg.time = 0;
1465 UnicodeMsg.pt.x = 0;
1466 UnicodeMsg.pt.y = 0;
1467 if (! MsgiUnicodeToAnsiMessage(hWnd, &AnsiMsg, &UnicodeMsg))
1468 {
1469 goto Exit;
1470 }
1471
1472 if (Hook && (MsgOverride || DlgOverride))
1473 {
1474 _SEH2_TRY
1475 {
1476 if (!DlgOverride)
1477 PreResult = guah.PreWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1478 else
1479 PreResult = guah.PreDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1480 }
1482 {
1483 ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1484 }
1485 _SEH2_END;
1486 }
1487
1488 if (PreResult) goto Exit;
1489
1490 if (!Dialog)
1491 Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
1492 else
1493 {
1494 _SEH2_TRY
1495 {
1496 Result = CALL_EXTERN_WNDPROC(WndProc, AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam);
1497 }
1499 {
1500 ERR("Exception Dialog Ansi %p Msg %d pti %p Wndpti %p\n",WndProc,Msg,GetW32ThreadInfo(),pWnd->head.pti);
1501 }
1502 _SEH2_END;
1503 }
1504
1505 if (Hook && (MsgOverride || DlgOverride))
1506 {
1507 _SEH2_TRY
1508 {
1509 if (!DlgOverride)
1510 guah.PostWndProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1511 else
1512 guah.PostDefDlgProc(AnsiMsg.hwnd, AnsiMsg.message, AnsiMsg.wParam, AnsiMsg.lParam, (ULONG_PTR)&Result, &Data );
1513 }
1515 {
1516 ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1517 }
1518 _SEH2_END;
1519 }
1520
1521 if (! MsgiUnicodeToAnsiReply(&AnsiMsg, &UnicodeMsg, &Result))
1522 {
1523 goto Exit;
1524 }
1525 }
1526 else
1527 {
1528 if (Hook && (MsgOverride || DlgOverride))
1529 {
1530 _SEH2_TRY
1531 {
1532 if (!DlgOverride)
1533 PreResult = guah.PreWndProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1534 else
1535 PreResult = guah.PreDefDlgProc(hWnd, Msg, wParam, lParam, (ULONG_PTR)&Result, &Data );
1536 }
1538 {
1539 ERR("Got exception in hooked PreWndProc, dlg:%d!\n", DlgOverride);
1540 }
1541 _SEH2_END;
1542 }
1543
1544 if (PreResult) goto Exit;
1545
1546 if (!Dialog)
1548 else
1549 {
1550 _SEH2_TRY
1551 {
1553 }
1555 {
1556 ERR("Exception Dialog unicode %p Msg %d pti %p Wndpti %p\n",WndProc, Msg,GetW32ThreadInfo(),pWnd->head.pti);
1557 }
1558 _SEH2_END;
1559 }
1560
1561 if (Hook && (MsgOverride || DlgOverride))
1562 {
1563 _SEH2_TRY
1564 {
1565 if (!DlgOverride)
1567 else
1569 }
1571 {
1572 ERR("Got exception in hooked PostWndProc, dlg:%d!\n", DlgOverride);
1573 }
1574 _SEH2_END;
1575 }
1576 }
1577
1578Exit:
1579 if (Hook) EndUserApiHook();
1580 return Result;
1581}
static BOOL FASTCALL MsgiUnicodeToAnsiReply(LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result)
Definition: message.c:1252
static BOOL FASTCALL MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:874

Referenced by CallWindowProcW(), IntCallMessageProc(), and User32CallWindowProcFromKernel().

◆ IntConvertMsgToAnsi()

static VOID IntConvertMsgToAnsi ( LPMSG  lpMsg)
static

Definition at line 2065 of file message.c.

2066{
2067 CHAR ch[2];
2068 WCHAR wch[2];
2069
2070 switch (lpMsg->message)
2071 {
2072 case WM_CHAR:
2073 case WM_DEADCHAR:
2074 case WM_SYSCHAR:
2075 case WM_SYSDEADCHAR:
2076 case WM_MENUCHAR:
2077 wch[0] = LOWORD(lpMsg->wParam);
2078 wch[1] = HIWORD(lpMsg->wParam);
2079 ch[0] = ch[1] = 0;
2080 WideCharToMultiByte(CP_THREAD_ACP, 0, wch, 2, ch, 2, NULL, NULL);
2081 lpMsg->wParam = MAKEWPARAM(ch[0] | (ch[1] << 8), 0);
2082 break;
2083 }
2084}
#define WideCharToMultiByte
Definition: compat.h:111
UINT message
Definition: winuser.h:3118
WPARAM wParam
Definition: winuser.h:3119
#define HIWORD(l)
Definition: typedefs.h:247
#define CP_THREAD_ACP
Definition: winnls.h:235
#define MAKEWPARAM(l, h)
Definition: winuser.h:4012
#define WM_SYSCHAR
Definition: winuser.h:1724
#define WM_SYSDEADCHAR
Definition: winuser.h:1725
#define WM_MENUCHAR
Definition: winuser.h:1751
#define WM_CHAR
Definition: winuser.h:1720
#define WM_DEADCHAR
Definition: winuser.h:1721
char CHAR
Definition: xmlstorage.h:175

Referenced by GetMessageA(), and PeekMessageA().

◆ is_pointer_message()

static int is_pointer_message ( UINT  message,
WPARAM  wparam 
)
inlinestatic

Definition at line 98 of file message.c.

99{
100 if (message >= 8*sizeof(message_pointer_flags)) return FALSE;
101 if (message == WM_DEVICECHANGE && !(wparam & 0x8000)) return FALSE;
102 return (message_pointer_flags[message / 32] & SET(message)) != 0;
103}
@ wparam
Definition: SystemMenu.c:30
static const unsigned int message_pointer_flags[]
Definition: message.c:58
#define SET(msg)
Definition: message.c:56
#define WM_DEVICECHANGE
Definition: winuser.h:1814

◆ IsDialogMessageA()

BOOL WINAPI IsDialogMessageA ( HWND  hwndDlg,
LPMSG  pmsg 
)

Definition at line 3302 of file message.c.

3303{
3304 MSG msg = *pmsg;
3305 msg.wParam = map_wparam_AtoW( msg.message, msg.wParam );
3306 return IsDialogMessageW( hwndDlg, &msg );
3307}
#define msg(x)
Definition: auth_time.c:54
static WPARAM FASTCALL map_wparam_AtoW(UINT message, WPARAM wparam)
Definition: message.c:282
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)

◆ IsInsideMessagePumpHook()

BOOL WINAPI IsInsideMessagePumpHook ( )

Definition at line 3088 of file message.c.

3089{ // FF uses this and polls it when Min/Max
3090 PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
3091 return (gfMessagePumpHook && pcti && (pcti->dwcPumpHook > 0));
3092}
DWORD dwcPumpHook
Definition: ntuser.h:176
DWORD gfMessagePumpHook
Definition: message.c:3086

Referenced by GetQueueStatus(), and MsgWaitForMultipleObjectsEx().

◆ listbox_has_strings()

static BOOL FASTCALL listbox_has_strings ( HWND  hwnd)
static

Definition at line 115 of file message.c.

116{
119}
#define LBS_OWNERDRAWFIXED
Definition: pedump.c:682
#define LBS_HASSTRINGS
Definition: pedump.c:684
#define LBS_OWNERDRAWVARIABLE
Definition: pedump.c:683

Referenced by MsgiAnsiToUnicodeCleanup(), MsgiAnsiToUnicodeMessage(), MsgiAnsiToUnicodeReply(), MsgiUnicodeToAnsiCleanup(), MsgiUnicodeToAnsiMessage(), and MsgiUnicodeToAnsiReply().

◆ map_wparam_AtoW()

static WPARAM FASTCALL map_wparam_AtoW ( UINT  message,
WPARAM  wparam 
)
static

Definition at line 282 of file message.c.

283{
284 char ch[2];
285 WCHAR wch[2];
286
287 wch[0] = wch[1] = 0;
288 switch(message)
289 {
290 case WM_CHAR:
291 /* WM_CHAR is magic: a DBCS char can be sent/posted as two consecutive WM_CHAR
292 * messages, in which case the first char is stored, and the conversion
293 * to Unicode only takes place once the second char is sent/posted.
294 */
295#if 0
296 if (mapping != WMCHAR_MAP_NOMAPPING) // NlsMbCodePageTag
297 {
299
300 struct wm_char_mapping_data *data = get_user_thread_info()->wmchar_data;
301
302 BYTE low = LOBYTE(wparam);
303
304 if (HIBYTE(wparam))
305 {
306 ch[0] = low;
307 ch[1] = HIBYTE(wparam);
308 RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
309 TRACE( "map %02x,%02x -> %04x mapping %u\n", (BYTE)ch[0], (BYTE)ch[1], wch[0], mapping );
310 if (data) data->lead_byte[mapping] = 0;
311 }
312 else if (data && data->lead_byte[mapping])
313 {
314 ch[0] = data->lead_byte[mapping];
315 ch[1] = low;
316 RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
317 TRACE( "map stored %02x,%02x -> %04x mapping %u\n", (BYTE)ch[0], (BYTE)ch[1], wch[0], mapping );
318 data->lead_byte[mapping] = 0;
319 }
320 else if (!IsDBCSLeadByte( low ))
321 {
322 ch[0] = low;
323 RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 1 );
324 TRACE( "map %02x -> %04x\n", (BYTE)ch[0], wch[0] );
325 if (data) data->lead_byte[mapping] = 0;
326 }
327 else /* store it and wait for trail byte */
328 {
329 if (!data)
330 {
331 if (!(data = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*data) )))
332 return FALSE;
333 get_user_thread_info()->wmchar_data = data;
334 }
335 TRACE( "storing lead byte %02x mapping %u\n", low, mapping );
336 data->lead_byte[mapping] = low;
337 return FALSE;
338 }
339 wparam = MAKEWPARAM(wch[0], wch[1]);
340 break;
341 }
342#endif
343 /* else fall through */
344 case WM_CHARTOITEM:
346 case WM_DEADCHAR:
347 case WM_SYSCHAR:
348 case WM_SYSDEADCHAR:
349 case WM_MENUCHAR:
350 ch[0] = LOBYTE(wparam);
351 ch[1] = HIBYTE(wparam);
352 RtlMultiByteToUnicodeN( wch, sizeof(wch), NULL, ch, 2 );
353 wparam = MAKEWPARAM(wch[0], wch[1]);
354 break;
355 case WM_IME_CHAR:
356 ch[0] = HIBYTE(wparam);
357 ch[1] = LOBYTE(wparam);
358 if (ch[0]) RtlMultiByteToUnicodeN( wch, sizeof(wch[0]), NULL, ch, 2 );
359 else RtlMultiByteToUnicodeN( wch, sizeof(wch[0]), NULL, ch + 1, 1 );
360 wparam = MAKEWPARAM(wch[0], HIWORD(wparam));
361 break;
362 }
363 return wparam;
364}
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
BOOL WINAPI IsDBCSLeadByte(BYTE testchar)
Definition: locale.c:2124
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
#define LOBYTE(W)
Definition: jmemdos.c:487
#define HIBYTE(W)
Definition: jmemdos.c:486
_Use_decl_annotations_ NTSTATUS NTAPI RtlMultiByteToUnicodeN(_Out_ PWCH UnicodeString, _In_ ULONG UnicodeSize, _Out_opt_ PULONG ResultSize, _In_ PCCH MbString, _In_ ULONG MbSize)
Definition: nlsboot.c:62
#define WM_CHARTOITEM
Definition: winuser.h:1652
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2017
#define WM_IME_CHAR
Definition: winuser.h:1837
unsigned char BYTE
Definition: xxhash.c:193

Referenced by IsDialogMessageA(), and MsgiAnsiToUnicodeMessage().

◆ map_wparam_char_WtoA()

static WPARAM FASTCALL map_wparam_char_WtoA ( WPARAM  wParam,
DWORD  len 
)
static

Definition at line 263 of file message.c.

264{
265 WCHAR wch = wParam;
266 BYTE ch[2];
268
269 len = WideCharToMultiByte( cp, 0, &wch, 1, (LPSTR)ch, len, NULL, NULL );
270 if (len == 2)
271 return MAKEWPARAM( (ch[0] << 8) | ch[1], HIWORD(wParam) );
272 else
273 return MAKEWPARAM( ch[0], HIWORD(wParam) );
274}
GLenum GLsizei len
Definition: glext.h:6722
DWORD FASTCALL get_input_codepage(void)
Definition: message.c:253
char * LPSTR
Definition: xmlstorage.h:182

Referenced by MsgiUnicodeToAnsiMessage().

◆ MessageCleanup()

VOID FASTCALL MessageCleanup ( VOID  )

Definition at line 3292 of file message.c.

3293{
3296}
CRITICAL_SECTION gcsMPH
Definition: message.c:3076
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)

Referenced by Cleanup(), and ClientThreadSetupHelper().

◆ MessageInit()

BOOL FASTCALL MessageInit ( VOID  )

Definition at line 3284 of file message.c.

3285{
3288
3289 return TRUE;
3290}
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751

Referenced by ClientThreadSetupHelper().

◆ MsgiAnsiToUnicodeCleanup()

static BOOL FASTCALL MsgiAnsiToUnicodeCleanup ( LPMSG  UnicodeMsg,
LPMSG  AnsiMsg 
)
static

Definition at line 709 of file message.c.

710{
712
713 switch (AnsiMsg->message)
714 {
715 case LB_GETTEXT:
716 if (!listbox_has_strings( UnicodeMsg->hwnd )) break;
717 case CB_GETLBTEXT:
718 if (UnicodeMsg->message == CB_GETLBTEXT && !combobox_has_strings( UnicodeMsg->hwnd )) break;
719 case WM_GETTEXT:
721 {
722 if (!UnicodeMsg->lParam) break;
723 RtlFreeHeap(GetProcessHeap(), 0, (PVOID) UnicodeMsg->lParam);
724 break;
725 }
726
727 case WM_SETTEXT:
728 case WM_WININICHANGE:
729 case WM_DEVMODECHANGE:
730 case CB_DIR:
731 case LB_DIR:
732 case LB_ADDFILE:
733 case EM_REPLACESEL:
734 {
735 if (!UnicodeMsg->lParam) break;
738 break;
739 }
740
741 case LB_ADDSTRING:
744 case LB_INSERTSTRING:
747 case LB_FINDSTRING:
749 case LB_SELECTSTRING:
750 {
751 if (UnicodeMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
752 {
755 }
756 break;
757 }
758
759 case CB_ADDSTRING:
760 case CB_INSERTSTRING:
761 case CB_FINDSTRING:
763 case CB_SELECTSTRING:
764 {
765 if (UnicodeMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
766 {
769 }
770 break;
771 }
772
773 case WM_NCCREATE:
774 case WM_CREATE:
775 {
776 struct s
777 {
778 CREATESTRUCTW cs; /* new structure */
779 MDICREATESTRUCTW mdi_cs; /* MDI info */
780 LPWSTR lpszName; /* allocated Name */
781 LPWSTR lpszClass; /* allocated Class */
782 };
783
784 struct s *xs = (struct s *)UnicodeMsg->lParam;
785 if (xs->lpszName)
786 {
789 }
790 if (xs->lpszClass)
791 {
792 RtlInitUnicodeString(&UnicodeString, (PCWSTR)xs->lpszClass);
794 }
795 HeapFree(GetProcessHeap(), 0, xs);
796 break;
797 }
798
799 case WM_MDICREATE:
800 {
801 MDICREATESTRUCTW *cs = (MDICREATESTRUCTW *)UnicodeMsg->lParam;
804 if (!IS_ATOM(cs->szClass))
805 {
808 }
810 break;
811 }
812 }
813
814 return(TRUE);
815}
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:608
#define IS_ATOM(x)
Definition: class.h:3
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
#define HeapFree(x, y, z)
Definition: compat.h:735
GLdouble s
Definition: gl.h:2039
#define cs
Definition: i386-dis.c:442
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
HWND hwnd
Definition: winuser.h:3117
LPARAM lParam
Definition: winuser.h:3120
const uint16_t * PCWSTR
Definition: typedefs.h:57
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_ADDFILE
Definition: winuser.h:2033
#define CB_SELECTSTRING
Definition: winuser.h:1963
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2038
#define CB_GETLBTEXT
Definition: winuser.h:1955
#define WM_MDICREATE
Definition: winuser.h:1815
#define LB_GETTEXT
Definition: winuser.h:2052
#define WM_CREATE
Definition: winuser.h:1611
#define LB_DIR
Definition: winuser.h:2036
#define WM_WININICHANGE
Definition: winuser.h:1633
#define EM_REPLACESEL
Definition: winuser.h:2009
#define WM_DEVMODECHANGE
Definition: winuser.h:1634
#define WM_GETTEXT
Definition: winuser.h:1621
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1943
#define LB_ADDSTRING
Definition: winuser.h:2034
#define CB_DIR
Definition: winuser.h:1941
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1876
#define WM_NCCREATE
Definition: winuser.h:1686
#define WM_SETTEXT
Definition: winuser.h:1620
#define LB_SELECTSTRING
Definition: winuser.h:2059
#define LB_FINDSTRING
Definition: winuser.h:2037
#define LB_INSERTSTRING
Definition: winuser.h:2056
#define CB_ADDSTRING
Definition: winuser.h:1939
#define CB_FINDSTRING
Definition: winuser.h:1942
#define CB_INSERTSTRING
Definition: winuser.h:1960
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by DesktopWndProcA(), MsgiAnsiToUnicodeReply(), SendMessageA(), SendMessageCallbackA(), SendMessageTimeoutA(), and SendNotifyMessageA().

◆ MsgiAnsiToUnicodeMessage()

static BOOL FASTCALL MsgiAnsiToUnicodeMessage ( HWND  hwnd,
LPMSG  UnicodeMsg,
LPMSG  AnsiMsg 
)
static

Definition at line 517 of file message.c.

518{
520
521 *UnicodeMsg = *AnsiMsg;
522
523 switch (AnsiMsg->message)
524 {
525 case WM_GETTEXT:
527 {
529 if (!AnsiMsg->lParam) break;
531 //ERR("WM_GETTEXT A2U Size %d\n",AnsiMsg->wParam);
532 if (!Buffer) return FALSE;
533 UnicodeMsg->lParam = (LPARAM)Buffer;
534 break;
535 }
536
537 case LB_GETTEXT:
538 {
539 DWORD Size = 1024 * sizeof(WCHAR);
540 if (!AnsiMsg->lParam || !listbox_has_strings( AnsiMsg->hwnd )) break;
541 /*Size = SendMessageW( AnsiMsg->hwnd, LB_GETTEXTLEN, AnsiMsg->wParam, 0 );
542 if (Size == LB_ERR)
543 {
544 ERR("LB_GETTEXT LB_ERR\n");
545 Size = sizeof(ULONG_PTR);
546 }
547 Size = (Size + 1) * sizeof(WCHAR);*/
549 if (!UnicodeMsg->lParam) return FALSE;
550 break;
551 }
552
553 case CB_GETLBTEXT:
554 {
555 DWORD Size = 1024 * sizeof(WCHAR);
556 if (!AnsiMsg->lParam || !combobox_has_strings( AnsiMsg->hwnd )) break;
557 /*Size = SendMessageW( AnsiMsg->hwnd, CB_GETLBTEXTLEN, AnsiMsg->wParam, 0 );
558 if (Size == LB_ERR)
559 {
560 ERR("CB_GETTEXT LB_ERR\n");
561 Size = sizeof(ULONG_PTR);
562 }
563 Size = (Size + 1) * sizeof(WCHAR);*/
565 if (!UnicodeMsg->lParam) return FALSE;
566 break;
567 }
568
569 /* AnsiMsg->lParam is string (0-terminated) */
570 case WM_SETTEXT:
571 case WM_WININICHANGE:
572 case WM_DEVMODECHANGE:
573 case CB_DIR:
574 case LB_DIR:
575 case LB_ADDFILE:
576 case EM_REPLACESEL:
577 {
578 if (!AnsiMsg->lParam) break;
580 UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
581 break;
582 }
583
584 case LB_ADDSTRING:
587 case LB_INSERTSTRING:
590 case LB_FINDSTRING:
592 case LB_SELECTSTRING:
593 {
594 if (AnsiMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
595 {
597 UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
598 }
599 break;
600 }
601
602 case CB_ADDSTRING:
603 case CB_INSERTSTRING:
604 case CB_FINDSTRING:
606 case CB_SELECTSTRING:
607 {
608 if (AnsiMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
609 {
611 UnicodeMsg->lParam = (LPARAM)UnicodeString.Buffer;
612 }
613 break;
614 }
615
616 case WM_NCCREATE:
617 case WM_CREATE:
618 {
619 struct s
620 {
621 CREATESTRUCTW cs; /* new structure */
622 MDICREATESTRUCTW mdi_cs; /* MDI info */
623 LPCWSTR lpszName; /* allocated Name */
624 LPCWSTR lpszClass; /* allocated Class */
625 };
626
627 struct s *xs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct s));
628 if (!xs)
629 {
630 return FALSE;
631 }
632 xs->cs = *(CREATESTRUCTW *)AnsiMsg->lParam;
633 if (!IS_INTRESOURCE(xs->cs.lpszName))
634 {
636 xs->lpszName = xs->cs.lpszName = UnicodeString.Buffer;
637 }
638 if (!IS_ATOM(xs->cs.lpszClass))
639 {
641 xs->lpszClass = xs->cs.lpszClass = UnicodeString.Buffer;
642 }
643
645 {
646 xs->mdi_cs = *(MDICREATESTRUCTW *)xs->cs.lpCreateParams;
647 xs->mdi_cs.szTitle = xs->cs.lpszName;
648 xs->mdi_cs.szClass = xs->cs.lpszClass;
649 xs->cs.lpCreateParams = &xs->mdi_cs;
650 }
651
652 UnicodeMsg->lParam = (LPARAM)xs;
653 break;
654 }
655
656 case WM_MDICREATE:
657 {
659 (MDICREATESTRUCTW *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs));
660
661 if (!cs)
662 {
663 return FALSE;
664 }
665
666 *cs = *(MDICREATESTRUCTW *)AnsiMsg->lParam;
667
668 if (!IS_ATOM(cs->szClass))
669 {
671 cs->szClass = UnicodeString.Buffer;
672 }
673
675 cs->szTitle = UnicodeString.Buffer;
676
677 UnicodeMsg->lParam = (LPARAM)cs;
678 break;
679 }
680
681 case WM_GETDLGCODE:
682 if (UnicodeMsg->lParam)
683 {
684 MSG newmsg = *(MSG *)UnicodeMsg->lParam;
685 newmsg.wParam = map_wparam_AtoW( newmsg.message, newmsg.wParam);
686 }
687 break;
688
689 case WM_CHARTOITEM:
690 case WM_MENUCHAR:
691 case WM_CHAR:
692 case WM_DEADCHAR:
693 case WM_SYSCHAR:
694 case WM_SYSDEADCHAR:
696 case WM_IME_CHAR:
697 UnicodeMsg->wParam = map_wparam_AtoW( AnsiMsg->message, AnsiMsg->wParam );
698 break;
699 case EM_GETLINE:
700 ERR("FIXME EM_GETLINE A2U\n");
701 break;
702
703 }
704
705 return TRUE;
706}
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:590
Definition: bufpool.h:45
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
LONG_PTR LPARAM
Definition: windef.h:208
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define EM_GETLINE
Definition: winuser.h:1994
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WM_GETDLGCODE
Definition: winuser.h:1692
#define GWL_EXSTYLE
Definition: winuser.h:854
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

Referenced by DesktopWndProcA(), DispatchMessageA(), IntCallWindowProcA(), SendMessageA(), SendMessageCallbackA(), SendMessageTimeoutA(), and SendNotifyMessageA().

◆ MsgiAnsiToUnicodeReply()

static BOOL FASTCALL MsgiAnsiToUnicodeReply ( LPMSG  UnicodeMsg,
LPMSG  AnsiMsg,
LRESULT Result 
)
static

Definition at line 821 of file message.c.

822{
823 LPWSTR Buffer = (LPWSTR)UnicodeMsg->lParam;
824 LPSTR AnsiBuffer = (LPSTR)AnsiMsg->lParam;
825
826 switch (AnsiMsg->message)
827 {
828 case WM_GETTEXT:
830 {
831 if (UnicodeMsg->wParam)
832 {
833 DWORD len = 0;
834 if (*Result) RtlUnicodeToMultiByteN( AnsiBuffer, UnicodeMsg->wParam - 1, &len, Buffer, strlenW(Buffer) * sizeof(WCHAR));
835 AnsiBuffer[len] = 0;
836 *Result = len;
837 //ERR("WM_GETTEXT U2A Result %d Size %d\n",*Result,AnsiMsg->wParam);
838 }
839 break;
840 }
841 case LB_GETTEXT:
842 {
843 if (!AnsiBuffer || !listbox_has_strings( UnicodeMsg->hwnd )) break;
844 if (*Result >= 0)
845 {
846 DWORD len;
847 RtlUnicodeToMultiByteN( AnsiBuffer, ~0u, &len, Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR) );
848 *Result = len - 1;
849 }
850 break;
851 }
852 case CB_GETLBTEXT:
853 {
854 if (!AnsiBuffer || !combobox_has_strings( UnicodeMsg->hwnd )) break;
855 if (*Result >= 0)
856 {
857 DWORD len;
858 RtlUnicodeToMultiByteN( AnsiBuffer, ~0u, &len, Buffer, (strlenW(Buffer) + 1) * sizeof(WCHAR) );
859 *Result = len - 1;
860 }
861 break;
862 }
863 }
864
865 MsgiAnsiToUnicodeCleanup(UnicodeMsg, AnsiMsg);
866
867 return TRUE;
868}
CHAR AnsiBuffer[1024]
Definition: debug.c:15
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble * u
Definition: glfuncs.h:240
_Use_decl_annotations_ NTSTATUS NTAPI RtlUnicodeToMultiByteN(_Out_ PCHAR MbString, _In_ ULONG MbSize, _Out_opt_ PULONG ResultSize, _In_ PCWCH UnicodeString, _In_ ULONG UnicodeSize)
Definition: nlsboot.c:107
#define strlenW(s)
Definition: unicode.h:34

Referenced by DispatchMessageA(), IntCallWindowProcA(), SendMessageA(), and SendMessageTimeoutA().

◆ MsgiKMToUMCleanup()

static VOID FASTCALL MsgiKMToUMCleanup ( PMSG  KMMsg,
PMSG  UMMsg 
)
static

Definition at line 488 of file message.c.

489{
490 switch (KMMsg->message)
491 {
492 case WM_DDE_EXECUTE:
493#ifdef TODO // Kept as historic.
494 HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
495 GlobalUnlock((HGLOBAL) UMMsg->lParam);
496#endif
497 break;
498 default:
499 break;
500 }
501
502 return;
503}
#define WM_DDE_EXECUTE
Definition: dde.h:45
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190

Referenced by MsgiKMToUMReply().

◆ MsgiKMToUMMessage()

static BOOL FASTCALL MsgiKMToUMMessage ( PMSG  KMMsg,
PMSG  UMMsg 
)
static

Definition at line 432 of file message.c.

433{
434 *UMMsg = *KMMsg;
435
436 if (KMMsg->lParam == 0) return TRUE;
437
438 switch (UMMsg->message)
439 {
440 case WM_CREATE:
441 case WM_NCCREATE:
442 {
443 CREATESTRUCTW *Cs = (CREATESTRUCTW *) KMMsg->lParam;
444 PCHAR Class;
445 Cs->lpszName = (LPCWSTR) ((PCHAR) Cs + (DWORD_PTR) Cs->lpszName);
446 Class = (PCHAR) Cs + (DWORD_PTR) Cs->lpszClass;
447 if (L'A' == *((WCHAR *) Class))
448 {
449 Class += sizeof(WCHAR);
450 Cs->lpszClass = (LPCWSTR)(DWORD_PTR) (*((ATOM *) Class));
451 }
452 else
453 {
454 ASSERT(L'S' == *((WCHAR *) Class));
455 Class += sizeof(WCHAR);
456 Cs->lpszClass = (LPCWSTR) Class;
457 }
458 }
459 break;
460
461 case WM_COPYDATA:
462 {
463 PCOPYDATASTRUCT pKMCopyData = (PCOPYDATASTRUCT)KMMsg->lParam;
464 pKMCopyData->lpData = pKMCopyData + 1;
465 }
466 break;
467
469 {
470 PVOID Data;
471 HGLOBAL hGlobal = GlobalAlloc(GHND | GMEM_SHARE, KMMsg->wParam);
472 Data = GlobalLock(hGlobal);
473 if (Data) RtlCopyMemory(Data, (PVOID)KMMsg->lParam, KMMsg->wParam);
474 GlobalUnlock(hGlobal);
475 TRACE("WM_COPYGLOBALDATA to User hGlobal %p\n",hGlobal);
476 UMMsg->lParam = (LPARAM)hGlobal;
477 }
478 break;
479
480 default:
481 break;
482 }
483
484 return TRUE;
485}
WORD ATOM
Definition: dimm.idl:113
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
#define PCHAR
Definition: match.c:90
#define ASSERT(a)
Definition: mode.c:44
#define L(x)
Definition: ntvdm.h:50
LPCWSTR lpszClass
Definition: winuser.h:2968
LPCWSTR lpszName
Definition: winuser.h:2967
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
char * PCHAR
Definition: typedefs.h:51
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
#define GHND
Definition: winbase.h:323
#define GMEM_SHARE
Definition: winbase.h:331
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define WM_COPYDATA
Definition: winuser.h:1667

Referenced by User32CallWindowProcFromKernel().

◆ MsgiKMToUMReply()

static BOOL FASTCALL MsgiKMToUMReply ( PMSG  KMMsg,
PMSG  UMMsg,
LRESULT Result 
)
static

Definition at line 506 of file message.c.

507{
508 MsgiKMToUMCleanup(KMMsg, UMMsg);
509
510 return TRUE;
511}
static VOID FASTCALL MsgiKMToUMCleanup(PMSG KMMsg, PMSG UMMsg)
Definition: message.c:488

Referenced by User32CallWindowProcFromKernel().

◆ MsgiUMToKMCleanup()

static VOID FASTCALL MsgiUMToKMCleanup ( PMSG  UMMsg,
PMSG  KMMsg 
)
static

Definition at line 412 of file message.c.

413{
414 switch (KMMsg->message)
415 {
416 case WM_COPYDATA:
417 HeapFree(GetProcessHeap(), 0, (LPVOID) KMMsg->lParam);
418 break;
420 TRACE("WM_COPYGLOBALDATA cleanup return\n");
421 GlobalUnlock((HGLOBAL)UMMsg->lParam);
422 GlobalFree((HGLOBAL)UMMsg->lParam);
423 break;
424 default:
425 break;
426 }
427
428 return;
429}
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611

Referenced by SendMessageA(), SendMessageTimeoutA(), SendMessageTimeoutW(), and SendMessageW().

◆ MsgiUMToKMMessage()

static BOOL FASTCALL MsgiUMToKMMessage ( PMSG  UMMsg,
PMSG  KMMsg,
BOOL  Posted 
)
static

Definition at line 368 of file message.c.

369{
370 *KMMsg = *UMMsg;
371
372 switch (UMMsg->message)
373 {
374 case WM_COPYDATA:
375 {
376 PCOPYDATASTRUCT pUMCopyData = (PCOPYDATASTRUCT)UMMsg->lParam;
377 PCOPYDATASTRUCT pKMCopyData;
378
379 pKMCopyData = HeapAlloc(GetProcessHeap(), 0, sizeof(COPYDATASTRUCT) + pUMCopyData->cbData);
380 if (!pKMCopyData)
381 {
383 return FALSE;
384 }
385
386 pKMCopyData->dwData = pUMCopyData->dwData;
387 pKMCopyData->cbData = pUMCopyData->cbData;
388 pKMCopyData->lpData = pKMCopyData + 1;
389
390 RtlCopyMemory(pKMCopyData + 1, pUMCopyData->lpData, pUMCopyData->cbData);
391
392 KMMsg->lParam = (LPARAM)pKMCopyData;
393 }
394 break;
395
397 {
398 KMMsg->lParam = (LPARAM)GlobalLock((HGLOBAL)UMMsg->lParam);;
399 TRACE("WM_COPYGLOBALDATA get data ptr %p\n",KMMsg->lParam);
400 }
401 break;
402
403 default:
404 break;
405 }
406
407 return TRUE;
408}
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13
ULONG_PTR dwData
Definition: winuser.h:3004
struct tagCOPYDATASTRUCT COPYDATASTRUCT

Referenced by SendMessageA(), SendMessageTimeoutA(), SendMessageTimeoutW(), and SendMessageW().

◆ MsgiUnicodeToAnsiCleanup()

static BOOL FASTCALL MsgiUnicodeToAnsiCleanup ( LPMSG  AnsiMsg,
LPMSG  UnicodeMsg 
)
static

Definition at line 1156 of file message.c.

1157{
1159
1160 switch(UnicodeMsg->message)
1161 {
1162 case LB_GETTEXT:
1163 if (!listbox_has_strings( AnsiMsg->hwnd )) break;
1164 case CB_GETLBTEXT:
1165 if (AnsiMsg->message == CB_GETLBTEXT && !combobox_has_strings( AnsiMsg->hwnd )) break;
1166 case WM_GETTEXT:
1167 case WM_ASKCBFORMATNAME:
1168 {
1169 if (!AnsiMsg->lParam) break;
1170 RtlFreeHeap(GetProcessHeap(), 0, (PVOID) AnsiMsg->lParam);
1171 break;
1172 }
1173 case WM_CREATE:
1174 case WM_NCCREATE:
1175 {
1176 CREATESTRUCTA* Cs;
1177
1178 Cs = (CREATESTRUCTA*) AnsiMsg->lParam;
1179 RtlFreeHeap(GetProcessHeap(), 0, Cs);
1180 break;
1181 }
1182
1183 case WM_SETTEXT:
1184 case WM_WININICHANGE:
1185 case WM_DEVMODECHANGE:
1186 case CB_DIR:
1187 case LB_DIR:
1188 case LB_ADDFILE:
1189 case EM_REPLACESEL:
1190 {
1191 if (!AnsiMsg->lParam) break;
1194 break;
1195 }
1196
1197 case LB_ADDSTRING:
1198 case LB_ADDSTRING_LOWER:
1199 case LB_ADDSTRING_UPPER:
1200 case LB_INSERTSTRING:
1203 case LB_FINDSTRING:
1204 case LB_FINDSTRINGEXACT:
1205 case LB_SELECTSTRING:
1206 {
1207 if (AnsiMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1208 {
1211 }
1212 break;
1213 }
1214
1215 case CB_ADDSTRING:
1216 case CB_INSERTSTRING:
1217 case CB_FINDSTRING:
1218 case CB_FINDSTRINGEXACT:
1219 case CB_SELECTSTRING:
1220 {
1221 if (AnsiMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
1222 {
1225 }
1226 break;
1227 }
1228
1229 case WM_MDICREATE:
1230 {
1232 RtlInitAnsiString(&AnsiString, (PCSTR)cs->szTitle);
1234 if (!IS_ATOM(cs->szClass))
1235 {
1236 RtlInitAnsiString(&AnsiString, (PCSTR)cs->szClass);
1238 }
1239 HeapFree(GetProcessHeap(), 0, cs);
1240 break;
1241 }
1242
1243 }
1244
1245 return TRUE;
1246}
@ AnsiString
Definition: dnslib.h:19
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
char * PSTR
Definition: typedefs.h:51
const char * PCSTR
Definition: typedefs.h:52

Referenced by MsgiUnicodeToAnsiReply().

◆ MsgiUnicodeToAnsiMessage()

static BOOL FASTCALL MsgiUnicodeToAnsiMessage ( HWND  hwnd,
LPMSG  AnsiMsg,
LPMSG  UnicodeMsg 
)
static

Definition at line 874 of file message.c.

875{
878
879 *AnsiMsg = *UnicodeMsg;
880
881 switch(UnicodeMsg->message)
882 {
883 case WM_CREATE:
884 case WM_NCCREATE:
885 {
886 MDICREATESTRUCTA *pmdi_cs;
887 CREATESTRUCTA* CsA;
888 CREATESTRUCTW* CsW;
889 ULONG NameSize, ClassSize;
891
892 CsW = (CREATESTRUCTW*)(UnicodeMsg->lParam);
895 if (NameSize == 0)
896 {
897 return FALSE;
898 }
899 ClassSize = 0;
900 if (!IS_ATOM(CsW->lpszClass))
901 {
904 if (ClassSize == 0)
905 {
906 return FALSE;
907 }
908 }
909
910 CsA = RtlAllocateHeap(GetProcessHeap(), 0, sizeof(CREATESTRUCTA) + sizeof(MDICREATESTRUCTA) + NameSize + ClassSize);
911 if (NULL == CsA)
912 {
913 return FALSE;
914 }
915 memcpy(CsA, CsW, sizeof(CREATESTRUCTW));
916
917 /* pmdi_cs starts right after CsA */
918 pmdi_cs = (MDICREATESTRUCTA*)(CsA + 1);
919
921 RtlInitEmptyAnsiString(&AnsiString, (PCHAR)(pmdi_cs + 1), NameSize);
923 if (! NT_SUCCESS(Status))
924 {
925 RtlFreeHeap(GetProcessHeap(), 0, CsA);
926 return FALSE;
927 }
928 CsA->lpszName = AnsiString.Buffer;
929 if (!IS_ATOM(CsW->lpszClass))
930 {
932 RtlInitEmptyAnsiString(&AnsiString, (PCHAR)(pmdi_cs + 1) + NameSize, ClassSize);
934 if (! NT_SUCCESS(Status))
935 {
936 RtlFreeHeap(GetProcessHeap(), 0, CsA);
937 return FALSE;
938 }
939 CsA->lpszClass = AnsiString.Buffer;
940 }
941
943 {
944 *pmdi_cs = *(MDICREATESTRUCTA *)CsW->lpCreateParams;
945 pmdi_cs->szTitle = CsA->lpszName;
946 pmdi_cs->szClass = CsA->lpszClass;
947 CsA->lpCreateParams = pmdi_cs;
948 }
949
950 AnsiMsg->lParam = (LPARAM)CsA;
951 break;
952 }
953 case WM_GETTEXT:
955 {
956 if (!UnicodeMsg->lParam) break;
957 /* Ansi string might contain MBCS chars so we need 2 * the number of chars */
958 AnsiMsg->lParam = (LPARAM) RtlAllocateHeap(GetProcessHeap(), HEAP_ZERO_MEMORY, UnicodeMsg->wParam * 2);
959 //ERR("WM_GETTEXT U2A Size %d\n",AnsiMsg->wParam);
960
961 if (!AnsiMsg->lParam) return FALSE;
962 break;
963 }
964
965 case LB_GETTEXT:
966 {
967 DWORD Size = 1024;
968 if (!UnicodeMsg->lParam || !listbox_has_strings( UnicodeMsg->hwnd )) break;
969 /*Size = SendMessageA( UnicodeMsg->hwnd, LB_GETTEXTLEN, UnicodeMsg->wParam, 0 );
970 if (Size == LB_ERR)
971 {
972 ERR("LB_GETTEXT LB_ERR\n");
973 Size = sizeof(ULONG_PTR);
974 }
975 Size = (Size + 1) * sizeof(WCHAR);*/
977 if (!AnsiMsg->lParam) return FALSE;
978 break;
979 }
980
981 case CB_GETLBTEXT:
982 {
983 DWORD Size = 1024;
984 if (!UnicodeMsg->lParam || !combobox_has_strings( UnicodeMsg->hwnd )) break;
985 /*Size = SendMessageA( UnicodeMsg->hwnd, CB_GETLBTEXTLEN, UnicodeMsg->wParam, 0 );
986 if (Size == LB_ERR)
987 {
988 ERR("CB_GETTEXT LB_ERR\n");
989 Size = sizeof(ULONG_PTR);
990 }
991 Size = (Size + 1) * sizeof(WCHAR);*/
993 if (!AnsiMsg->lParam) return FALSE;
994 break;
995 }
996
997 case WM_SETTEXT:
998 case WM_WININICHANGE:
999 case WM_DEVMODECHANGE:
1000 case CB_DIR:
1001 case LB_DIR:
1002 case LB_ADDFILE:
1003 case EM_REPLACESEL:
1004 {
1005 if (!UnicodeMsg->lParam) break;
1009 TRUE)))
1010 {
1011 return FALSE;
1012 }
1013 AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1014 break;
1015 }
1016
1017 case LB_ADDSTRING:
1018 case LB_ADDSTRING_LOWER:
1019 case LB_ADDSTRING_UPPER:
1020 case LB_INSERTSTRING:
1023 case LB_FINDSTRING:
1024 case LB_FINDSTRINGEXACT:
1025 case LB_SELECTSTRING:
1026 {
1027 if (UnicodeMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1028 {
1032 TRUE)))
1033 {
1034 return FALSE;
1035 }
1036 AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1037 }
1038 break;
1039 }
1040
1041 case CB_ADDSTRING:
1042 case CB_INSERTSTRING:
1043 case CB_FINDSTRING:
1044 case CB_FINDSTRINGEXACT:
1045 case CB_SELECTSTRING:
1046 {
1047 if (UnicodeMsg->lParam && combobox_has_strings(AnsiMsg->hwnd))
1048 {
1052 TRUE)))
1053 {
1054 return FALSE;
1055 }
1056 AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1057 }
1058 break;
1059 }
1060
1061 case WM_MDICREATE:
1062 {
1064 (MDICREATESTRUCTA *)HeapAlloc(GetProcessHeap(), 0, sizeof(*cs));
1065
1066 if (!cs)
1067 {
1068 return FALSE;
1069 }
1070
1071 *cs = *(MDICREATESTRUCTA *)UnicodeMsg->lParam;
1072
1073 if (!IS_ATOM(cs->szClass))
1074 {
1078 TRUE)))
1079 {
1080 HeapFree(GetProcessHeap(), 0, cs);
1081 return FALSE;
1082 }
1083 cs->szClass = AnsiString.Buffer;
1084 }
1085
1089 TRUE)))
1090 {
1091 if (!IS_ATOM(cs->szClass))
1092 {
1093 RtlInitAnsiString(&AnsiString, cs->szClass);
1095 }
1096
1097 HeapFree(GetProcessHeap(), 0, cs);
1098 return FALSE;
1099 }
1100 cs->szTitle = AnsiString.Buffer;
1101
1102 AnsiMsg->lParam = (LPARAM)cs;
1103 break;
1104 }
1105
1106 case WM_GETDLGCODE:
1107 if (UnicodeMsg->lParam)
1108 {
1109 MSG newmsg = *(MSG *)UnicodeMsg->lParam;
1110 switch(newmsg.message)
1111 {
1112 case WM_CHAR:
1113 case WM_DEADCHAR:
1114 case WM_SYSCHAR:
1115 case WM_SYSDEADCHAR:
1116 newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 1 );
1117 break;
1118 case WM_IME_CHAR:
1119 newmsg.wParam = map_wparam_char_WtoA( newmsg.wParam, 2 );
1120 break;
1121 }
1122 }
1123 break;
1124
1125 case WM_CHAR:
1126 {
1127 WCHAR wch = UnicodeMsg->wParam;
1128 char ch[2];
1130 DWORD len = WideCharToMultiByte( cp, 0, &wch, 1, ch, 2, NULL, NULL );
1131 AnsiMsg->wParam = (BYTE)ch[0];
1132 if (len == 2) AnsiMsg->wParam = (BYTE)ch[1];
1133 }
1134 break;
1135
1136 case WM_CHARTOITEM:
1137 case WM_MENUCHAR:
1138 case WM_DEADCHAR:
1139 case WM_SYSCHAR:
1140 case WM_SYSDEADCHAR:
1141 case EM_SETPASSWORDCHAR:
1142 AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,1);
1143 break;
1144
1145 case WM_IME_CHAR:
1146 AnsiMsg->wParam = map_wparam_char_WtoA(UnicodeMsg->wParam,2);
1147 break;
1148 case EM_GETLINE:
1149 ERR("FIXME EM_GETLINE U2A\n");
1150 break;
1151 }
1152 return TRUE;
1153}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
LPCSTR lpszName
Definition: winuser.h:2952
LPCSTR lpszClass
Definition: winuser.h:2953
LPVOID lpCreateParams
Definition: winuser.h:2943
LPVOID lpCreateParams
Definition: winuser.h:2958
uint16_t * PWSTR
Definition: typedefs.h:56
uint32_t ULONG
Definition: typedefs.h:59
static WPARAM FASTCALL map_wparam_char_WtoA(WPARAM wParam, DWORD len)
Definition: message.c:263
#define RtlUnicodeStringToAnsiSize(String)
Definition: rtlfuncs.h:1022

Referenced by IntCallWindowProcW().

◆ MsgiUnicodeToAnsiReply()

static BOOL FASTCALL MsgiUnicodeToAnsiReply ( LPMSG  AnsiMsg,
LPMSG  UnicodeMsg,
LRESULT Result 
)
static

Definition at line 1252 of file message.c.

1253{
1254 LPSTR Buffer = (LPSTR) AnsiMsg->lParam;
1255 LPWSTR UBuffer = (LPWSTR) UnicodeMsg->lParam;
1256
1257 switch (UnicodeMsg->message)
1258 {
1259 case WM_GETTEXT:
1260 case WM_ASKCBFORMATNAME:
1261 {
1262 DWORD len = AnsiMsg->wParam;// * 2;
1263 if (len)
1264 {
1265 if (*Result)
1266 {
1267 RtlMultiByteToUnicodeN( UBuffer, AnsiMsg->wParam*sizeof(WCHAR), &len, Buffer, strlen(Buffer)+1 );
1268 *Result = len/sizeof(WCHAR) - 1; /* do not count terminating null */
1269 //ERR("WM_GETTEXT U2A Result %d Size %d\n",*Result,AnsiMsg->wParam);
1270 }
1271 UBuffer[*Result] = 0;
1272 }
1273 break;
1274 }
1275 case LB_GETTEXT:
1276 {
1277 if (!UBuffer || !listbox_has_strings( UnicodeMsg->hwnd )) break;
1278 if (*Result >= 0)
1279 {
1280 DWORD len;
1281 RtlMultiByteToUnicodeN( UBuffer, ~0u, &len, Buffer, strlen(Buffer) + 1 );
1282 *Result = len / sizeof(WCHAR) - 1;
1283 }
1284 break;
1285 }
1286 case CB_GETLBTEXT:
1287 {
1288 if (!UBuffer || !combobox_has_strings( UnicodeMsg->hwnd )) break;
1289 if (*Result >= 0)
1290 {
1291 DWORD len;
1292 RtlMultiByteToUnicodeN( UBuffer, ~0u, &len, Buffer, strlen(Buffer) + 1 );
1293 *Result = len / sizeof(WCHAR) - 1;
1294 }
1295 break;
1296 }
1297 }
1298
1299 MsgiUnicodeToAnsiCleanup(AnsiMsg, UnicodeMsg);
1300
1301 return TRUE;
1302}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
static BOOL FASTCALL MsgiUnicodeToAnsiCleanup(LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:1156

Referenced by IntCallWindowProcW().

◆ MsgWaitForMultipleObjects()

DWORD WINAPI MsgWaitForMultipleObjects ( DWORD  nCount,
CONST HANDLE lpHandles,
BOOL  fWaitAll,
DWORD  dwMilliseconds,
DWORD  dwWakeMask 
)

Definition at line 3272 of file message.c.

3278{
3279 return MsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds,
3280 dwWakeMask, fWaitAll ? MWMO_WAITALL : 0);
3281}
DWORD WINAPI MsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
Definition: message.c:3258
#define MWMO_WAITALL
Definition: winuser.h:911

◆ MsgWaitForMultipleObjectsEx()

DWORD WINAPI MsgWaitForMultipleObjectsEx ( DWORD  nCount,
CONST HANDLE lpHandles,
DWORD  dwMilliseconds,
DWORD  dwWakeMask,
DWORD  dwFlags 
)

Definition at line 3258 of file message.c.

3264{
3265 return IsInsideMessagePumpHook() ? gmph.RealMsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds, dwWakeMask, dwFlags) : RealMsgWaitForMultipleObjectsEx(nCount, lpHandles,dwMilliseconds, dwWakeMask, dwFlags);
3266}
RealMsgWaitForMultipleObjectsExProc RealMsgWaitForMultipleObjectsEx
Definition: message.c:3062
DWORD WINAPI RealMsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)

Referenced by MsgWaitForMultipleObjects().

◆ PeekMessageA()

BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageA ( LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg 
)

Definition at line 2187 of file message.c.

2192{
2193 BOOL Res;
2194
2195 Res = PeekMessageWorker(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2196 if (-1 == (int) Res || !Res)
2197 {
2198 return FALSE;
2199 }
2200
2201 IntConvertMsgToAnsi(lpMsg);
2202
2203 return Res;
2204}
BOOL WINAPI PeekMessageWorker(PMSG pMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
Definition: message.c:2145

◆ PeekMessageW()

BOOL WINAPI DECLSPEC_HOTPATCH PeekMessageW ( LPMSG  lpMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg 
)

Definition at line 2213 of file message.c.

2219{
2220 BOOL Res;
2221
2222 Res = PeekMessageWorker(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2223 if (-1 == (int) Res || !Res)
2224 {
2225 return FALSE;
2226 }
2227
2228 return Res;
2229}

◆ PeekMessageWorker()

BOOL WINAPI PeekMessageWorker ( PMSG  pMsg,
HWND  hWnd,
UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  wRemoveMsg 
)

Definition at line 2145 of file message.c.

2150{
2151 PCLIENTINFO pci;
2152 PCLIENTTHREADINFO pcti;
2153 pci = GetWin32ClientInfo();
2154 pcti = pci->pClientThreadInfo;
2155
2156 if (!hWnd && pci && pcti)
2157 {
2158 pci->cSpins++;
2159
2160 if ((pci->cSpins >= 100) && (pci->dwTIFlags & TIF_SPINNING))
2161 { // Yield after 100 spin cycles and ready to swap vinyl.
2162 if (!(pci->dwTIFlags & TIF_WAITFORINPUTIDLE))
2163 { // Not waiting for idle event.
2164 if (!pcti->fsChangeBits && !pcti->fsWakeBits)
2165 { // No messages are available.
2166 if ((GetTickCount() - pcti->timeLastRead) > 1000)
2167 { // Up the msg read count if over 1 sec.
2169 }
2170 pci->cSpins = 0;
2172 FIXME("seeSpins!\n");
2173 return FALSE;
2174 }
2175 }
2176 }
2177 }
2178 return NtUserPeekMessage(pMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2179}
#define FIXME(fmt,...)
Definition: precomp.h:53
BOOL APIENTRY NtUserPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg)
Definition: message.c:2391
#define TIF_WAITFORINPUTIDLE
Definition: ntuser.h:277
@ THREADSTATE_UPTIMELASTREAD
Definition: ntuser.h:2480
#define TIF_SPINNING
Definition: ntuser.h:273
NTSYSAPI NTSTATUS NTAPI ZwYieldExecution(VOID)
ULONG_PTR cSpins
Definition: ntuser.h:320
PCLIENTTHREADINFO pClientThreadInfo
Definition: ntuser.h:332
DWORD dwTIFlags
Definition: ntuser.h:324
ULONG timeLastRead
Definition: ntuser.h:175

Referenced by PeekMessageA(), and PeekMessageW().

◆ PostMessageA()

BOOL WINAPI PostMessageA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2236 of file message.c.

2241{
2242 LRESULT Ret;
2243
2244 /* Check for combo box or a list box to send names. */
2245 if (Msg == CB_DIR || Msg == LB_DIR)
2246 {
2247 /*
2248 Set DDL_POSTMSGS, so use the PostMessage function to send messages to the
2249 combo/list box. Forces a call like DlgDirListComboBox.
2250 */
2251 //wParam |= DDL_POSTMSGS;
2253 }
2254
2255 /* No drop files or current Process, just post message. */
2256 if ( (Msg != WM_DROPFILES) ||
2259 {
2261 }
2262
2263 /* We have drop files and this is not the same process for this window. */
2264
2265 /* Just incase, check wParam for Global memory handle and send size. */
2266 Ret = SendMessageA( hWnd,
2268 (WPARAM)GlobalSize((HGLOBAL)wParam), // Zero if not a handle.
2269 (LPARAM)wParam); // Send wParam as lParam.
2270
2271 if ( Ret ) return NtUserPostMessage(hWnd, Msg, (WPARAM)Ret, lParam);
2272
2273 return FALSE;
2274}
#define PtrToUint(p)
Definition: basetsd.h:85
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:4194
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2827
BOOL NTAPI NtUserPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2279
#define NtCurrentTeb
HANDLE UniqueProcess
Definition: compat.h:825
LRESULT WINAPI SendMessageA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2442
UINT_PTR WPARAM
Definition: windef.h:207
#define WM_DROPFILES
Definition: winuser.h:1828
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1151

◆ PostMessageW()

BOOL WINAPI PostMessageW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2281 of file message.c.

2286{
2287 LRESULT Ret;
2288
2289 /* Check for combo box or a list box to send names. */
2290 if (Msg == CB_DIR || Msg == LB_DIR)
2291 {
2292 /*
2293 Set DDL_POSTMSGS, so use the PostMessage function to send messages to the
2294 combo/list box. Forces a call like DlgDirListComboBox.
2295 */
2296 //wParam |= DDL_POSTMSGS;
2298 }
2299
2300 /* No drop files or current Process, just post message. */
2301 if ( (Msg != WM_DROPFILES) ||
2304 {
2306 }
2307
2308 /* We have drop files and this is not the same process for this window. */
2309
2310 /* Just incase, check wParam for Global memory handle and send size. */
2311 Ret = SendMessageW( hWnd,
2313 (WPARAM)GlobalSize((HGLOBAL)wParam), // Zero if not a handle.
2314 (LPARAM)wParam); // Send wParam as lParam.
2315
2316 if ( Ret ) return NtUserPostMessage(hWnd, Msg, (WPARAM)Ret, lParam);
2317
2318 return FALSE;
2319}
LRESULT WINAPI SendMessageW(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2367

◆ PostQuitMessage()

VOID WINAPI PostQuitMessage ( int  nExitCode)

Definition at line 2326 of file message.c.

2328{
2329 NtUserxPostQuitMessage(nExitCode);
2330}
EXTINLINE VOID NtUserxPostQuitMessage(int nExitCode)
Definition: ntwrapper.h:661

◆ PostThreadMessageA()

BOOL WINAPI PostThreadMessageA ( DWORD  idThread,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2338 of file message.c.

2343{
2344 return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
2345}
BOOL NTAPI NtUserPostThreadMessage(DWORD idThread, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2296

◆ PostThreadMessageW()

BOOL WINAPI PostThreadMessageW ( DWORD  idThread,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2353 of file message.c.

2358{
2359 return NtUserPostThreadMessage(idThread, Msg, wParam, lParam);
2360}

◆ RealGetQueueStatus()

DWORD WINAPI RealGetQueueStatus ( UINT  flags)

ATM, we do not support QS_RAWINPUT, but we need to support apps that pass this flag along, while also working around QS_RAWINPUT checks in winetests. Just set the last error to ERROR_INVALID_FLAGS but do not fail the call.

Definition at line 2901 of file message.c.

2902{
2904 {
2906 return 0;
2907 }
2912 if (flags & QS_RAWINPUT)
2913 {
2915 flags &= ~QS_RAWINPUT;
2916 }
2917
2919}
EXTINLINE DWORD NtUserxGetQueueStatus(UINT flags)
Definition: ntwrapper.h:666
#define QS_SMRESULT
Definition: undocuser.h:95
#define ERROR_INVALID_FLAGS
Definition: winerror.h:583
#define QS_ALLPOSTMESSAGE
Definition: winuser.h:885
#define QS_ALLINPUT
Definition: winuser.h:906

Referenced by GetQueueStatus(), and ResetMessagePumpHook().

◆ RealMsgWaitForMultipleObjectsEx() [1/2]

DWORD WINAPI RealMsgWaitForMultipleObjectsEx ( DWORD  nCount,
CONST HANDLE pHandles,
DWORD  dwMilliseconds,
DWORD  dwWakeMask,
DWORD  dwFlags 
)

◆ RealMsgWaitForMultipleObjectsEx() [2/2]

DWORD WINAPI RealMsgWaitForMultipleObjectsEx ( DWORD  nCount,
const HANDLE pHandles,
DWORD  dwMilliseconds,
DWORD  dwWakeMask,
DWORD  dwFlags 
)

Definition at line 3183 of file message.c.

3189{
3190 LPHANDLE RealHandles;
3191 HANDLE MessageQueueHandle;
3192 DWORD Result;
3193 PCLIENTINFO pci;
3194 PCLIENTTHREADINFO pcti;
3195
3197 {
3199 return WAIT_FAILED;
3200 }
3201
3202 pci = GetWin32ClientInfo();
3203 if (!pci) return WAIT_FAILED;
3204
3205 pcti = pci->pClientThreadInfo;
3206 if (pcti && ( !nCount || !(dwFlags & MWMO_WAITALL) ))
3207 {
3208 if ( (pcti->fsChangeBits & LOWORD(dwWakeMask)) ||
3209 ( (dwFlags & MWMO_INPUTAVAILABLE) && (pcti->fsWakeBits & LOWORD(dwWakeMask)) ) )
3210 {
3211 //FIXME("Return Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3212 return nCount;
3213 }
3214 }
3215
3216 MessageQueueHandle = NtUserxMsqSetWakeMask(MAKELONG(dwWakeMask, dwFlags));
3217 if (MessageQueueHandle == NULL)
3218 {
3219 SetLastError(0); /* ? */
3220 return WAIT_FAILED;
3221 }
3222
3223 RealHandles = HeapAlloc(GetProcessHeap(), 0, (nCount + 1) * sizeof(HANDLE));
3224 if (RealHandles == NULL)
3225 {
3228 return WAIT_FAILED;
3229 }
3230
3231 RtlCopyMemory(RealHandles, pHandles, nCount * sizeof(HANDLE));
3232 RealHandles[nCount] = MessageQueueHandle;
3233
3234 //FIXME("1 Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3235
3236 Result = WaitForMultipleObjectsEx( nCount + 1,
3237 RealHandles,
3239 dwMilliseconds,
3241
3242 //FIXME("2 Chg 0x%x Wake 0x%x Mask 0x%x nCnt %d\n",pcti->fsChangeBits, pcti->fsWakeBits, dwWakeMask, nCount);
3243
3244 HeapFree(GetProcessHeap(), 0, RealHandles);
3246
3247 // wine hack! MSDN: If dwMilliseconds is zero,,specified objects are not signaled; it always returns immediately.
3248 if (!Result && !nCount && !dwMilliseconds) Result = WAIT_TIMEOUT;
3249
3250 //FIXME("Result 0X%x\n",Result);
3251 return Result;
3252}
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define WAIT_TIMEOUT
Definition: dderror.h:14
EXTINLINE HANDLE NtUserxMsqSetWakeMask(DWORD_PTR dwWaitMask)
Definition: ntwrapper.h:581
EXTINLINE VOID NtUserxMsqClearWakeMask(VOID)
Definition: ntwrapper.h:546
DWORD WINAPI WaitForMultipleObjectsEx(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds, IN BOOL bAlertable)
Definition: synch.c:169
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define WAIT_FAILED
Definition: message.c:3112
#define MWMO_ALERTABLE
Definition: winuser.h:912
#define MWMO_INPUTAVAILABLE
Definition: winuser.h:913

◆ RegisterMessagePumpHook()

BOOL WINAPI RegisterMessagePumpHook ( MESSAGEPUMPHOOKPROC  Hook)

Definition at line 3103 of file message.c.

3104{
3106 if(!Hook) {
3109 return FALSE;
3110 }
3111 if(!gcLoadMPH) {
3113 gpfnInitMPH = Hook;
3114 ResetMessagePumpHook(&Addresses);
3115 if(!Hook(FALSE, &Addresses) || !Addresses.cbSize) {
3117 return FALSE;
3118 }
3119 memcpy(&gmph, &Addresses, Addresses.cbSize);
3120 } else {
3121 if(gpfnInitMPH != Hook) {
3123 return FALSE;
3124 }
3125 }
3128 return FALSE;
3129 }
3130 if (!gcLoadMPH++) {
3132 }
3134 return TRUE;
3135}
#define InterlockedExchange
Definition: armddk.h:54
EXTINLINE BOOL NtUserxInitMessagePump(VOID)
Definition: ntwrapper.h:571
int32_t * PLONG
Definition: typedefs.h:58
DWORD gcLoadMPH
Definition: message.c:3078
void WINAPI ResetMessagePumpHook(PUSER_MESSAGE_PUMP_ADDRESSES Addresses)
Definition: message.c:3094
MESSAGEPUMPHOOKPROC gpfnInitMPH
Definition: message.c:3077

◆ RegisterWindowMessageA()

UINT WINAPI RegisterWindowMessageA ( LPCSTR  lpString)

Definition at line 2850 of file message.c.

2851{
2853 UINT Atom;
2854
2856 {
2857 return(0);
2858 }
2861 return(Atom);
2862}
_Out_ RTL_ATOM * Atom
Definition: class.h:54
UINT NTAPI NtUserRegisterWindowMessage(PUNICODE_STRING MessageName)
Definition: window.c:4299
unsigned int UINT
Definition: ndis.h:50
CONST char * PCSZ
Definition: umtypes.h:125
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433

◆ RegisterWindowMessageW()

UINT WINAPI RegisterWindowMessageW ( LPCWSTR  lpString)

Definition at line 2869 of file message.c.

2870{
2872
2873 RtlInitUnicodeString(&String, lpString);
2875}

◆ ReleaseCapture()

BOOL WINAPI ReleaseCapture ( VOID  )

Definition at line 2890 of file message.c.

2891{
2892 return NtUserxReleaseCapture();
2893}
EXTINLINE BOOL NtUserxReleaseCapture(VOID)
Definition: ntwrapper.h:566

Referenced by BrFolder_Expand(), BUTTON_WindowProc(), ButtonWndProc_common(), C1_OnButtonUp(), CBRollUp(), CC_WMLButtonUp(), CC_WMMouseMove(), CheckListWndProc(), ChildWndProc(), COMBO_LButtonDown(), COMBO_LButtonUp(), COMBO_MouseMove(), COMBOEX_ComboWndProc(), DoAppSwitch(), DoTest_BUTTON(), DoTest_EDIT(), drag_end(), DragDetect(), DragList_EndDrag(), EDIT_WM_LButtonUp(), finish_splitbar(), GROUP_GroupWndProc(), HEADER_LButtonUp(), HEXEDIT_WM_LBUTTONUP(), IntScrollHandleScrollEvent(), ITextHostImpl_TxSetCapture(), LISTBOX_HandleLButtonDownCombo(), LISTBOX_HandleLButtonUp(), LISTVIEW_KillFocus(), LISTVIEW_LButtonDown(), LISTVIEW_LButtonUp(), LISTVIEW_TrackMouse(), MainProc(), MonSelCancelDragging(), MONTHCAL_LButtonUp(), MsgCheckProc(), MyWndProc(), CCanvasWindow::OnButtonDblClk(), CCanvasWindow::OnButtonUp(), CCanvasWindow::OnKeyDown(), CardButton::OnLButtonUp(), Window::OnLButtonUp(), CardRegion::OnLButtonUp(), CPaletteWindow::OnLButtonUp(), CToolBox::OnLButtonUp(), CTrayShowDesktopButton::OnLButtonUp(), CBaseBar::OnLButtonUp(), CInternetToolbar::OnLUp(), OnMouse(), OwnerDrawButtonSubclass(), PAGER_MouseMove(), CUiSplitPanel::ProcessWindowMessage(), REBAR_LButtonUp(), REBAR_MouseMove(), SB_OnLButtonUp(), SCROLL_HandleScrollEvent(), SCROLL_TrackScrollBar(), ScrollTrackScrollBar(), CMenuFocusManager::SetMenuCapture(), T1_OnButtonUp(), test_button_messages(), test_capture_3(), test_capture_4_proc(), test_edit_messages(), test_Input_mouse(), ThemeHandleButton(), TOOLBAR_LButtonUp(), TRACKBAR_LButtonUp(), TREEVIEW_TrackMouse(), UPDOWN_CancelMode(), WndProc(), SDIMainFrame::WndProc(), StartButton::WndProc(), StartMenu::WndProc(), ChildWindow::WndProc(), FlatButton::WndProc(), and ZoomWnd_OnButtonUp().

◆ ReplyMessage()

BOOL WINAPI ReplyMessage ( LRESULT  lResult)

Definition at line 1407 of file message.c.

1408{
1409 return NtUserxReplyMessage(lResult);
1410}
EXTINLINE BOOL NtUserxReplyMessage(LRESULT lResult)
Definition: ntwrapper.h:656

◆ ResetMessagePumpHook()

void WINAPI ResetMessagePumpHook ( PUSER_MESSAGE_PUMP_ADDRESSES  Addresses)

Definition at line 3094 of file message.c.

3095{
3096 Addresses->cbSize = sizeof(USER_MESSAGE_PUMP_ADDRESSES);
3101}
BOOL NTAPI NtUserRealInternalGetMessage(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL bGMSG)
Definition: ntstubs.c:616
BOOL NTAPI NtUserRealWaitMessageEx(DWORD dwWakeMask, UINT uTimeout)
Definition: ntstubs.c:630
RealInternalGetMessageProc NtUserRealInternalGetMessage
Definition: message.c:3059
RealWaitMessageExProc NtUserRealWaitMessageEx
Definition: message.c:3060
struct _USER_MESSAGE_PUMP_ADDRESSES USER_MESSAGE_PUMP_ADDRESSES

Referenced by RegisterMessagePumpHook(), and UnregisterMessagePumpHook().

◆ SendMessageA()

LRESULT WINAPI SendMessageA ( HWND  Wnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2442 of file message.c.

2443{
2444 MSG AnsiMsg, UcMsg, KMMsg;
2446 BOOL Ret;
2447 PWND Window;
2449
2450 if ( Msg & ~WM_MAXIMUM )
2451 {
2453 return 0;
2454 }
2455
2456 if (Wnd != HWND_TOPMOST && Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
2457 {
2458 Window = ValidateHwnd(Wnd);
2459
2460 if ( Window != NULL &&
2461 Window->head.pti == ti &&
2464 !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
2465 {
2466 /* NOTE: We can directly send messages to the window procedure
2467 if *all* the following conditions are met:
2468
2469 * Window belongs to calling thread
2470 * The calling thread is not being hooked for CallWndProc
2471 * Not calling a server side proc:
2472 Desktop, Switch, ScrollBar, Menu, IconTitle, or hWndMessage
2473 */
2474
2475 return IntCallMessageProc(Window, Wnd, Msg, wParam, lParam, TRUE);
2476 }
2477 }
2478
2479 AnsiMsg.hwnd = Wnd;
2480 AnsiMsg.message = Msg;
2481 AnsiMsg.wParam = wParam;
2482 AnsiMsg.lParam = lParam;
2483 AnsiMsg.time = 0;
2484 AnsiMsg.pt.x = 0;
2485 AnsiMsg.pt.y = 0;
2486
2487 if (!MsgiAnsiToUnicodeMessage(Wnd, &UcMsg, &AnsiMsg))
2488 {
2489 return FALSE;
2490 }
2491
2492 if (!MsgiUMToKMMessage(&UcMsg, &KMMsg, FALSE))
2493 {
2494 MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2495 return FALSE;
2496 }
2497
2498 Ret = NtUserMessageCall( Wnd,
2499 KMMsg.message,
2500 KMMsg.wParam,
2501 KMMsg.lParam,
2502 (ULONG_PTR)&Result,
2504 TRUE);
2505 if (!Ret)
2506 {
2507 ERR("SendMessageA Error\n");
2508 }
2509
2510 MsgiUMToKMCleanup(&UcMsg, &KMMsg);
2511 MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
2512
2513 return Result;
2514}
#define WM_DDE_LAST
Definition: dde.h:46
#define ISITHOOKED(HookId)
Definition: hook.h:6
#define FNID_SENDMESSAGE
Definition: ntuser.h:882
Definition: window.c:28
static VOID FASTCALL MsgiUMToKMCleanup(PMSG UMMsg, PMSG KMMsg)
Definition: message.c:412
static BOOL FASTCALL MsgiUMToKMMessage(PMSG UMMsg, PMSG KMMsg, BOOL Posted)
Definition: message.c:368
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define HWND_TOPMOST
Definition: winuser.h:1211
#define HWND_BROADCAST
Definition: winuser.h:1207
#define WH_CALLWNDPROC
Definition: winuser.h:34

Referenced by PostMessageA().

◆ SendMessageCallbackA()

BOOL WINAPI SendMessageCallbackA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
SENDASYNCPROC  lpCallBack,
ULONG_PTR  dwData 
)

Definition at line 2521 of file message.c.

2528{
2529 BOOL Result;
2530 MSG AnsiMsg, UcMsg;
2531 CALL_BACK_INFO CallBackInfo;
2532
2534 {
2536 return FALSE;
2537 }
2538
2539 CallBackInfo.CallBack = lpCallBack;
2540 CallBackInfo.Context = dwData;
2541
2542 AnsiMsg.hwnd = hWnd;
2543 AnsiMsg.message = Msg;
2544 AnsiMsg.wParam = wParam;
2545 AnsiMsg.lParam = lParam;
2546 AnsiMsg.time = 0;
2547 AnsiMsg.pt.x = 0;
2548 AnsiMsg.pt.y = 0;
2549
2550 if (!MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2551 {
2552 return FALSE;
2553 }
2554
2556 UcMsg.message,
2557 UcMsg.wParam,
2558 UcMsg.lParam,
2559 (ULONG_PTR)&CallBackInfo,
2561 TRUE);
2562
2563 MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2564
2565 return Result;
2566}
#define FNID_SENDMESSAGECALLBACK
Definition: ntuser.h:890
static HANDLE ULONG_PTR dwData
Definition: file.c:35
SENDASYNCPROC CallBack
Definition: callback.h:45
ULONG_PTR Context
Definition: callback.h:46

◆ SendMessageCallbackW()

BOOL WINAPI SendMessageCallbackW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
SENDASYNCPROC  lpCallBack,
ULONG_PTR  dwData 
)

Definition at line 2573 of file message.c.

2580{
2581 CALL_BACK_INFO CallBackInfo;
2582
2584 {
2586 return FALSE;
2587 }
2588
2589 CallBackInfo.CallBack = lpCallBack;
2590 CallBackInfo.Context = dwData;
2591
2592 return NtUserMessageCall(hWnd,
2593 Msg,
2594 wParam,
2595 lParam,
2596 (ULONG_PTR)&CallBackInfo,
2598 FALSE);
2599}

◆ SendMessageTimeoutA()

LRESULT WINAPI SendMessageTimeoutA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
UINT  fuFlags,
UINT  uTimeout,
PDWORD_PTR  lpdwResult 
)

Definition at line 2606 of file message.c.

2614{
2615 MSG AnsiMsg, UcMsg, KMMsg;
2617 DOSENDMESSAGE dsm;
2618
2619 if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
2620 {
2622 return 0;
2623 }
2624
2625 if (lpdwResult) *lpdwResult = 0;
2626
2628
2629 dsm.uFlags = fuFlags;
2630 dsm.uTimeout = uTimeout;
2631 dsm.Result = 0;
2632
2633 AnsiMsg.hwnd = hWnd;
2634 AnsiMsg.message = Msg;
2635 AnsiMsg.wParam = wParam;
2636 AnsiMsg.lParam = lParam;
2637 AnsiMsg.time = 0;
2638 AnsiMsg.pt.x = 0;
2639 AnsiMsg.pt.y = 0;
2640
2641 if (! MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2642 {
2643 return FALSE;
2644 }
2645
2646 if (!MsgiUMToKMMessage(&UcMsg, &KMMsg, FALSE))
2647 {
2648 MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2649 return FALSE;
2650 }
2651
2653 KMMsg.message,
2654 KMMsg.wParam,
2655 KMMsg.lParam,
2656 (ULONG_PTR)&dsm,
2658 TRUE);
2659
2660 MsgiUMToKMCleanup(&UcMsg, &KMMsg);
2661 MsgiAnsiToUnicodeReply(&UcMsg, &AnsiMsg, &Result);
2662
2663 if (lpdwResult) *lpdwResult = dsm.Result;
2664
2666
2667 return Result;
2668}
#define FNID_SENDMESSAGEWTOOPTION
Definition: ntuser.h:885
ULONG_PTR Result
Definition: ntuser.h:2650
#define SPY_RESULT_OK
Definition: user32p.h:70
void SPY_EnterMessage(INT iFlag, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2593
#define SPY_SENDMESSAGE
Definition: user32p.h:68
void SPY_ExitMessage(INT iFlag, HWND hwnd, UINT msg, LRESULT lReturn, WPARAM wParam, LPARAM lParam)
Definition: spy.c:2648
#define SMTO_BLOCK
Definition: winuser.h:1227
#define SMTO_ABORTIFHUNG
Definition: winuser.h:1226

◆ SendMessageTimeoutW()

LRESULT WINAPI SendMessageTimeoutW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam,
UINT  fuFlags,
UINT  uTimeout,
PDWORD_PTR  lpdwResult 
)

Definition at line 2676 of file message.c.

2684{
2686 DOSENDMESSAGE dsm;
2687 MSG UMMsg, KMMsg;
2688
2689 if ( Msg & ~WM_MAXIMUM || fuFlags & ~(SMTO_NOTIMEOUTIFNOTHUNG|SMTO_ABORTIFHUNG|SMTO_BLOCK))
2690 {
2692 return 0;
2693 }
2694
2695 if (lpdwResult) *lpdwResult = 0;
2696
2698
2699 dsm.uFlags = fuFlags;
2700 dsm.uTimeout = uTimeout;
2701 dsm.Result = 0;
2702
2703 UMMsg.hwnd = hWnd;
2704 UMMsg.message = Msg;
2705 UMMsg.wParam = wParam;
2706 UMMsg.lParam = lParam;
2707 UMMsg.time = 0;
2708 UMMsg.pt.x = 0;
2709 UMMsg.pt.y = 0;
2710 if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, TRUE))
2711 {
2712 return FALSE;
2713 }
2714
2716 KMMsg.message,
2717 KMMsg.wParam,
2718 KMMsg.lParam,
2719 (ULONG_PTR)&dsm,
2721 FALSE);
2722
2723 MsgiUMToKMCleanup(&UMMsg, &KMMsg);
2724
2725 if (lpdwResult) *lpdwResult = dsm.Result;
2726
2728
2729 return Result;
2730}

◆ SendMessageW()

LRESULT WINAPI SendMessageW ( HWND  Wnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2367 of file message.c.

2371{
2372 MSG UMMsg, KMMsg;
2374 BOOL Ret;
2375 PWND Window;
2377
2378 if ( Msg & ~WM_MAXIMUM )
2379 {
2381 return 0;
2382 }
2383
2384 if (Wnd != HWND_TOPMOST && Wnd != HWND_BROADCAST && (Msg < WM_DDE_FIRST || Msg > WM_DDE_LAST))
2385 {
2386 Window = ValidateHwnd(Wnd);
2387
2388 if ( Window != NULL &&
2389 Window->head.pti == ti &&
2392 !(Window->state & WNDS_SERVERSIDEWINDOWPROC) )
2393 {
2394 /* NOTE: We can directly send messages to the window procedure
2395 if *all* the following conditions are met:
2396
2397 * Window belongs to calling thread
2398 * The calling thread is not being hooked for CallWndProc
2399 * Not calling a server side proc:
2400 Desktop, Switch, ScrollBar, Menu, IconTitle, or hWndMessage
2401 */
2402
2404 }
2405 }
2406
2407 UMMsg.hwnd = Wnd;
2408 UMMsg.message = Msg;
2409 UMMsg.wParam = wParam;
2410 UMMsg.lParam = lParam;
2411 UMMsg.time = 0;
2412 UMMsg.pt.x = 0;
2413 UMMsg.pt.y = 0;
2414
2415 if (! MsgiUMToKMMessage(&UMMsg, &KMMsg, FALSE))
2416 {
2417 return FALSE;
2418 }
2419
2420 Ret = NtUserMessageCall( Wnd,
2421 KMMsg.message,
2422 KMMsg.wParam,
2423 KMMsg.lParam,
2424 (ULONG_PTR)&Result,
2426 FALSE);
2427 if (!Ret)
2428 {
2429 ERR("SendMessageW Error\n");
2430 }
2431
2432 MsgiUMToKMCleanup(&UMMsg, &KMMsg);
2433
2434 return Result;
2435}

Referenced by PostMessageW().

◆ SendNotifyMessageA()

BOOL WINAPI SendNotifyMessageA ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2737 of file message.c.

2742{
2743 BOOL Ret;
2744 MSG AnsiMsg, UcMsg;
2745
2747 {
2749 return FALSE;
2750 }
2751
2752 AnsiMsg.hwnd = hWnd;
2753 AnsiMsg.message = Msg;
2754 AnsiMsg.wParam = wParam;
2755 AnsiMsg.lParam = lParam;
2756 AnsiMsg.time = 0;
2757 AnsiMsg.pt.x = 0;
2758 AnsiMsg.pt.y = 0;
2759 if (! MsgiAnsiToUnicodeMessage(hWnd, &UcMsg, &AnsiMsg))
2760 {
2761 return FALSE;
2762 }
2763 Ret = SendNotifyMessageW(hWnd, UcMsg.message, UcMsg.wParam, UcMsg.lParam);
2764
2765 MsgiAnsiToUnicodeCleanup(&UcMsg, &AnsiMsg);
2766
2767 return Ret;
2768}
BOOL WINAPI SendNotifyMessageW(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2775

◆ SendNotifyMessageW()

BOOL WINAPI SendNotifyMessageW ( HWND  hWnd,
UINT  Msg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 2775 of file message.c.

2780{
2782
2784 {
2786 return FALSE;
2787 }
2788
2790 Msg,
2791 wParam,
2792 lParam,
2793 0,
2795 FALSE);
2796
2797 return Result;
2798}
#define FNID_SENDNOTIFYMESSAGE
Definition: ntuser.h:889

Referenced by SendNotifyMessageA().

◆ SetMessageExtraInfo()

LPARAM WINAPI SetMessageExtraInfo ( LPARAM  lParam)

Definition at line 1418 of file message.c.

1420{
1422}
EXTINLINE LPARAM NtUserxSetMessageExtraInfo(LPARAM lParam)
Definition: ntwrapper.h:601

◆ SetMessageQueue()

BOOL WINAPI SetMessageQueue ( int  cMessagesMax)

Definition at line 3047 of file message.c.

3048{
3049 /* Function does nothing on 32 bit windows */
3050 return TRUE;
3051}

◆ TranslateMessage()

BOOL WINAPI TranslateMessage ( CONST MSG lpMsg)

Definition at line 2826 of file message.c.

2827{
2828 BOOL ret;
2829
2830 // http://msdn.microsoft.com/en-us/library/aa912145.aspx
2831 if (LOWORD(lpMsg->wParam) == VK_PROCESSKEY)
2832 {
2833 ret = IMM_FN(ImmTranslateMessage)(lpMsg->hwnd,
2834 lpMsg->message,
2835 lpMsg->wParam,
2836 lpMsg->lParam);
2837 if (ret)
2838 return ret;
2839 }
2840
2841 ret = TranslateMessageEx((LPMSG)lpMsg, 0);
2842 return ret;
2843}
BOOL WINAPI ImmTranslateMessage(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lKeyData)
Definition: keymsg.c:977
#define IMM_FN(name)
Definition: user32p.h:56
BOOL WINAPI TranslateMessageEx(CONST MSG *lpMsg, UINT Flags)
Definition: message.c:2804
#define VK_PROCESSKEY
Definition: winuser.h:2330

◆ TranslateMessageEx()

BOOL WINAPI TranslateMessageEx ( CONST MSG lpMsg,
UINT  Flags 
)

Definition at line 2804 of file message.c.

2805{
2806 switch (lpMsg->message)
2807 {
2808 case WM_KEYDOWN:
2809 case WM_KEYUP:
2810 case WM_SYSKEYDOWN:
2811 case WM_SYSKEYUP:
2812 return(NtUserTranslateMessage((LPMSG)lpMsg, Flags));
2813
2814 default:
2815 if ( lpMsg->message & ~WM_MAXIMUM )
2817 return FALSE;
2818 }
2819}
BOOL NTAPI NtUserTranslateMessage(LPMSG lpMsg, UINT flags)
Definition: message.c:2503
#define WM_KEYUP
Definition: winuser.h:1719
#define WM_SYSKEYUP
Definition: winuser.h:1723
#define WM_KEYDOWN
Definition: winuser.h:1718
#define WM_SYSKEYDOWN
Definition: winuser.h:1722
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by TranslateMessage().

◆ UnregisterMessagePumpHook()

BOOL WINAPI UnregisterMessagePumpHook ( VOID  )

Definition at line 3137 of file message.c.

3138{
3140 if(gcLoadMPH > 0) {
3142 gcLoadMPH--;
3143 if(!gcLoadMPH) {
3147 gpfnInitMPH = 0;
3148 }
3150 return TRUE;
3151 }
3152 }
3154 return FALSE;
3155}
EXTINLINE BOOL NtUserxUnInitMessagePump(VOID)
Definition: ntwrapper.h:576

◆ User32CallWindowProcFromKernel()

NTSTATUS WINAPI User32CallWindowProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 2937 of file message.c.

2938{
2939 PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs;
2940 MSG KMMsg, UMMsg;
2941 PWND pWnd = NULL;
2943
2944 /* Make sure we don't try to access mem beyond what we were given */
2945 if (ArgumentLength < sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2946 {
2948 }
2949
2950 CallbackArgs = (PWINDOWPROC_CALLBACK_ARGUMENTS) Arguments;
2951 KMMsg.hwnd = CallbackArgs->Wnd;
2952 KMMsg.message = CallbackArgs->Msg;
2953 KMMsg.wParam = CallbackArgs->wParam;
2954 KMMsg.time = 0;
2955 KMMsg.pt.x = 0;
2956 KMMsg.pt.y = 0;
2957 /* Check if lParam is really a pointer and adjust it if it is */
2958 if (0 <= CallbackArgs->lParamBufferSize)
2959 {
2960 if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS)
2961 + CallbackArgs->lParamBufferSize)
2962 {
2964 }
2965 KMMsg.lParam = (LPARAM) ((char *) CallbackArgs + sizeof(WINDOWPROC_CALLBACK_ARGUMENTS));
2966 switch(KMMsg.message)
2967 {
2968 case WM_CREATE:
2969 {
2970 TRACE("WM_CREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2971 break;
2972 }
2973 case WM_NCCREATE:
2974 {
2975 TRACE("WM_NCCREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2976 break;
2977 }
2978 case WM_SYSTIMER:
2979 {
2980 TRACE("WM_SYSTIMER %p\n",KMMsg.hwnd);
2981 break;
2982 }
2983 case WM_SIZING:
2984 {
2985 PRECT prect = (PRECT) KMMsg.lParam;
2986 TRACE("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
2987 break;
2988 }
2989 default:
2990 break;
2991 }
2992 }
2993 else
2994 {
2995 if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2996 {
2998 }
2999 KMMsg.lParam = CallbackArgs->lParam;
3000 }
3001
3002 if (WM_NCCALCSIZE == CallbackArgs->Msg && CallbackArgs->wParam)
3003 {
3004 NCCALCSIZE_PARAMS *Params = (NCCALCSIZE_PARAMS *) KMMsg.lParam;
3005 Params->lppos = (PWINDOWPOS) (Params + 1);
3006 }
3007
3008 if (! MsgiKMToUMMessage(&KMMsg, &UMMsg))
3009 {
3010 }
3011
3012 if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
3013 pWnd = pci->CallbackWnd.pWnd;
3014
3015 CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
3016 CallbackArgs->Proc,
3017 pWnd,
3018 UMMsg.hwnd,
3019 UMMsg.message,
3020 UMMsg.wParam,
3021 UMMsg.lParam);
3022
3023 if (! MsgiKMToUMReply(&KMMsg, &UMMsg, &CallbackArgs->Result))
3024 {
3025 }
3026
3027 if (0 <= CallbackArgs->lParamBufferSize)
3028 {
3029 switch(KMMsg.message)
3030 {
3031 case WM_SIZING:
3032 {
3033 PRECT prect = (PRECT) KMMsg.lParam;
3034 TRACE("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
3035 break;
3036 }
3037 default:
3038 break;
3039 }
3040 }
3041 return ZwCallbackReturn(CallbackArgs, ArgumentLength, STATUS_SUCCESS);
3042}
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define STATUS_SUCCESS
Definition: shellext.h:65
HWND hWnd
Definition: ntuser.h:295
struct _WND * pWnd
Definition: ntuser.h:296
CALLBACKWND CallbackWnd
Definition: ntuser.h:329
PWINDOWPOS lppos
Definition: winuser.h:3602
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
#define PRECT
Definition: precomp.h:27
struct _WINDOWPROC_CALLBACK_ARGUMENTS WINDOWPROC_CALLBACK_ARGUMENTS
struct _WINDOWPROC_CALLBACK_ARGUMENTS * PWINDOWPROC_CALLBACK_ARGUMENTS
static BOOL FASTCALL MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
Definition: message.c:432
static BOOL FASTCALL MsgiKMToUMReply(PMSG KMMsg, PMSG UMMsg, LRESULT *Result)
Definition: message.c:506
#define WM_SIZING
Definition: winuser.h:1810
#define WM_NCCALCSIZE
Definition: winuser.h:1688

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( user32  )

Variable Documentation

◆ DdeCrst

CRITICAL_SECTION DdeCrst
static

Definition at line 178 of file message.c.

Referenced by DdeAddPair(), DdeGetPair(), MessageCleanup(), and MessageInit().

◆ DdeNumAlloc

unsigned DdeNumAlloc = 0
static

Definition at line 176 of file message.c.

Referenced by DdeAddPair(), and DdeGetPair().

◆ DdeNumUsed

unsigned DdeNumUsed = 0
static

Definition at line 177 of file message.c.

Referenced by DdeAddPair(), and DdeGetPair().

◆ DdePairs

PDDEPAIR DdePairs = NULL
static

Definition at line 175 of file message.c.

Referenced by DdeAddPair(), and DdeGetPair().

◆ gcLoadMPH

DWORD gcLoadMPH = 0

Definition at line 3078 of file message.c.

Referenced by RegisterMessagePumpHook(), and UnregisterMessagePumpHook().

◆ gcsMPH

◆ gfMessagePumpHook

DWORD gfMessagePumpHook = 0

◆ gmph

◆ gpfnInitMPH

MESSAGEPUMPHOOKPROC gpfnInitMPH

Definition at line 3077 of file message.c.

Referenced by RegisterMessagePumpHook(), and UnregisterMessagePumpHook().

◆ message_pointer_flags

const unsigned int message_pointer_flags[]
static

Definition at line 36 of file message.c.