ReactOS 0.4.15-dev-7958-gcd0bb1a
callback.h File Reference
#include "u32cb.h"
Include dependency graph for callback.h:
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 DEFINE_USER32_CALLBACK(id, value, fn)   id,
 

Typedefs

typedef enum _USER32_CALLBACK USER32_CALLBACK
 
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
 

Enumerations

enum  _USER32_CALLBACK { USER32_CALLBACK_COUNT }
 

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

◆ DEFINE_USER32_CALLBACK

#define DEFINE_USER32_CALLBACK (   id,
  value,
  fn 
)    id,

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

◆ USER32_CALLBACK

◆ WINDOWPROC_CALLBACK_ARGUMENTS

Enumeration Type Documentation

◆ _USER32_CALLBACK

Enumerator
USER32_CALLBACK_COUNT 

Definition at line 13 of file callback.h.

14{
15#include "u32cb.h"
enum _USER32_CALLBACK USER32_CALLBACK
@ USER32_CALLBACK_COUNT
Definition: callback.h:16

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}
#define NULL
Definition: types.h:112
#define ULONG_PTR
Definition: config.h:101
unsigned int BOOL
Definition: ntddk_ex.h:94
NTSYSAPI NTSTATUS NTAPI ZwCallbackReturn(_In_ PVOID Result, _In_ ULONG ResultLength, _In_ NTSTATUS Status)
#define STATUS_SUCCESS
Definition: shellext.h:65
UNICODE_STRING strLibraryName
Definition: callback.h:119
UNICODE_STRING strInitFuncName
Definition: callback.h:120
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint16_t * PWCHAR
Definition: typedefs.h:56
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

◆ User32CallClientThreadSetupFromKernel()

NTSTATUS WINAPI User32CallClientThreadSetupFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 566 of file dllmain.c.

567{
568 TRACE("User32CallClientThreadSetupFromKernel -->\n");
569 // FIXME: Disabling this call is a HACK!! See also ClientThreadSetup...
570 // ClientThreadSetupHelper(TRUE);
571 TRACE("<-- User32CallClientThreadSetupFromKernel\n");
573}
#define TRACE(s)
Definition: solgame.cpp:4

◆ User32CallCopyImageFromKernel()

NTSTATUS WINAPI User32CallCopyImageFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 1969 of file cursoricon.c.

1970{
1972 HANDLE Result;
1973 Common = (PCOPYIMAGE_CALLBACK_ARGUMENTS) Arguments;
1974
1975 Result = CopyImage(Common->hImage,
1976 Common->uType,
1977 Common->cxDesired,
1978 Common->cyDesired,
1979 Common->fuFlags);
1980
1981 return ZwCallbackReturn(&Result, sizeof(HANDLE), STATUS_SUCCESS);
1982}
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:1987
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

◆ 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
#define ERR(fmt,...)
Definition: debug.h:110
Status
Definition: gdiplustypes.h:25
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
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}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * PVOID
Definition: typedefs.h:50
BOOL post_dde_message(struct packed_message *data, UINT message, LPARAM lParam, LPARAM *lp)
Definition: dde.c:53

◆ 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}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define FreeLibrary(x)
Definition: compat.h:748
#define MAX_PATH
Definition: compat.h:34
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
Definition: loader.c:838
unsigned long DWORD
Definition: ntddk_ex.h:95
@ Loaded
Definition: fs_rec.h:187
GLenum GLsizei len
Definition: glext.h:6722
static int mod
Definition: i386-dis.c:1288
struct _EVENTPROC_CALLBACK_ARGUMENTS * PEVENTPROC_CALLBACK_ARGUMENTS
VOID(CALLBACK * WINEVENTPROC)(HWINEVENTHOOK, DWORD, HWND, LONG, LONG, DWORD, DWORD)
Definition: winable.h:68
#define LOAD_WITH_ALTERED_SEARCH_PATH
Definition: winbase.h:344
__wchar_t WCHAR
Definition: xmlstorage.h:180

◆ User32CallGetCharsetInfo()

NTSTATUS WINAPI User32CallGetCharsetInfo ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 577 of file dllmain.c.

578{
579 BOOL Ret;
580 PGET_CHARSET_INFO pgci = (PGET_CHARSET_INFO)Arguments;
581
582 TRACE("GetCharsetInfo\n");
583
584 Ret = TranslateCharsetInfo((DWORD *)(ULONG_PTR)pgci->Locale, &pgci->Cs, TCI_SRCLOCALE);
585
586 return ZwCallbackReturn(Arguments, ArgumentLength, Ret ? STATUS_SUCCESS : STATUS_UNSUCCESSFUL);
587}
CHARSETINFO Cs
Definition: callback.h:128
struct _GET_CHARSET_INFO * PGET_CHARSET_INFO
#define TCI_SRCLOCALE
Definition: wingdi.h:964
BOOL WINAPI TranslateCharsetInfo(_Inout_ PDWORD, _Out_ LPCHARSETINFO, _In_ DWORD)

