ReactOS  0.4.14-dev-57-g333b8f1
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  _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
 

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_MAXIMUM   (17)
 

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 _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
 

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)
 

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_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   (17)

Definition at line 22 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

◆ DDEPOSTGET_CALLBACK_ARGUMENTS

◆ EVENTPROC_CALLBACK_ARGUMENTS

◆ GET_CHARSET_INFO

◆ HOOKPROC_CALLBACK_ARGUMENTS

◆ HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS

◆ LOADMENU_CALLBACK_ARGUMENTS

◆ LPK_CALLBACK_ARGUMENTS

◆ PCALL_BACK_INFO

◆ PCLIENT_LOAD_LIBRARY_ARGUMENTS

◆ PCOPYIMAGE_CALLBACK_ARGUMENTS

◆ PDDEPOSTGET_CALLBACK_ARGUMENTS

◆ PEVENTPROC_CALLBACK_ARGUMENTS

◆ PGET_CHARSET_INFO

◆ PHOOKPROC_CALLBACK_ARGUMENTS

◆ PHOOKPROC_CBT_CREATEWND_EXTRA_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:54
UNICODE_STRING strInitFuncName
Definition: callback.h:108
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
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 ULONG_PTR
Definition: config.h:101
UNICODE_STRING strLibraryName
Definition: callback.h:107
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32CallClientThreadSetupFromKernel()

NTSTATUS WINAPI User32CallClientThreadSetupFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 578 of file dllmain.c.

