ReactOS  0.4.15-dev-3308-g9455def
simplecall.c File Reference
#include <win32k.h>
Include dependency graph for simplecall.c:

Go to the source code of this file.

Functions

 DBG_DEFAULT_CHANNEL (UserMisc)
 
BOOL FASTCALL co_IntRegisterLogonProcess (HANDLE ProcessId, BOOL Register)
 
DWORD_PTR APIENTRY NtUserCallNoParam (DWORD Routine)
 
DWORD_PTR APIENTRY NtUserCallOneParam (DWORD_PTR Param, DWORD Routine)
 
DWORD_PTR APIENTRY NtUserCallTwoParam (DWORD_PTR Param1, DWORD_PTR Param2, DWORD Routine)
 
BOOL APIENTRY NtUserCallHwndLock (HWND hWnd, DWORD Routine)
 
HWND APIENTRY NtUserCallHwndOpt (HWND hWnd, DWORD Routine)
 
DWORD APIENTRY NtUserCallHwnd (HWND hWnd, DWORD Routine)
 
DWORD APIENTRY NtUserCallHwndParam (HWND hWnd, DWORD_PTR Param, DWORD Routine)
 
DWORD APIENTRY NtUserCallHwndParamLock (HWND hWnd, DWORD_PTR Param, DWORD Routine)
 

Variables

HANDLE gpidLogon = 0
 

Function Documentation

◆ co_IntRegisterLogonProcess()

BOOL FASTCALL co_IntRegisterLogonProcess ( HANDLE  ProcessId,
BOOL  Register 
)

Definition at line 18 of file simplecall.c.

19 {
22 
24  if (!NT_SUCCESS(Status))
25  {
27  return FALSE;
28  }
29 
30  ProcessId = Process->UniqueProcessId;
31 
33 
34  if (Register)
35  {
36  /* Register the logon process */
37  if (gpidLogon != 0)
38  return FALSE;
39 
41  }
42  else
43  {
44  /* Deregister the logon process */
45  if (gpidLogon != ProcessId)
46  return FALSE;
47 
48  gpidLogon = 0;
49  }
50 
51  return TRUE;
52 }
IN PLARGE_INTEGER IN PLARGE_INTEGER PEPROCESS ProcessId
Definition: fatprocs.h:2709
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSYSAPI ULONG WINAPI RtlNtStatusToDosError(NTSTATUS)
#define FALSE
Definition: types.h:117
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define ObDereferenceObject
Definition: obfuncs.h:203
NTSTATUS NTAPI PsLookupProcessByProcessId(IN HANDLE ProcessId, OUT PEPROCESS *Process)
Definition: process.c:919
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
HANDLE gpidLogon
Definition: simplecall.c:15

Referenced by NtUserCallTwoParam().

◆ DBG_DEFAULT_CHANNEL()

DBG_DEFAULT_CHANNEL ( UserMisc  )

◆ NtUserCallHwnd()

DWORD APIENTRY NtUserCallHwnd ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 699 of file simplecall.c.

702 {
703  switch (Routine)
704  {
706  {
707  PWND Window;
708  DWORD HelpId;
709 
710  UserEnterShared();
711 
712  if (!(Window = UserGetWindowObject(hWnd)))
713  {
714  UserLeave();
715  return 0;
716  }
717 
719 
720  UserLeave();
721  return HelpId;
722  }
723 
725  if (IntIsWindow(hWnd))
727  return FALSE;
728  break;
729 
731  if (IntIsWindow(hWnd))
733  return FALSE;
734 
736  {
737  PWND Window;
740  {
741  Window->state |= WNDS_MSGBOX;
742  }
743  UserLeave();
744  return FALSE;
745  }
746  }
747 
748  STUB;
749 
750  return 0;
751 }
VOID FASTCALL UserEnterShared(VOID)
Definition: ntuser.c:239
#define TRUE
Definition: types.h:120
HWND hWnd
Definition: settings.c:17
ATOM atomContextHelpIdProp
Definition: ntuser.h:1029
#define DWORD
Definition: nt_native.h:44
PSERVERINFO gpsi
Definition: main.c:27
Definition: window.c:28
#define FALSE
Definition: types.h:117
BOOL IntRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1719
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
BOOL IntDeRegisterShellHookWindow(HWND hWnd)
Definition: desktop.c:1751
HANDLE FASTCALL UserGetProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
Definition: prop.c:46
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL FASTCALL IntIsWindow(HWND hWnd)
Definition: window.c:157
int Window
Definition: x11stubs.h:26
#define WNDS_MSGBOX
Definition: ntuser.h:584
uint32_t DWORD_PTR
Definition: typedefs.h:65
Definition: ntuser.h:663
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
#define STUB
Definition: kernel32.h:27

Referenced by NtUserxDeregisterShellHookWindow(), NtUserxGetWindowContextHelpId(), NtUserxRegisterShellHookWindow(), NtUserxSetMessageBox(), START_TEST(), Test_HwndParamRoutine_SetWindowContextHelpId(), Test_HwndRoutine_DeregisterShellHookWindow(), Test_HwndRoutine_GetWindowContextHelpId(), and Test_HwndRoutine_SetMsgBox().

◆ NtUserCallHwndLock()

