ReactOS  0.4.15-dev-483-ga77a65a
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
 
#define QS_TEMPALLINPUT   255
 

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

◆ QS_TEMPALLINPUT

#define QS_TEMPALLINPUT   255

◆ 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 3064 of file message.c.

◆ PDDEPAIR

◆ PUSER_MESSAGE_PUMP_ADDRESSES

◆ RealGetQueueStatusProc

typedef DWORD(WINAPI * RealGetQueueStatusProc) (UINT flags)

Definition at line 3042 of file message.c.

◆ RealInternalGetMessageProc

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

Definition at line 3044 of file message.c.

◆ RealMsgWaitForMultipleObjectsExProc

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

Definition at line 3043 of file message.c.

◆ RealWaitMessageExProc

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

Definition at line 3045 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 3383 of file message.c.

3389 {
3390  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, TRUE );
3391 }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3301
smooth NULL
Definition: ftsmooth.c:416
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPARAM lParam
Definition: combotst.c:139

Referenced by START_TEST().

◆ BroadcastSystemMessageExA()

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

Definition at line 3413 of file message.c.

3420 {
3421  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, TRUE );
3422 }
#define TRUE
Definition: types.h:120
WPARAM wParam
Definition: combotst.c:138
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3301
static _In_ DWORD dwflags
Definition: dispmode.c:64
LPARAM lParam
Definition: combotst.c:139

Referenced by START_TEST().

◆ BroadcastSystemMessageExW()

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

Definition at line 3429 of file message.c.

3436 {
3437  return IntBroadcastSystemMessage( dwflags, lpdwRecipients, uiMessage, wParam, lParam , pBSMInfo, FALSE );
3438 }
WPARAM wParam
Definition: combotst.c:138
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3301
static _In_ DWORD dwflags
Definition: dispmode.c:64
LPARAM lParam
Definition: combotst.c:139

Referenced by START_TEST().

◆ BroadcastSystemMessageW()

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

Definition at line 3398 of file message.c.

3404 {
3405  return IntBroadcastSystemMessage( dwFlags, lpdwRecipients, uiMessage, wParam, lParam, NULL, FALSE );
3406 }
WPARAM wParam
Definition: combotst.c:138
LONG WINAPI IntBroadcastSystemMessage(DWORD dwflags, LPDWORD lpdwRecipients, UINT uiMessage, WPARAM wParam, LPARAM lParam, PBSMINFO pBSMInfo, BOOL Ansi)
Definition: message.c:3301
smooth NULL
Definition: ftsmooth.c:416
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
LPARAM lParam
Definition: combotst.c:139

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 }
static LRESULT FASTCALL IntCallWindowProcA(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1584
#define TRUE
Definition: types.h:120
WNDPROC pfnClientPrevious
Definition: ntuser.h:520
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc)
Definition: misc.c:349
#define WARN(fmt,...)
Definition: debug.h:112
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
WPARAM wParam
Definition: combotst.c:138
GETCPD wType
Definition: ntuser.h:521
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
Definition: ntuser.h:657
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
LPARAM lParam
Definition: combotst.c:139

◆ 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 }
WNDPROC pfnClientPrevious
Definition: ntuser.h:520
PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc)
Definition: misc.c:349
#define WARN(fmt,...)
Definition: debug.h:112
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
WPARAM wParam
Definition: combotst.c:138
GETCPD wType
Definition: ntuser.h:521
LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1425
smooth NULL
Definition: ftsmooth.c:416
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
Definition: ntuser.h:657
static __inline BOOL IsCallProcHandle(IN WNDPROC lpWndProc)
Definition: class.h:13
LPARAM lParam
Definition: combotst.c:139

◆ combobox_has_strings()

static BOOL FASTCALL combobox_has_strings ( HWND  hwnd)
static

Definition at line 108 of file message.c.

