ReactOS  0.4.15-dev-5089-g555bec6
callback.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _WINDOWPROC_CALLBACK_ARGUMENTS
 
struct  _SENDASYNCPROC_CALLBACK_ARGUMENTS
 
struct  _CALL_BACK_INFO
 
struct  _HOOKPROC_CALLBACK_ARGUMENTS
 
struct  _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
 
struct  tagCWP_Struct
 
struct  tagCWPR_Struct
 
struct  _EVENTPROC_CALLBACK_ARGUMENTS
 
struct  _LOADMENU_CALLBACK_ARGUMENTS
 
struct  _COPYIMAGE_CALLBACK_ARGUMENTS
 
struct  _CLIENT_LOAD_LIBRARY_ARGUMENTS
 
struct  _GET_CHARSET_INFO
 
struct  _SETWNDICONS_CALLBACK_ARGUMENTS
 
struct  _DDEPOSTGET_CALLBACK_ARGUMENTS
 
struct  _SETOBM_CALLBACK_ARGUMENTS
 
struct  _LPK_CALLBACK_ARGUMENTS
 
struct  _IMMPROCESSKEY_CALLBACK_ARGUMENTS
 
struct  _IMMLOADLAYOUT_CALLBACK_ARGUMENTS
 
struct  _IMMLOADLAYOUT_CALLBACK_OUTPUT
 

Macros

#define USER32_CALLBACK_WINDOWPROC   (0)
 
#define USER32_CALLBACK_SENDASYNCPROC   (1)
 
#define USER32_CALLBACK_LOADSYSMENUTEMPLATE   (2)
 
#define USER32_CALLBACK_LOADDEFAULTCURSORS   (3)
 
#define USER32_CALLBACK_HOOKPROC   (4)
 
#define USER32_CALLBACK_EVENTPROC   (5)
 
#define USER32_CALLBACK_LOADMENU   (6)
 
#define USER32_CALLBACK_CLIENTTHREADSTARTUP   (7)
 
#define USER32_CALLBACK_CLIENTLOADLIBRARY   (8)
 
#define USER32_CALLBACK_GETCHARSETINFO   (9)
 
#define USER32_CALLBACK_COPYIMAGE   (10)
 
#define USER32_CALLBACK_SETWNDICONS   (11)
 
#define USER32_CALLBACK_DELIVERUSERAPC   (12)
 
#define USER32_CALLBACK_DDEPOST   (13)
 
#define USER32_CALLBACK_DDEGET   (14)
 
#define USER32_CALLBACK_SETOBM   (15)
 
#define USER32_CALLBACK_LPK   (16)
 
#define USER32_CALLBACK_UMPD   (17)
 
#define USER32_CALLBACK_IMMPROCESSKEY   (18)
 
#define USER32_CALLBACK_IMMLOADLAYOUT   (19)
 
#define USER32_CALLBACK_MAXIMUM   USER32_CALLBACK_IMMLOADLAYOUT
 

Typedefs

typedef struct _WINDOWPROC_CALLBACK_ARGUMENTS WINDOWPROC_CALLBACK_ARGUMENTS
 
typedef struct _WINDOWPROC_CALLBACK_ARGUMENTSPWINDOWPROC_CALLBACK_ARGUMENTS
 
typedef struct _SENDASYNCPROC_CALLBACK_ARGUMENTS SENDASYNCPROC_CALLBACK_ARGUMENTS
 
typedef struct _SENDASYNCPROC_CALLBACK_ARGUMENTSPSENDASYNCPROC_CALLBACK_ARGUMENTS
 
typedef struct _CALL_BACK_INFO CALL_BACK_INFO
 
typedef struct _CALL_BACK_INFOPCALL_BACK_INFO
 
typedef struct _HOOKPROC_CALLBACK_ARGUMENTS HOOKPROC_CALLBACK_ARGUMENTS
 
typedef struct _HOOKPROC_CALLBACK_ARGUMENTSPHOOKPROC_CALLBACK_ARGUMENTS
 
typedef struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
 
typedef struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTSPHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
 
typedef struct tagCWP_Struct CWP_Struct
 
typedef struct tagCWP_StructPCWP_Struct
 
typedef struct tagCWPR_Struct CWPR_Struct
 
typedef struct tagCWPR_StructPCWPR_Struct
 
typedef struct _EVENTPROC_CALLBACK_ARGUMENTS EVENTPROC_CALLBACK_ARGUMENTS
 
typedef struct _EVENTPROC_CALLBACK_ARGUMENTSPEVENTPROC_CALLBACK_ARGUMENTS
 
typedef struct _LOADMENU_CALLBACK_ARGUMENTS LOADMENU_CALLBACK_ARGUMENTS
 
typedef struct _LOADMENU_CALLBACK_ARGUMENTSPLOADMENU_CALLBACK_ARGUMENTS
 
typedef struct _COPYIMAGE_CALLBACK_ARGUMENTS COPYIMAGE_CALLBACK_ARGUMENTS
 
typedef struct _COPYIMAGE_CALLBACK_ARGUMENTSPCOPYIMAGE_CALLBACK_ARGUMENTS
 
typedef struct _CLIENT_LOAD_LIBRARY_ARGUMENTS CLIENT_LOAD_LIBRARY_ARGUMENTS
 
typedef struct _CLIENT_LOAD_LIBRARY_ARGUMENTSPCLIENT_LOAD_LIBRARY_ARGUMENTS
 
typedef struct _GET_CHARSET_INFO GET_CHARSET_INFO
 
typedef struct _GET_CHARSET_INFOPGET_CHARSET_INFO
 
typedef struct _SETWNDICONS_CALLBACK_ARGUMENTS SETWNDICONS_CALLBACK_ARGUMENTS
 
typedef struct _SETWNDICONS_CALLBACK_ARGUMENTSPSETWNDICONS_CALLBACK_ARGUMENTS
 
typedef struct _DDEPOSTGET_CALLBACK_ARGUMENTS DDEPOSTGET_CALLBACK_ARGUMENTS
 