579 {
580  TRACE("User32CallClientThreadSetupFromKernel -->\n");
581  // FIXME: Disabling this call is a HACK!! See also ClientThreadSetup...
582  // ClientThreadSetupHelper(TRUE);
583  TRACE("<-- User32CallClientThreadSetupFromKernel\n");
585 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ 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
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ 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
#define TRACE(s)
Definition: solgame.cpp:4
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
BOOL unpack_dde_message(HWND hwnd, UINT message, LPARAM *lparam, PVOID buffer, int size)
Definition: dde.c:159
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ 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
#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
Status
Definition: gdiplustypes.h:24
#define ERR(fmt,...)
Definition: debug.h:109
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32CallEventProcFromKernel()

NTSTATUS WINAPI User32CallEventProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 783 of file hook.c.

784 {
786  WINEVENTPROC Proc;
788  DWORD len;
789  HMODULE mod = NULL;
790  BOOL Loaded = FALSE;
791 
792  Common = (PEVENTPROC_CALLBACK_ARGUMENTS) Arguments;
793 
794  Proc = Common->Proc;
795 
796  if (Common->offPfn && Common->Mod)
797  { // Validate the module again.
798  if (!(len = GetModuleFileNameW((HINSTANCE)Common->Mod, module, MAX_PATH)) || len >= MAX_PATH)
799  {
800  ERR("Error check for module!\n");
801  Common->Mod = 0;
802  }
803 
804  if (Common->Mod && !(mod = GetModuleHandleW(module)))
805  {
806  TRACE("Reloading Event Module.\n");
808  {
809  ERR("Failed to load Event Module.\n");
810  }
811  else
812  {
813  Loaded = TRUE; // Free it only when loaded.
814  }
815  }
816 
817  if (mod)
818  {
819  TRACE("Loading Event Module. %S\n",module);
820  Proc = (WINEVENTPROC)((char *)mod + Common->offPfn);
821  }
822  }
823 
824  Proc(Common->hook,
825  Common->event,
826  Common->hwnd,
827  Common->idObject,
828  Common->idChild,
829  Common->dwEventThread,
830  Common->dwmsEventTime);
831 
832  if (Loaded) FreeLibrary(mod);
833 
835 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:609
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:339
Definition: fs_rec.h:186
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
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:405
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:109
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
return STATUS_SUCCESS
Definition: btrfs.c:2966
static int mod
Definition: i386-dis.c:1273

◆ User32CallGetCharsetInfo()

NTSTATUS WINAPI User32CallGetCharsetInfo ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 589 of file dllmain.c.

590 {
591  BOOL Ret;
592  PGET_CHARSET_INFO pgci = (PGET_CHARSET_INFO)Arguments;
593 
594  TRACE("GetCharsetInfo\n");
595 
596  Ret = TranslateCharsetInfo((DWORD *)(ULONG_PTR)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE);
597 
598  return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
599 }
#define TCI_SRCLOCALE
Definition: wingdi.h:963
uint32_t ULONG_PTR
Definition: typedefs.h:63
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
CHARSETINFO Cs
Definition: callback.h:116
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
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32CallHookProcFromKernel()

NTSTATUS WINAPI User32CallHookProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 554 of file hook.c.

555 {
557  CREATESTRUCTW Csw;
558  CBT_CREATEWNDW CbtCreatewndw;
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  RtlCopyMemory(&Csw, &CbtCreatewndExtra->Cs, sizeof(CREATESTRUCTW));
612  CbtCreatewndw.lpcs = &Csw;
613  CbtCreatewndw.hwndInsertAfter = CbtCreatewndExtra->WndInsertAfter;
614  wParam = Common->wParam;
615  lParam = (LPARAM) &CbtCreatewndw;
616  //ERR("HCBT_CREATEWND: hWnd 0x%x Name 0x%x Class 0x%x\n", Common->wParam, Csw.lpszName, Csw.lpszClass);
617  break;
618  case HCBT_CLICKSKIPPED:
619  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
620  lParam = (LPARAM) pMHook;
621  wParam = Common->wParam;
622  break;
623  case HCBT_MOVESIZE:
624  prl = (PRECTL)((PCHAR) Common + Common->lParam);
625  lParam = (LPARAM) prl;
626  wParam = Common->wParam;
627  break;
628  case HCBT_ACTIVATE:
629  //ERR("HCBT_ACTIVATE: hwnd %p\n",Common->wParam);
630  pcbtas = (LPCBTACTIVATESTRUCT)((PCHAR) Common + Common->lParam);
631  lParam = (LPARAM) pcbtas;
632  wParam = Common->wParam;
633  break;
634  case HCBT_KEYSKIPPED: /* The rest SEH support */
635  case HCBT_MINMAX:
636  case HCBT_SETFOCUS:
637  case HCBT_SYSCOMMAND:
638  case HCBT_DESTROYWND:
639  case HCBT_QS:
640  wParam = Common->wParam;
641  lParam = Common->lParam;
642  break;
643  default:
644  if (Loaded) FreeLibrary(mod);
645  ERR("HCBT_ not supported = %d\n", Common->Code);
647  }
648 
649  if (Proc)
650  {
651  _SEH2_TRY
652  {
653  Result = Proc(Common->Code, wParam, lParam);
654  }
656  {
657  Hit = TRUE;
658  }
659  _SEH2_END;
660  }
661  else
662  {
663  ERR("Null Proc! Common = 0x%x, Proc = 0x%x\n",Common,Proc);
664  }
665  switch(Common->Code)
666  {
667  case HCBT_CREATEWND:
668  CbtCreatewndExtra->WndInsertAfter = CbtCreatewndw.hwndInsertAfter;
669  CbtCreatewndExtra->Cs.x = CbtCreatewndw.lpcs->x;
670  CbtCreatewndExtra->Cs.y = CbtCreatewndw.lpcs->y;
671  CbtCreatewndExtra->Cs.cx = CbtCreatewndw.lpcs->cx;
672  CbtCreatewndExtra->Cs.cy = CbtCreatewndw.lpcs->cy;
673  break;
674  }
675  break;
676  }
677  case WH_KEYBOARD_LL:
678  //ERR("WH_KEYBOARD_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
679  pKeyboardLlData = (PKBDLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
680  RtlCopyMemory(&KeyboardLlData, pKeyboardLlData, sizeof(KBDLLHOOKSTRUCT));
681  Result = Proc(Common->Code, Common->wParam, (LPARAM) &KeyboardLlData);
682  break;
683  case WH_MOUSE_LL:
684  //ERR("WH_MOUSE_LL: Code %d, wParam %d\n",Common->Code,Common->wParam);
685  pMouseLlData = (PMSLLHOOKSTRUCT)((PCHAR) Common + Common->lParam);
686  RtlCopyMemory(&MouseLlData, pMouseLlData, sizeof(MSLLHOOKSTRUCT));
687  Result = Proc(Common->Code, Common->wParam, (LPARAM) &MouseLlData);
688  break;
689  case WH_MOUSE: /* SEH support */
690  pMHook = (PMOUSEHOOKSTRUCT)((PCHAR) Common + Common->lParam);
691  _SEH2_TRY
692  {
693  Result = Proc(Common->Code, Common->wParam, (LPARAM) pMHook);
694  }
696  {
697  Hit = TRUE;
698  }
699  _SEH2_END;
700  break;
701  case WH_CALLWNDPROC:
702 // ERR("WH_CALLWNDPROC: Code %d, wParam %d\n",Common->Code,Common->wParam);
703  pCWP = HeapAlloc(GetProcessHeap(), 0, ArgumentLength - sizeof(HOOKPROC_CALLBACK_ARGUMENTS));
704  RtlCopyMemory(pCWP, (PCHAR) Common + Common->lParam, sizeof(CWPSTRUCT));
705  /* If more memory is reserved, then lParam is a pointer.
706  * Size of the buffer is stocked in the lParam member, and its content
707  * is at the end of the argument buffer */
708  if(ArgumentLength > (sizeof(CWPSTRUCT) + sizeof(HOOKPROC_CALLBACK_ARGUMENTS)))
709  {
710  RtlCopyMemory((PCHAR)pCWP + sizeof(CWPSTRUCT),
711  (PCHAR)Common + Common->lParam + sizeof(CWPSTRUCT),
712  pCWP->lParam);
713  pCWP->lParam = (LPARAM)((PCHAR)pCWP + sizeof(CWPSTRUCT));
714  }
715  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWP);
716  HeapFree(GetProcessHeap(), 0, pCWP);
717  break;
718  case WH_CALLWNDPROCRET:
719  /* Almost the same as WH_CALLWNDPROC */
720  pCWPR = HeapAlloc(GetProcessHeap(), 0, ArgumentLength - sizeof(HOOKPROC_CALLBACK_ARGUMENTS));
721  RtlCopyMemory(pCWPR, (PCHAR) Common + Common->lParam, sizeof(CWPRETSTRUCT));
722  if(ArgumentLength > (sizeof(CWPRETSTRUCT) + sizeof(HOOKPROC_CALLBACK_ARGUMENTS)))
723  {
724  RtlCopyMemory((PCHAR)pCWPR + sizeof(CWPRETSTRUCT),
725  (PCHAR)Common + Common->lParam + sizeof(CWPRETSTRUCT),
726  pCWPR->lParam);
727  pCWPR->lParam = (LPARAM)((PCHAR)pCWPR + sizeof(CWPRETSTRUCT));
728  }
729  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWPR);
730  HeapFree(GetProcessHeap(), 0, pCWPR);
731  break;
732  case WH_MSGFILTER: /* All SEH support */
733  case WH_SYSMSGFILTER:
734  case WH_GETMESSAGE:
735  pMsg = (PMSG)((PCHAR) Common + Common->lParam);
736  pcMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSG));
737  RtlCopyMemory(pcMsg, pMsg, sizeof(MSG));
738 // ERR("pMsg %d pcMsg %d\n",pMsg->message, pcMsg->message);
739  _SEH2_TRY
740  {
741  Result = Proc(Common->Code, Common->wParam, (LPARAM) pcMsg);
742  }
744  {
745  Hit = TRUE;
746  }
747  _SEH2_END;
748  if (!Hit && Common->HookId == WH_GETMESSAGE)
749  RtlCopyMemory(pMsg, pcMsg, sizeof(MSG));
750  HeapFree( GetProcessHeap(), 0, pcMsg );
751  break;
752  case WH_KEYBOARD:
753  case WH_SHELL:
754  Result = Proc(Common->Code, Common->wParam, Common->lParam);
755  break;
756  case WH_FOREGROUNDIDLE: /* <-- SEH support */
757  _SEH2_TRY
758  {
759  Result = Proc(Common->Code, Common->wParam, Common->lParam);
760  }
762  {
763  Hit = TRUE;
764  }
765  _SEH2_END;
766  break;
767  default:
768  if (Loaded) FreeLibrary(mod);
769  ERR("WH_ not supported = %d\n", Common->HookId);
771  }
772  if (Hit)
773  {
774  ERR("Hook Exception! Id: %d, Code %d, Proc 0x%x\n",Common->HookId,Common->Code,Proc);
776  }
777  if (Loaded) FreeLibrary(mod);
778  Common->Result = Result;
779  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
780 }
#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
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define WH_GETMESSAGE
Definition: winuser.h:33
#define HCBT_CREATEWND
Definition: winuser.h:58
struct RECTL * PRECTL
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
LPCREATESTRUCTW lpcs
Definition: winuser.h:2949
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
LPARAM lParam
Definition: winuser.h:2992
UINT_PTR WPARAM
Definition: windef.h:207
#define HCBT_SETFOCUS
Definition: winuser.h:64
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:339
WPARAM wParam
Definition: combotst.c:138
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2873
Definition: fs_rec.h:186
_SEH2_TRY
Definition: create.c:4250
#define HCBT_KEYSKIPPED
Definition: winuser.h:62
HWND hwndInsertAfter
Definition: winuser.h:2950
#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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define HCBT_DESTROYWND
Definition: winuser.h:59
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
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
LONG_PTR LPARAM
Definition: windef.h:208
#define WH_CBT
Definition: winuser.h:35
struct tagMOUSEHOOKSTRUCT * PMOUSEHOOKSTRUCT
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:405
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WH_KEYBOARD_LL
Definition: winuser.h:43
LPARAM lParam
Definition: winuser.h:2999
#define HCBT_QS
Definition: winuser.h:57
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define WH_CALLWNDPROC
Definition: winuser.h:34
struct tagCBTACTIVATESTRUCT * LPCBTACTIVATESTRUCT
Status
Definition: gdiplustypes.h:24
#define HCBT_MINMAX
Definition: winuser.h:56
#define ERR(fmt,...)
Definition: debug.h:109
_SEH2_END
Definition: create.c:4424
struct tagMSG * PMSG
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define WH_KEYBOARD
Definition: winuser.h:32
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:409
struct tagMSLLHOOKSTRUCT * PMSLLHOOKSTRUCT
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:847
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
LONG_PTR LRESULT
Definition: windef.h:209
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define WH_SYSMSGFILTER
Definition: winuser.h:36
LPARAM lParam
Definition: combotst.c:139
struct tagKBDLLHOOKSTRUCT * PKBDLLHOOKSTRUCT
#define HeapFree(x, y, z)
Definition: compat.h:394
struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS * PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
static int mod
Definition: i386-dis.c:1273