109 {
112 }
#define CBS_OWNERDRAWFIXED
Definition: winuser.h:289
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define CBS_OWNERDRAWVARIABLE
Definition: winuser.h:290
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
#define CBS_HASSTRINGS
Definition: winuser.h:285
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
Arabic default style
Definition: afstyles.h:93

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
191  PDDEPAIR New;
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));
211  DdeNumAlloc += GROWBY;
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 TRUE
Definition: types.h:120
HGLOBAL ServerMem
Definition: message.c:172
#define GROWBY
#define New(t)
Definition: rtf.h:1086
static unsigned DdeNumUsed
Definition: message.c:177
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HGLOBAL ClientMem
Definition: message.c:171
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
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
static unsigned DdeNumAlloc
Definition: message.c:176
static PDDEPAIR DdePairs
Definition: message.c:175
#define HeapReAlloc
Definition: compat.h:402
static CRITICAL_SECTION DdeCrst
Definition: message.c:178
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define memset(x, y, z)
Definition: compat.h:39

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 }
HGLOBAL ServerMem
Definition: message.c:172
static unsigned DdeNumUsed
Definition: message.c:177
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HGLOBAL ClientMem
Definition: message.c:171
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
smooth NULL
Definition: ftsmooth.c:416
static unsigned DdeNumAlloc
Definition: message.c:176
static PDDEPAIR DdePairs
Definition: message.c:175
static CRITICAL_SECTION DdeCrst
Definition: message.c:178
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)

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 {
1309  LRESULT Result;
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  }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
LRESULT WINAPI DesktopWndProcW(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:33
Definition: tftpd.h:59
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: glext.h:5579
WPARAM wParam
Definition: combotst.c:138
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
_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:426
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:709
#define TRACE(s)
Definition: solgame.cpp:4
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

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 ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
#define WM_SYSTIMER
Definition: comctl32.h:112
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
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
static BOOL FASTCALL MsgiAnsiToUnicodeReply(LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT *Result)
Definition: message.c:821
_SEH2_TRY
Definition: create.c:4226
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
smooth NULL
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define WM_TIMER
Definition: winuser.h:1724
#define SetLastError(x)
Definition: compat.h:418
#define WM_PAINT
Definition: winuser.h:1602
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define WM_MAXIMUM
Definition: undocuser.h:62
LRESULT APIENTRY NtUserDispatchMessage(PMSG UnsafeMsgInfo)
Definition: message.c:2423
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:657
_SEH2_END
Definition: create.c:4400
BOOL APIENTRY NtUserValidateTimerCallback(LPARAM lParam)
Definition: timer.c:700
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
DWORD state
Definition: ntuser.h:665
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:591
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:98

◆ 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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define TRUE
Definition: types.h:120
#define WM_SYSTIMER
Definition: comctl32.h:112
#define WARN(fmt,...)
Definition: debug.h:112
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
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
_SEH2_TRY
Definition: create.c:4226
unsigned int BOOL
Definition: ntddk_ex.h:94
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define WM_TIMER
Definition: winuser.h:1724
#define SetLastError(x)
Definition: compat.h:418
#define WM_PAINT
Definition: winuser.h:1602
PWND FASTCALL ValidateHwnd(HWND hwnd)
Definition: misc.c:369
#define WM_MAXIMUM
Definition: undocuser.h:62
LRESULT APIENTRY NtUserDispatchMessage(PMSG UnsafeMsgInfo)
Definition: message.c:2423
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
Definition: ntuser.h:657
_SEH2_END
Definition: create.c:4400
BOOL APIENTRY NtUserValidateTimerCallback(LPARAM lParam)
Definition: timer.c:700
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
DWORD state
Definition: ntuser.h:665
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:591
static int is_pointer_message(UINT message, WPARAM wparam)
Definition: message.c:98

◆ get_input_codepage()

DWORD FASTCALL get_input_codepage ( void  )

Definition at line 253 of file message.c.

254 {
255  DWORD cp;
256  int ret;
257  HKL hkl = GetKeyboardLayout( 0 );
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 LOCALE_IDEFAULTANSICODEPAGE
Definition: winnls.h:38
#define CP_ACP
Definition: compat.h:99
INT WINAPI GetLocaleInfoW(LCID lcid, LCTYPE lctype, LPWSTR buffer, INT len)
Definition: lang.c:1098
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
UINT_PTR HKL
Definition: msctf.idl:101
HKL hkl
Definition: msctf.idl:611
PKEYBOARD_LAYOUT GetKeyboardLayout()
Definition: utils.c:194
POINT cp
Definition: magnifier.c:59
#define LOWORD(l)
Definition: pedump.c:82

Referenced by map_wparam_char_WtoA(), and MsgiUnicodeToAnsiMessage().

◆ GetCapture()

HWND WINAPI GetCapture ( VOID  )

Definition at line 2880 of file message.c.

2881 {
2883 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231

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(), MsgCheckProc(), CSizeboxWindow::OnKeyDown(), CMainWindow::OnKeyDown(), CSelectionWindow::OnKeyDown(), CImgAreaWindow::OnKeyDown(), PAGER_MouseMove(), CMenuFocusManager::ProcessMouseDown(), CMenuFocusManager::ProcessMouseMove(), CMenuFocusManager::ProcessMouseUp(), CUiSplitPanel::ProcessWindowMessage(), REBAR_MouseMove(), RebarSubclassProc(), SCROLL_TrackScrollBar(), ScrollTrackScrollBar(), subpopuplocked_wnd_proc(), test_button_messages(), test_capture_1(), test_capture_4_proc(), test_DestroyWindow(), test_missing_lbuttonup(), test_showwindow(), ToolTipProc(), TREEVIEW_TrackMouse(), UPDOWN_CancelMode(), UpDownWindowProc(), WndProc(), StartButton::WndProc(), SDIMainFrame::WndProc(), and ChildWindow::WndProc().

◆ GetInputState()

BOOL WINAPI GetInputState ( VOID  )

Definition at line 2915 of file message.c.

2916 {
2917  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
2918 
2919  if ((!pcti) || (pcti->fsChangeBits & (QS_KEY|QS_MOUSEBUTTON)))
2921 
2922  return FALSE;
2923 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
#define GetWin32ClientInfo()
Definition: ntuser.h:320
unsigned int BOOL
Definition: ntddk_ex.h:94
WORD fsChangeBits
Definition: ntuser.h:166
#define QS_MOUSEBUTTON
Definition: winuser.h:885
#define QS_KEY
Definition: winuser.h:883

◆ 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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
HWND hWnd
Definition: settings.c:17
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL APIENTRY NtUserGetMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax)
Definition: message.c:2293
static VOID IntConvertMsgToAnsi(LPMSG lpMsg)
Definition: message.c:2065
#define SetLastError(x)
Definition: compat.h:418
#define WM_MAXIMUM
Definition: undocuser.h:62

◆ GetMessageExtraInfo()

LPARAM WINAPI GetMessageExtraInfo ( VOID  )

Definition at line 1340 of file message.c.

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

Referenced by OSK_DlgCommand(), and OSK_ReleaseKey().

◆ GetMessagePos()

◆ GetMessageTime()

LONG WINAPI GetMessageTime ( VOID  )

Definition at line 1361 of file message.c.

1362 {
1364 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231

Referenced by ME_CalculateClickCount(), mstsc_WndProc(), STATUSBAR_Relay2Tip(), TAB_RelayEvent(), TOOLBAR_RelayEvent(), and WindowProc().

◆ 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 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
HWND hWnd
Definition: settings.c:17
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL APIENTRY NtUserGetMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax)
Definition: message.c:2293
#define SetLastError(x)
Definition: compat.h:418
#define WM_MAXIMUM
Definition: undocuser.h:62

◆ GetQueueStatus()

DWORD WINAPI GetQueueStatus ( UINT  flags)

Definition at line 3147 of file message.c.

3148 {
3150 }
RealGetQueueStatusProc RealGetQueueStatus
Definition: message.c:3051
DWORD WINAPI RealGetQueueStatus(UINT flags)
Definition: message.c:2900
GLbitfield flags
Definition: glext.h:7161
BOOL WINAPI IsInsideMessagePumpHook()
Definition: message.c:3078
USER_MESSAGE_PUMP_ADDRESSES gmph
Definition: message.c:3069

◆ 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 }
#define TRUE
Definition: types.h:120
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
#define GetWin32ClientInfo()
Definition: ntuser.h:320
DWORD CTI_flags
Definition: ntuser.h:165
#define CTI_INSENDMESSAGE
Definition: ntuser.h:161

Referenced by ClientRpcChannelBuffer_SendReceive(), co_IntCallWindowProc(), DoMessage(), 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 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
#define GetWin32ClientInfo()
Definition: ntuser.h:320
DWORD CTI_flags
Definition: ntuser.h:165
#define CTI_INSENDMESSAGE
Definition: ntuser.h:161

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

◆ IntBroadcastSystemMessage()

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

Definition at line 3301 of file message.c.

3309 {
3310  BROADCASTPARM parm;
3311  DWORD recips = BSM_ALLCOMPONENTS;
3312  BOOL ret = -1; // Set to return fail
3313  static const DWORD all_flags = ( BSF_QUERY | BSF_IGNORECURRENTTASK | BSF_FLUSHDISK | BSF_NOHANG
3315  | BSF_ALLOWSFW | BSF_SENDNOTIFYMESSAGE | BSF_RETURNHDESK | BSF_LUID );
3316 
3317  if ((dwflags & ~all_flags) ||
3318  (!pBSMInfo && (dwflags & (BSF_RETURNHDESK|BSF_LUID))) )
3319  {
3321  return 0;
3322  }
3323 
3324  if(uiMessage >= WM_USER && uiMessage < 0xC000)
3325  {
3327  return 0;
3328  }
3329 
3331 
3332  if (dwflags & BSF_QUERY) dwflags &= ~BSF_SENDNOTIFYMESSAGE|BSF_POSTMESSAGE;
3333 
3334  if (!lpdwRecipients)
3335  lpdwRecipients = &recips;
3336 
3338  {
3340  return 0;
3341  }
3342 
3343  if ( pBSMInfo && (dwflags & BSF_QUERY) )
3344  {
3345  if (pBSMInfo->cbSize != sizeof(BSMINFO))
3346  {
3348  return 0;
3349  }
3350  }
3351 
3352  parm.hDesk = NULL;
3353  parm.hWnd = NULL;
3354  parm.flags = dwflags;
3355  parm.recipients = *lpdwRecipients;
3356 
3357  if (dwflags & BSF_LUID) parm.luid = pBSMInfo->luid;
3358 
3360  uiMessage,
3361  wParam,
3362  lParam,
3363  (ULONG_PTR)&parm,
3365  Ansi);
3366 
3367  if (!ret)
3368  {
3369  if ( pBSMInfo && (dwflags & BSF_QUERY) )
3370  {
3371  pBSMInfo->hdesk = parm.hDesk;
3372  pBSMInfo->hwnd = parm.hWnd;
3373  }
3374  }
3375  return ret;
3376 }
#define BSM_ALLCOMPONENTS
Definition: dbt.h:47
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
#define BSF_FORCEIFHUNG
Definition: dbt.h:54
#define BSF_IGNORECURRENTTASK
Definition: dbt.h:55
HDESK hDesk
Definition: ntuser.h:1063
DWORD recipients
Definition: ntuser.h:1062
#define BSF_NOTIMEOUTIFNOTHUNG
Definition: dbt.h:57
#define BSF_QUERY
Definition: dbt.h:59
#define BSF_NOHANG
Definition: dbt.h:56
#define BSF_POSTMESSAGE
Definition: dbt.h:58
WPARAM wParam
Definition: combotst.c:138
uint32_t ULONG_PTR
Definition: typedefs.h:64
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:656
BOOL APIENTRY NtUserMessageCall(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam, ULONG_PTR ResultInfo, DWORD dwType, BOOL Ansi)
Definition: message.c:2486
#define BSM_NETDRIVER
Definition: dbt.h:51
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BSF_FLUSHDISK
Definition: dbt.h:53
#define SetLastError(x)
Definition: compat.h:418
int ret
DWORD flags
Definition: ntuser.h:1061
static _In_ DWORD dwflags
Definition: dispmode.c:64
#define BSM_VXDS
Definition: dbt.h:52
#define WM_USER
Definition: winuser.h:1877
#define FNID_BROADCASTSYSTEMMESSAGE
Definition: ntuser.h:849
#define BSM_ALLDESKTOPS
Definition: dbt.h:49
#define BSM_INSTALLABLEDRIVERS
Definition: dbt.h:50
LPARAM lParam
Definition: combotst.c:139
#define BSM_APPLICATIONS
Definition: dbt.h:48

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 {
1749  WNDPROC WndProc;
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 const WCHAR Class[]
Definition: cfgmgr.c:39
static LRESULT FASTCALL IntCallWindowProcA(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1584
#define GETPFNCLIENTW(fnid)
Definition: ntuser.h:867
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
WPARAM wParam
Definition: combotst.c:138
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:779
static __inline PVOID DesktopPtrToUser(PVOID Ptr)
Definition: user_x.h:12
unsigned int BOOL
Definition: ntddk_ex.h:94
LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1425
smooth NULL
Definition: ftsmooth.c:416
Definition: ntuser.h:533
#define TRACE(s)
Definition: solgame.cpp:4
#define SetLastError(x)
Definition: compat.h:418
#define GETPFNCLIENTA(fnid)
Definition: ntuser.h:865
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2881
#define FNID_GHOST
Definition: ntuser.h:837
#define ERROR_MESSAGE_SYNC_ONLY
Definition: winerror.h:681
#define FNID_FIRST
Definition: ntuser.h:820
LPARAM lParam
Definition: combotst.c:139

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 
1740 Exit:
1741  if (Hook) EndUserApiHook();
1742  return Result;
1743 }
#define CALL_EXTERN_WNDPROC(proc, h, m, w, l)
Definition: message.c:27
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:343
UAHOWP DlgProcArray
Definition: undocuser.h:344
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WARN(fmt,...)
Definition: debug.h:112
USERAPIHOOK guah
Definition: usrapihk.c:344
HWND hWnd
Definition: settings.c:17
static BOOL FASTCALL MsgiAnsiToUnicodeReply(LPMSG UnicodeMsg, LPMSG AnsiMsg, LRESULT *Result)
Definition: message.c:821
struct @1604 Msg[]
WPARAM wParam
Definition: combotst.c:138
_SEH2_TRY
Definition: create.c:4226
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:779
uint32_t ULONG_PTR
Definition: typedefs.h:64
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
WNDPROC_OWP PostWndProc
Definition: undocuser.h:340
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FNID_DIALOG
Definition: ntuser.h:831
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
THRDESKHEAD head
Definition: ntuser.h:659
static BOOL FASTCALL MsgiAnsiToUnicodeMessage(HWND hwnd, LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:517
smooth NULL
Definition: ftsmooth.c:416
_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:426
#define TRACE(s)
Definition: solgame.cpp:4
static void Exit(void)
Definition: sock.c:1331
unsigned long DWORD
Definition: ntddk_ex.h:95
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:342
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
Definition: window.h:371
WNDPROC_OWP PreWndProc
Definition: undocuser.h:339
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
UAHOWP WndProcArray
Definition: undocuser.h:341
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

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 
1578 Exit:
1579  if (Hook) EndUserApiHook();
1580  return Result;
1581 }
#define CALL_EXTERN_WNDPROC(proc, h, m, w, l)
Definition: message.c:27
BOOL FASTCALL EndUserApiHook(VOID)
Definition: usrapihk.c:164
WNDPROC_OWP PostDefDlgProc
Definition: undocuser.h:343
UAHOWP DlgProcArray
Definition: undocuser.h:344
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WARN(fmt,...)
Definition: debug.h:112
USERAPIHOOK guah
Definition: usrapihk.c:344
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
WPARAM wParam
Definition: combotst.c:138
_SEH2_TRY
Definition: create.c:4226
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:779
uint32_t ULONG_PTR
Definition: typedefs.h:64
BOOL FASTCALL IsMsgOverride(UINT, PUAHOWP)
Definition: usrapihk.c:63
WNDPROC_OWP PostWndProc
Definition: undocuser.h:340
DWORD fnid
Definition: ntuser.h:673
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL FASTCALL MsgiUnicodeToAnsiMessage(HWND hwnd, LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:874
#define FNID_DIALOG
Definition: ntuser.h:831
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
THRDESKHEAD head
Definition: ntuser.h:659
smooth NULL
Definition: ftsmooth.c:416
_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:426
static void Exit(void)
Definition: sock.c:1331
unsigned long DWORD
Definition: ntddk_ex.h:95
WNDPROC_OWP PreDefDlgProc
Definition: undocuser.h:342
LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
Definition: solitaire.cpp:598
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
Definition: window.h:371
WNDPROC_OWP PreWndProc
Definition: undocuser.h:339
BOOL FASTCALL BeginIfHookedUserApiHook(VOID)
Definition: usrapihk.c:106
UAHOWP WndProcArray
Definition: undocuser.h:341
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
static BOOL FASTCALL MsgiUnicodeToAnsiReply(LPMSG AnsiMsg, LPMSG UnicodeMsg, LRESULT *Result)
Definition: message.c:1252
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139

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 MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define WM_CHAR
Definition: winuser.h:1699
#define WideCharToMultiByte
Definition: compat.h:101
#define WM_MENUCHAR
Definition: winuser.h:1730
char CHAR
Definition: xmlstorage.h:175
WPARAM wParam
Definition: winuser.h:3091
#define WM_SYSCHAR
Definition: winuser.h:1703
smooth NULL
Definition: ftsmooth.c:416
#define WM_DEADCHAR
Definition: winuser.h:1700
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define WM_SYSDEADCHAR
Definition: winuser.h:1704
#define HIWORD(l)
Definition: typedefs.h:246
#define CP_THREAD_ACP
Definition: winnls.h:230
UINT message
Definition: winuser.h:3090
#define LOWORD(l)
Definition: pedump.c:82

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 }
Definition: tftpd.h:59
#define SET(msg)
Definition: message.c:34
static const unsigned int message_pointer_flags[]
Definition: message.c:36
#define WM_DEVICECHANGE
Definition: winuser.h:1793
static UINT WPARAM wparam
Definition: combo.c:716

Referenced by DispatchMessageA(), DispatchMessageW(), SendMessageCallbackA(), SendMessageCallbackW(), SendNotifyMessageA(), and SendNotifyMessageW().

◆ IsDialogMessageA()

BOOL WINAPI IsDialogMessageA ( HWND  hwndDlg,
LPMSG  pmsg 
)

Definition at line 3292 of file message.c.

3293 {
3294  MSG msg = *pmsg;
3295  msg.wParam = map_wparam_AtoW( msg.message, msg.wParam );
3296  return IsDialogMessageW( hwndDlg, &msg );
3297 }
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
static WPARAM FASTCALL map_wparam_AtoW(UINT message, WPARAM wparam)
Definition: message.c:282
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI IsDialogMessageW(_In_ HWND, _In_ LPMSG)

◆ IsInsideMessagePumpHook()

BOOL WINAPI IsInsideMessagePumpHook ( )

Definition at line 3078 of file message.c.

3079 { // FF uses this and polls it when Min/Max
3080  PCLIENTTHREADINFO pcti = GetWin32ClientInfo()->pClientThreadInfo;
3081  return (gfMessagePumpHook && pcti && (pcti->dwcPumpHook > 0));
3082 }
#define GetWin32ClientInfo()
Definition: ntuser.h:320
DWORD gfMessagePumpHook
Definition: message.c:3076
DWORD dwcPumpHook
Definition: ntuser.h:171

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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LBS_HASSTRINGS
Definition: pedump.c:684
#define LBS_OWNERDRAWFIXED
Definition: pedump.c:682
LONG WINAPI GetWindowLongA(_In_ HWND, _In_ int)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GWL_STYLE
Definition: winuser.h:846
#define LBS_OWNERDRAWVARIABLE
Definition: pedump.c:683
Arabic default style
Definition: afstyles.h:93

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:
345  case EM_SETPASSWORDCHAR:
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 }
Definition: tftpd.h:59
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define WM_CHAR
Definition: winuser.h:1699
#define WM_IME_CHAR
Definition: winuser.h:1816
#define LOBYTE(W)
Definition: jmemdos.c:487
#define WM_MENUCHAR
Definition: winuser.h:1730
#define HIBYTE(W)
Definition: jmemdos.c:486
#define GetWin32ClientInfo()
Definition: ntuser.h:320
#define WM_CHARTOITEM
Definition: winuser.h:1631
#define WM_SYSCHAR
Definition: winuser.h:1703
smooth NULL
Definition: ftsmooth.c:416
BOOL WINAPI IsDBCSLeadByte(BYTE TestByte)
Definition: nls.c:2232
#define WM_DEADCHAR
Definition: winuser.h:1700
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
#define EM_SETPASSWORDCHAR
Definition: winuser.h:1996
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
__wchar_t WCHAR
Definition: xmlstorage.h:180
GLenum GLenum GLenum GLenum mapping
Definition: glext.h:9031
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned char BYTE
Definition: xxhash.c:193
#define WM_SYSDEADCHAR
Definition: winuser.h:1704
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HIWORD(l)
Definition: typedefs.h:246
static UINT WPARAM wparam
Definition: combo.c:716

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 }
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
#define WideCharToMultiByte
Definition: compat.h:101
char * LPSTR
Definition: xmlstorage.h:182
WPARAM wParam
Definition: combotst.c:138
smooth NULL
Definition: ftsmooth.c:416
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: xxhash.c:193
DWORD FASTCALL get_input_codepage(void)
Definition: message.c:253
POINT cp
Definition: magnifier.c:59
#define HIWORD(l)
Definition: typedefs.h:246

