3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * PURPOSE: Window classes
6 * FILE: subsys/win32k/ntuser/wndproc.c
7 * PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
9 * 06-06-2001 CSH Created
12 /* INCLUDES ******************************************************************/
14 #include <ddk/ntddk.h>
15 #include <win32k/win32k.h>
16 #include <win32k/userobj.h>
17 #include <include/class.h>
18 #include <include/error.h>
19 #include <include/winsta.h>
20 #include <include/msgqueue.h>
21 #include <user32/callback.h>
22 #include <include/callback.h>
27 /* FUNCTIONS *****************************************************************/
30 W32kCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
33 ULONG_PTR CompletionCallbackContext,
36 SENDASYNCPROC_CALLBACK_ARGUMENTS Arguments;
39 Arguments.Callback = CompletionCallback;
42 Arguments.Context = CompletionCallbackContext;
43 Arguments.Result = Result;
44 Status = NtW32Call(USER32_CALLBACK_SENDASYNCPROC,
46 sizeof(SENDASYNCPROC_CALLBACK_ARGUMENTS),
49 if (!NT_SUCCESS(Status))
57 W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
58 NCCALCSIZE_PARAMS* Params)
60 SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS Arguments;
61 SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT Result;
67 Arguments.Validate = Validate;
70 Arguments.Rect = *Rect;
74 Arguments.Params = *Params;
76 ResultPointer = &Result;
77 ResultLength = sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT);
78 Status = NtW32Call(USER32_CALLBACK_SENDNCCALCSIZE,
80 sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS),
83 if (!NT_SUCCESS(Status))
93 *Params = Result.Params;
95 return(Result.Result);
99 W32kSendCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
101 SENDCREATEMESSAGE_CALLBACK_ARGUMENTS Arguments;
108 Arguments.CreateStruct = *CreateStruct;
109 ResultPointer = &Result;
110 ResultLength = sizeof(LRESULT);
111 Status = NtW32Call(USER32_CALLBACK_SENDCREATE,
113 sizeof(SENDCREATEMESSAGE_CALLBACK_ARGUMENTS),
116 if (!NT_SUCCESS(Status))
124 W32kSendNCCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
126 SENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS Arguments;
133 Arguments.CreateStruct = *CreateStruct;
134 ResultPointer = &Result;
135 ResultLength = sizeof(LRESULT);
136 Status = NtW32Call(USER32_CALLBACK_SENDNCCREATE,
138 sizeof(SENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS),
141 if (!NT_SUCCESS(Status))
149 W32kCallWindowProc(WNDPROC Proc,
155 WINDOWPROC_CALLBACK_ARGUMENTS Arguments;
161 if (W32kIsDesktopWindow(Wnd))
163 return(W32kDesktopWindowProc(Wnd, Message, wParam, lParam));
166 Arguments.Proc = Proc;
168 Arguments.Msg = Message;
169 Arguments.wParam = wParam;
170 Arguments.lParam = lParam;
171 ResultPointer = &Result;
172 ResultLength = sizeof(LRESULT);
173 Status = NtW32Call(USER32_CALLBACK_WINDOWPROC,
175 sizeof(WINDOWPROC_CALLBACK_ARGUMENTS),
178 if (!NT_SUCCESS(Status))
186 W32kSendGETMINMAXINFOMessage(HWND Wnd, MINMAXINFO* MinMaxInfo)
188 SENDGETMINMAXINFO_CALLBACK_ARGUMENTS Arguments;
189 SENDGETMINMAXINFO_CALLBACK_RESULT Result;
195 Arguments.MinMaxInfo = *MinMaxInfo;
196 ResultPointer = &Result;
197 ResultLength = sizeof(Result);
198 Status = NtW32Call(USER32_CALLBACK_SENDGETMINMAXINFO,
200 sizeof(SENDGETMINMAXINFO_CALLBACK_ARGUMENTS),
203 if (!NT_SUCCESS(Status))
207 return(Result.Result);
211 W32kCallTrampolineWindowProc(WNDPROC Proc,
220 return(W32kSendNCCREATEMessage(Wnd, (CREATESTRUCTW*)lParam));
223 return(W32kSendCREATEMessage(Wnd, (CREATESTRUCTW*)lParam));
225 case WM_GETMINMAXINFO:
226 return(W32kSendGETMINMAXINFOMessage(Wnd, (MINMAXINFO*)lParam));
232 return(W32kSendNCCALCSIZEMessage(Wnd, TRUE, NULL,
233 (NCCALCSIZE_PARAMS*)lParam));
237 return(W32kSendNCCALCSIZEMessage(Wnd, FALSE, (RECT*)lParam, NULL));
242 return(W32kCallWindowProc(Proc, Wnd, Message, wParam, lParam));