◆ 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 ? MAKEINTRESOURCE(Common->InterSource) : (LPCWSTR)&Common->MenuName);
673 
674  return ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS);
675 }
#define MAKEINTRESOURCE
Definition: winuser.h:591
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
LONG_PTR LRESULT
Definition: windef.h:209
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32CallLPKFromKernel()

NTSTATUS WINAPI User32CallLPKFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 664 of file dllmain.c.

665 {
666  BOOL bResult;
667  PLPK_CALLBACK_ARGUMENTS Argument;
668 
669  Argument = (PLPK_CALLBACK_ARGUMENTS)Arguments;
670 
671  Argument->lpString = (LPWSTR)((ULONG_PTR)Argument->lpString + (ULONG_PTR)Argument);
672 
673  bResult = ExtTextOutW(Argument->hdc,
674  Argument->x,
675  Argument->y,
676  Argument->flags,
677  (Argument->bRect) ? &Argument->rect : NULL,
678  Argument->lpString,
679  Argument->count,
680  NULL);
681 
682  return ZwCallbackReturn(&bResult, sizeof(BOOL), STATUS_SUCCESS);
683 }
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:63
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
unsigned int BOOL
Definition: ntddk_ex.h:94
smooth NULL
Definition: ftsmooth.c:416
#define ULONG_PTR
Definition: config.h:101
struct _LPK_CALLBACK_ARGUMENTS * PLPK_CALLBACK_ARGUMENTS
WCHAR * LPWSTR
Definition: xmlstorage.h:184
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32CallOBMFromKernel()