Referenced by MsgiUnicodeToAnsiMessage().

◆ MessageCleanup()

VOID FASTCALL MessageCleanup ( VOID  )

Definition at line 3282 of file message.c.

3283 {
3286 }
CRITICAL_SECTION gcsMPH
Definition: message.c:3066
void WINAPI DeleteCriticalSection(PCRITICAL_SECTION)
static CRITICAL_SECTION DdeCrst
Definition: message.c:178

Referenced by Cleanup(), and ClientThreadSetupHelper().

◆ MessageInit()

BOOL FASTCALL MessageInit ( VOID  )

Definition at line 3274 of file message.c.

3275 {
3278 
3279  return TRUE;
3280 }
CRITICAL_SECTION gcsMPH
Definition: message.c:3066
#define TRUE
Definition: types.h:120
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
static CRITICAL_SECTION DdeCrst
Definition: message.c:178

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:
720  case WM_ASKCBFORMATNAME:
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:
742  case LB_ADDSTRING_LOWER:
743  case LB_ADDSTRING_UPPER:
744  case LB_INSERTSTRING:
747  case LB_FINDSTRING:
748  case LB_FINDSTRINGEXACT:
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:
762  case CB_FINDSTRINGEXACT:
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  {
787  RtlInitUnicodeString(&UnicodeString, (PCWSTR)xs->lpszName);
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  }
809  HeapFree(GetProcessHeap(), 0, cs);
810  break;
811  }
812  }
813 
814  return(TRUE);
815 }
const uint16_t * PCWSTR
Definition: typedefs.h:56
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:2015
*BytesInUnicodeString PWCH UnicodeString
Definition: rtlfuncs.h:1979
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_ADDFILE
Definition: winuser.h:2012
#define LB_ADDSTRING
Definition: winuser.h:2013
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
#define WM_GETTEXT
Definition: winuser.h:1600
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define WM_DEVMODECHANGE
Definition: winuser.h:1613
#define WM_NCCREATE
Definition: winuser.h:1665
#define LB_SELECTSTRING
Definition: winuser.h:2038
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
uint32_t cs
Definition: isohybrid.c:75
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_INSERTSTRING
Definition: winuser.h:1939
#define WM_WININICHANGE
Definition: winuser.h:1612
LPARAM lParam
Definition: winuser.h:3092
#define WM_SETTEXT
Definition: winuser.h:1599
#define GetProcessHeap()
Definition: compat.h:404
if(!(yy_init))
Definition: macro.lex.yy.c:714
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_GETTEXT
Definition: winuser.h:2031
#define CB_SELECTSTRING
Definition: winuser.h:1942
GLdouble s
Definition: gl.h:2039
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
#define LB_FINDSTRING
Definition: winuser.h:2016
#define CB_DIR
Definition: winuser.h:1920
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
HWND hwnd
Definition: winuser.h:3089
#define WM_MDICREATE
Definition: winuser.h:1794
#define WM_CREATE
Definition: winuser.h:1590
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IS_ATOM(x)
Definition: class.h:3
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UINT message
Definition: winuser.h:3090
#define CB_FINDSTRING
Definition: winuser.h:1921
#define LB_INSERTSTRING
Definition: winuser.h:2035
#define HeapFree(x, y, z)
Definition: compat.h:403
#define EM_REPLACESEL
Definition: winuser.h:1988
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

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:
526  case WM_ASKCBFORMATNAME:
527  {
528  LPWSTR Buffer;
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:
585  case LB_ADDSTRING_LOWER:
586  case LB_ADDSTRING_UPPER:
587  case LB_INSERTSTRING:
590  case LB_FINDSTRING:
591  case LB_FINDSTRINGEXACT:
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:
605  case CB_FINDSTRINGEXACT:
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:
695  case EM_SETPASSWORDCHAR:
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 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:2015
*BytesInUnicodeString PWCH UnicodeString
Definition: rtlfuncs.h:1979
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_ADDFILE
Definition: winuser.h:2012
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CHAR
Definition: winuser.h:1699
#define WM_IME_CHAR
Definition: winuser.h:1816
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LB_ADDSTRING
Definition: winuser.h:2013
#define WM_MENUCHAR
Definition: winuser.h:1730
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WM_GETTEXT
Definition: winuser.h:1600
#define WM_DEVMODECHANGE
Definition: winuser.h:1613
#define GWL_EXSTYLE
Definition: winuser.h:845
WPARAM wParam
Definition: winuser.h:3091
char * LPSTR
Definition: xmlstorage.h:182
#define WM_NCCREATE
Definition: winuser.h:1665
#define LB_SELECTSTRING
Definition: winuser.h:2038
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
static WPARAM FASTCALL map_wparam_AtoW(UINT message, WPARAM wparam)
Definition: message.c:282
uint32_t cs
Definition: isohybrid.c:75
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WM_CHARTOITEM
Definition: winuser.h:1631
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
#define WM_SYSCHAR
Definition: winuser.h:1703
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define CB_INSERTSTRING
Definition: winuser.h:1939
#define WM_WININICHANGE
Definition: winuser.h:1612
LPARAM lParam
Definition: winuser.h:3092
LONG_PTR LPARAM
Definition: windef.h:208
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeStringFromAsciiz(_Out_ PUNICODE_STRING Destination, _In_ PCSZ Source)
Definition: bufpool.h:45
#define WM_SETTEXT
Definition: winuser.h:1599
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define WM_DEADCHAR
Definition: winuser.h:1700
#define IS_INTRESOURCE(i)
Definition: winuser.h:580
#define GetProcessHeap()
Definition: compat.h:404
#define EM_SETPASSWORDCHAR
Definition: winuser.h:1996
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_GETTEXT
Definition: winuser.h:2031
#define CB_SELECTSTRING
Definition: winuser.h:1942
GLdouble s
Definition: gl.h:2039
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
#define ERR(fmt,...)
Definition: debug.h:110
#define LB_FINDSTRING
Definition: winuser.h:2016
#define CB_DIR
Definition: winuser.h:1920
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
#define WM_SYSDEADCHAR
Definition: winuser.h:1704
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HWND hwnd
Definition: winuser.h:3089
#define WM_MDICREATE
Definition: winuser.h:1794
#define WM_CREATE
Definition: winuser.h:1590
#define EM_GETLINE
Definition: winuser.h:1973
#define IS_ATOM(x)
Definition: class.h:3
WCHAR * LPWSTR
Definition: xmlstorage.h:184
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
UINT message
Definition: winuser.h:3090
#define CB_FINDSTRING
Definition: winuser.h:1921
#define LB_INSERTSTRING
Definition: winuser.h:2035
#define EM_REPLACESEL
Definition: winuser.h:1988
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

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:
829  case WM_ASKCBFORMATNAME:
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 }
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
#define TRUE
Definition: types.h:120
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
#define WM_GETTEXT
Definition: winuser.h:1600
WPARAM wParam
Definition: winuser.h:3091
char * LPSTR
Definition: xmlstorage.h:182
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
_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:426
LPARAM lParam
Definition: winuser.h:3092
Definition: bufpool.h:45
static BOOL FASTCALL MsgiAnsiToUnicodeCleanup(LPMSG UnicodeMsg, LPMSG AnsiMsg)
Definition: message.c:709
__wchar_t WCHAR
Definition: xmlstorage.h:180
CHAR AnsiBuffer[1024]
Definition: debug.c:15
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
NTSYSAPI NTSTATUS NTAPI RtlUnicodeToMultiByteN(PCHAR MbString, ULONG MbSize, PULONG ResultSize, PCWCH UnicodeString, ULONG UnicodeSize)
#define LB_GETTEXT
Definition: winuser.h:2031
GLenum GLsizei len
Definition: glext.h:6722
HWND hwnd
Definition: winuser.h:3089
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UINT message
Definition: winuser.h:3090

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 }
LPARAM lParam
Definition: winuser.h:3092
#define GetProcessHeap()
Definition: compat.h:404
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
UINT message
Definition: winuser.h:3090
#define WM_DDE_EXECUTE
Definition: dde.h:45
#define HeapFree(x, y, z)
Definition: compat.h:403

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 
468  case WM_COPYGLOBALDATA:
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 }
signed char * PCHAR
Definition: retypes.h:7
static const WCHAR Class[]
Definition: cfgmgr.c:39
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
HGLOBAL NTAPI GlobalAlloc(UINT uFlags, SIZE_T dwBytes)
Definition: heapmem.c:368
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WORD ATOM
Definition: dimm.idl:113
WPARAM wParam
Definition: winuser.h:3091
#define GMEM_SHARE
Definition: winbase.h:302
#define WM_NCCREATE
Definition: winuser.h:1665
#define GHND
Definition: winbase.h:294
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
LPARAM lParam
Definition: winuser.h:3092
LONG_PTR LPARAM
Definition: windef.h:208
#define PCHAR
Definition: match.c:90
#define WM_COPYDATA
Definition: winuser.h:1646
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
static const WCHAR L[]
Definition: oid.c:1250
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
LPCWSTR lpszName
Definition: winuser.h:2939
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
uint32_t DWORD_PTR
Definition: typedefs.h:64
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
#define WM_CREATE
Definition: winuser.h:1590
LPCWSTR lpszClass
Definition: winuser.h:2940
UINT message
Definition: winuser.h:3090

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 }
#define TRUE
Definition: types.h:120
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;
419  case WM_COPYGLOBALDATA:
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 }
LPARAM lParam
Definition: winuser.h:3092
#define WM_COPYDATA
Definition: winuser.h:1646
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
HGLOBAL NTAPI GlobalFree(HGLOBAL hMem)
Definition: heapmem.c:611
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
Definition: heapmem.c:1190
UINT message
Definition: winuser.h:3090
#define HeapFree(x, y, z)
Definition: compat.h:403

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 
396  case WM_COPYGLOBALDATA:
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 TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
ULONG_PTR dwData
Definition: winuser.h:2976
LPARAM lParam
Definition: winuser.h:3092
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_COPYDATA
Definition: winuser.h:1646
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define SetLastError(x)
Definition: compat.h:418
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
Definition: heapmem.c:755
struct tagCOPYDATASTRUCT * PCOPYDATASTRUCT
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
struct tagCOPYDATASTRUCT COPYDATASTRUCT
UINT message
Definition: winuser.h:3090
#define ERROR_OUTOFMEMORY
Definition: deptool.c:13

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;
1192  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
1194  break;
1195  }
1196 
1197  case LB_ADDSTRING:
1198  case LB_ADDSTRING_LOWER:
1199  case LB_ADDSTRING_UPPER:
1200  case LB_INSERTSTRING:
1201  case LB_INSERTSTRING_UPPER:
1202  case LB_INSERTSTRING_LOWER:
1203  case LB_FINDSTRING:
1204  case LB_FINDSTRINGEXACT:
1205  case LB_SELECTSTRING:
1206  {
1207  if (AnsiMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1208  {
1209  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
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  {
1223  RtlInitAnsiString(&AnsiString, (PSTR) AnsiMsg->lParam);
1225  }
1226  break;
1227  }
1228 
1229  case WM_MDICREATE:
1230  {
1231  MDICREATESTRUCTA *cs = (MDICREATESTRUCTA *)AnsiMsg->lParam;
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 }
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:2015
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_ADDFILE
Definition: winuser.h:2012
#define LB_ADDSTRING
Definition: winuser.h:2013
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
#define WM_GETTEXT
Definition: winuser.h:1600
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define WM_DEVMODECHANGE
Definition: winuser.h:1613
#define WM_NCCREATE
Definition: winuser.h:1665
#define LB_SELECTSTRING
Definition: winuser.h:2038
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
uint32_t cs
Definition: isohybrid.c:75
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
#define CB_ADDSTRING
Definition: winuser.h:1918
#define CB_INSERTSTRING
Definition: winuser.h:1939
#define WM_WININICHANGE
Definition: winuser.h:1612
LPARAM lParam
Definition: winuser.h:3092
#define WM_SETTEXT
Definition: winuser.h:1599
#define GetProcessHeap()
Definition: compat.h:404
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_GETTEXT
Definition: winuser.h:2031
#define CB_SELECTSTRING
Definition: winuser.h:1942
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
#define LB_FINDSTRING
Definition: winuser.h:2016
#define CB_DIR
Definition: winuser.h:1920
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
signed char * PSTR
Definition: retypes.h:7
HWND hwnd
Definition: winuser.h:3089
#define WM_MDICREATE
Definition: winuser.h:1794
#define WM_CREATE
Definition: winuser.h:1590
#define IS_ATOM(x)
Definition: class.h:3
const char * PCSTR
Definition: typedefs.h:52
UINT message
Definition: winuser.h:3090
#define CB_FINDSTRING
Definition: winuser.h:1921
#define LB_INSERTSTRING
Definition: winuser.h:2035
#define HeapFree(x, y, z)
Definition: compat.h:403
#define EM_REPLACESEL
Definition: winuser.h:1988
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

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:
954  case WM_ASKCBFORMATNAME:
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;
1008  &UnicodeString,
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:
1021  case LB_INSERTSTRING_UPPER:
1022  case LB_INSERTSTRING_LOWER:
1023  case LB_FINDSTRING:
1024  case LB_FINDSTRINGEXACT:
1025  case LB_SELECTSTRING:
1026  {
1027  if (UnicodeMsg->lParam && listbox_has_strings(AnsiMsg->hwnd))
1028  {
1031  &UnicodeString,
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  {
1051  &UnicodeString,
1052  TRUE)))
1053  {
1054  return FALSE;
1055  }
1056  AnsiMsg->lParam = (LPARAM) AnsiString.Buffer;
1057  }
1058  break;
1059  }
1060 
1061  case WM_MDICREATE:
1062  {
1063  MDICREATESTRUCTA *cs =
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  {
1077  &UnicodeString,
1078  TRUE)))
1079  {
1080  HeapFree(GetProcessHeap(), 0, cs);
1081  return FALSE;
1082  }
1083  cs->szClass = AnsiString.Buffer;
1084  }
1085 
1088  &UnicodeString,
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 }
signed char * PCHAR
Definition: retypes.h:7
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define LB_INSERTSTRING_LOWER
Definition: controls.h:87
#define TRUE
Definition: types.h:120
#define LB_DIR
Definition: winuser.h:2015
*BytesInUnicodeString PWCH UnicodeString
Definition: rtlfuncs.h:1979
#define LB_FINDSTRINGEXACT
Definition: winuser.h:2017
#define LB_ADDFILE
Definition: winuser.h:2012
#define WM_GETDLGCODE
Definition: winuser.h:1671
#define WM_CHAR
Definition: winuser.h:1699
#define WideCharToMultiByte
Definition: compat.h:101
#define WM_IME_CHAR
Definition: winuser.h:1816
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define LB_ADDSTRING
Definition: winuser.h:2013
#define WM_MENUCHAR
Definition: winuser.h:1730
#define CB_GETLBTEXT
Definition: winuser.h:1934
uint16_t * PWSTR
Definition: typedefs.h:55
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WM_GETTEXT
Definition: winuser.h:1600
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI RtlFreeHeap(IN PVOID HeapHandle, IN ULONG Flags, IN PVOID HeapBase)
Definition: heap.c:606
#define WM_DEVMODECHANGE
Definition: winuser.h:1613
#define GWL_EXSTYLE
Definition: winuser.h:845
WPARAM wParam
Definition: winuser.h:3091
#define WM_NCCREATE
Definition: winuser.h:1665
#define LB_SELECTSTRING
Definition: winuser.h:2038
#define LB_ADDSTRING_UPPER
Definition: controls.h:88
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
LPCSTR lpszName
Definition: winuser.h:2924
uint32_t cs
Definition: isohybrid.c:75
#define WS_EX_MDICHILD
Definition: winuser.h:394
#define WM_CHARTOITEM
Definition: winuser.h:1631
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
static WPARAM FASTCALL map_wparam_char_WtoA(WPARAM wParam, DWORD len)
Definition: message.c:263
#define WM_SYSCHAR
Definition: winuser.h:1703
#define CB_ADDSTRING
Definition: winuser.h:1918
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define CB_INSERTSTRING
Definition: winuser.h:1939
smooth NULL
Definition: ftsmooth.c:416
#define WM_WININICHANGE
Definition: winuser.h:1612
LPARAM lParam
Definition: winuser.h:3092
LONG_PTR LPARAM
Definition: windef.h:208
NTSYSAPI NTSTATUS NTAPI RtlUnicodeStringToAnsiString(PANSI_STRING DestinationString, PUNICODE_STRING SourceString, BOOLEAN AllocateDestinationString)
#define WM_SETTEXT
Definition: winuser.h:1599
PVOID NTAPI RtlAllocateHeap(IN PVOID HeapHandle, IN ULONG Flags, IN SIZE_T Size)
Definition: heap.c:588
#define WM_DEADCHAR
Definition: winuser.h:1700
#define GetProcessHeap()
Definition: compat.h:404
#define EM_SETPASSWORDCHAR
Definition: winuser.h:1996
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
if(!(yy_init))
Definition: macro.lex.yy.c:714
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
NTSYSAPI VOID NTAPI RtlFreeAnsiString(PANSI_STRING AnsiString)
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_GETTEXT
Definition: winuser.h:2031
LPVOID lpCreateParams
Definition: winuser.h:2930
LPCWSTR lpszName
Definition: winuser.h:2939
#define CB_SELECTSTRING
Definition: winuser.h:1942
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define LB_INSERTSTRING_UPPER
Definition: controls.h:86
unsigned char BYTE
Definition: xxhash.c:193
Status
Definition: gdiplustypes.h:24
NTSYSAPI DWORD WINAPI RtlUnicodeStringToAnsiSize(const UNICODE_STRING *)
DWORD FASTCALL get_input_codepage(void)
Definition: message.c:253
#define ERR(fmt,...)
Definition: debug.h:110
#define LB_FINDSTRING
Definition: winuser.h:2016
LPVOID lpCreateParams
Definition: winuser.h:2915
#define CB_DIR
Definition: winuser.h:1920
#define LB_ADDSTRING_LOWER
Definition: controls.h:89
#define WM_SYSDEADCHAR
Definition: winuser.h:1704
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
HWND hwnd
Definition: winuser.h:3089
#define WM_MDICREATE
Definition: winuser.h:1794
POINT cp
Definition: magnifier.c:59
#define WM_CREATE
Definition: winuser.h:1590
#define EM_GETLINE
Definition: winuser.h:1973
LPCWSTR lpszClass
Definition: winuser.h:2940
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define IS_ATOM(x)
Definition: class.h:3
UINT message
Definition: winuser.h:3090
#define CB_FINDSTRING
Definition: winuser.h:1921
#define LB_INSERTSTRING
Definition: winuser.h:2035
#define HeapFree(x, y, z)
Definition: compat.h:403
#define EM_REPLACESEL
Definition: winuser.h:1988
LPCSTR lpszClass
Definition: winuser.h:2925
#define CB_FINDSTRINGEXACT
Definition: winuser.h:1922

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 }
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
#define TRUE
Definition: types.h:120
static BOOL FASTCALL MsgiUnicodeToAnsiCleanup(LPMSG AnsiMsg, LPMSG UnicodeMsg)
Definition: message.c:1156
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define CB_GETLBTEXT
Definition: winuser.h:1934
#define WM_ASKCBFORMATNAME
Definition: winuser.h:1855
#define WM_GETTEXT
Definition: winuser.h:1600
WPARAM wParam
Definition: winuser.h:3091
char * LPSTR
Definition: xmlstorage.h:182
static BOOL FASTCALL combobox_has_strings(HWND hwnd)
Definition: message.c:108
_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:426
LPARAM lParam
Definition: winuser.h:3092
Definition: bufpool.h:45
NTSYSAPI NTSTATUS WINAPI RtlMultiByteToUnicodeN(LPWSTR, DWORD, LPDWORD, LPCSTR, DWORD)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL FASTCALL listbox_has_strings(HWND hwnd)
Definition: message.c:115
#define LB_GETTEXT
Definition: winuser.h:2031
GLenum GLsizei len
Definition: glext.h:6722
HWND hwnd
Definition: winuser.h:3089
WCHAR * LPWSTR
Definition: xmlstorage.h:184
UINT message
Definition: winuser.h:3090