◆ 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;
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;
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 {
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);
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;
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);
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 */
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}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
struct RECTL * PRECTL
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34
LPCREATESTRUCTW lpcs
Definition: winuser.h:2975
HWND hwndInsertAfter
Definition: winuser.h:2976
LPARAM lParam
Definition: winuser.h:3018
CWPRETSTRUCT cwprs
Definition: callback.h:83
PBYTE Extra[4]
Definition: callback.h:84
LPARAM lParam
Definition: winuser.h:3025
PBYTE Extra[4]
Definition: callback.h:77
CWPSTRUCT cwps
Definition: callback.h:76
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
char * PCHAR
Definition: typedefs.h:51
struct tagCWPR_Struct * PCWPR_Struct
struct _HOOKPROC_CALLBACK_ARGUMENTS * PHOOKPROC_CALLBACK_ARGUMENTS
struct _HOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS * PHOOKPROC_CBT_CREATEWND_EXTRA_ARGUMENTS
struct tagCWP_Struct * PCWP_Struct
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
#define HCBT_MINMAX
Definition: winuser.h:56
#define WH_KEYBOARD
Definition: winuser.h:32
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2899
#define WH_CALLWNDPROCRET
Definition: winuser.h:42
#define HCBT_ACTIVATE
Definition: winuser.h:60
#define WH_MSGFILTER
Definition: winuser.h:29
struct tagMSG * PMSG
#define HCBT_DESTROYWND
Definition: winuser.h:59
struct tagCREATESTRUCTW CREATESTRUCTW
#define WH_SHELL
Definition: winuser.h:40
#define WH_CBT
Definition: winuser.h:35
struct tagCBTACTIVATESTRUCT * LPCBTACTIVATESTRUCT
#define HCBT_CREATEWND
Definition: winuser.h:58
struct tagKBDLLHOOKSTRUCT * PKBDLLHOOKSTRUCT
#define WH_MOUSE_LL
Definition: winuser.h:44
#define WH_MOUSE
Definition: winuser.h:37
#define HCBT_SETFOCUS
Definition: winuser.h:64
struct tagCWPRETSTRUCT CWPRETSTRUCT
#define HCBT_CLICKSKIPPED
Definition: winuser.h:61
#define HCBT_QS
Definition: winuser.h:57
#define HCBT_MOVESIZE
Definition: winuser.h:55
#define WH_KEYBOARD_LL
Definition: winuser.h:43
#define WH_GETMESSAGE
Definition: winuser.h:33
#define WH_SYSMSGFILTER
Definition: winuser.h:36
struct tagMOUSEHOOKSTRUCT * PMOUSEHOOKSTRUCT
struct tagCBT_CREATEWNDW CBT_CREATEWNDW
#define WH_FOREGROUNDIDLE
Definition: winuser.h:41
struct tagMSLLHOOKSTRUCT * PMSLLHOOKSTRUCT
struct tagCWPSTRUCT CWPSTRUCT
#define HCBT_SYSCOMMAND
Definition: winuser.h:63
#define HCBT_KEYSKIPPED
Definition: winuser.h:62
#define WH_CALLWNDPROC
Definition: winuser.h:34
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ User32CallImmLoadLayoutFromKernel()

NTSTATUS WINAPI User32CallImmLoadLayoutFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 717 of file dllmain.c.

718{
719 PIMMLOADLAYOUT_CALLBACK_ARGUMENTS Common = Arguments;
721 Result.ret = IMM_FN(ImmLoadLayout)(Common->hKL, &Result.iiex);
722 return ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS);
723}
BOOL WINAPI ImmLoadLayout(HKL hKL, PIMEINFOEX pImeInfoEx)
Definition: imm.c:67
#define IMM_FN(name)
Definition: user32p.h:56

◆ User32CallImmProcessKeyFromKernel()

NTSTATUS WINAPI User32CallImmProcessKeyFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 704 of file dllmain.c.

705{
706 PIMMPROCESSKEY_CALLBACK_ARGUMENTS Common = Arguments;
708 Common->hKL,
709 Common->vKey,
710 Common->lParam,
711 Common->dwHotKeyID);
712
713 return ZwCallbackReturn(&Result, sizeof(DWORD), STATUS_SUCCESS);
714}
DWORD WINAPI ImmProcessKey(HWND hWnd, HKL hKL, UINT vKey, LPARAM lParam, DWORD dwHotKeyID)
Definition: keymsg.c:715