NTSTATUS WINAPI User32CallOBMFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 632 of file dllmain.c.

633 {
634  BITMAP bmp;
635  PSETOBM_CALLBACK_ARGUMENTS Common = Arguments;
636 
638  Common->oembmi[OBI_CLOSE].cx = bmp.bmWidth;
639  Common->oembmi[OBI_CLOSE].cy = bmp.bmHeight;
640 
642  Common->oembmi[OBI_MNARROW].cx = bmp.bmWidth;
643  Common->oembmi[OBI_MNARROW].cy = bmp.bmHeight;
644 
646  Common->oembmi[OBI_DNARROW].cx = bmp.bmWidth;
647  Common->oembmi[OBI_DNARROW].cy = bmp.bmHeight;
648 
650  Common->oembmi[OBI_DNARROWI].cx = bmp.bmWidth;
651  Common->oembmi[OBI_DNARROWI].cy = bmp.bmHeight;
652 
654  Common->oembmi[OBI_UPARROW].cx = bmp.bmWidth;
655  Common->oembmi[OBI_UPARROW].cy = bmp.bmHeight;
656 
658  Common->oembmi[OBI_UPARROWI].cx = bmp.bmWidth;
659  Common->oembmi[OBI_UPARROWI].cy = bmp.bmHeight;
660 
661  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
662 }
#define OBM_DNARROW
Definition: winuser.h:1116
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define OBM_CLOSE
Definition: winuser.h:1118
BITMAP bmp
Definition: alphablend.c:62
#define OBM_UPARROWI
Definition: winuser.h:1101
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
#define OBM_MNARROW
Definition: winuser.h:1103
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2132
Definition: bl.h:1331
#define OBM_DNARROWI
Definition: winuser.h:1100
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
return STATUS_SUCCESS
Definition: btrfs.c:2966
struct tagOEMBITMAPINFO oembmi[93]
Definition: callback.h:141
#define OBM_UPARROW
Definition: winuser.h:1117