typedef struct _DDEPOSTGET_CALLBACK_ARGUMENTSPDDEPOSTGET_CALLBACK_ARGUMENTS
 
typedef struct _SETOBM_CALLBACK_ARGUMENTS SETOBM_CALLBACK_ARGUMENTS
 
typedef struct _SETOBM_CALLBACK_ARGUMENTSPSETOBM_CALLBACK_ARGUMENTS
 
typedef struct _LPK_CALLBACK_ARGUMENTS LPK_CALLBACK_ARGUMENTS
 
typedef struct _LPK_CALLBACK_ARGUMENTSPLPK_CALLBACK_ARGUMENTS
 
typedef struct _IMMPROCESSKEY_CALLBACK_ARGUMENTS IMMPROCESSKEY_CALLBACK_ARGUMENTS
 
typedef struct _IMMPROCESSKEY_CALLBACK_ARGUMENTSPIMMPROCESSKEY_CALLBACK_ARGUMENTS
 
typedef struct _IMMLOADLAYOUT_CALLBACK_ARGUMENTS IMMLOADLAYOUT_CALLBACK_ARGUMENTS
 
typedef struct _IMMLOADLAYOUT_CALLBACK_ARGUMENTSPIMMLOADLAYOUT_CALLBACK_ARGUMENTS
 
typedef struct _IMMLOADLAYOUT_CALLBACK_OUTPUT IMMLOADLAYOUT_CALLBACK_OUTPUT
 
typedef struct _IMMLOADLAYOUT_CALLBACK_OUTPUTPIMMLOADLAYOUT_CALLBACK_OUTPUT
 

Functions