◆ User32CallLoadMenuFromKernel()

NTSTATUS WINAPI User32CallLoadMenuFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 657 of file menu.c.

658{
661
662 Common = (PLOADMENU_CALLBACK_ARGUMENTS) Arguments;
663
664 Result = (LRESULT)LoadMenuW(Common->hModule, Common->InterSource ? MAKEINTRESOURCEW(Common->InterSource) : (LPCWSTR)&Common->MenuName);
665
667}
#define LRESULT
Definition: ole.h:14
struct _LOADMENU_CALLBACK_ARGUMENTS * PLOADMENU_CALLBACK_ARGUMENTS
HMENU WINAPI LoadMenuW(HINSTANCE hInstance, LPCWSTR lpMenuName)
Definition: menu.c:1399
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ User32CallLPKFromKernel()

NTSTATUS WINAPI User32CallLPKFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 652 of file dllmain.c.

653{
654 BOOL bResult;
656
657 Argument = (PLPK_CALLBACK_ARGUMENTS)Arguments;
658
659 Argument->lpString = (LPWSTR)((ULONG_PTR)Argument->lpString + (ULONG_PTR)Argument);
660
661 bResult = ExtTextOutW(Argument->hdc,
662 Argument->x,
663 Argument->y,
664 Argument->flags,
665 (Argument->bRect) ? &Argument->rect : NULL,
666 Argument->lpString,
667 Argument->count,
668 NULL);
669
670 return ZwCallbackReturn(&bResult, sizeof(BOOL), STATUS_SUCCESS);
671}
struct _LPK_CALLBACK_ARGUMENTS * PLPK_CALLBACK_ARGUMENTS
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)
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ User32CallOBMFromKernel()

NTSTATUS WINAPI User32CallOBMFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 620 of file dllmain.c.

621{
622 BITMAP bmp;
623 PSETOBM_CALLBACK_ARGUMENTS Common = Arguments;
624
625 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_CLOSE)), sizeof(bmp), &bmp);
626 Common->oembmi[OBI_CLOSE].cx = bmp.bmWidth;
627 Common->oembmi[OBI_CLOSE].cy = bmp.bmHeight;
628
629 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_MNARROW)), sizeof(bmp), &bmp);
630 Common->oembmi[OBI_MNARROW].cx = bmp.bmWidth;
631 Common->oembmi[OBI_MNARROW].cy = bmp.bmHeight;
632
633 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROW)), sizeof(bmp), &bmp);
634 Common->oembmi[OBI_DNARROW].cx = bmp.bmWidth;
635 Common->oembmi[OBI_DNARROW].cy = bmp.bmHeight;
636
637 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_DNARROWI)), sizeof(bmp), &bmp);
638 Common->oembmi[OBI_DNARROWI].cx = bmp.bmWidth;
639 Common->oembmi[OBI_DNARROWI].cy = bmp.bmHeight;
640
641 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROW)), sizeof(bmp), &bmp);
642 Common->oembmi[OBI_UPARROW].cx = bmp.bmWidth;
643 Common->oembmi[OBI_UPARROW].cy = bmp.bmHeight;
644
645 GetObjectW(LoadBitmapW(0, MAKEINTRESOURCEW(OBM_UPARROWI)), sizeof(bmp), &bmp);
646 Common->oembmi[OBI_UPARROWI].cx = bmp.bmWidth;
647 Common->oembmi[OBI_UPARROWI].cy = bmp.bmHeight;
648
649 return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
650}
@ OBI_UPARROWI
Definition: ntuser.h:968
@ OBI_UPARROW
Definition: ntuser.h:967
@ OBI_DNARROW
Definition: ntuser.h:969
@ OBI_CLOSE
Definition: ntuser.h:966
@ OBI_DNARROWI
Definition: ntuser.h:970
@ OBI_MNARROW
Definition: ntuser.h:971
BITMAP bmp
Definition: alphablend.c:62
Definition: bl.h:1331
struct tagOEMBITMAPINFO oembmi[93]
Definition: callback.h:153
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2163

◆ 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
struct _SENDASYNCPROC_CALLBACK_ARGUMENTS * PSENDASYNCPROC_CALLBACK_ARGUMENTS

◆ User32CallSetWndIconsFromKernel()

NTSTATUS WINAPI User32CallSetWndIconsFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 591 of file dllmain.c.

