ReactOS  0.4.15-dev-425-gc40b086
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
 

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

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

◆ CWP_Struct

◆ CWPR_Struct

◆ 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

◆ PCWP_Struct

◆ PCWPR_Struct

◆ 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:55
UNICODE_STRING strInitFuncName
Definition: callback.h:123
uint32_t ULONG_PTR
Definition: typedefs.h:64
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:122
return STATUS_SUCCESS
Definition: btrfs.c:3014

◆ 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:3014

◆ 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:3014

◆ 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:110
BOOL unpack_dde_message(HWND hwnd, UINT message, LPARAM *lparam, PVOID buffer, int size)
Definition: dde.c:159
return STATUS_SUCCESS
Definition: btrfs.c:3014

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

◆ User32CallEventProcFromKernel()

NTSTATUS WINAPI User32CallEventProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 795 of file hook.c.

796 {
798  WINEVENTPROC Proc;
800  DWORD len;
801  HMODULE mod = NULL;
802  BOOL Loaded = FALSE;
803 
804  Common = (PEVENTPROC_CALLBACK_ARGUMENTS) Arguments;
805 
806  Proc = Common->Proc;
807 
808  if (Common->offPfn && Common->Mod)
809  { // Validate the module again.
810  if (!(len = GetModuleFileNameW((HINSTANCE)Common->Mod, module, MAX_PATH)) || len >= MAX_PATH)
811  {
812  ERR("Error check for module!\n");
813  Common->Mod = 0;
814  }
815 
816  if (Common->Mod && !(mod = GetModuleHandleW(module)))
817  {
818  TRACE("Reloading Event Module.\n");
820  {
821  ERR("Failed to load Event Module.\n");
822  }
823  else
824  {
825  Loaded = TRUE; // Free it only when loaded.
826  }
827  }
828 
829  if (mod)
830  {
831  TRACE("Loading Event Module. %S\n",module);
832  Proc = (WINEVENTPROC)((char *)mod + Common->offPfn);
833  }
834  }
835 
836  Proc(Common->hook,
837  Common->event,
838  Common->hwnd,
839  Common->idObject,
840  Common->idChild,
841  Common->dwEventThread,
842  Common->dwmsEventTime);
843 
844  if (Loaded) FreeLibrary(mod);
845 
847 }
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: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:414
__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:110
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
return STATUS_SUCCESS
Definition: btrfs.c:3014
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:64
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
CHARSETINFO Cs
Definition: callback.h:131
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:3014

◆ 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 msg %d\n",Common->Code,Common->wParam,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(CWPSTRUCT));
735  if ( Common->lParamSize )
736  {
737  pCWPR->lParam = (LPARAM)((PCHAR)pCWPR + sizeof(CWPRETSTRUCT));
738  RtlCopyMemory( (PCHAR)pCWPR + sizeof(CWPRETSTRUCT), &pcwprs->Extra, Common->lParamSize );
739  }
740  Result = Proc(Common->Code, Common->wParam, (LPARAM) pCWPR);
741  HeapFree(GetProcessHeap(), 0, pCWPR);
742  }
743  break;
744  case WH_MSGFILTER: /* All SEH support */
745  case WH_SYSMSGFILTER:
746  case WH_GETMESSAGE:
747  pMsg = (PMSG)((PCHAR) Common + Common->lParam);
748  pcMsg = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(MSG));
749  RtlCopyMemory(pcMsg, pMsg, sizeof(MSG));
750 // ERR("pMsg %d pcMsg %d\n",pMsg->message, pcMsg->message);
751  _SEH2_TRY
752  {
753  Result = Proc(Common->Code, Common->wParam, (LPARAM) pcMsg);
754  }
756  {
757  Hit = TRUE;
758  }
759  _SEH2_END;
760  if (!Hit && Common->HookId == WH_GETMESSAGE)
761  RtlCopyMemory(pMsg, pcMsg, sizeof(MSG));
762  HeapFree( GetProcessHeap(), 0, pcMsg );
763  break;
764  case WH_KEYBOARD:
765  case WH_SHELL:
766  Result = Proc(Common->Code, Common->wParam, Common->lParam);
767  break;
768  case WH_FOREGROUNDIDLE: /* <-- SEH support */
769  _SEH2_TRY
770  {
771  Result = Proc(Common->Code, Common->wParam, Common->lParam);
772  }
774  {
775  Hit = TRUE;
776  }
777  _SEH2_END;
778  break;
779  default:
780  if (Loaded) FreeLibrary(mod);
781  ERR("WH_ not supported = %d\n", Common->HookId);
783  }
784  if (Hit)
785  {
786  ERR("Hook Exception! Id: %d, Code %d, Proc 0x%x\n",Common->HookId,Common->Code,Proc);
788  }
789  if (Loaded) FreeLibrary(mod);
790  Common->Result = Result;
791  return ZwCallbackReturn(Arguments, ArgumentLength, Status);
792 }
#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:2950
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:79
LPARAM lParam
Definition: winuser.h:2993
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:339
WPARAM wParam
Definition: combotst.c:138
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2874
Definition: fs_rec.h:186
_SEH2_TRY
Definition: create.c:4226
#define HCBT_KEYSKIPPED
Definition: winuser.h:62
HWND hwndInsertAfter
Definition: winuser.h:2951
#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
PBYTE Extra[4]
Definition: callback.h:80
#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
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:86
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:414
#define GetProcessHeap()
Definition: compat.h:404
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define WH_KEYBOARD_LL
Definition: winuser.h:43
LPARAM lParam
Definition: winuser.h:3000
PBYTE Extra[4]
Definition: callback.h:87
#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
Status
Definition: gdiplustypes.h:24
#define HCBT_MINMAX
Definition: winuser.h:56
#define ERR(fmt,...)
Definition: debug.h:110
_SEH2_END
Definition: create.c:4400
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:838
#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:3014
#define WH_SYSMSGFILTER
Definition: winuser.h:36
LPARAM lParam
Definition: combotst.c:139
struct tagKBDLLHOOKSTRUCT * PKBDLLHOOKSTRUCT
#define HeapFree(x, y, z)
Definition: compat.h:403
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:3014

◆ 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:64
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:3014

◆ 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:3014
struct tagOEMBITMAPINFO oembmi[93]
Definition: callback.h:156
#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:3014
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:110
#define IDI_QUESTION
Definition: winuser.h:701
HICON hIconSmWindows
Definition: dllmain.c:38
return STATUS_SUCCESS
Definition: btrfs.c:3014
#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:57
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:3014
#define GDI_ERROR
Definition: wingdi.h:1308
struct _UMPDPKTHEAD * PUMPDPKTHEAD

◆ User32CallWindowProcFromKernel()

NTSTATUS WINAPI User32CallWindowProcFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 2927 of file message.c.

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

◆ 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:3014

◆ 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:3014

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