◆ 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
return STATUS_SUCCESS
Definition: btrfs.c:2966
struct _SENDASYNCPROC_CALLBACK_ARGUMENTS * PSENDASYNCPROC_CALLBACK_ARGUMENTS

◆ User32CallSetWndIconsFromKernel()

NTSTATUS WINAPI User32CallSetWndIconsFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 603 of file dllmain.c.

604 {
605  PSETWNDICONS_CALLBACK_ARGUMENTS Common = Arguments;
606 
607  if (!gpsi->hIconSmWindows)
608  {
610  Common->hIconHand = LoadImageW(0, IDI_HAND, IMAGE_ICON, 0, 0, LR_DEFAULTSIZE);
616  hIconWindows = Common->hIconWindows;
617  hIconSmWindows = Common->hIconSmWindows;
618  }
619  ERR("hIconSmWindows %p hIconWindows %p \n",hIconSmWindows,hIconWindows);
620  return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
621 }
#define IMAGE_ICON
Definition: winuser.h:212
#define SM_CYSMICON
Definition: winuser.h:1003
#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:38
#define LR_DEFAULTSIZE
Definition: winuser.h:1084
#define IDI_WINLOGO
Definition: winuser.h:704
int WINAPI GetSystemMetrics(_In_ int)
#define SM_CXSMICON
Definition: winuser.h:1002
#define ERR(fmt,...)
Definition: debug.h:109
#define IDI_QUESTION
Definition: winuser.h:701
HICON hIconSmWindows
Definition: dllmain.c:38
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define IDI_ASTERISK
Definition: winuser.h:703
#define IDI_HAND
Definition: winuser.h:700
PSERVERINFO gpsi
Definition: dllmain.c:32