Referenced by IntCallWindowProcW().

◆ MsgWaitForMultipleObjects()

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

Definition at line 3262 of file message.c.

3268 {
3269  return MsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds,
3270  dwWakeMask, fWaitAll ? MWMO_WAITALL : 0);
3271 }
DWORD WINAPI MsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
Definition: message.c:3248
#define MWMO_WAITALL
Definition: winuser.h:898

◆ MsgWaitForMultipleObjectsEx()

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

Definition at line 3248 of file message.c.

3254 {
3255  return IsInsideMessagePumpHook() ? gmph.RealMsgWaitForMultipleObjectsEx(nCount, lpHandles, dwMilliseconds, dwWakeMask, dwFlags) : RealMsgWaitForMultipleObjectsEx(nCount, lpHandles,dwMilliseconds, dwWakeMask, dwFlags);
3256 }
RealMsgWaitForMultipleObjectsExProc RealMsgWaitForMultipleObjectsEx
Definition: message.c:3052
DWORD WINAPI RealMsgWaitForMultipleObjectsEx(DWORD nCount, CONST HANDLE *pHandles, DWORD dwMilliseconds, DWORD dwWakeMask, DWORD dwFlags)
BOOL WINAPI IsInsideMessagePumpHook()
Definition: message.c:3078
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
USER_MESSAGE_PUMP_ADDRESSES gmph
Definition: message.c:3069

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 }
HWND hWnd
Definition: settings.c:17
unsigned int BOOL
Definition: ntddk_ex.h:94
static VOID IntConvertMsgToAnsi(LPMSG lpMsg)
Definition: message.c:2065
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 }
HWND hWnd
Definition: settings.c:17
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI PeekMessageWorker(PMSG pMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg)
Definition: message.c:2145