592{
593 PSETWNDICONS_CALLBACK_ARGUMENTS Common = Arguments;
594
595 if (!gpsi->hIconSmWindows)
596 {
604 hIconWindows = Common->hIconWindows;
606 }
607 ERR("hIconSmWindows %p hIconWindows %p \n",hIconSmWindows,hIconWindows);
608 return ZwCallbackReturn(Arguments, ArgumentLength, STATUS_SUCCESS);
609}
HICON hIconWindows
Definition: dllmain.c:37
HICON hIconSmWindows
Definition: dllmain.c:37
PSERVERINFO gpsi
Definition: dllmain.c:31
#define IDI_QUESTION
Definition: winuser.h:706
#define IMAGE_ICON
Definition: winuser.h:212
#define IDI_HAND
Definition: winuser.h:705
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2203
#define SM_CYSMICON
Definition: winuser.h:1013
#define IDI_WINLOGO
Definition: winuser.h:709
#define IDI_APPLICATION
Definition: winuser.h:704
#define IDI_ASTERISK
Definition: winuser.h:708
#define SM_CXSMICON
Definition: winuser.h:1012
#define LR_DEFAULTSIZE
Definition: winuser.h:1094
#define IDI_EXCLAMATION
Definition: winuser.h:707
int WINAPI GetSystemMetrics(_In_ int)

◆ User32CallUMPDFromKernel()

NTSTATUS WINAPI User32CallUMPDFromKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 673 of file dllmain.c.

674{
676 INT cbSize = 0;
678 PUMPDPKTHEAD pkt, pktOut = NULL;
679
680 pkt = (PUMPDPKTHEAD)Arguments;
681
682 if ( pkt->RetSize <= sizeof(Buffer) )
683 {
684 pktOut = (PUMPDPKTHEAD)Buffer;
685
686 if ( (GdiPrinterThunk( pkt, pktOut, pkt->RetSize ) == GDI_ERROR) )
687 {
688 pktOut = NULL;
690 }
691 else
692 {
693 cbSize = pkt->RetSize;
694 }
695 }
696 else
697 {
699 }
700 return ZwCallbackReturn( pktOut, cbSize, Status );
701}
Definition: bufpool.h:45
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
INT RetSize
Definition: dllmain.c:14
int32_t INT
Definition: typedefs.h:58
struct _UMPDPKTHEAD * PUMPDPKTHEAD
#define MAX_USER_MODE_DRV_BUFFER
Definition: dllmain.c:5
INT WINAPI GdiPrinterThunk(PUMPDPKTHEAD, PVOID, INT)
#define GDI_ERROR
Definition: wingdi.h:1309

◆ 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}
#define WM_SYSTIMER
Definition: comctl32.h:119
#define GetWin32ClientInfo()
Definition: ntuser.h:352
HWND hWnd
Definition: ntuser.h:295
struct _WND * pWnd
Definition: ntuser.h:296
CALLBACKWND CallbackWnd
Definition: ntuser.h:329
Definition: ntuser.h:694
PWINDOWPOS lppos
Definition: winuser.h:3599
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
_In_ WDFIOTARGET _In_ PWDF_REQUEST_COMPLETION_PARAMS Params
Definition: wdfrequest.h:308
#define PRECT
Definition: precomp.h:27
struct _WINDOWPROC_CALLBACK_ARGUMENTS WINDOWPROC_CALLBACK_ARGUMENTS
struct _WINDOWPROC_CALLBACK_ARGUMENTS * PWINDOWPROC_CALLBACK_ARGUMENTS
LRESULT FASTCALL IntCallWindowProcW(BOOL IsAnsiProc, WNDPROC WndProc, PWND pWnd, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1425
static BOOL FASTCALL MsgiKMToUMMessage(PMSG KMMsg, PMSG UMMsg)
Definition: message.c:432
static BOOL FASTCALL MsgiKMToUMReply(PMSG KMMsg, PMSG UMMsg, LRESULT *Result)
Definition: message.c:506
#define WM_CREATE
Definition: winuser.h:1608
#define WM_NCCREATE
Definition: winuser.h:1683
#define WM_SIZING
Definition: winuser.h:1807
#define WM_NCCALCSIZE
Definition: winuser.h:1685

◆ User32DeliverUserAPC()

NTSTATUS WINAPI User32DeliverUserAPC ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 613 of file dllmain.c.

614{
615 return ZwCallbackReturn(0, 0, STATUS_SUCCESS);
616}

◆ User32LoadSysMenuTemplateForKernel()

NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel ( PVOID  Arguments,
ULONG  ArgumentLength 
)

Definition at line 647 of file menu.c.

648{
649 LRESULT Result = 0;
650
651 // Use this for Menu Ole!!
652
653 return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
654}

◆ 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}
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpCursorName)
Definition: cursoricon.c:2105
VOID LoadSystemCursors(VOID)
Definition: cursoricon.c:21
HICON HCURSOR
Definition: windef.h:299
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)