◆ User32CallUMPDFromKernel()

NTSTATUS WINAPI User32CallUMPDFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 685 of file dllmain.c.

686 {
688  INT cbSize = 0;
690  PUMPDPKTHEAD pkt, pktOut = NULL;
691 
692  pkt = (PUMPDPKTHEAD)Arguments;
693 
694  if ( pkt->RetSize <= sizeof(Buffer) )
695  {
696  pktOut = (PUMPDPKTHEAD)Buffer;
697 
698  if ( (GdiPrinterThunk( pkt, pktOut, pkt->RetSize ) == GDI_ERROR) )
699  {
700  pktOut = NULL;
702  }
703  else
704  {
705  cbSize = pkt->RetSize;
706  }
707  }
708  else
709  {
711  }
712  return ZwCallbackReturn( pktOut, cbSize, Status );
713 }
#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:56
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
INT WINAPI GdiPrinterThunk(PUMPDPKTHEAD, PVOID, INT)
unsigned long DWORD
Definition: ntddk_ex.h:95
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
Status
Definition: gdiplustypes.h:24
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
return STATUS_SUCCESS
Definition: btrfs.c:2966
#define GDI_ERROR
Definition: wingdi.h:1308
struct _UMPDPKTHEAD * PUMPDPKTHEAD

◆ User32CallWindowProcFromKernel()

NTSTATUS WINAPI User32CallWindowProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 2926 of file message.c.