◆ 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;
2171  ZwYieldExecution();
2172  FIXME("seeSpins!\n");
2173  return FALSE;
2174  }
2175  }
2176  }
2177  }
2178  return NtUserPeekMessage(pMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
2179 }
DWORD_PTR NTAPI NtUserGetThreadState(DWORD Routine)
Definition: misc.c:231
HWND hWnd
Definition: settings.c:17
DWORD WINAPI GetTickCount(VOID)
Definition: time.c:455
#define GetWin32ClientInfo()
Definition: ntuser.h:320
#define TIF_WAITFORINPUTIDLE
Definition: ntuser.h:254
PCLIENTTHREADINFO pClientThreadInfo
Definition: ntuser.h:300
#define FIXME(fmt,...)
Definition: debug.h:111
#define TIF_SPINNING
Definition: ntuser.h:250
NTSYSAPI NTSTATUS NTAPI ZwYieldExecution(VOID)
WORD fsChangeBits
Definition: ntuser.h:166
ULONG_PTR cSpins
Definition: ntuser.h:288
DWORD dwTIFlags
Definition: ntuser.h:292
BOOL APIENTRY NtUserPeekMessage(PMSG pMsg, HWND hWnd, UINT MsgFilterMin, UINT MsgFilterMax, UINT RemoveMsg)
Definition: message.c:2337
ULONG timeLastRead
Definition: ntuser.h:170

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;
2252  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2253  }
2254 
2255  /* No drop files or current Process, just post message. */
2256  if ( (Msg != WM_DROPFILES) ||
2259  {
2260  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
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 }
LRESULT WINAPI SendMessageA(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2442
#define PtrToUint(p)
Definition: basetsd.h:85
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2796
#define LB_DIR
Definition: winuser.h:2015
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
UINT_PTR WPARAM
Definition: windef.h:207
HANDLE UniqueProcess
Definition: compat.h:483
WPARAM wParam
Definition: combotst.c:138
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
#define WM_DROPFILES
Definition: winuser.h:1807
LONG_PTR LPARAM
Definition: windef.h:208
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
#define WM_COPYGLOBALDATA
Definition: undocuser.h:36
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define CB_DIR
Definition: winuser.h:1920
LONG_PTR LRESULT
Definition: windef.h:209
LPARAM lParam
Definition: combotst.c:139
BOOL APIENTRY NtUserPostMessage(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:2225

◆ 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;
2297  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
2298  }
2299 
2300  /* No drop files or current Process, just post message. */
2301  if ( (Msg != WM_DROPFILES) ||
2304  {
2305  return NtUserPostMessage(hWnd, Msg, wParam, lParam);
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 }
#define PtrToUint(p)
Definition: basetsd.h:85
#define QUERY_WINDOW_UNIQUE_PROCESS_ID
Definition: ntuser.h:2796
#define LB_DIR
Definition: winuser.h:2015
HWND hWnd
Definition: settings.c:17
struct @1604 Msg[]
UINT_PTR WPARAM
Definition: windef.h:207
HANDLE UniqueProcess
Definition: compat.h:483
WPARAM wParam
Definition: combotst.c:138
DWORD_PTR NTAPI NtUserQueryWindow(HWND hWnd, DWORD Index)
Definition: window.c:3929
SIZE_T NTAPI GlobalSize(HGLOBAL hMem)
Definition: heapmem.c:1090
#define WM_DROPFILES
Definition: winuser.h:1807
LONG_PTR LPARAM
Definition: windef.h:208
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:116