NTSTATUS WINAPI User32CallCopyImageFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallSetWndIconsFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallWindowProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallSendAsyncProcForKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32SetupDefaultCursors (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallHookProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallEventProcFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallLoadMenuFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallClientThreadSetupFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallClientLoadLibraryFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallGetCharsetInfo (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32DeliverUserAPC (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallDDEPostFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallDDEGetFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallOBMFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallLPKFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallUMPDFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallImmProcessKeyFromKernel (PVOID Arguments, ULONG ArgumentLength)
 
NTSTATUS WINAPI User32CallImmLoadLayoutFromKernel (PVOID Arguments, ULONG ArgumentLength)
 

Macro Definition Documentation

◆ USER32_CALLBACK_CLIENTLOADLIBRARY

#define USER32_CALLBACK_CLIENTLOADLIBRARY   (8)

Definition at line 12 of file callback.h.

◆ USER32_CALLBACK_CLIENTTHREADSTARTUP

#define USER32_CALLBACK_CLIENTTHREADSTARTUP   (7)

Definition at line 11 of file callback.h.

◆ USER32_CALLBACK_COPYIMAGE

#define USER32_CALLBACK_COPYIMAGE   (10)

Definition at line 14 of file callback.h.

◆ USER32_CALLBACK_DDEGET

#define USER32_CALLBACK_DDEGET   (14)

Definition at line 18 of file callback.h.

◆ USER32_CALLBACK_DDEPOST

#define USER32_CALLBACK_DDEPOST   (13)

Definition at line 17 of file callback.h.

◆ USER32_CALLBACK_DELIVERUSERAPC

#define USER32_CALLBACK_DELIVERUSERAPC   (12)

Definition at line 16 of file callback.h.

◆ USER32_CALLBACK_EVENTPROC

#define USER32_CALLBACK_EVENTPROC   (5)

Definition at line 9 of file callback.h.

◆ USER32_CALLBACK_GETCHARSETINFO

#define USER32_CALLBACK_GETCHARSETINFO   (9)

Definition at line 13 of file callback.h.

◆ USER32_CALLBACK_HOOKPROC

#define USER32_CALLBACK_HOOKPROC   (4)

Definition at line 8 of file callback.h.

◆ USER32_CALLBACK_IMMLOADLAYOUT

#define USER32_CALLBACK_IMMLOADLAYOUT   (19)

Definition at line 23 of file callback.h.

◆ USER32_CALLBACK_IMMPROCESSKEY

#define USER32_CALLBACK_IMMPROCESSKEY   (18)

Definition at line 22 of file callback.h.

◆ USER32_CALLBACK_LOADDEFAULTCURSORS

#define USER32_CALLBACK_LOADDEFAULTCURSORS   (3)

Definition at line 7 of file callback.h.

◆ USER32_CALLBACK_LOADMENU

#define USER32_CALLBACK_LOADMENU   (6)

Definition at line 10 of file callback.h.

◆ USER32_CALLBACK_LOADSYSMENUTEMPLATE

#define USER32_CALLBACK_LOADSYSMENUTEMPLATE   (2)

Definition at line 6 of file callback.h.

◆ USER32_CALLBACK_LPK

#define USER32_CALLBACK_LPK   (16)

Definition at line 20 of file callback.h.

◆ USER32_CALLBACK_MAXIMUM

#define USER32_CALLBACK_MAXIMUM   USER32_CALLBACK_IMMLOADLAYOUT

Definition at line 24 of file callback.h.

◆ USER32_CALLBACK_SENDASYNCPROC

#define USER32_CALLBACK_SENDASYNCPROC   (1)

Definition at line 5 of file callback.h.

◆ USER32_CALLBACK_SETOBM

#define USER32_CALLBACK_SETOBM   (15)

Definition at line 19 of file callback.h.

◆ USER32_CALLBACK_SETWNDICONS

#define USER32_CALLBACK_SETWNDICONS   (11)

Definition at line 15 of file callback.h.

◆ USER32_CALLBACK_UMPD

#define USER32_CALLBACK_UMPD   (17)

Definition at line 21 of file callback.h.

◆ USER32_CALLBACK_WINDOWPROC

#define USER32_CALLBACK_WINDOWPROC   (0)

Definition at line 4 of file callback.h.

Typedef Documentation

◆ CALL_BACK_INFO

◆ CLIENT_LOAD_LIBRARY_ARGUMENTS

◆ COPYIMAGE_CALLBACK_ARGUMENTS

◆ CWP_Struct

◆ CWPR_Struct

◆ DDEPOSTGET_CALLBACK_ARGUMENTS

◆ EVENTPROC_CALLBACK_ARGUMENTS

◆ GET_CHARSET_INFO

◆ HOOKPROC_CALLBACK_ARGUMENTS

◆ HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS

◆ IMMLOADLAYOUT_CALLBACK_ARGUMENTS

◆ IMMLOADLAYOUT_CALLBACK_OUTPUT

◆ IMMPROCESSKEY_CALLBACK_ARGUMENTS

◆ LOADMENU_CALLBACK_ARGUMENTS

◆ LPK_CALLBACK_ARGUMENTS

◆ PCALL_BACK_INFO

◆ PCLIENT_LOAD_LIBRARY_ARGUMENTS

◆ PCOPYIMAGE_CALLBACK_ARGUMENTS

◆ PCWP_Struct

◆ PCWPR_Struct

◆ PDDEPOSTGET_CALLBACK_ARGUMENTS

◆ PEVENTPROC_CALLBACK_ARGUMENTS

◆ PGET_CHARSET_INFO

◆ PHOOKPROC_CALLBACK_ARGUMENTS

◆ PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS

◆ PIMMLOADLAYOUT_CALLBACK_ARGUMENTS

◆ PIMMLOADLAYOUT_CALLBACK_OUTPUT

◆ PIMMPROCESSKEY_CALLBACK_ARGUMENTS

◆ PLOADMENU_CALLBACK_ARGUMENTS

◆ PLPK_CALLBACK_ARGUMENTS

◆ PSENDASYNCPROC_CALLBACK_ARGUMENTS

◆ PSETOBM_CALLBACK_ARGUMENTS

◆ PSETWNDICONS_CALLBACK_ARGUMENTS

◆ PWINDOWPROC_CALLBACK_ARGUMENTS

◆ SENDASYNCPROC_CALLBACK_ARGUMENTS

◆ SETOBM_CALLBACK_ARGUMENTS

◆ SETWNDICONS_CALLBACK_ARGUMENTS

◆ WINDOWPROC_CALLBACK_ARGUMENTS

Function Documentation

◆ User32CallClientLoadLibraryFromKernel()

NTSTATUS WINAPI User32CallClientLoadLibraryFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 528 of file hook.c.

529 {
530  BOOL bResult;
532 
533  /* Retireve the callback parameters */
534  Argument = (PCLIENT_LOAD_LIBRARY_ARGUMENTS)Arguments;
535  if(Argument->strLibraryName.Buffer != NULL)
536  {
537  Argument->strLibraryName.Buffer = (PWCHAR)((ULONG_PTR)Argument->strLibraryName.Buffer + (ULONG_PTR)Argument);
538  }
539  if(Argument->strInitFuncName.Buffer != NULL)
540  {
541  Argument->strInitFuncName.Buffer = (PWCHAR)((ULONG_PTR)Argument->strInitFuncName.Buffer + (ULONG_PTR)Argument);
542  }
543 
544  /* Call the implementation of the callback */
545  bResult = ClientLoadLibrary(&Argument->strLibraryName,
546  &Argument->strInitFuncName,
547  Argument->Unload,
548  Argument->ApiHook);
549 
550  return ZwCallbackReturn(&bResult, sizeof(HINSTANCE), STATUS_SUCCESS);
551 }
uint16_t * PWCHAR
Definition: typedefs.h:56
UNICODE_STRING strInitFuncName
Definition: callback.h:125
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
static BOOL ClientLoadLibrary(PUNICODE_STRING pstrLibName, PUNICODE_STRING pstrInitFunc, BOOL bUnload, BOOL bApiHook)
Definition: hook.c:430
struct _CLIENT_LOAD_LIBRARY_ARGUMENTS * PCLIENT_LOAD_LIBRARY_ARGUMENTS
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
#define STATUS_SUCCESS
Definition: shellext.h:65
UNICODE_STRING strLibraryName
Definition: callback.h:124

◆ User32CallClientThreadSetupFromKernel()

NTSTATUS WINAPI User32CallClientThreadSetupFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 580 of file dllmain.c.

581 {
582  TRACE("User32CallClientThreadSetupFromKernel -->\n");
583  // FIXME: Disabling this call is a HACK!! See also ClientThreadSetup...
584  // ClientThreadSetupHelper(TRUE);
585  TRACE("<-- User32CallClientThreadSetupFromKernel\n");
587 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define TRACE(s)
Definition: solgame.cpp:4
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ User32CallCopyImageFromKernel()

NTSTATUS WINAPI User32CallCopyImageFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 1938 of file cursoricon.c.

1939 {
1941  HANDLE Result;
1942  Common = (PCOPYIMAGE_CALLBACK_ARGUMENTS) Arguments;
1943 
1944  Result = CopyImage(Common->hImage,
1945  Common->uType,
1946  Common->cxDesired,
1947  Common->cyDesired,
1948  Common->fuFlags);
1949 
1950  return ZwCallbackReturn(&Result, sizeof(HANDLE), STATUS_SUCCESS);
1951 }
struct _COPYIMAGE_CALLBACK_ARGUMENTS * PCOPYIMAGE_CALLBACK_ARGUMENTS
HANDLE WINAPI CopyImage(_In_ HANDLE hImage, _In_ UINT uType, _In_ int cxDesired, _In_ int cyDesired, _In_ UINT fuFlags)
Definition: cursoricon.c:1956
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_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 STATUS_SUCCESS
Definition: shellext.h:65

◆ User32CallDDEGetFromKernel()

NTSTATUS WINAPI User32CallDDEGetFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 288 of file dde.c.

289 {
290  BOOL Ret;
292  PDDEPOSTGET_CALLBACK_ARGUMENTS Common = Arguments;
293 
294  TRACE("DDE Get CB size %d\n",Common->size);
295 
296  Ret = unpack_dde_message( Common->hwnd, Common->message, &Common->lParam, Common->buffer, Common->size );
297 
298  if (!Ret)
299  {
300  ERR("DDE Get CB Return bad msg 0x%x\n",Common->message);
302  }
303  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
304 }
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ERR(fmt,...)
Definition: debug.h:110
#define STATUS_SUCCESS
Definition: shellext.h:65
BOOL unpack_dde_message(HWND hwnd, UINT message, LPARAM *lparam, PVOID buffer, int size)
Definition: dde.c:159

◆ User32CallDDEPostFromKernel()

NTSTATUS WINAPI User32CallDDEPostFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 256 of file dde.c.

257 {
258  struct packed_message data;
259  BOOL Ret;
261  PDDEPOSTGET_CALLBACK_ARGUMENTS Common = Arguments;
262 
263  data.data = 0;
264  data.size = 0;
265  TRACE("DDE Post CB\n");
266  Ret = post_dde_message( &data, Common->message, Common->lParam, &Common->lParam);
267 
268  if (Ret)
269  {
270  Common->pvData = (PVOID)data.data;
271  Common->size = data.size;
272  TRACE("DDE Post CB size %d\n",data.size);
273  }
274  else
275  {
276  ERR("DDE Post CB Return bad msg 0x%x Size %d\n",Common->message,Common->size);
278  }
279 
280  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
281 }
LONG NTSTATUS
Definition: precomp.h:26
BOOL post_dde_message(struct packed_message *data, UINT message, LPARAM lParam, LPARAM *lp)
Definition: dde.c:53
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
void * PVOID
Definition: retypes.h:9
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define ERR(fmt,...)
Definition: debug.h:110
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ User32CallEventProcFromKernel()

NTSTATUS WINAPI User32CallEventProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 796 of file hook.c.

797 {
799  WINEVENTPROC Proc;
801  DWORD len;
802  HMODULE mod = NULL;
803  BOOL Loaded = FALSE;
804 
805  Common = (PEVENTPROC_CALLBACK_ARGUMENTS) Arguments;
806 
807  Proc = Common->Proc;
808 
809  if (Common->offPfn && Common->Mod)
810  { // Validate the module again.
811  if (!(len = GetModuleFileNameW((HINSTANCE)Common->Mod, module, MAX_PATH)) || len >= MAX_PATH)
812  {
813  ERR("Error check for module!\n");
814  Common->Mod = 0;
815  }
816 
817  if (Common->Mod && !(mod = GetModuleHandleW(module)))
818  {
819  TRACE("Reloading Event Module.\n");
821  {
822  ERR("Failed to load Event Module.\n");
823  }
824  else
825  {
826  Loaded = TRUE; // Free it only when loaded.
827  }
828  }
829 
830  if (mod)
831  {
832  TRACE("Loading Event Module. %S\n",module);
833  Proc = (WINEVENTPROC)((char *)mod + Common->offPfn);
834  }
835  }
836 
837  Proc(Common->hook,
838  Common->event,
839  Common->hwnd,
840  Common->idObject,
841  Common->idChild,
842  Common->dwEventThread,
843  Common->dwmsEventTime);
844 
845  if (Loaded) FreeLibrary(mod);
846 
848 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
struct _EVENTPROC_CALLBACK_ARGUMENTS * PEVENTPROC_CALLBACK_ARGUMENTS
#define TRUE
Definition: types.h:120
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:341
Definition: fs_rec.h:186
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
VOID(CALLBACK * WINEVENTPROC)(HWINEVENTHOOK, DWORD, HWND, LONG, LONG, DWORD, DWORD)
Definition: winable.h:68
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:110
#define NULL
Definition: types.h:112
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define STATUS_SUCCESS
Definition: shellext.h:65
static int mod
Definition: i386-dis.c:1289

◆ User32CallGetCharsetInfo()

NTSTATUS WINAPI User32CallGetCharsetInfo ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 591 of file dllmain.c.

592 {
593  BOOL Ret;
594  PGET_CHARSET_INFO pgci = (PGET_CHARSET_INFO)Arguments;
595 
596  TRACE("GetCharsetInfo\n");
597 
598  Ret = TranslateCharsetInfo((DWORD *)(ULONG_PTR)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE);
599 
600  return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
601 }
#define TCI_SRCLOCALE
Definition: wingdi.h:964
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
CHARSETINFO Cs
Definition: callback.h:133
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct _GET_CHARSET_INFO * PGET_CHARSET_INFO
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ User32CallHookProcFromKernel()

NTSTATUS WINAPI User32CallHookProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 554 of file hook.c.

555 {
557  CREATESTRUCTW *pCsw = NULL;
558  CBT_CREATEWNDW *pCbtCreatewndw = NULL;
559  PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS CbtCreatewndExtra = NULL;
560  KBDLLHOOKSTRUCT KeyboardLlData, *pKeyboardLlData;
561  MSLLHOOKSTRUCT MouseLlData, *pMouseLlData;
562  MSG *pcMsg, *pMsg;
563  PMOUSEHOOKSTRUCT pMHook;
564  CWPSTRUCT *pCWP;
565  CWPRETSTRUCT *pCWPR;
566  PRECTL prl;
567  LPCBTACTIVATESTRUCT pcbtas;
568  HOOKPROC Proc;
569  WPARAM wParam = 0;
570  LPARAM lParam = 0;
571  LRESULT Result = 0;
572  BOOL Hit = FALSE, Loaded = FALSE;
573  HMODULE mod = NULL;
575 
576  Common = (PHOOKPROC_CALLBACK_ARGUMENTS) Arguments;
577 
578  Proc = Common->Proc;
579  // HookProc Justin Case module is from another process.
580  if (Common->offPfn && Common->Mod)
581  {
582  if (!(mod = GetModuleHandleW((LPCWSTR)Common->ModuleName)))
583  {
584  TRACE("Reloading Hook Module.\n");
586  {
587  ERR("Failed to load Hook Module.\n");
588  }
589  else
590  {
591  Loaded = TRUE; // Free it only when loaded.
592  }
593  }
594  if (mod)
595  {
596  TRACE("Loading Hook Module. %S\n",Common->ModuleName);
597  Proc = (HOOKPROC)((char *)mod + Common->offPfn);
598  }
599  }
600 
601  switch(Common->HookId)
602  {
603  case WH_CBT:
604  {
605  //ERR("WH_CBT: Code %d\n", Common->Code);
606  switch(Common->Code)
607  {
608  case HCBT_CREATEWND:
609  CbtCreatewndExtra = (PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS)
610  ((PCHAR) Common + Common->lParam);
611 
612  pCbtCreatewndw = (CBT_CREATEWNDW*)HeapAlloc(GetProcessHeap(), 0, sizeof(CBT_CREATEWNDW));
613  RtlCopyMemory(pCbtCreatewndw, CbtCreatewndExtra, sizeof(CBT_CREATEWNDW));
614 
615  pCsw = (CREATESTRUCTW*)HeapAlloc(GetProcessHeap(), 0, sizeof(CREATESTRUCTW));
616  RtlCopyMemory(pCsw, &CbtCreatewndExtra->Cs, sizeof(CREATESTRUCTW));
617 
618  pCbtCreatewndw->lpcs = pCsw;
619  pCbtCreatewndw->hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
620  wParam = Common->wParam;
621  lParam = (LPARAM) pCbtCreatewndw;
622  //ERR("HCBT_CREATEWND: hWnd %p Csw %p Name %p Class %p\n", Common->wParam, pCsw, pCsw->lpszName, pCsw->lpszClass);
623  break;
624  case HCBT_CLICKSKIPPED:
625  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
626  lParam = (LPARAM) pMHook;
627  wParam = Common->wParam;
628  break;
629  case HCBT_MOVESIZE:
630  prl = (PRECTL)((PCHAR) Common + Common->lParam);
631  lParam = (LPARAM) prl;
632  wParam = Common->wParam;
633  break;
634  case HCBT_ACTIVATE:
635  //ERR("HCBT_ACTIVATE: hwnd %p\n",Common->wParam);
636  pcbtas = (LPCBTACTIVATESTRUCT)((PCHAR) Common + Common->lParam);
637  lParam = (LPARAM) pcbtas;
638  wParam = Common->wParam;
639  break;
640  case HCBT_KEYSKIPPED: /* The rest SEH support */
641  case HCBT_MINMAX:
642  case HCBT_SETFOCUS:
643  case HCBT_SYSCOMMAND:
644  case HCBT_DESTROYWND:
645  case HCBT_QS:
646  wParam = Common->wParam;
647  lParam = Common->lParam;
648  break;
649  default:
650  if (Loaded) FreeLibrary(mod);
651  ERR("HCBT_ not supported = %d\n", Common->Code);
653  }
654 
655  if (Proc)
656  {
657  _SEH2_TRY
658  {
659  Result = Proc(Common->Code, wParam, lParam);
660  }
662  {
663  Hit = TRUE;
664  }
665  _SEH2_END;
666  }
667  else
668  {
669  ERR("Null Proc! Common = 0x%x, Proc = 0x%x\n",Common,Proc);
670  }
671  switch(Common->Code)
672  {
673  case HCBT_CREATEWND:
674  CbtCreatewndExtra->WndInsertAfter = pCbtCreatewndw->hwndInsertAfter;
675  CbtCreatewndExtra->Cs.x = pCbtCreatewndw->lpcs->x;
676  CbtCreatewndExtra->Cs.y = pCbtCreatewndw->lpcs->y;
677  CbtCreatewndExtra->Cs.cx = pCbtCreatewndw->lpcs->cx;
678  CbtCreatewndExtra->Cs.cy = pCbtCreatewndw->lpcs->cy;
679  HeapFree(GetProcessHeap(), 0, pCsw);
680  HeapFree(GetProcessHeap(), 0, pCbtCreatewndw);
681  break;
682  }
683  break;
684  }
685  case WH_KEYBOARD_LL:
686  //ERR("WH_KEYBOARD_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
687  pKeyboardLlData = (PKBDLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
688  RtlCopyMemory(&KeyboardLlData, pKeyboardLlData, sizeof(KBDLLHOOKSTRUCT));
689  Result = Proc(Common->Code, Common->wParam, (LPARAM) &KeyboardLlData);
690  break;
691  case WH_MOUSE_LL:
692  //ERR("WH_MOUSE_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
693  pMouseLlData = (PMSLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
694  RtlCopyMemory(&MouseLlData, pMouseLlData, sizeof(MSLLHOOKSTRUCT));
695  Result = Proc(Common->Code, Common->wParam, (LPARAM) &MouseLlData);
696  break;
697  case WH_MOUSE: /* SEH support */
698  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
699  _SEH2_TRY
700  {
701  Result = Proc(Common->Code, Common->wParam, (LPARAM) pMHook);
702  }
704  {
705  Hit = TRUE;
706  }
707  _SEH2_END;
708  break;
709  case WH_CALLWNDPROC:
710  {
711  PCWP_Struct pcwps = (PCWP_Struct)Common;
712  CWPSTRUCT *pCWPT = &pcwps->cwps;
713  pCWP = HeapAlloc(GetProcessHeap(), 0, Common->lParamSize + sizeof(CWPSTRUCT));
714  RtlCopyMemory(pCWP, pCWPT, sizeof(CWPSTRUCT));
715  //ERR("WH_CALLWNDPROC: Code %d, wParam %d hwnd %p msg %d\n",Common->Code,Common->wParam,pCWP->hwnd,pCWP->message);
716  /* If more memory is reserved, then lParam is a pointer.
717  * Size of the buffer is stocked in the lParam member, and its content
718  * is at the end of the argument buffer */
719  if ( Common->lParamSize )
720  {
721  pCWP->lParam = (LPARAM)((PCHAR)pCWP + sizeof(CWPSTRUCT));
722  RtlCopyMemory( (PCHAR)pCWP + sizeof(CWPSTRUCT), &pcwps->Extra, Common->lParamSize );
723  }
724  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWP);
725  HeapFree(GetProcessHeap(), 0, pCWP);
726  }
727  break;
728  case WH_CALLWNDPROCRET:
729  /* Almost the same as WH_CALLWNDPROC */
730  {
731  PCWPR_Struct pcwprs = (PCWPR_Struct)Common;
732  CWPRETSTRUCT *pCWPRT = &pcwprs->cwprs;
733  pCWPR = HeapAlloc(GetProcessHeap(), 0, Common->lParamSize + sizeof(CWPRETSTRUCT));
734  RtlCopyMemory(pCWPR, pCWPRT, sizeof(CWPRETSTRUCT));
735  //ERR("WH_CALLWNDPROCRET: Code %d, wParam %d hwnd %p msg %d\n",Common->Code,Common->wParam,pCWPRT->hwnd,pCWPRT->message);
736  if ( Common->lParamSize )
737  {
738  pCWPR->lParam = (LPARAM)((PCHAR)pCWPR + sizeof(CWPRETSTRUCT));
739  RtlCopyMemory( (PCHAR)pCWPR + sizeof(CWPRETSTRUCT), &pcwprs->Extra, Common->lParamSize );
740  }
741  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWPR);
742  HeapFree(GetProcessHeap(), 0, pCWPR);
743  }
744  break;
745  case WH_MSGFILTER: /* All SEH support */
746  case WH_SYSMSGFILTER:
747  case WH_GETMESSAGE:
748  pMsg = (PMSG)((PCHAR) Common + Common->lParam);
749  pcMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSG));
750  RtlCopyMemory(pcMsg, pMsg, sizeof(MSG));
751 // ERR("pMsg %d pcMsg %d\n",pMsg->message, pcMsg->message);
752  _SEH2_TRY
753  {
754  Result = Proc(Common->Code, Common->wParam, (LPARAM) pcMsg);
755  }
757  {
758  Hit = TRUE;
759  }
760  _SEH2_END;
761  if (!Hit && Common->HookId == WH_GETMESSAGE)
762  RtlCopyMemory(pMsg, pcMsg, sizeof(MSG));
763  HeapFree( GetProcessHeap(), 0, pcMsg );
764  break;
765  case WH_KEYBOARD:
766  case WH_SHELL:
767  Result = Proc(Common->Code, Common->wParam, Common->lParam);
768  break;
769  case WH_FOREGROUNDIDLE: /* <-- SEH support */
770  _SEH2_TRY
771  {
772  Result = Proc(Common->Code, Common->wParam, Common->lParam);
773  }
775  {
776  Hit = TRUE;
777  }
778  _SEH2_END;
779  break;
780  default:
781  if (Loaded) FreeLibrary(mod);
782  ERR("WH_ not supported = %d\n", Common->HookId);
784  }
785  if (Hit)
786  {
787  ERR("Hook Exception! Id: %d, Code %d, Proc 0x%x\n",Common->HookId,Common->Code,Proc);
789  }
790  if (Loaded) FreeLibrary(mod);
791  Common->Result = Result;
792  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
793 }
#define WH_MOUSE
Definition: winuser.h:37
signed char * PCHAR
Definition: retypes.h:7
#define HCBT_CLICKSKIPPED
Definition: winuser.h:61
struct tagCWPSTRUCT CWPSTRUCT
#define HCBT_SYSCOMMAND
Definition: winuser.h:63
return STATUS_NOT_SUPPORTED
#define WH_GETMESSAGE
Definition: winuser.h:33
#define HCBT_CREATEWND
Definition: winuser.h:58
struct RECTL * PRECTL
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
#define TRUE
Definition: types.h:120
LPCREATESTRUCTW lpcs
Definition: winuser.h:2965
struct tagCWP_Struct * PCWP_Struct
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
#define WH_MSGFILTER
Definition: winuser.h:29
struct _HOOKPROC_CALLBACK_ARGUMENTS * PHOOKPROC_CALLBACK_ARGUMENTS
LONG NTSTATUS
Definition: precomp.h:26
#define WH_SHELL
Definition: winuser.h:40
CWPSTRUCT cwps
Definition: callback.h:81
LPARAM lParam
Definition: winuser.h:3008
struct tagCBT_CREATEWNDW CBT_CREATEWNDW
UINT_PTR WPARAM
Definition: windef.h:207
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:341
WPARAM wParam
Definition: combotst.c:138
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2889
Definition: fs_rec.h:186
_SEH2_TRY
Definition: create.c:4226
#define HCBT_KEYSKIPPED
Definition: winuser.h:62
HWND hwndInsertAfter
Definition: winuser.h:2966
#define WH_FOREGROUNDIDLE
Definition: winuser.h:41
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
struct tagCWPRETSTRUCT CWPRETSTRUCT
#define WH_MOUSE_LL
Definition: winuser.h:44
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HCBT_DESTROYWND
Definition: winuser.h:59
PBYTE Extra[4]
Definition: callback.h:82
_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
LONG_PTR LPARAM
Definition: windef.h:208
struct tagCREATESTRUCTW CREATESTRUCTW
#define WH_CBT
Definition: winuser.h:35
struct tagMOUSEHOOKSTRUCT * PMOUSEHOOKSTRUCT
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
CWPRETSTRUCT cwprs
Definition: callback.h:88
Status
Definition: gdiplustypes.h:24
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:607
#define GetProcessHeap()
Definition: compat.h:595
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WH_KEYBOARD_LL
Definition: winuser.h:43
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
LPARAM lParam
Definition: winuser.h:3015
PBYTE Extra[4]
Definition: callback.h:89
#define HCBT_QS
Definition: winuser.h:57
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
struct tagCWPR_Struct * PCWPR_Struct
#define WH_CALLWNDPROC
Definition: winuser.h:34
struct tagCBTACTIVATESTRUCT * LPCBTACTIVATESTRUCT
#define HCBT_MINMAX
Definition: winuser.h:56
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
struct tagMSG * PMSG
#define NULL
Definition: types.h:112
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define WH_KEYBOARD
Definition: winuser.h:32
struct tagMSLLHOOKSTRUCT * PMSLLHOOKSTRUCT
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
#define STATUS_SUCCESS
Definition: shellext.h:65
LONG_PTR LRESULT
Definition: windef.h:209
#define WH_SYSMSGFILTER
Definition: winuser.h:36
LPARAM lParam
Definition: combotst.c:139
struct tagKBDLLHOOKSTRUCT * PKBDLLHOOKSTRUCT
#define HeapFree(x, y, z)
Definition: compat.h:594
struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS * PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
static int mod
Definition: i386-dis.c:1289

◆ User32CallImmLoadLayoutFromKernel()

NTSTATUS WINAPI User32CallImmLoadLayoutFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 731 of file dllmain.c.

732 {
733  PIMMLOADLAYOUT_CALLBACK_ARGUMENTS Common = Arguments;
735  Result.ret = IMM_FN(ImmLoadLayout)(Common->hKL, &Result.iiex);
736  return ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS);
737 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_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 STATUS_SUCCESS
Definition: shellext.h:65
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx)
Definition: imm.c:54
#define IMM_FN(name)
Definition: user32p.h:56

◆ User32CallImmProcessKeyFromKernel()

NTSTATUS WINAPI User32CallImmProcessKeyFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 718 of file dllmain.c.

719 {
720  PIMMPROCESSKEY_CALLBACK_ARGUMENTS Common = Arguments;
721  DWORD Result = IMM_FN(ImmProcessKey)(Common->hWnd,
722  Common->hKL,
723  Common->vKey,
724  Common->lParam,
725  Common->dwHotKeyID);
726 
727  return ZwCallbackReturn(&Result, sizeof(DWORD), STATUS_SUCCESS);
728 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_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
DWORD WINAPI ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID)
Definition: keymsg.c:690
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_SUCCESS
Definition: shellext.h:65
#define IMM_FN(name)
Definition: user32p.h:56

◆ User32CallLoadMenuFromKernel()

NTSTATUS WINAPI User32CallLoadMenuFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 665 of file menu.c.

666 {
668  LRESULT Result;
669 
670  Common = (PLOADMENU_CALLBACK_ARGUMENTS) Arguments;
671 
672  Result = (LRESULT)LoadMenuW(Common->hModule, Common->InterSource ? MAKEINTRESOURCEW(Common->InterSource) : (LPCWSTR)&Common->MenuName);
673 
674  return ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS);
675 }
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HMENU WINAPI LoadMenuW(HINSTANCE hInstance, LPCWSTR lpMenuName)
Definition: menu.c:1407
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_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
struct _LOADMENU_CALLBACK_ARGUMENTS * PLOADMENU_CALLBACK_ARGUMENTS
#define LRESULT
Definition: ole.h:14
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define STATUS_SUCCESS
Definition: shellext.h:65
LONG_PTR LRESULT
Definition: windef.h:209

◆ User32CallLPKFromKernel()

NTSTATUS WINAPI User32CallLPKFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 666 of file dllmain.c.

667 {
668  BOOL bResult;
669  PLPK_CALLBACK_ARGUMENTS Argument;
670 
671  Argument = (PLPK_CALLBACK_ARGUMENTS)Arguments;
672 
673  Argument->lpString = (LPWSTR)((ULONG_PTR)Argument->lpString + (ULONG_PTR)Argument);
674 
675  bResult = ExtTextOutW(Argument->hdc,
676  Argument->x,
677  Argument->y,
678  Argument->flags,
679  (Argument->bRect) ? &Argument->rect : NULL,
680  Argument->lpString,
681  Argument->count,
682  NULL);
683 
684  return ZwCallbackReturn(&bResult, sizeof(BOOL), STATUS_SUCCESS);
685 }
BOOL WINAPI ExtTextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_ UINT options, _In_opt_ const RECT *lprect, _In_reads_opt_(c) LPCWSTR lpString, _In_ UINT c, _In_reads_opt_(c) const INT *lpDx)
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
#define STATUS_SUCCESS
Definition: shellext.h:65
struct _LPK_CALLBACK_ARGUMENTS * PLPK_CALLBACK_ARGUMENTS
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ User32CallOBMFromKernel()