BOOL APIENTRY NtUserCallHwndLock ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 577 of file simplecall.c.

580 {
581  BOOL Ret = FALSE;
582  PWND Window;
584 
585  TRACE("Enter NtUserCallHwndLock\n");
587 
588  if (!(Window = UserGetWindowObject(hWnd)))
589  {
590  Ret = FALSE;
591  goto Exit;
592  }
593 
594  UserRefObjectCo(Window, &Ref);
595 
596  /* FIXME: Routine can be 0x53 - 0x5E */
597  switch (Routine)
598  {
601  break;
602 
604  {
605  TRACE("HWNDLOCK_ROUTINE_DRAWMENUBAR\n");
606  Ret = TRUE;
607  if ((Window->style & (WS_CHILD | WS_POPUP)) != WS_CHILD)
609  HWND_DESKTOP,
610  0, 0, 0, 0,
611  SWP_NOSIZE |
612  SWP_NOMOVE |
613  SWP_NOZORDER |
616  break;
617  }
618 
621  HWND_DESKTOP,
622  0, 0, 0, 0,
623  SWP_NOSIZE |
624  SWP_NOMOVE |
625  SWP_NOZORDER |
628  Ret = TRUE;
629  break;
630 
633  HWND_DESKTOP,
634  0, 0, 0, 0,
635  SWP_NOSIZE |
636  SWP_NOMOVE |
637  SWP_NOZORDER |
640  if (!Window->spwndOwner && !IntGetParent(Window))
641  {
642  co_IntShellHookNotify(HSHELL_REDRAW, (WPARAM)hWnd, FALSE); // FIXME Flashing?
643  }
644  Ret = TRUE;
645  break;
646 
648  TRACE("co_IntSetForegroundWindow 1 0x%p\n", hWnd);
650  TRACE("co_IntSetForegroundWindow 2 0x%p\n", hWnd);
651  break;
652 
654  TRACE("co_IntSetForegroundWindow M 1 0x%p\n", hWnd);
656  TRACE("co_IntSetForegroundWindow M 2 0x%p\n", hWnd);
657  break;
658 
661  Ret = TRUE;
662  break;
663  }
664 
666 
667 Exit:
668  TRACE("Leave NtUserCallHwndLock, ret=%u\n", Ret);
669  UserLeave();
670 
671  return Ret;
672 }
#define TRUE
Definition: types.h:120
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1720
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
UINT_PTR WPARAM
Definition: windef.h:207
#define WS_CHILD
Definition: pedump.c:617
#define SWP_NOZORDER
Definition: winuser.h:1233
Definition: window.c:28
#define FALSE
Definition: types.h:117
unsigned int BOOL
Definition: ntddk_ex.h:94
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
Definition: object.h:3
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define TRACE(s)
Definition: solgame.cpp:4
UINT FASTCALL co_WinPosArrangeIconicWindows(PWND parent)
Definition: winpos.c:728
#define SWP_NOACTIVATE
Definition: winuser.h:1228
static void Exit(void)
Definition: sock.c:1331
VOID FASTCALL co_IntUpdateWindows(PWND Wnd, ULONG Flags, BOOL Recurse)
Definition: painting.c:519
int Window
Definition: x11stubs.h:26
#define SWP_FRAMECHANGED
Definition: winuser.h:1226
#define SWP_NOSIZE
Definition: winuser.h:1231
Definition: ntuser.h:663
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
#define RDW_ALLCHILDREN
Definition: winuser.h:1207
PWND FASTCALL IntGetParent(PWND Wnd)
Definition: window.c:185
#define HWND_DESKTOP
Definition: winuser.h:1195
#define WS_POPUP
Definition: pedump.c:616
VOID co_IntShellHookNotify(WPARAM Message, WPARAM wParam, LPARAM lParam)
Definition: desktop.c:1659
#define HWNDLOCK_ROUTINE_SETFOREGROUNDWINDOWMOUSE
Definition: ntuser.h:3645
#define SWP_NOMOVE
Definition: winuser.h:1230
BOOL FASTCALL co_IntSetForegroundWindowMouse(PWND Window)
Definition: focus.c:1443
BOOL FASTCALL co_IntSetForegroundWindow(PWND Window)
Definition: focus.c:1432

Referenced by NtUserxArrangeIconicWindows(), NtUserxDrawMenuBar(), NtUserxMDIRedrawFrame(), NtUserxSetForegroundWindow(), NtUserxUpdateWindow(), START_TEST(), Test_HwndLockRoutine_CheckImeShowStatusInThread(), Test_HwndLockRoutine_DrawMenuBar(), Test_HwndLockRoutine_GetSysMenuHandle(), and Test_HwndLockRoutine_UpdateWindow().

◆ NtUserCallHwndOpt()

HWND APIENTRY NtUserCallHwndOpt ( HWND  hWnd,
DWORD  Routine 
)

Definition at line 679 of file simplecall.c.

682 {
683  switch (Routine)
684  {
686  GetW32ThreadInfo()->pDeskInfo->hProgmanWindow = hWnd;
687  break;
688 
690  GetW32ThreadInfo()->pDeskInfo->hTaskManWindow = hWnd;
691  break;
692  }
693 
694  return hWnd;
695 }
HWND hWnd
Definition: settings.c:17
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:782