2927 {
2928  PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs;
2929  MSG KMMsg, UMMsg;
2930  PWND pWnd = NULL;
2932 
2933  /* Make sure we don't try to access mem beyond what we were given */
2934  if (ArgumentLength < sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2935  {
2937  }
2938 
2939  CallbackArgs = (PWINDOWPROC_CALLBACK_ARGUMENTS) Arguments;
2940  KMMsg.hwnd = CallbackArgs->Wnd;
2941  KMMsg.message = CallbackArgs->Msg;
2942  KMMsg.wParam = CallbackArgs->wParam;
2943  KMMsg.time = 0;
2944  KMMsg.pt.x = 0;
2945  KMMsg.pt.y = 0;
2946  /* Check if lParam is really a pointer and adjust it if it is */
2947  if (0 <= CallbackArgs->lParamBufferSize)
2948  {
2949  if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS)
2950  + CallbackArgs->lParamBufferSize)
2951  {
2953  }
2954  KMMsg.lParam = (LPARAM) ((char *) CallbackArgs + sizeof(WINDOWPROC_CALLBACK_ARGUMENTS));
2955  switch(KMMsg.message)
2956  {
2957  case WM_CREATE:
2958  {
2959  TRACE("WM_CREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2960  break;
2961  }
2962  case WM_NCCREATE:
2963  {
2964  TRACE("WM_NCCREATE CB %p lParam %p\n",CallbackArgs, KMMsg.lParam);
2965  break;
2966  }
2967  case WM_SYSTIMER:
2968  {
2969  TRACE("WM_SYSTIMER %p\n",KMMsg.hwnd);
2970  break;
2971  }
2972  case WM_SIZING:
2973  {
2974  PRECT prect = (PRECT) KMMsg.lParam;
2975  TRACE("WM_SIZING 1 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
2976  break;
2977  }
2978  default:
2979  break;
2980  }
2981  }
2982  else
2983  {
2984  if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
2985  {
2987  }
2988  KMMsg.lParam = CallbackArgs->lParam;
2989  }
2990 
2991  if (WM_NCCALCSIZE == CallbackArgs->Msg && CallbackArgs->wParam)
2992  {
2993  NCCALCSIZE_PARAMS *Params = (NCCALCSIZE_PARAMS *) KMMsg.lParam;
2994  Params->lppos = (PWINDOWPOS) (Params + 1);
2995  }
2996 
2997  if (! MsgiKMToUMMessage(&KMMsg, &UMMsg))
2998  {
2999  }
3000 
3001  if (pci->CallbackWnd.hWnd == UMMsg.hwnd)
3002  pWnd = pci->CallbackWnd.pWnd;
3003 
3004  CallbackArgs->Result = IntCallWindowProcW( CallbackArgs->IsAnsiProc,
3005  CallbackArgs->Proc,
3006  pWnd,
3007  UMMsg.hwnd,
3008  UMMsg.message,
3009  UMMsg.wParam,
3010  UMMsg.lParam);
3011 
3012  if (! MsgiKMToUMReply(&KMMsg, &UMMsg, &CallbackArgs->Result))
3013  {
3014  }
3015 
3016  if (0 <= CallbackArgs->lParamBufferSize)
3017  {
3018  switch(KMMsg.message)
3019  {
3020  case WM_SIZING:
3021  {
3022  PRECT prect = (PRECT) KMMsg.lParam;
3023  TRACE("WM_SIZING 2 t %d l %d r %d b %d\n",prect->top,prect->left,prect->right,prect->bottom);
3024  break;
3025  }
3026  default:
3027  break;
3028  }
3029  }
3030  return ZwCallbackReturn(CallbackArgs, ArgumentLength, STATUS_SUCCESS);
3031 }
CALLBACKWND CallbackWnd
Definition: ntuser.h:297
#define STATUS_INFO_LENGTH_MISMATCH
Definition: udferr_usr.h:133
struct _WINDOWPROC_CALLBACK_ARGUMENTS * PWINDOWPROC_CALLBACK_ARGUMENTS
#define WM_SYSTIMER
Definition: comctl32.h:111
#define WM_NCCALCSIZE
Definition: winuser.h:1667
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LONG top
Definition: windef.h:292
#define GetWin32ClientInfo()
Definition: ntuser.h:320
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
#define WM_NCCREATE
Definition: winuser.h:1665
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:1424
static BOOL FASTCALL MsgiKMToUMReply(PMSG KMMsg, PMSG UMMsg, LRESULT *Result)
Definition: message.c:505
#define WM_SIZING
Definition: winuser.h:1789
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
PWINDOWPOS lppos
Definition: winuser.h:3573
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:431
HWND hWnd
Definition: ntuser.h:272
Definition: ntuser.h:657
struct _WND * pWnd
Definition: ntuser.h:273
#define WM_CREATE
Definition: winuser.h:1590
LONG bottom
Definition: windef.h:294
struct tagRECT * PRECT
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ User32DeliverUserAPC()

NTSTATUS WINAPI User32DeliverUserAPC ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 625 of file dllmain.c.

626 {
627  return ZwCallbackReturn(0, 0, STATUS_SUCCESS);
628 }
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ 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
LONG_PTR LRESULT
Definition: windef.h:209
return STATUS_SUCCESS
Definition: btrfs.c:2966

◆ 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:284
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
return STATUS_SUCCESS
Definition: btrfs.c:2966