NTSTATUS WINAPI User32CallOBMFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 634 of file dllmain.c.

635 {
636  BITMAP bmp;
637  PSETOBM_CALLBACK_ARGUMENTS Common = Arguments;
638 
640  Common->oembmi[OBI_CLOSE].cx = bmp.bmWidth;
641  Common->oembmi[OBI_CLOSE].cy = bmp.bmHeight;
642 
644  Common->oembmi[OBI_MNARROW].cx = bmp.bmWidth;
645  Common->oembmi[OBI_MNARROW].cy = bmp.bmHeight;
646 
648  Common->oembmi[OBI_DNARROW].cx = bmp.bmWidth;
649  Common->oembmi[OBI_DNARROW].cy = bmp.bmHeight;
650 
652  Common->oembmi[OBI_DNARROWI].cx = bmp.bmWidth;
653  Common->oembmi[OBI_DNARROWI].cy = bmp.bmHeight;
654 
656  Common->oembmi[OBI_UPARROW].cx = bmp.bmWidth;
657  Common->oembmi[OBI_UPARROW].cy = bmp.bmHeight;
658 
660  Common->oembmi[OBI_UPARROWI].cx = bmp.bmWidth;
661  Common->oembmi[OBI_UPARROWI].cy = bmp.bmHeight;
662 
663  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
664 }
#define OBM_DNARROW
Definition: winuser.h:1120
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define OBM_CLOSE
Definition: winuser.h:1122
BITMAP bmp
Definition: alphablend.c:62
#define OBM_UPARROWI
Definition: winuser.h:1105
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define OBM_MNARROW
Definition: winuser.h:1107
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
Definition: bl.h:1330
#define OBM_DNARROWI
Definition: winuser.h:1104
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define STATUS_SUCCESS
Definition: shellext.h:65
struct tagOEMBITMAPINFO oembmi[93]
Definition: callback.h:158
#define OBM_UPARROW
Definition: winuser.h:1121

