+/*
+ * ReactOS W32 Subsystem
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
/* $Id$
*
* COPYRIGHT: See COPYING in the top level directory
#include <include/class.h>
#include <include/error.h>
#include <include/winsta.h>
+#include <include/window.h>
#include <include/msgqueue.h>
#include <user32/callback.h>
#include <include/callback.h>
/* FUNCTIONS *****************************************************************/
VOID STDCALL
-W32kCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
+IntCallSentMessageCallback(SENDASYNCPROC CompletionCallback,
HWND hWnd,
UINT Msg,
ULONG_PTR CompletionCallbackContext,
}
LRESULT STDCALL
-W32kSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
+IntSendNCCALCSIZEMessage(HWND Wnd, BOOL Validate, PRECT Rect,
NCCALCSIZE_PARAMS* Params)
{
SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS Arguments;
}
LRESULT STDCALL
-W32kSendCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
+IntSendCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
{
SENDCREATEMESSAGE_CALLBACK_ARGUMENTS Arguments;
LRESULT Result;
}
LRESULT STDCALL
-W32kSendNCCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
+IntSendNCCREATEMessage(HWND Wnd, CREATESTRUCTW* CreateStruct)
{
SENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS Arguments;
LRESULT Result;
}
LRESULT STDCALL
-W32kCallWindowProc(WNDPROC Proc,
+IntCallWindowProc(WNDPROC Proc,
HWND Wnd,
UINT Message,
WPARAM wParam,
NTSTATUS Status;
PVOID ResultPointer;
ULONG ResultLength;
+ PWINDOW_OBJECT WindowObject = IntGetWindowObject(Wnd);
- if (W32kIsDesktopWindow(Wnd))
+ if (IntIsDesktopWindow(WindowObject))
{
- return(W32kDesktopWindowProc(Wnd, Message, wParam, lParam));
+ IntReleaseWindowObject(WindowObject);
+ return(IntDesktopWindowProc(Wnd, Message, wParam, lParam));
}
+ IntReleaseWindowObject(WindowObject);
Arguments.Proc = Proc;
Arguments.Wnd = Wnd;
}
LRESULT STDCALL
-W32kSendGETMINMAXINFOMessage(HWND Wnd, MINMAXINFO* MinMaxInfo)
+IntSendGETMINMAXINFOMessage(HWND Wnd, MINMAXINFO* MinMaxInfo)
{
SENDGETMINMAXINFO_CALLBACK_ARGUMENTS Arguments;
SENDGETMINMAXINFO_CALLBACK_RESULT Result;
}
LRESULT STDCALL
-W32kCallTrampolineWindowProc(WNDPROC Proc,
+IntSendWINDOWPOSCHANGINGMessage(HWND Wnd, WINDOWPOS* WindowPos)
+{
+ SENDWINDOWPOSCHANGING_CALLBACK_ARGUMENTS Arguments;
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ Arguments.Wnd = Wnd;
+ Arguments.WindowPos = *WindowPos;
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_SENDWINDOWPOSCHANGING,
+ &Arguments,
+ sizeof(SENDWINDOWPOSCHANGING_CALLBACK_ARGUMENTS),
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ return(Result);
+}
+
+LRESULT STDCALL
+IntSendWINDOWPOSCHANGEDMessage(HWND Wnd, WINDOWPOS* WindowPos)
+{
+ SENDWINDOWPOSCHANGED_CALLBACK_ARGUMENTS Arguments;
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ Arguments.Wnd = Wnd;
+ Arguments.WindowPos = *WindowPos;
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_SENDWINDOWPOSCHANGED,
+ &Arguments,
+ sizeof(SENDWINDOWPOSCHANGED_CALLBACK_ARGUMENTS),
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ return(Result);
+}
+
+LRESULT STDCALL
+IntSendSTYLECHANGINGMessage(HWND Wnd, DWORD WhichStyle, STYLESTRUCT* Style)
+{
+ SENDSTYLECHANGING_CALLBACK_ARGUMENTS Arguments;
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ Arguments.Wnd = Wnd;
+ Arguments.Style = *Style;
+ Arguments.WhichStyle = WhichStyle;
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_SENDSTYLECHANGING,
+ &Arguments,
+ sizeof(SENDSTYLECHANGING_CALLBACK_ARGUMENTS),
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ *Style = Arguments.Style;
+ return(Result);
+}
+
+LRESULT STDCALL
+IntSendSTYLECHANGEDMessage(HWND Wnd, DWORD WhichStyle, STYLESTRUCT* Style)
+{
+ SENDSTYLECHANGED_CALLBACK_ARGUMENTS Arguments;
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ Arguments.Wnd = Wnd;
+ Arguments.Style = *Style;
+ Arguments.WhichStyle = WhichStyle;
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_SENDSTYLECHANGED,
+ &Arguments,
+ sizeof(SENDSTYLECHANGED_CALLBACK_ARGUMENTS),
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ return(Result);
+}
+
+LRESULT STDCALL
+IntCallTrampolineWindowProc(WNDPROC Proc,
HWND Wnd,
UINT Message,
WPARAM wParam,
switch (Message)
{
case WM_NCCREATE:
- return(W32kSendNCCREATEMessage(Wnd, (CREATESTRUCTW*)lParam));
+ return IntSendNCCREATEMessage(Wnd, (CREATESTRUCTW*)lParam);
case WM_CREATE:
- return(W32kSendCREATEMessage(Wnd, (CREATESTRUCTW*)lParam));
+ return IntSendCREATEMessage(Wnd, (CREATESTRUCTW*)lParam);
case WM_GETMINMAXINFO:
- return(W32kSendGETMINMAXINFOMessage(Wnd, (MINMAXINFO*)lParam));
+ return IntSendGETMINMAXINFOMessage(Wnd, (MINMAXINFO*)lParam);
case WM_NCCALCSIZE:
{
if (wParam)
{
- return(W32kSendNCCALCSIZEMessage(Wnd, TRUE, NULL,
- (NCCALCSIZE_PARAMS*)lParam));
+ return IntSendNCCALCSIZEMessage(Wnd, TRUE, NULL,
+ (NCCALCSIZE_PARAMS*)lParam);
}
else
{
- return(W32kSendNCCALCSIZEMessage(Wnd, FALSE, (RECT*)lParam, NULL));
+ return IntSendNCCALCSIZEMessage(Wnd, FALSE, (RECT*)lParam, NULL);
}
}
+ case WM_WINDOWPOSCHANGING:
+ return IntSendWINDOWPOSCHANGINGMessage(Wnd, (WINDOWPOS*) lParam);
+
+ case WM_WINDOWPOSCHANGED:
+ return IntSendWINDOWPOSCHANGEDMessage(Wnd, (WINDOWPOS*) lParam);
+
+ case WM_STYLECHANGING:
+ return IntSendSTYLECHANGINGMessage(Wnd, wParam, (STYLESTRUCT*) lParam);
+
+ case WM_STYLECHANGED:
+ return IntSendSTYLECHANGEDMessage(Wnd, wParam, (STYLESTRUCT*) lParam);
+
default:
- return(W32kCallWindowProc(Proc, Wnd, Message, wParam, lParam));
+ return(IntCallWindowProc(Proc, Wnd, Message, wParam, lParam));
+ }
+}
+
+HMENU STDCALL
+IntLoadSysMenuTemplate()
+{
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_LOADSYSMENUTEMPLATE,
+ NULL,
+ 0,
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
+ }
+ return (HMENU)Result;
+}
+
+BOOL STDCALL
+IntLoadDefaultCursors()
+{
+ LRESULT Result;
+ NTSTATUS Status;
+ PVOID ResultPointer;
+ ULONG ResultLength;
+
+ ResultPointer = &Result;
+ ResultLength = sizeof(LRESULT);
+ Status = NtW32Call(USER32_CALLBACK_LOADDEFAULTCURSORS,
+ NULL,
+ 0,
+ &ResultPointer,
+ &ResultLength);
+ if (!NT_SUCCESS(Status))
+ {
+ return(0);
}
+ return (BOOL)Result;
}
/* EOF */