Referenced by NtUserxSetProgmanWindow(), and NtUserxSetTaskmanWindow().

◆ NtUserCallHwndParam()

DWORD APIENTRY NtUserCallHwndParam ( HWND  hWnd,
DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 755 of file simplecall.c.

759 {
760 
761  switch (Routine)
762  {
764  {
765  DWORD ret;
766 
769  UserLeave();
770  return ret;
771  }
772 
774  {
775  PWND Window;
776 
778  if (!(Window = UserGetWindowObject(hWnd)))
779  {
780  UserLeave();
781  return FALSE;
782  }
783 
784  if (Param)
785  UserSetProp(Window, gpsi->atomContextHelpIdProp, (HANDLE)Param, TRUE);
786  else
788 
789  UserLeave();
790  return TRUE;
791  }
792 
794  {
795  PWND pWnd;
797 
799 
800  if (!(pWnd = UserGetWindowObject(hWnd)))
801  {
802  UserLeave();
803  return 0;
804  }
805  UserRefObjectCo(pWnd, &Ref);
806 
807  if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
808  pWnd->cbwndExtra >= DLGWINDOWEXTRA &&
809  !(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
810  {
811  pWnd->DialogPointer = (PVOID)Param;
812  if (Param)
813  {
814  if (!pWnd->fnid) pWnd->fnid = FNID_DIALOG;
815  pWnd->state |= WNDS_DIALOGWINDOW;
816  }
817  else
818  {
819  pWnd->fnid |= FNID_DESTROY;
820  pWnd->state &= ~WNDS_DIALOGWINDOW;
821  }
822  }
823 
824  UserDerefObjectCo(pWnd);
825  UserLeave();
826  return 0;
827  }
828 
830  {
831  PWND pWnd;
832  PNOTIFYEVENT pne;
834  pne = (PNOTIFYEVENT)Param;
835  if (hWnd)
836  pWnd = UserGetWindowObject(hWnd);
837  else
838  pWnd = NULL;
839  IntNotifyWinEvent(pne->event, pWnd, pne->idObject, pne->idChild, pne->flags);
840  UserLeave();
841  return 0;
842  }
843 
845  {
846  PWND pWnd;
848  pWnd = UserGetWindowObject(hWnd);
849  if (pWnd) IntClearWindowState(pWnd, (UINT)Param);
850  UserLeave();
851  return 0;
852  }
853 
855  {
856  PWND pWnd;
858  pWnd = UserGetWindowObject(hWnd);
859  if (pWnd) IntSetWindowState(pWnd, (UINT)Param);
860  UserLeave();
861  return 0;
862  }
863  }
864 
865  STUB;
866 
867  return 0;
868 }
LONG idChild
Definition: hook.h:39
#define TRUE
Definition: types.h:120
VOID FASTCALL IntNotifyWinEvent(DWORD Event, PWND pWnd, LONG idObject, LONG idChild, DWORD flags)
Definition: event.c:179
BOOL FASTCALL IntKillTimer(PWND Window, UINT_PTR IDEvent, BOOL SystemTimer)
Definition: timer.c:573
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
#define FNID_DESTROY
Definition: ntuser.h:868
ATOM atomContextHelpIdProp
Definition: ntuser.h:1029
PSERVERINFO gpsi
Definition: main.c:27
ULONG cbwndExtra
Definition: ntuser.h:708
Definition: window.c:28
#define FALSE
Definition: types.h:117
DWORD fnid
Definition: ntuser.h:679
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
#define FNID_DIALOG
Definition: ntuser.h:839
THRDESKHEAD head
Definition: ntuser.h:665
Definition: object.h:3
void * PVOID
Definition: retypes.h:9
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define HWNDPARAM_ROUTINE_ROS_NOTIFYWINEVENT
Definition: ntuser.h:3655
#define WNDS_DIALOGWINDOW
Definition: ntuser.h:595
VOID FASTCALL IntSetWindowState(PWND pWnd, UINT Flag)
Definition: misc.c:570
unsigned long DWORD
Definition: ntddk_ex.h:95
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
int Window
Definition: x11stubs.h:26
int ret
DWORD event
Definition: hook.h:37
#define DLGWINDOWEXTRA
Definition: winuser.h:2541
Definition: ntuser.h:663
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
#define STUB
Definition: kernel32.h:27
DWORD state
Definition: ntuser.h:671
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
VOID FASTCALL IntClearWindowState(PWND pWnd, UINT Flag)
Definition: misc.c:591
PVOID DialogPointer
Definition: ntuser.h:736
#define WNDS_SERVERSIDEWINDOWPROC
Definition: ntuser.h:597
HANDLE FASTCALL UserRemoveProp(_In_ PWND Window, _In_ ATOM Atom, _In_ BOOLEAN SystemProp)
DWORD flags
Definition: hook.h:40
struct _NOTIFYEVENT * PNOTIFYEVENT
LONG idObject
Definition: hook.h:38

Referenced by NtUserxClearWindowState(), NtUserxKillSystemTimer(), NtUserxNotifyWinEvent(), NtUserxSetDialogPointer(), NtUserxSetWindowContextHelpId(), NtUserxSetWindowState(), Test_HwndParamRoutine_SetWindowContextHelpId(), and Test_HwndRoutine_GetWindowContextHelpId().

◆ NtUserCallHwndParamLock()

DWORD APIENTRY NtUserCallHwndParamLock ( HWND  hWnd,
DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 872 of file simplecall.c.

876 {
877  DWORD Ret = FALSE;
878  PWND Window;
880 
881  TRACE("Enter NtUserCallHwndParamLock\n");
883 
884  if (!(Window = UserGetWindowObject(hWnd)))
885  {
886  Ret = FALSE;
887  goto Exit;
888  }
889 
890  UserRefObjectCo(Window, &Ref);
891 
892  switch (Routine)
893  {
895  {
896  PREGION Rgn = REGION_LockRgn((HRGN)Param);
898  if (Rgn) REGION_UnlockRgn(Rgn);
899  break;
900  }
901  }
902 
904 
905 Exit:
906 
907  TRACE("Leave NtUserCallHwndParamLock, ret=%lu\n", Ret);
908  UserLeave();
909 
910  return Ret;
911 }
HWND hWnd
Definition: settings.c:17
static __inline VOID UserRefObjectCo(PVOID obj, PUSER_REFERENCE_ENTRY UserReferenceEntry)
Definition: object.h:25
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2377
#define DWORD
Definition: nt_native.h:44
Definition: window.c:28
#define FALSE
Definition: types.h:117
static __inline VOID UserDerefObjectCo(PVOID obj)
Definition: object.h:38
Definition: object.h:3
Definition: region.h:7
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define TRACE(s)
Definition: solgame.cpp:4
static void Exit(void)
Definition: sock.c:1331
unsigned long DWORD
Definition: ntddk_ex.h:95
int Window
Definition: x11stubs.h:26
#define RDW_VALIDATE
Definition: winuser.h:1204
Definition: ntuser.h:663
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
BOOL FASTCALL co_UserRedrawWindow(PWND Window, const RECTL *UpdateRect, PREGION UpdateRgn, ULONG Flags)
Definition: painting.c:888
#define NULL
Definition: types.h:112
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2392

Referenced by NtUserxValidateRgn().

◆ NtUserCallNoParam()

DWORD_PTR APIENTRY NtUserCallNoParam ( DWORD  Routine)

Definition at line 59 of file simplecall.c.

60 {
61  DWORD_PTR Result = 0;
62 
63  TRACE("Enter NtUserCallNoParam\n");
65 
66  switch (Routine)
67  {
70  break;
71 
74  break;
75 
78  break;
79 
82  break;
83 
86  break;
87 
90  break;
91 
93  {
95  Result = (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y);
96  break;
97  }
98 
101  break;
102 
105  break;
106 
108  {
110  TRACE("Zapping the Active and Focus window out of the Queue!\n");
111  pti->MessageQueue->spwndFocus = NULL;
112  pti->MessageQueue->spwndActive = NULL;
113  Result = 0;
114  break;
115  }
116 
117  /* this is a ReactOS only case and is needed for gui-on-demand */
120  break;
121 
123  gpsi->dwSRVIFlags |= SRVINFO_IMM32; // Always set.
124  Result = TRUE; // Always return TRUE.
125  break;
126 
127  default:
128  ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
130  break;
131  }
132 
133  TRACE("Leave NtUserCallNoParam, ret=%p\n",(PVOID)Result);
134  UserLeave();
135 
136  return Result;
137 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
long y
Definition: polytest.cpp:48
#define DWORD_PTR
Definition: treelist.c:76
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
long x
Definition: polytest.cpp:48
BOOL FASTCALL IntReleaseCapture(VOID)
Definition: focus.c:1412
#define TRUE
Definition: types.h:120
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
PSERVERINFO gpsi
Definition: main.c:27
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:782
BOOL APIENTRY IntUninitMessagePumpHook(VOID)
Definition: message.c:2120
BOOL FASTCALL UserLoadApiHook(VOID)
Definition: hook.c:132
#define FALSE
Definition: types.h:117
DWORD dwSRVIFlags
Definition: ntuser.h:1013
BOOL FASTCALL co_IntDestroyCaret(PTHREADINFO Win32Thread)
Definition: caret.c:164
#define MAKELONG(a, b)
Definition: typedefs.h:249
_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
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
#define TRACE(s)
Definition: solgame.cpp:4
BOOL APIENTRY IntInitMessagePumpHook(VOID)
Definition: message.c:2107
uint32_t DWORD_PTR
Definition: typedefs.h:65
POINT ptLast
Definition: win32.h:130
#define ERR(fmt,...)
Definition: debug.h:110
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:90
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
#define NULL
Definition: types.h:112
BOOL FASTCALL IntMsqClearWakeMask(VOID)
Definition: msgqueue.c:392
#define SRVINFO_IMM32
Definition: ntuser.h:919
#define NOPARAM_ROUTINE_ISCONSOLEMODE
Definition: ntuser.h:3640
HDC ScreenDeviceContext
Definition: desktop.c:36
HMENU FASTCALL UserCreateMenu(PDESKTOP Desktop, BOOL PopupMenu)
Definition: menu.c:5029
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27

Referenced by EndDialog(), IsConsoleMode(), LoadUserApiHook(), NtUserxCreateMenu(), NtUserxCreatePopupMenu(), NtUserxDestroyCaret(), NtUserxGetMessagePos(), NtUserxInitMessagePump(), NtUserxMsqClearWakeMask(), NtUserxReleaseCapture(), NtUserxUnInitMessagePump(), Test_NoParamRoutine_CreateMenu(), Test_NoParamRoutine_CreatePopupMenu(), Test_NoParamRoutine_LoadUserApiHook(), and UpdatePerUserImmEnabling().

◆ NtUserCallOneParam()

DWORD_PTR APIENTRY NtUserCallOneParam ( DWORD_PTR  Param,
DWORD  Routine 
)

Definition at line 145 of file simplecall.c.

148 {
150 
151  TRACE("Enter NtUserCallOneParam\n");
152 
154 
155  switch (Routine)
156  {
158  {
159  PTHREADINFO pti;
161  MsqPostQuitMessage(pti, Param);
162  Result = TRUE;
163  break;
164  }
165 
167  {
168  PSMWP psmwp;
169  HDWP hDwp = NULL;
170  INT count = (INT)Param;
171 
172  if (count < 0)
173  {
175  Result = 0;
176  break;
177  }
178 
179  /* Windows allows zero count, in which case it allocates context for 8 moves */
180  if (count == 0) count = 8;
181 
183  NULL,
184  NULL,
185  (PHANDLE)&hDwp,
187  sizeof(SMWP));
188  if (!psmwp)
189  {
190  Result = 0;
191  break;
192  }
193 
195  if (!psmwp->acvr)
196  {
198  Result = 0;
199  break;
200  }
201 
202  RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
203  psmwp->bHandle = TRUE;
204  psmwp->ccvr = 0; // actualCount
205  psmwp->ccvrAlloc = count; // suggestedCount
206  Result = (DWORD_PTR)hDwp;
207  break;
208  }
209 
211  Result = (DWORD_PTR)UserShowCursor((BOOL)Param);
212  break;
213 
215  {
216  PTHREADINFO ti;
217  ti = GetW32ThreadInfo();
218  if (ti != NULL)
219  {
220  /* Try convert the pointer to a user mode pointer if the desktop is
221  mapped into the process */
223  }
224  else
225  {
226  Result = 0;
227  }
228  break;
229  }
230 
232  Result = (DWORD_PTR)IntWindowFromDC((HDC)Param);
233  break;
234 
236  {
238  gspv.bMouseBtnSwap = Param ? TRUE : FALSE;
239  gpsi->aiSysMet[SM_SWAPBUTTON] = gspv.bMouseBtnSwap;
240  break;
241  }
242 
245  break;
246 
249  break;
250 
252  {
253  if (!(Result = (DWORD_PTR)IntCreateCurIconHandle((DWORD)Param)))
254  {
256  Result = 0;
257  }
258  break;
259  }
260 
262  {
263  BOOL Enable;
265 
266  if (Process != NULL)
267  {
268  Enable = (BOOL)(Param != 0);
269 
270  if (Enable)
271  {
272  Process->W32PF_flags &= ~W32PF_NOWINDOWGHOSTING;
273  }
274  else
275  {
276  Process->W32PF_flags |= W32PF_NOWINDOWGHOSTING;
277  }
278 
279  Result = TRUE;
280  break;
281  }
282 
283  Result = FALSE;
284  break;
285  }
286 
289  break;
290 
292  Result = UserGetKeyboardType(Param);
293  break;
294 
297  break;
298 
300  Result = UserReleaseDC(NULL, (HDC) Param, FALSE);
301  break;
302 
304  Result = UserRealizePalette((HDC) Param);
305  break;
306 
308  {
309  Result = IntGetQueueStatus((DWORD)Param);
310  break;
311  }
312 
314  /* FIXME: Should use UserEnterShared */
316  break;
317 
318  case ONEPARAM_ROUTINE_GETCURSORPOS:
319  {
320  PPOINTL pptl;
322  Result = TRUE;
323  if (pti->rpdesk != IntGetActiveDesktop())
324  {
325  Result = FALSE;
326  break;
327  }
328  _SEH2_TRY
329  {
330  ProbeForWrite((POINT*)Param,sizeof(POINT),1);
331  pptl = (PPOINTL)Param;
332  *pptl = gpsi->ptCursor;
333  }
335  {
336  Result = FALSE;
337  }
338  _SEH2_END;
339  break;
340  }
341 
343  {
344  PPROCESSINFO ppi;
345  if (Param & LAYOUT_ORIENTATIONMASK || Param == LAYOUT_LTR)
346  {
348  ppi->dwLayout = Param;
349  Result = TRUE;
350  break;
351  }
353  Result = FALSE;
354  break;
355  }
356 
358  {
359  PPROCESSINFO ppi;
360  PDWORD pdwLayout;
361  Result = TRUE;
362 
364  {
366  Result = FALSE;
367  break;
368  }
369 
371  _SEH2_TRY
372  {
373  pdwLayout = (PDWORD)Param;
374  *pdwLayout = ppi->dwLayout;
375  }
377  {
379  Result = FALSE;
380  }
381  _SEH2_END;
382  break;
383  }
384 
387  break;
388 
390  /* TODO: Implement sound sentry */
392  break;
393 
394  case ONEPARAM_ROUTINE_CREATESYSTEMTHREADS:
395  Result = UserSystemThreadProc(Param);
396  break;
397 
400  break;
401 
404  break;
405 
406  default:
407  ERR("Calling invalid routine number 0x%x in NtUserCallOneParam(), Param=0x%x\n",
408  Routine, Param);
410  Result = 0;
411  break;
412  }
413 
414  TRACE("Leave NtUserCallOneParam, ret=%p\n", (PVOID)Result);
415  UserLeave();
416 
417  return Result;
418 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
struct _SMWP SMWP
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1346
#define ONEPARAM_ROUTINE_ENABLEPROCWNDGHSTING
Definition: ntuser.h:3641
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:683
struct _POINTL * PPOINTL
#define DWORD_PTR
Definition: treelist.c:76
#define TRUE
Definition: types.h:120
BOOL bMouseBtnSwap
Definition: sysparams.h:82
GLuint GLuint GLsizei count
Definition: gl.h:1545
HANDLE FASTCALL IntMsqSetWakeMask(DWORD WakeMask)
Definition: msgqueue.c:362
UINT WINAPI UserRealizePalette(HDC hDC)
Definition: painting.c:2348
PEPROCESS gpepCSRSS
Definition: csr.c:15
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
#define INT
Definition: polytest.cpp:20
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
static HDC
Definition: imagelist.c:92
UINT APIENTRY UserEnumClipboardFormats(UINT fmt)
Definition: clipboard.c:443
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
int UserShowCursor(BOOL bShow)
Definition: msgqueue.c:168
#define BOOL
Definition: nt_native.h:43
struct _DESKTOP * rpdesk
Definition: win32.h:93
PSERVERINFO gpsi
Definition: main.c:27
int32_t INT
Definition: typedefs.h:58
VOID NTAPI ProbeForWrite(IN PVOID Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:143
PVOID FASTCALL UserCreateObject(PUSER_HANDLE_TABLE ht, PDESKTOP pDesktop, PTHREADINFO pti, HANDLE *h, HANDLE_TYPE type, ULONG size)
Definition: object.c:535
DWORD dwLayout
Definition: win32.h:277
_SEH2_TRY
Definition: create.c:4226
static __inline PVOID DesktopHeapAddressToUser(PVOID lpMem)
Definition: desktop.h:334
struct _THREADINFO * GetW32ThreadInfo(VOID)
Definition: misc.c:782
_In_ POINTL * pptl
Definition: winddi.h:3741
#define LAYOUT_LTR
Definition: dc.c:36
#define LAYOUT_ORIENTATIONMASK
Definition: wingdi.h:1374
#define FALSE
Definition: types.h:117
INT ccvr
Definition: winpos.h:25
unsigned int BOOL
Definition: ntddk_ex.h:94
DWORD UserSystemThreadProc(BOOL bRemoteProcess)
Definition: csr.c:207
BOOL FASTCALL co_MsqReplyMessage(LRESULT lResult)
Definition: msgqueue.c:2529
#define PsGetCurrentProcess
Definition: psfuncs.h:17
DWORD APIENTRY IntGetQueueStatus(DWORD Changes)
Definition: message.c:2086
_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
HWND FASTCALL IntWindowFromDC(HDC hDc)
Definition: windc.c:893
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
HWND hwndSAS
Definition: winsta.c:24
struct _SMWP * PSMWP
#define TRACE(s)
Definition: solgame.cpp:4
HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId)
Definition: kbdlayout.c:506
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
BOOL FASTCALL IntLockSetForegroundWindow(UINT uLockCode)
Definition: focus.c:1454
Definition: winpos.h:3
UINT bHandle
Definition: winpos.h:24
#define W32PF_NOWINDOWGHOSTING
Definition: win32.h:31
SPIVALUES gspv
Definition: sysparams.c:17
unsigned long DWORD
Definition: ntddk_ex.h:95
Definition: winpos.h:20
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
PVOID *typedef PHANDLE
Definition: ntsecpkg.h:454
#define ERROR_INVALID_ACCESS
Definition: winerror.h:115
#define WM_LOGONNOTIFY
Definition: undocuser.h:37
uint32_t DWORD_PTR
Definition: typedefs.h:65
VOID FASTCALL SetLastNtError(NTSTATUS Status)
Definition: error.c:36
#define ERR(fmt,...)
Definition: debug.h:110
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
_SEH2_END
Definition: create.c:4400
#define ONEPARAM_ROUTINE_GETDESKTOPMAPPING
Definition: ntuser.h:3642
INT ccvrAlloc
Definition: winpos.h:26
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
HANDLE IntCreateCurIconHandle(BOOLEAN Animated)
Definition: cursoricon.c:281
INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint)
Definition: windc.c:917
DWORD * PDWORD
Definition: pedump.c:68
#define USERTAG_SWP
Definition: tags.h:280
DWORD FASTCALL UserGetKeyboardType(DWORD dwTypeFlag)
Definition: keyboard.c:1538
#define SM_SWAPBUTTON
Definition: winuser.h:974
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
VOID FASTCALL MsqPostQuitMessage(PTHREADINFO pti, ULONG ExitCode)
Definition: msgqueue.c:1380
PCVR acvr
Definition: winpos.h:27
BOOL FASTCALL IntAllowSetForegroundWindow(DWORD dwProcessId)
Definition: focus.c:1485
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
LPARAM FASTCALL MsqSetMessageExtraInfo(LPARAM lParam)
Definition: msgqueue.c:2492
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:40
PDESKTOP FASTCALL IntGetActiveDesktop(VOID)
Definition: desktop.c:1231
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:165
#define LN_MESSAGE_BEEP
Definition: undocuser.h:119
LONG_PTR LRESULT
Definition: windef.h:209
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
BOOL FASTCALL IntSetCaretBlinkTime(UINT uMSeconds)
Definition: caret.c:188

Referenced by CreateSystemThreads(), GetProcessDefaultLayout(), GetWinStationInfo(), NtUserxAllowSetForegroundWindow(), NtUserxBeginDeferWindowPos(), NtUserxCreateEmptyCurObject(), NtUserxCreateSystemThreads(), NtUserxEnableProcessWindowGhosting(), NtUserxEnumClipboardFormats(), NtUserxGetCursorPos(), NtUserxGetDesktopMapping(), NtUserxGetKeyboardLayout(), NtUserxGetKeyboardType(), NtUserxGetQueueStatus(), NtUserxLockSetForegroundWindow(), NtUserxMessageBeep(), NtUserxMsqSetWakeMask(), NtUserxPostQuitMessage(), NtUserxRealizePalette(), NtUserxReleaseDC(), NtUserxReplyMessage(), NtUserxSetCaretBlinkTime(), NtUserxSetMessageExtraInfo(), NtUserxShowCursor(), NtUserxSwapMouseButton(), NtUserxWindowFromDC(), SetProcessDefaultLayout(), START_TEST(), Test_OneParamRoutine_BeginDeferWindowPos(), Test_OneParamRoutine_CreateEmptyCurObject(), Test_OneParamRoutine_MapDesktopObject(), Test_OneParamRoutine_SwapMouseButtons(), and Test_OneParamRoutine_WindowFromDC().

◆ NtUserCallTwoParam()

DWORD_PTR APIENTRY NtUserCallTwoParam ( DWORD_PTR  Param1,
DWORD_PTR  Param2,
DWORD  Routine 
)

Definition at line 426 of file simplecall.c.

430 {
431  PWND Window;
432  DWORD_PTR Ret;
433  TRACE("Enter NtUserCallTwoParam\n");
435 
436  switch (Routine)
437  {
439  {
440  Window = UserGetWindowObject((HWND)Param1);
441  Ret = (DWORD_PTR)UserPaintCaption(Window, (INT)Param2);
442  break;
443  }
444 
446  {
447  PMENU MenuObject = IntGetMenuObject((HMENU)Param1);
448  if (!MenuObject)
449  {
450  Ret = 0;
451  break;
452  }
453 
454  if (Param2 > 0)
455  {
456  Ret = (MenuObject->cyMenu == (int)Param2);
457  MenuObject->cyMenu = (int)Param2;
458  }
459  else
460  Ret = (DWORD_PTR)MenuObject->cyMenu;
461  IntReleaseMenuObject(MenuObject);
462  break;
463  }
464 
466  {
468  ASSERT(pti->MessageQueue);
469  Ret = (DWORD_PTR)MsqSetStateWindow(pti, (ULONG)Param1, (HWND)Param2);
470  break;
471  }
472 
474  Ret = IntEnableWindow((HWND)Param1, (BOOL)Param2);
475  break;
476 
478  {
479  Window = UserGetWindowObject((HWND)Param1);
480  if (!Window)
481  {
482  Ret = 0;
483  break;
484  }
485 
486  Ret = (DWORD_PTR)IntShowOwnedPopups(Window, (BOOL)Param2);
487  break;
488  }
489 
491  {
492  WPARAM wParam;
493  Window = UserGetWindowObject((HWND)Param1);
494  if (!Window)
495  {
496  Ret = 0;
497  break;
498  }
499 
500  /* Unpack wParam */
501  wParam = MAKEWPARAM((Param2 >> 3) & 0x3,
502  Param2 & (UISF_HIDEFOCUS | UISF_HIDEACCEL | UISF_ACTIVE));
503 
505  break;
506  }
507 
509  {
510  HWND hwnd = (HWND)Param1;
511  BOOL fAltTab = (BOOL)Param2;
512  Ret = 0;
514  if (!Window)
515  {
516  break;
517  }
518  if (MsqIsHung(Window->head.pti, MSQ_HUNG))
519  {
520  // TODO: Make the window ghosted and activate.
521  break;
522  }
523  if (fAltTab)
524  {
525  if (Window->style & WS_MINIMIZE)
526  {
528  }
529  /* bring window to top and activate */
533  }
534  else
535  {
537  }
538  break;
539  }
540 
542  Ret = (DWORD_PTR)co_IntSetCaretPos((int)Param1, (int)Param2);
543  break;
544 
546  Ret = (DWORD_PTR)co_IntRegisterLogonProcess((HANDLE)Param1, (BOOL)Param2);
547  break;
548 
550  Ret = (DWORD_PTR)UserSetCursorPos((int)Param1, (int)Param2, 0, 0, FALSE);
551  break;
552 
554  Ret = IntUnhookWindowsHook((int)Param1, (HOOKPROC)Param2);
555  break;
556 
557  default:
558  ERR("Calling invalid routine number 0x%x in NtUserCallTwoParam(), Param1=0x%x Parm2=0x%x\n",
559  Routine, Param1, Param2);
561  Ret = 0;
562  }
563 
564 
565  TRACE("Leave NtUserCallTwoParam, ret=%p\n", (PVOID)Ret);
566  UserLeave();
567 
568  return Ret;
569 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
BOOL FASTCALL UserPostMessage(HWND Wnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: message.c:1346
#define MAKEWPARAM(l, h)
Definition: winuser.h:3985
BOOL FASTCALL MsqIsHung(PTHREADINFO pti, DWORD TimeOut)
Definition: msgqueue.c:2194
#define SC_RESTORE
Definition: winuser.h:2574
#define DWORD_PTR
Definition: treelist.c:76
BOOL FASTCALL co_IntRegisterLogonProcess(HANDLE ProcessId, BOOL Register)
Definition: simplecall.c:18
PVOID NTAPI PsGetCurrentThreadWin32Thread(VOID)
Definition: thread.c:805
BOOLEAN FASTCALL co_WinPosSetWindowPos(PWND Window, HWND WndInsertAfter, INT x, INT y, INT cx, INT cy, UINT flags)
Definition: winpos.c:1720
HANDLE HWND
Definition: compat.h:19
#define MSQ_HUNG
Definition: msgqueue.h:3
BOOL FASTCALL UserSetActiveWindow(_In_opt_ PWND Wnd)
Definition: focus.c:1143
BOOL FASTCALL IntShowOwnedPopups(PWND OwnerWnd, BOOL fShow)
Definition: window.c:4404
#define HWND_TOP
Definition: winuser.h:1193
UINT_PTR WPARAM
Definition: windef.h:207
#define BOOL
Definition: nt_native.h:43
BOOL UserSetCursorPos(INT x, INT y, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook)
Definition: cursoricon.c:238
int32_t INT
Definition: typedefs.h:58
#define SWP_NOSENDCHANGING
Definition: winuser.h:1237
WPARAM wParam
Definition: combotst.c:138
LRESULT(CALLBACK * HOOKPROC)(int, WPARAM, LPARAM)
Definition: winuser.h:2875
PMENU FASTCALL IntGetMenuObject(HMENU hMenu)
Definition: menu.c:192
Definition: window.c:28
#define FALSE
Definition: types.h:117
#define WS_MINIMIZE
Definition: pedump.c:622
#define TWOPARAM_ROUTINE_ROS_UPDATEUISTATE
Definition: ntuser.h:3654
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL FASTCALL UserUpdateUiState(PWND Wnd, WPARAM wParam)
Definition: window.c:16
ULONG cyMenu
Definition: ntuser.h:397
#define SWP_ASYNCWINDOWPOS
Definition: winuser.h:1239
PWND FASTCALL UserGetWindowObject(HWND hWnd)
Definition: window.c:103
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
HWND FASTCALL MsqSetStateWindow(PTHREADINFO pti, ULONG Type, HWND hWnd)
Definition: msgqueue.c:2552
#define TRACE(s)
Definition: solgame.cpp:4
struct _THREADINFO * PTHREADINFO
Definition: ntwin32.h:6
#define ASSERT(a)
Definition: mode.c:44
#define TWOPARAM_ROUTINE_SETMENUBARHEIGHT
Definition: ntuser.h:3643
int Window
Definition: x11stubs.h:26
BOOL FASTCALL co_IntSetCaretPos(int X, int Y)
Definition: caret.c:205
uint32_t DWORD_PTR
Definition: typedefs.h:65
BOOL FASTCALL IntEnableWindow(HWND hWnd, BOOL bEnable)
Definition: window.c:201
#define SWP_NOSIZE
Definition: winuser.h:1231
#define ERR(fmt,...)
Definition: debug.h:110
Definition: ntuser.h:663
struct _USER_MESSAGE_QUEUE * MessageQueue
Definition: win32.h:90
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
#define TWOPARAM_ROUTINE_SETGUITHRDHANDLE
Definition: ntuser.h:3644
BOOL UserPaintCaption(PWND pWnd, INT Flags)
Definition: defwnd.c:396
BOOL FASTCALL IntUnhookWindowsHook(int HookId, HOOKPROC pfnFilterProc)
Definition: hook.c:1320
unsigned int ULONG
Definition: retypes.h:1
#define SWP_NOMOVE
Definition: winuser.h:1230
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
#define WM_SYSCOMMAND
Definition: winuser.h:1724
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define SWP_NOOWNERZORDER
Definition: winuser.h:1235

Referenced by MDI_UpdateFrameText(), NtUserxEnableWindow(), NtUserxRegisterLogonProcess(), NtUserxSetCaretPos(), NtUserxSetCursorPos(), NtUserxSetGUIThreadHandle(), NtUserxSetMenuBarHeight(), NtUserxShowOwnedPopups(), NtUserxSwitchToThisWindow(), NtUserxUnhookWindowsHook(), and NtUserxUpdateUiState().

Variable Documentation

◆ gpidLogon