◆ User32CallSendAsyncProcForKernel()

NTSTATUS WINAPI User32CallSendAsyncProcForKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 24 of file window.c.

25 {
27 
28  TRACE("User32CallSendAsyncProcKernel()\n");
29 
30  CallbackArgs = (PSENDASYNCPROC_CALLBACK_ARGUMENTS)Arguments;
31 
32  if (ArgumentLength != sizeof(SENDASYNCPROC_CALLBACK_ARGUMENTS))
33  {
35  }
36 
37  CallbackArgs->Callback(CallbackArgs->Wnd,
38  CallbackArgs->Msg,
39  CallbackArgs->Context,
40  CallbackArgs->Result);
41  return(STATUS_SUCCESS);
42 }
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_SUCCESS
Definition: shellext.h:65
struct _SENDASYNCPROC_CALLBACK_ARGUMENTS * PSENDASYNCPROC_CALLBACK_ARGUMENTS

◆ User32CallSetWndIconsFromKernel()

NTSTATUS WINAPI User32CallSetWndIconsFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 605 of file dllmain.c.

606 {
607  PSETWNDICONS_CALLBACK_ARGUMENTS Common = Arguments;
608 
609  if (!gpsi->hIconSmWindows)
610  {
612  Common->hIconHand = LoadImageW(0, IDI_HAND, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
618  hIconWindows = Common->hIconWindows;
619  hIconSmWindows = Common->hIconSmWindows;
620  }
621  ERR("hIconSmWindows %p hIconWindows %p \n",hIconSmWindows,hIconWindows);
622  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
623 }
#define IMAGE_ICON
Definition: winuser.h:212
#define SM_CYSMICON
Definition: winuser.h:1007
#define IDI_APPLICATION
Definition: winuser.h:699
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define IDI_EXCLAMATION
Definition: winuser.h:702
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
HICON hIconWindows
Definition: dllmain.c:37
#define LR_DEFAULTSIZE
Definition: winuser.h:1088
#define IDI_WINLOGO
Definition: winuser.h:704
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1006
#define ERR(fmt,...)
Definition: debug.h:110
#define IDI_QUESTION
Definition: winuser.h:701
#define STATUS_SUCCESS
Definition: shellext.h:65
HICON hIconSmWindows
Definition: dllmain.c:37
#define IDI_ASTERISK
Definition: winuser.h:703
#define IDI_HAND
Definition: winuser.h:700
PSERVERINFO gpsi
Definition: dllmain.c:31

◆ User32CallUMPDFromKernel()

NTSTATUS WINAPI User32CallUMPDFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 687 of file dllmain.c.

688 {
690  INT cbSize = 0;
692  PUMPDPKTHEAD pkt, pktOut = NULL;
693 
694  pkt = (PUMPDPKTHEAD)Arguments;
695 
696  if ( pkt->RetSize <= sizeof(Buffer) )
697  {
698  pktOut = (PUMPDPKTHEAD)Buffer;
699 
700  if ( (GdiPrinterThunk( pkt, pktOut, pkt->RetSize ) == GDI_ERROR) )
701  {
702  pktOut = NULL;
704  }
705  else
706  {
707  cbSize = pkt->RetSize;
708  }
709  }
710  else
711  {
713  }
714  return ZwCallbackReturn( pktOut, cbSize, Status );
715 }
#define MAX_USER_MODE_DRV_BUFFER
Definition: dllmain.c:5
INT RetSize
Definition: dllmain.c:14
LONG NTSTATUS
Definition: precomp.h:26
int32_t INT
Definition: typedefs.h:58
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
Definition: bufpool.h:45
INT WINAPI GdiPrinterThunk(PUMPDPKTHEAD, PVOID, INT)
Status
Definition: gdiplustypes.h:24
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define NULL
Definition: types.h:112
#define STATUS_SUCCESS
Definition: shellext.h:65
#define GDI_ERROR
Definition: wingdi.h:1309
struct _UMPDPKTHEAD * PUMPDPKTHEAD

◆ User32CallWindowProcFromKernel()

NTSTATUS WINAPI User32CallWindowProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 2937 of file message.c.

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

◆ User32DeliverUserAPC()

NTSTATUS WINAPI User32DeliverUserAPC ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 627 of file dllmain.c.

628 {
629  return ZwCallbackReturn(0, 0, STATUS_SUCCESS);
630 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define STATUS_SUCCESS
Definition: shellext.h:65

◆ User32LoadSysMenuTemplateForKernel()

NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 655 of file menu.c.

656 {
657  LRESULT Result = 0;
658 
659  // Use this for Menu Ole!!
660 
661  return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
662 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
_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 STATUS_SUCCESS
Definition: shellext.h:65
LONG_PTR LRESULT
Definition: windef.h:209

◆ User32SetupDefaultCursors()

NTSTATUS WINAPI User32SetupDefaultCursors ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 48 of file cursoricon.c.

50 {
51  BOOL *DefaultCursor = (BOOL*)Arguments;
52  HCURSOR hCursor;
53 
54  /* Load system cursors first */
56 
57  if(*DefaultCursor)
58  {
59  /* set default cursor */
60  hCursor = LoadCursorW(0, IDC_ARROW);
61  SetCursor(hCursor);
62  }
63  else
64  {
65  /* FIXME load system cursor scheme */
66  SetCursor(0);
67  hCursor = LoadCursorW(0, IDC_ARROW);
68  SetCursor(hCursor);
69  }
70 
71  return(ZwCallbackReturn(&hCursor, sizeof(HCURSOR), STATUS_SUCCESS));
72 }
HICON HCURSOR
Definition: windef.h:299
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpCursorName)
Definition: cursoricon.c:2074
VOID LoadSystemCursors(VOID)
Definition: cursoricon.c:21
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define IDC_ARROW
Definition: winuser.h:682
#define STATUS_SUCCESS
Definition: shellext.h:65