reactos/reactos/lib/user32/windows/window.c

943 lines
18 KiB
C
Raw Normal View History

/* $Id: window.c,v 1.17 2003/03/04 22:34:48 rcampbell Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/window.c
* PURPOSE: Window management
* PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* UPDATE HISTORY:
* 06-06-2001 CSH Created
*/
/* INCLUDES ******************************************************************/
#include <windows.h>
#include <user32.h>
#include <window.h>
#include <debug.h>
#include <user32/callback.h>
/* FUNCTIONS *****************************************************************/
NTSTATUS STDCALL
User32SendNCCALCSIZEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
{
PSENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
SENDNCCALCSIZEMESSAGE_CALLBACK_RESULT Result;
WNDPROC Proc;
DbgPrint("User32SendNCCALCSIZEMessageForKernel.\n");
CallbackArgs = (PSENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(SENDNCCALCSIZEMESSAGE_CALLBACK_ARGUMENTS))
{
DbgPrint("Wrong length.\n");
return(STATUS_INFO_LENGTH_MISMATCH);
}
Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
DbgPrint("Proc %X\n", Proc);
/* Call the window procedure; notice kernel messages are always unicode. */
if (CallbackArgs->Validate)
{
Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCALCSIZE,
TRUE,
(LPARAM)&CallbackArgs->Params);
Result.Params = CallbackArgs->Params;
}
else
{
Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCALCSIZE,
FALSE, (LPARAM)&CallbackArgs->Rect);
Result.Rect = CallbackArgs->Rect;
}
DbgPrint("Returning result %d.\n", Result);
return(ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS));
}
NTSTATUS STDCALL
User32SendGETMINMAXINFOMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
{
PSENDGETMINMAXINFO_CALLBACK_ARGUMENTS CallbackArgs;
SENDGETMINMAXINFO_CALLBACK_RESULT Result;
WNDPROC Proc;
DbgPrint("User32SendGETMINAXINFOMessageForKernel.\n");
CallbackArgs = (PSENDGETMINMAXINFO_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(SENDGETMINMAXINFO_CALLBACK_ARGUMENTS))
{
DbgPrint("Wrong length.\n");
return(STATUS_INFO_LENGTH_MISMATCH);
}
Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
DbgPrint("Proc %X\n", Proc);
/* Call the window procedure; notice kernel messages are always unicode. */
Result.Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_GETMINMAXINFO,
0, (LPARAM)&CallbackArgs->MinMaxInfo);
Result.MinMaxInfo = CallbackArgs->MinMaxInfo;
DbgPrint("Returning result %d.\n", Result);
return(ZwCallbackReturn(&Result, sizeof(Result), STATUS_SUCCESS));
}
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
NTSTATUS STDCALL
User32SendCREATEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
{
PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
WNDPROC Proc;
LRESULT Result;
DbgPrint("User32SendCREATEMessageForKernel.\n");
CallbackArgs = (PSENDCREATEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(SENDCREATEMESSAGE_CALLBACK_ARGUMENTS))
{
DbgPrint("Wrong length.\n");
return(STATUS_INFO_LENGTH_MISMATCH);
}
Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
DbgPrint("Proc %X\n", Proc);
/* Call the window procedure; notice kernel messages are always unicode. */
Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_CREATE, 0,
(LPARAM)&CallbackArgs->CreateStruct);
DbgPrint("Returning result %d.\n", Result);
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
}
NTSTATUS STDCALL
User32SendNCCREATEMessageForKernel(PVOID Arguments, ULONG ArgumentLength)
{
PSENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS CallbackArgs;
WNDPROC Proc;
LRESULT Result;
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
DbgPrint("User32SendNCCREATEMessageForKernel.\n");
CallbackArgs = (PSENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(SENDNCCREATEMESSAGE_CALLBACK_ARGUMENTS))
{
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
DbgPrint("Wrong length.\n");
return(STATUS_INFO_LENGTH_MISMATCH);
}
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
Proc = (WNDPROC)GetWindowLongW(CallbackArgs->Wnd, GWL_WNDPROC);
DbgPrint("Proc %X\n", Proc);
/* Call the window procedure; notice kernel messages are always unicode. */
Result = CallWindowProcW(Proc, CallbackArgs->Wnd, WM_NCCREATE, 0,
(LPARAM)&CallbackArgs->CreateStruct);
DbgPrint("Returning result %d.\n", Result);
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}
NTSTATUS STDCALL
User32CallSendAsyncProcForKernel(PVOID Arguments, ULONG ArgumentLength)
{
PSENDASYNCPROC_CALLBACK_ARGUMENTS CallbackArgs;
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
DbgPrint("User32CallSendAsyncProcKernel()\n");
CallbackArgs = (PSENDASYNCPROC_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
{
return(STATUS_INFO_LENGTH_MISMATCH);
}
2002-07-04 David Welch <welch@computer2.darkstar.org> * subsys/win32k/include/callback.h: Fixed callback argument definitions. * subsys/win32k/ntuser/winpos.c: Implemented some more of the windows sizing/moving code. * subsys/win32k/ntuser/painting.c: Implemented some more of the window painting code. * subsys/win32k/objects/coord.c: Implemented LPtoDP and DPtoLP. * subsys/win32k/objects/region.c: Added stubs for some more region functions. 2002-07-04 David Welch <welch@computer2.darkstar.org> * ntoskrnl/ps/process.c (NtCreateProcess): Duplicate the process desktop handle as well. 2002-07-04 David Welch <welch@computer2.darkstar.org> * ntoskrnl/se/token.c: Don't call the ZwXXX variant of system calls when in system context. 2002-07-04 David Welch <welch@computer2.darkstar.org> * ntoskrnl/Makefile: Added file with MDA output code. * ntoskrnl/kd/kdebug.c: Recognize MDA as a destination for debug output. 2002-07-04 David Welch <welch@computer2.darkstar.org> * lib/user32/windows/defwnd.c: Implemented some more of the default window handler. 2002-07-04 David Welch <welch@computer2.darkstar.org> * lib/user32/misc/stubs.c: Removed some stubs to seperate files. 2002-07-04 David Welch <welch@computer2.darkstar.org> * lib/user32/user32.def: Export ScreenToClient otherwise we get problems when code in user32 tries to call it. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/win32k/region.h: Added prototypes for some missing region functions. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/win32k/ntuser.h: Added prototypes for some missing NtUserXXX functions. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/user32/wininternal.h: Added some constants for private GetDCEx styles that WINE needs. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/user32/callback.h: Fixed callbacks for messages with parameters. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/napi/win32.h (W32THREAD): Added pointer to the thread's desktop. * include/napi/win32.h (W32PROCESS): Removed handle table, added a pointer to the process's window station. * subsys/win32k/ntuser/guicheck.c (W32kGuiCheck): Reference a process's window station on the first win32k system call. Reference a thread's desktop on the first win32k system call. 2002-07-04 David Welch <welch@computer2.darkstar.org> * include/messages.h: Added some missing WM_XXX constants. 2002-07-04 David Welch <welch@computer2.darkstar.org> * drivers/dd/ide/makefile: Compiling with debugging messages needs libgcc to be linked in. 2002-07-04 David Welch <welch@computer2.darkstar.org> * iface/addsys/genw32k.c: Generate a variable with the number of system calls. * iface/native/genntdll.c: Generate a proper stack frame for the user system call stubs. * ntoskrnl/ke/i386/syscall.S: Generate a proper stack frame for the handler for system calls. 2002-07-04 David Welch <welch@computer2.darkstar.org> * Makefile: Build the GUI startup application. * subsys/system/gstart/gstart.c: Application to start up the GUI. svn path=/trunk/; revision=3179
2002-07-04 19:56:38 +00:00
CallbackArgs->Callback(CallbackArgs->Wnd, CallbackArgs->Msg,
CallbackArgs->Context, CallbackArgs->Result);
return(STATUS_SUCCESS);
}
NTSTATUS STDCALL
User32CallWindowProcFromKernel(PVOID Arguments, ULONG ArgumentLength)
{
PWINDOWPROC_CALLBACK_ARGUMENTS CallbackArgs;
LRESULT Result;
CallbackArgs = (PWINDOWPROC_CALLBACK_ARGUMENTS)Arguments;
if (ArgumentLength != sizeof(WINDOWPROC_CALLBACK_ARGUMENTS))
{
return(STATUS_INFO_LENGTH_MISMATCH);
}
if (CallbackArgs->Proc == NULL)
{
CallbackArgs->Proc = (WNDPROC)GetWindowLong(CallbackArgs->Wnd,
GWL_WNDPROC);
}
2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * tools/helper.mk: Make an import library a proper target depending on the .def file. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/ntuser/window.c (NtUserGetWindowLong): Began implementation. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/misc/object.c (ObmCreateHandle): Return the correct handle value. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * subsys/win32k/makefile: Make win32k depend on the file containing the service table. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * ntoskrnl/ke/i386/stkswitch.S (KeSwitchStackAndRet, KePushAndStackSwitchAndSysRet): Push one value only. * ntoskrnl/ps/w32call.c (NtCallbackReturn, NtW32Call): Moved these functions to a new file. Restore the old trap frame after returning from a callback. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * lib/user32/windows/message.c (CallWindowProcA, CallWindowProcW): Convert message to Unicode or ASCII if necessary. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/user32/callback.h: Added WM_CREATE and WM_NCCALCSIZE callbacks. * lib/user32/windows/window.c (User32SendCREATEMessageForKernel, User32SendNCCREATEMessageForKernel): Implemented. * subsys/win32k/ntuser/callback.c (W32kSendCREATEMessage): Implemented. 2002-06-18 David Welch <welch@whitehall1-5.seh.ox.ac.uk> * include/structs.h: Added Unicode and ASCII versions of CREATESTRUCT. svn path=/trunk/; revision=3118
2002-06-18 21:51:11 +00:00
Result = CallWindowProcW(CallbackArgs->Proc, CallbackArgs->Wnd,
CallbackArgs->Msg, CallbackArgs->wParam,
CallbackArgs->lParam);
return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}
WINBOOL STDCALL
AdjustWindowRect(LPRECT lpRect,
DWORD dwStyle,
WINBOOL bMenu)
{
return(AdjustWindowRectEx(lpRect, dwStyle, bMenu, 0));
}
WINBOOL STDCALL
AdjustWindowRectEx(LPRECT lpRect,
DWORD dwStyle,
WINBOOL bMenu,
DWORD dwExStyle)
{
return(FALSE);
}
WINBOOL STDCALL
AllowSetForegroundWindow(DWORD dwProcessId)
{
return(FALSE);
}
WINBOOL STDCALL
AnimateWindow(HWND hwnd,
DWORD dwTime,
DWORD dwFlags)
{
return FALSE;
}
UINT STDCALL
ArrangeIconicWindows(HWND hWnd)
{
return 0;
}
HDWP STDCALL
BeginDeferWindowPos(int nNumWindows)
{
return (HDWP)0;
}
WINBOOL STDCALL
BringWindowToTop(HWND hWnd)
{
return FALSE;
}
WORD STDCALL
CascadeWindows(HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
const HWND *lpKids)
{
return 0;
}
HWND STDCALL
ChildWindowFromPoint(HWND hWndParent,
POINT Point)
{
return (HWND)0;
}
HWND STDCALL
ChildWindowFromPointEx(HWND hwndParent,
POINT pt,
UINT uFlags)
{
return (HWND)0;
}
WINBOOL STDCALL
CloseWindow(HWND hWnd)
{
return FALSE;
}
HWND STDCALL
CreateWindowExA(DWORD dwExStyle,
LPCSTR lpClassName,
LPCSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam)
{
UNICODE_STRING WindowName;
UNICODE_STRING ClassName;
HWND Handle;
INT sw;
if (IS_ATOM(lpClassName))
{
RtlInitUnicodeString(&ClassName, NULL);
ClassName.Buffer = (LPWSTR)lpClassName;
}
else
{
if (!RtlCreateUnicodeStringFromAsciiz(&(ClassName), (PCSZ)lpClassName))
{
SetLastError(ERROR_OUTOFMEMORY);
return (HWND)0;
}
}
if (!RtlCreateUnicodeStringFromAsciiz(&WindowName, (PCSZ)lpWindowName))
{
if (!IS_ATOM(lpClassName))
{
RtlFreeUnicodeString(&ClassName);
}
SetLastError(ERROR_OUTOFMEMORY);
return (HWND)0;
}
/* Fixup default coordinates. */
sw = SW_SHOW;
if (x == (LONG) CW_USEDEFAULT || nWidth == (LONG) CW_USEDEFAULT)
{
if (dwStyle & (WS_CHILD | WS_POPUP))
{
if (x == (LONG) CW_USEDEFAULT)
{
x = y = 0;
}
if (nWidth == (LONG) CW_USEDEFAULT)
{
nWidth = nHeight = 0;
}
}
else
{
STARTUPINFOA info;
GetStartupInfoA(&info);
if (x == (LONG) CW_USEDEFAULT)
{
if (y != (LONG) CW_USEDEFAULT)
{
sw = y;
}
x = (info.dwFlags & STARTF_USEPOSITION) ? info.dwX : 0;
y = (info.dwFlags & STARTF_USEPOSITION) ? info.dwY : 0;
}
if (nWidth == (LONG) CW_USEDEFAULT)
{
if (info.dwFlags & STARTF_USESIZE)
{
nWidth = info.dwXSize;
nHeight = info.dwYSize;
}
else
{
RECT r;
SystemParametersInfoA(SPI_GETWORKAREA, 0, &r, 0);
nWidth = (((r.right - r.left) * 3) / 4) - x;
nHeight = (((r.bottom - r.top) * 3) / 4) - y;
}
}
}
}
Handle = NtUserCreateWindowEx(dwExStyle,
&ClassName,
&WindowName,
dwStyle,
x,
y,
nWidth,
nHeight,
hWndParent,
hMenu,
hInstance,
lpParam,
sw);
RtlFreeUnicodeString(&WindowName);
if (!IS_ATOM(lpClassName))
{
RtlFreeUnicodeString(&ClassName);
}
return Handle;
}
HWND STDCALL
CreateWindowExW(DWORD dwExStyle,
LPCWSTR lpClassName,
LPCWSTR lpWindowName,
DWORD dwStyle,
int x,
int y,
int nWidth,
int nHeight,
HWND hWndParent,
HMENU hMenu,
HINSTANCE hInstance,
LPVOID lpParam)
{
UNICODE_STRING WindowName;
UNICODE_STRING ClassName;
HANDLE Handle;
UINT sw;
if (IS_ATOM(lpClassName))
{
RtlInitUnicodeString(&ClassName, NULL);
ClassName.Buffer = (LPWSTR)lpClassName;
}
else
{
RtlInitUnicodeString(&ClassName, lpClassName);
}
RtlInitUnicodeString(&WindowName, lpWindowName);
/* Fixup default coordinates. */
sw = SW_SHOW;
if (x == (LONG) CW_USEDEFAULT || nWidth == (LONG) CW_USEDEFAULT)
{
if (dwStyle & (WS_CHILD | WS_POPUP))
{
if (x == (LONG) CW_USEDEFAULT)
{
x = y = 0;
}
if (nWidth == (LONG) CW_USEDEFAULT)
{
nWidth = nHeight = 0;
}
}
else
{
STARTUPINFOW info;
GetStartupInfoW(&info);
if (x == (LONG) CW_USEDEFAULT)
{
if (y != (LONG) CW_USEDEFAULT)
{
sw = y;
}
x = (info.dwFlags & STARTF_USEPOSITION) ? info.dwX : 0;
y = (info.dwFlags & STARTF_USEPOSITION) ? info.dwY : 0;
}
if (nWidth == (LONG) CW_USEDEFAULT)
{
if (info.dwFlags & STARTF_USESIZE)
{
nWidth = info.dwXSize;
nHeight = info.dwYSize;
}
else
{
RECT r;
SystemParametersInfoW(SPI_GETWORKAREA, 0, &r, 0);
nWidth = (((r.right - r.left) * 3) / 4) - x;
nHeight = (((r.bottom - r.top) * 3) / 4) - y;
}
}
}
}
Handle = NtUserCreateWindowEx(dwExStyle,
&ClassName,
&WindowName,
dwStyle,
x,
y,
nWidth,
nHeight,
hWndParent,
hMenu,
hInstance,
lpParam,
0);
return (HWND)Handle;
}
HDWP STDCALL
DeferWindowPos(HDWP hWinPosInfo,
HWND hWnd,
HWND hWndInsertAfter,
int x,
int y,
int cx,
int cy,
UINT uFlags)
{
return (HDWP)0;
}
WINBOOL STDCALL
DestroyWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
EndDeferWindowPos(HDWP hWinPosInfo)
{
return FALSE;
}
WINBOOL STDCALL
EnumChildWindows(HWND hWndParent,
ENUMWINDOWSPROC lpEnumFunc,
LPARAM lParam)
{
return FALSE;
}
WINBOOL STDCALL
EnumThreadWindows(DWORD dwThreadId,
ENUMWINDOWSPROC lpfn,
LPARAM lParam)
{
return FALSE;
}
WINBOOL STDCALL
EnumWindows(ENUMWINDOWSPROC lpEnumFunc,
LPARAM lParam)
{
return FALSE;
}
HWND STDCALL
FindWindowA(LPCSTR lpClassName, LPCSTR lpWindowName)
{
//FIXME: FindWindow does not search children, but FindWindowEx does.
// what should we do about this?
return FindWindowExA (NULL, NULL, lpClassName, lpWindowName);
}
HWND STDCALL
FindWindowExA(HWND hwndParent,
HWND hwndChildAfter,
LPCSTR lpszClass,
LPCSTR lpszWindow)
{
return (HWND)0;
}
HWND STDCALL
FindWindowW(LPCWSTR lpClassName, LPCWSTR lpWindowName)
{
//FIXME: FindWindow does not search children, but FindWindowEx does.
// what should we do about this?
return FindWindowExW (NULL, NULL, lpClassName, lpWindowName);
}
HWND STDCALL
FindWindowExW(HWND hwndParent,
HWND hwndChildAfter,
LPCWSTR lpszClass,
LPCWSTR lpszWindow)
{
return (HWND)0;
}
WINBOOL STDCALL
GetAltTabInfo(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPTSTR pszItemText,
UINT cchItemText)
{
return FALSE;
}
WINBOOL STDCALL
GetAltTabInfoA(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPSTR pszItemText,
UINT cchItemText)
{
return FALSE;
}
WINBOOL STDCALL
GetAltTabInfoW(HWND hwnd,
int iItem,
PALTTABINFO pati,
LPWSTR pszItemText,
UINT cchItemText)
{
return FALSE;
}
HWND STDCALL
GetAncestor(HWND hwnd, UINT gaFlags)
{
return(NtUserGetAncestor(hwnd, gaFlags));
}
WINBOOL STDCALL
GetClientRect(HWND hWnd, LPRECT lpRect)
{
return FALSE;
}
HWND STDCALL
GetDesktopWindow(VOID)
{
return (HWND)0;
}
HWND STDCALL
GetForegroundWindow(VOID)
{
return (HWND)0;
}
WINBOOL STDCALL
GetGUIThreadInfo(DWORD idThread,
LPGUITHREADINFO lpgui)
{
return FALSE;
}
HWND STDCALL
GetLastActivePopup(HWND hWnd)
{
return (HWND)0;
}
HWND STDCALL
GetParent(HWND hWnd)
{
return (HWND)0;
}
WINBOOL STDCALL
GetProcessDefaultLayout(DWORD *pdwDefaultLayout)
{
return FALSE;
}
WINBOOL STDCALL
GetTitleBarInfo(HWND hwnd,
PTITLEBARINFO pti)
{
return FALSE;
}
HWND STDCALL
GetTopWindow(HWND hWnd)
{
return (HWND)0;
}
HWND STDCALL
GetWindow(HWND hWnd,
UINT uCmd)
{
return (HWND)0;
}
WINBOOL STDCALL
GetWindowInfo(HWND hwnd,
PWINDOWINFO pwi)
{
return FALSE;
}
UINT STDCALL
GetWindowModuleFileName(HWND hwnd,
LPSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
UINT STDCALL
GetWindowModuleFileNameA(HWND hwnd,
LPSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
UINT STDCALL
GetWindowModuleFileNameW(HWND hwnd,
LPWSTR lpszFileName,
UINT cchFileNameMax)
{
return 0;
}
WINBOOL STDCALL
GetWindowPlacement(HWND hWnd,
WINDOWPLACEMENT *lpwndpl)
{
return FALSE;
}
WINBOOL STDCALL
GetWindowRect(HWND hWnd,
LPRECT lpRect)
{
return(NtUserGetWindowRect(hWnd, lpRect));
}
int STDCALL
GetWindowTextA(HWND hWnd, LPSTR lpString, int nMaxCount)
{
return(SendMessageA(hWnd, WM_GETTEXT, nMaxCount, (LPARAM)lpString));
}
int STDCALL
GetWindowTextLengthA(HWND hWnd)
{
return(SendMessageA(hWnd, WM_GETTEXTLENGTH, 0, 0));
}
int STDCALL
GetWindowTextLengthW(HWND hWnd)
{
return 0;
}
int STDCALL
GetWindowTextW(HWND hWnd,
LPWSTR lpString,
int nMaxCount)
{
return 0;
}
DWORD STDCALL
GetWindowThreadProcessId(HWND hWnd,
LPDWORD lpdwProcessId)
{
return 0;
}
WINBOOL STDCALL
IsChild(HWND hWndParent,
HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
IsIconic(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
IsWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
IsWindowUnicode(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
IsWindowVisible(HWND hWnd)
{
while (GetWindowLong(hWnd, GWL_STYLE) & WS_CHILD)
{
if (!(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE))
{
return(FALSE);
}
hWnd = GetAncestor(hWnd, GA_PARENT);
}
return(GetWindowLong(hWnd, GWL_STYLE) & WS_VISIBLE);
}
WINBOOL STDCALL
IsZoomed(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
LockSetForegroundWindow(UINT uLockCode)
{
return FALSE;
}
WINBOOL STDCALL
MoveWindow(HWND hWnd,
int X,
int Y,
int nWidth,
int nHeight,
WINBOOL bRepaint)
{
int flags = SWP_NOZORDER | SWP_NOACTIVATE;
if (!bRepaint) flags |= SWP_NOREDRAW;
return SetWindowPos( hWnd, 0, X, Y, nWidth, nHeight, SWP_NOZORDER |
SWP_NOACTIVATE | bRepaint ? SWP_NOREDRAW : 0 );
}
WINBOOL STDCALL
OpenIcon(HWND hWnd)
{
return FALSE;
}
HWND STDCALL
RealChildWindowFromPoint(HWND hwndParent,
POINT ptParentClientCoords)
{
return (HWND)0;
}
UINT
RealGetWindowClass(HWND hwnd,
LPTSTR pszType,
UINT cchType)
{
return 0;
}
WINBOOL STDCALL
SetForegroundWindow(HWND hWnd)
{
return FALSE;
}
WINBOOL STDCALL
SetLayeredWindowAttributes(HWND hwnd,
COLORREF crKey,
BYTE bAlpha,
DWORD dwFlags)
{
return FALSE;
}
HWND STDCALL
SetParent(HWND hWndChild,
HWND hWndNewParent)
{
return (HWND)0;
}
WINBOOL STDCALL
SetProcessDefaultLayout(DWORD dwDefaultLayout)
{
return FALSE;
}
WINBOOL STDCALL
SetWindowPlacement(HWND hWnd,
CONST WINDOWPLACEMENT *lpwndpl)
{
return FALSE;
}
WINBOOL STDCALL
SetWindowPos(HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags)
{
return FALSE;
}
WINBOOL STDCALL
SetWindowTextA(HWND hWnd,
LPCSTR lpString)
{
return FALSE;
}
WINBOOL STDCALL
SetWindowTextW(HWND hWnd,
LPCWSTR lpString)
{
return FALSE;
}
WINBOOL STDCALL
ShowOwnedPopups(HWND hWnd,
WINBOOL fShow)
{
return FALSE;
}
WINBOOL STDCALL
ShowWindow(HWND hWnd,
int nCmdShow)
{
return NtUserShowWindow(hWnd, nCmdShow);
}
WINBOOL STDCALL
ShowWindowAsync(HWND hWnd,
int nCmdShow)
{
return FALSE;
}
WORD STDCALL
TileWindows(HWND hwndParent,
UINT wHow,
CONST RECT *lpRect,
UINT cKids,
const HWND *lpKids)
{
return 0;
}
WINBOOL STDCALL
UpdateLayeredWindow(HWND hwnd,
HDC hdcDst,
POINT *pptDst,
SIZE *psize,
HDC hdcSrc,
POINT *pptSrc,
COLORREF crKey,
BLENDFUNCTION *pblend,
DWORD dwFlags)
{
return FALSE;
}
HWND STDCALL
WindowFromPoint(POINT Point)
{
return (HWND)0;
}
int STDCALL
MapWindowPoints(HWND hWndFrom, HWND hWndTo, LPPOINT lpPoints, UINT cPoints)
{
POINT FromOffset, ToOffset;
LONG XMove, YMove;
ULONG i;
NtUserGetClientOrigin(hWndFrom, &FromOffset);
NtUserGetClientOrigin(hWndTo, &ToOffset);
XMove = ToOffset.x - FromOffset.x;
YMove = ToOffset.y - FromOffset.y;
for (i = 0; i < cPoints; i++)
{
lpPoints[i].x += XMove;
lpPoints[i].y += YMove;
}
return(MAKELONG(LOWORD(XMove), LOWORD(YMove)));
}
WINBOOL STDCALL
ScreenToClient(HWND hWnd, LPPOINT lpPoint)
{
return(MapWindowPoints(NULL, hWnd, lpPoint, 1));
}
/* EOF */