mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:36:04 +00:00
WndProc changes by Jonathan Wilson
svn path=/trunk/; revision=6621
This commit is contained in:
parent
bd9ad38a70
commit
44a3da7588
14 changed files with 182 additions and 74 deletions
|
@ -318,7 +318,7 @@ NtUserCreateCursorIconHandle 2
|
||||||
NtUserCreateDesktop 5
|
NtUserCreateDesktop 5
|
||||||
NtUserCreateLocalMemHandle 4
|
NtUserCreateLocalMemHandle 4
|
||||||
NtUserCreateMenu 0
|
NtUserCreateMenu 0
|
||||||
NtUserCreateWindowEx 13
|
NtUserCreateWindowEx 14
|
||||||
NtUserCreateWindowStation 6
|
NtUserCreateWindowStation 6
|
||||||
NtUserDdeGetQualityOfService 3
|
NtUserDdeGetQualityOfService 3
|
||||||
NtUserDdeInitialize 5
|
NtUserDdeInitialize 5
|
||||||
|
@ -563,6 +563,7 @@ NtUserGetParent 1
|
||||||
NtUserGetWindow 2
|
NtUserGetWindow 2
|
||||||
NtUserGetLastActivePopup 1
|
NtUserGetLastActivePopup 1
|
||||||
NtUserGetShellWindow 0
|
NtUserGetShellWindow 0
|
||||||
|
NtUserDereferenceWndProcHandle 2
|
||||||
# DirectDraw system calls
|
# DirectDraw system calls
|
||||||
NtGdiD3dContextCreate 4
|
NtGdiD3dContextCreate 4
|
||||||
NtGdiD3dContextDestroy 1
|
NtGdiD3dContextDestroy 1
|
||||||
|
|
|
@ -312,7 +312,8 @@ NtUserCreateWindowEx(
|
||||||
HMENU hMenu,
|
HMENU hMenu,
|
||||||
HINSTANCE hInstance,
|
HINSTANCE hInstance,
|
||||||
LPVOID lpParam,
|
LPVOID lpParam,
|
||||||
DWORD Unknown12);
|
DWORD dwShowMode,
|
||||||
|
BOOL bUnicodeWindow);
|
||||||
|
|
||||||
HWINSTA
|
HWINSTA
|
||||||
STDCALL
|
STDCALL
|
||||||
|
@ -1190,7 +1191,7 @@ RTL_ATOM
|
||||||
STDCALL
|
STDCALL
|
||||||
NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
|
NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
|
||||||
BOOL bUnicodeClass,
|
BOOL bUnicodeClass,
|
||||||
DWORD Unknown3,
|
WNDPROC wpExtra,
|
||||||
DWORD Unknown4,
|
DWORD Unknown4,
|
||||||
DWORD Unknown5);
|
DWORD Unknown5);
|
||||||
|
|
||||||
|
@ -1832,7 +1833,15 @@ NtUserGetWindow(HWND hWnd, UINT Relationship);
|
||||||
|
|
||||||
HWND STDCALL
|
HWND STDCALL
|
||||||
NtUserGetLastActivePopup(HWND hWnd);
|
NtUserGetLastActivePopup(HWND hWnd);
|
||||||
|
typedef struct _WndProcHandle
|
||||||
|
{
|
||||||
|
WNDPROC WindowProc;
|
||||||
|
BOOL IsUnicode;
|
||||||
|
HANDLE ProcessID;
|
||||||
|
} WndProcHandle;
|
||||||
|
|
||||||
|
DWORD STDCALL
|
||||||
|
NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
|
||||||
#endif /* __WIN32K_NTUSER_H */
|
#endif /* __WIN32K_NTUSER_H */
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: regcontrol.c,v 1.14 2003/11/02 06:58:57 navaraf Exp $
|
/* $Id: regcontrol.c,v 1.15 2003/11/11 20:28:20 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS User32
|
* PROJECT: ReactOS User32
|
||||||
|
@ -11,30 +11,34 @@
|
||||||
|
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "user32/regcontrol.h"
|
#include "user32/regcontrol.h"
|
||||||
|
#include "win32k/ntuser.h"
|
||||||
|
|
||||||
static void RegisterBuiltinClass(const struct builtin_class_descr *Descr)
|
static void RegisterBuiltinClass(const struct builtin_class_descr *Descr)
|
||||||
{
|
{
|
||||||
WNDCLASSW wc;
|
WNDCLASSEXW wc;
|
||||||
ATOM Class;
|
ATOM Class;
|
||||||
|
|
||||||
|
wc.cbSize = sizeof(WNDCLASSEXW);
|
||||||
wc.lpszClassName = Descr->name;
|
wc.lpszClassName = Descr->name;
|
||||||
wc.lpfnWndProc = Descr->procW;
|
wc.lpfnWndProc = Descr->procW;
|
||||||
wc.style = Descr->style;
|
wc.style = Descr->style;
|
||||||
wc.hInstance = NULL;
|
wc.hInstance = NULL;
|
||||||
wc.hIcon = NULL;
|
wc.hIcon = NULL;
|
||||||
|
wc.hIconSm = NULL;
|
||||||
wc.hCursor = LoadCursorW(NULL, Descr->cursor);
|
wc.hCursor = LoadCursorW(NULL, Descr->cursor);
|
||||||
wc.hbrBackground = Descr->brush;
|
wc.hbrBackground = Descr->brush;
|
||||||
wc.lpszMenuName = NULL;
|
wc.lpszMenuName = NULL;
|
||||||
wc.cbClsExtra = 0;
|
wc.cbClsExtra = 0;
|
||||||
wc.cbWndExtra = Descr->extra;
|
wc.cbWndExtra = Descr->extra;
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if(IS_ATOM(wc.lpszClassName))
|
if(IS_ATOM(wc.lpszClassName))
|
||||||
DbgPrint("Registering built-in class atom=0x%x\n", wc.lpszClassName);
|
DbgPrint("Registering built-in class atom=0x%x\n", wc.lpszClassName);
|
||||||
else
|
else
|
||||||
DbgPrint("Registering built-in class %wS\n", wc.lpszClassName);
|
DbgPrint("Registering built-in class %wS\n", wc.lpszClassName);
|
||||||
#endif
|
#endif
|
||||||
Class = RegisterClassW(&wc);
|
Class = NtUserRegisterClassExWOW(&wc,TRUE,Descr->procA,0,0);
|
||||||
#if 0
|
#if 0
|
||||||
DbgPrint("RegisterClassW = %d\n", Class);
|
DbgPrint("RegisterClassW = %d\n", Class);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: class.c,v 1.38 2003/08/20 03:07:33 silverblade Exp $
|
/* $Id: class.c,v 1.39 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -524,7 +524,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
||||||
wndclass.lpszMenuName = MenuName;
|
wndclass.lpszMenuName = MenuName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Atom = NtUserRegisterClassExWOW ( &wndclass, FALSE, 0, 0, 0 );
|
Atom = NtUserRegisterClassExWOW ( &wndclass, FALSE, (WNDPROC)0, 0, 0 );
|
||||||
|
|
||||||
/* free strings if neccessary */
|
/* free strings if neccessary */
|
||||||
if ( MenuName ) HEAP_free ( MenuName );
|
if ( MenuName ) HEAP_free ( MenuName );
|
||||||
|
@ -582,7 +582,7 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
||||||
wndclass.lpszMenuName = MenuName;
|
wndclass.lpszMenuName = MenuName;
|
||||||
}
|
}
|
||||||
|
|
||||||
Atom = NtUserRegisterClassExWOW ( &wndclass, TRUE, 0, 0, 0 );
|
Atom = NtUserRegisterClassExWOW ( &wndclass, TRUE, (WNDPROC)0, 0, 0 );
|
||||||
|
|
||||||
/* free strings if neccessary */
|
/* free strings if neccessary */
|
||||||
if ( MenuName ) HEAP_free ( MenuName );
|
if ( MenuName ) HEAP_free ( MenuName );
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: message.c,v 1.26 2003/11/08 09:33:14 navaraf Exp $
|
/* $Id: message.c,v 1.27 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -398,29 +398,25 @@ CallWindowProcA(WNDPROC lpPrevWndFunc,
|
||||||
MSG UnicodeMsg;
|
MSG UnicodeMsg;
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
BOOL IsHandle;
|
BOOL IsHandle;
|
||||||
|
WndProcHandle wphData;
|
||||||
|
|
||||||
if ((DWORD)lpPrevWndFunc > 0x80000000)
|
IsHandle = NtUserDereferenceWndProcHandle(lpPrevWndFunc,&wphData);
|
||||||
{
|
|
||||||
lpPrevWndFunc -= 0x80000000;
|
|
||||||
IsHandle = TRUE;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
IsHandle = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
AnsiMsg.hwnd = hWnd;
|
AnsiMsg.hwnd = hWnd;
|
||||||
AnsiMsg.message = Msg;
|
AnsiMsg.message = Msg;
|
||||||
AnsiMsg.wParam = wParam;
|
AnsiMsg.wParam = wParam;
|
||||||
AnsiMsg.lParam = lParam;
|
AnsiMsg.lParam = lParam;
|
||||||
|
if (!IsHandle)
|
||||||
if (IsWindowUnicode(hWnd))
|
{
|
||||||
|
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
||||||
|
} else {
|
||||||
|
if (wphData.IsUnicode)
|
||||||
{
|
{
|
||||||
if (!MsgiAnsiToUnicodeMessage(&UnicodeMsg, &AnsiMsg))
|
if (!MsgiAnsiToUnicodeMessage(&UnicodeMsg, &AnsiMsg))
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
Result = lpPrevWndFunc(hWnd, Msg, wParam, lParam);
|
Result = wphData.WindowProc(UnicodeMsg.hwnd, UnicodeMsg.message,
|
||||||
|
UnicodeMsg.wParam, UnicodeMsg.lParam);
|
||||||
if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result))
|
if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result))
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
|
@ -429,7 +425,8 @@ CallWindowProcA(WNDPROC lpPrevWndFunc,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
return(wphData.WindowProc(hWnd, Msg, wParam, lParam));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -445,26 +442,25 @@ CallWindowProcW(WNDPROC lpPrevWndFunc,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
BOOL IsHandle;
|
BOOL IsHandle;
|
||||||
if ((DWORD)lpPrevWndFunc > 0x80000000)
|
WndProcHandle wphData;
|
||||||
|
|
||||||
|
IsHandle = NtUserDereferenceWndProcHandle(lpPrevWndFunc,&wphData);
|
||||||
|
if (!IsHandle)
|
||||||
{
|
{
|
||||||
lpPrevWndFunc-= 0x80000000;
|
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
||||||
IsHandle = TRUE;
|
} else {
|
||||||
}
|
if (!wphData.IsUnicode)
|
||||||
else
|
|
||||||
{
|
|
||||||
IsHandle = FALSE;
|
|
||||||
}
|
|
||||||
if (!IsWindowUnicode(hWnd))
|
|
||||||
{
|
{
|
||||||
LRESULT Result;
|
LRESULT Result;
|
||||||
User32ConvertToAsciiMessage(&Msg, &wParam, &lParam);
|
User32ConvertToAsciiMessage(&Msg, &wParam, &lParam);
|
||||||
Result = lpPrevWndFunc(hWnd, Msg, wParam, lParam);
|
Result = wphData.WindowProc(hWnd, Msg, wParam, lParam);
|
||||||
User32FreeAsciiConvertedMessage(Msg, wParam, lParam);
|
User32FreeAsciiConvertedMessage(Msg, wParam, lParam);
|
||||||
return(Result);
|
return(Result);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
return(wphData.WindowProc(hWnd, Msg, wParam, lParam));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: window.c,v 1.80 2003/11/09 13:50:04 navaraf Exp $
|
/* $Id: window.c,v 1.81 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS user32.dll
|
* PROJECT: ReactOS user32.dll
|
||||||
|
@ -501,7 +501,8 @@ CreateWindowExA(DWORD dwExStyle,
|
||||||
hMenu,
|
hMenu,
|
||||||
hInstance,
|
hInstance,
|
||||||
lpParam,
|
lpParam,
|
||||||
sw);
|
sw,
|
||||||
|
FALSE);
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle);
|
DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle);
|
||||||
|
@ -631,7 +632,8 @@ CreateWindowExW(DWORD dwExStyle,
|
||||||
hMenu,
|
hMenu,
|
||||||
hInstance,
|
hInstance,
|
||||||
lpParam,
|
lpParam,
|
||||||
sw);
|
sw,
|
||||||
|
TRUE);
|
||||||
|
|
||||||
return (HWND)Handle;
|
return (HWND)Handle;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ ClassReferenceClassByNameOrAtom(PWNDCLASS_OBJECT *Class,
|
||||||
PWNDCLASS_OBJECT FASTCALL
|
PWNDCLASS_OBJECT FASTCALL
|
||||||
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
||||||
BOOL bUnicodeClass,
|
BOOL bUnicodeClass,
|
||||||
|
WNDPROC wpExtra,
|
||||||
RTL_ATOM Atom);
|
RTL_ATOM Atom);
|
||||||
struct _WINDOW_OBJECT;
|
struct _WINDOW_OBJECT;
|
||||||
ULONG FASTCALL
|
ULONG FASTCALL
|
||||||
|
|
|
@ -192,6 +192,9 @@ WINLOCK_TYPE FASTCALL IntSuspendWinLock();
|
||||||
VOID FASTCALL IntRestoreWinLock(WINLOCK_TYPE Type);
|
VOID FASTCALL IntRestoreWinLock(WINLOCK_TYPE Type);
|
||||||
inline BOOL IntInitializeWinLock();
|
inline BOOL IntInitializeWinLock();
|
||||||
inline VOID IntDeleteWinLock();
|
inline VOID IntDeleteWinLock();
|
||||||
|
DWORD IntRemoveWndProcHandle(WNDPROC Handle);
|
||||||
|
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
||||||
|
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
||||||
|
|
||||||
#endif /* __WIN32K_WINDOW_H */
|
#endif /* __WIN32K_WINDOW_H */
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: dllmain.c,v 1.48 2003/11/07 17:40:02 gvg Exp $
|
/* $Id: dllmain.c,v 1.49 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* Entry Point for win32k.sys
|
* Entry Point for win32k.sys
|
||||||
*/
|
*/
|
||||||
|
@ -94,7 +94,7 @@ Win32kProcessCallback (struct _EPROCESS *Process,
|
||||||
DbgPrint (" Destroy process\n");
|
DbgPrint (" Destroy process\n");
|
||||||
DbgPrint (" IRQ level: %lu\n", KeGetCurrentIrql ());
|
DbgPrint (" IRQ level: %lu\n", KeGetCurrentIrql ());
|
||||||
#endif
|
#endif
|
||||||
|
IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
|
||||||
IntCleanupMenus(Process, Win32Process);
|
IntCleanupMenus(Process, Win32Process);
|
||||||
|
|
||||||
CleanupForProcess(Process, Process->UniqueProcessId);
|
CleanupForProcess(Process, Process->UniqueProcessId);
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: class.c,v 1.38 2003/10/28 20:19:45 gvg Exp $
|
/* $Id: class.c,v 1.39 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -291,6 +291,7 @@ NtUserGetWOWClass(DWORD Unknown0,
|
||||||
PWNDCLASS_OBJECT FASTCALL
|
PWNDCLASS_OBJECT FASTCALL
|
||||||
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
||||||
BOOL bUnicodeClass,
|
BOOL bUnicodeClass,
|
||||||
|
WNDPROC wpExtra,
|
||||||
RTL_ATOM Atom)
|
RTL_ATOM Atom)
|
||||||
{
|
{
|
||||||
PWNDCLASS_OBJECT ClassObject;
|
PWNDCLASS_OBJECT ClassObject;
|
||||||
|
@ -326,15 +327,28 @@ IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
||||||
ClassObject->Unicode = bUnicodeClass;
|
ClassObject->Unicode = bUnicodeClass;
|
||||||
ClassObject->hIconSm = lpwcx->hIconSm;
|
ClassObject->hIconSm = lpwcx->hIconSm;
|
||||||
ClassObject->lpszClassName = (PUNICODE_STRING)(ULONG)Atom;
|
ClassObject->lpszClassName = (PUNICODE_STRING)(ULONG)Atom;
|
||||||
|
if (wpExtra == 0) {
|
||||||
if (bUnicodeClass)
|
if (bUnicodeClass)
|
||||||
{
|
{
|
||||||
ClassObject->lpfnWndProcW = lpwcx->lpfnWndProc;
|
ClassObject->lpfnWndProcW = lpwcx->lpfnWndProc;
|
||||||
ClassObject->lpfnWndProcA = lpwcx->lpfnWndProc+0x80000000;
|
ClassObject->lpfnWndProcA = (WNDPROC)IntAddWndProcHandle(lpwcx->lpfnWndProc,TRUE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ClassObject->lpfnWndProcA = lpwcx->lpfnWndProc;
|
ClassObject->lpfnWndProcA = lpwcx->lpfnWndProc;
|
||||||
ClassObject->lpfnWndProcW = lpwcx->lpfnWndProc+0x80000000;
|
ClassObject->lpfnWndProcW = (WNDPROC)IntAddWndProcHandle(lpwcx->lpfnWndProc,FALSE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (bUnicodeClass)
|
||||||
|
{
|
||||||
|
ClassObject->lpfnWndProcW = lpwcx->lpfnWndProc;
|
||||||
|
ClassObject->lpfnWndProcA = wpExtra;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClassObject->lpfnWndProcA = lpwcx->lpfnWndProc;
|
||||||
|
ClassObject->lpfnWndProcW = wpExtra;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (IS_INTRESOURCE(lpwcx->lpszMenuName))
|
if (IS_INTRESOURCE(lpwcx->lpszMenuName))
|
||||||
{
|
{
|
||||||
|
@ -363,7 +377,7 @@ RTL_ATOM STDCALL
|
||||||
NtUserRegisterClassExWOW(
|
NtUserRegisterClassExWOW(
|
||||||
CONST WNDCLASSEXW *lpwcx,
|
CONST WNDCLASSEXW *lpwcx,
|
||||||
BOOL bUnicodeClass,
|
BOOL bUnicodeClass,
|
||||||
DWORD Unknown3,
|
WNDPROC wpExtra,
|
||||||
DWORD Unknown4,
|
DWORD Unknown4,
|
||||||
DWORD Unknown5)
|
DWORD Unknown5)
|
||||||
|
|
||||||
|
@ -374,6 +388,7 @@ NtUserRegisterClassExWOW(
|
||||||
* lpwcx = Win32 extended window class structure
|
* lpwcx = Win32 extended window class structure
|
||||||
* bUnicodeClass = Whether to send ANSI or unicode strings
|
* bUnicodeClass = Whether to send ANSI or unicode strings
|
||||||
* to window procedures
|
* to window procedures
|
||||||
|
* wpExtra = Extra window procedure, if this is not null, its used for the second window procedure for standard controls.
|
||||||
* RETURNS:
|
* RETURNS:
|
||||||
* Atom identifying the new class
|
* Atom identifying the new class
|
||||||
*/
|
*/
|
||||||
|
@ -412,7 +427,7 @@ NtUserRegisterClassExWOW(
|
||||||
{
|
{
|
||||||
Atom = (RTL_ATOM)(ULONG)lpwcx->lpszClassName;
|
Atom = (RTL_ATOM)(ULONG)lpwcx->lpszClassName;
|
||||||
}
|
}
|
||||||
ClassObject = IntCreateClass(lpwcx, bUnicodeClass, Atom);
|
ClassObject = IntCreateClass(lpwcx, bUnicodeClass, wpExtra, Atom);
|
||||||
if (ClassObject == NULL)
|
if (ClassObject == NULL)
|
||||||
{
|
{
|
||||||
if (!IS_ATOM(lpwcx->lpszClassName))
|
if (!IS_ATOM(lpwcx->lpszClassName))
|
||||||
|
@ -575,13 +590,13 @@ IntSetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset, LONG dwNewLong, BOOL
|
||||||
if (Ansi)
|
if (Ansi)
|
||||||
{
|
{
|
||||||
WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong;
|
WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong;
|
||||||
WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong+0x80000000;
|
WindowObject->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE);
|
||||||
WindowObject->Class->Unicode = FALSE;
|
WindowObject->Class->Unicode = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong;
|
WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong;
|
||||||
WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong+0x80000000;
|
WindowObject->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE);
|
||||||
WindowObject->Class->Unicode = TRUE;
|
WindowObject->Class->Unicode = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: message.c,v 1.30 2003/10/09 06:13:04 gvg Exp $
|
/* $Id: message.c,v 1.31 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -109,22 +109,11 @@ NtUserDispatchMessage(CONST MSG* UnsafeMsg)
|
||||||
/* FIXME: Call hook procedures. */
|
/* FIXME: Call hook procedures. */
|
||||||
|
|
||||||
/* Call the window procedure. */
|
/* Call the window procedure. */
|
||||||
if (WindowObject->Unicode == TRUE)
|
|
||||||
{
|
|
||||||
Result = IntCallWindowProc(WindowObject->WndProcW,
|
Result = IntCallWindowProc(WindowObject->WndProcW,
|
||||||
Msg.hwnd,
|
Msg.hwnd,
|
||||||
Msg.message,
|
Msg.message,
|
||||||
Msg.wParam,
|
Msg.wParam,
|
||||||
Msg.lParam);
|
Msg.lParam);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Result = IntCallWindowProc(WindowObject->WndProcA,
|
|
||||||
Msg.hwnd,
|
|
||||||
Msg.message,
|
|
||||||
Msg.wParam,
|
|
||||||
Msg.lParam);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
@ -531,15 +520,8 @@ IntSendMessage(HWND hWnd,
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
if (Window->Unicode == TRUE)
|
|
||||||
{
|
{
|
||||||
Result = IntCallWindowProc(Window->WndProcW, hWnd, Msg, wParam, lParam);
|
Result = IntCallWindowProc(Window->WndProcW, hWnd, Msg, wParam, lParam);
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Result = IntCallWindowProc(Window->WndProcA, hWnd, Msg, wParam, lParam);
|
|
||||||
}
|
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: misc.c,v 1.22 2003/11/10 17:44:49 weiden Exp $
|
/* $Id: misc.c,v 1.23 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -261,7 +261,7 @@ NtUserCallTwoParam(
|
||||||
case TWOPARAM_ROUTINE_SETCARETPOS:
|
case TWOPARAM_ROUTINE_SETCARETPOS:
|
||||||
return (DWORD)IntSetCaretPos((int)Param1, (int)Param2);
|
return (DWORD)IntSetCaretPos((int)Param1, (int)Param2);
|
||||||
}
|
}
|
||||||
DPRINT1("Calling invalid routine number 0x%x in NtUserCallOneParam()\n Param1=0x%x Parm2=0x%x\n",
|
DPRINT1("Calling invalid routine number 0x%x in NtUserCallTwoParam()\n Param1=0x%x Parm2=0x%x\n",
|
||||||
Routine, Param1, Param2);
|
Routine, Param1, Param2);
|
||||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: window.c,v 1.131 2003/11/09 11:42:08 navaraf Exp $
|
/* $Id: window.c,v 1.132 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -62,9 +62,12 @@ typedef struct _REGISTERED_MESSAGE
|
||||||
} REGISTERED_MESSAGE, *PREGISTERED_MESSAGE;
|
} REGISTERED_MESSAGE, *PREGISTERED_MESSAGE;
|
||||||
|
|
||||||
static LIST_ENTRY RegisteredMessageListHead;
|
static LIST_ENTRY RegisteredMessageListHead;
|
||||||
|
static WndProcHandle *WndProcHandlesArray = 0;
|
||||||
|
static WORD WndProcHandlesArraySize = 0;
|
||||||
|
|
||||||
#define REGISTERED_MESSAGE_MIN 0xc000
|
#define REGISTERED_MESSAGE_MIN 0xc000
|
||||||
#define REGISTERED_MESSAGE_MAX 0xffff
|
#define REGISTERED_MESSAGE_MAX 0xffff
|
||||||
|
#define WPH_SIZE 0x40 /* the size to add to the WndProcHandle array each time */
|
||||||
|
|
||||||
/* globally stored handles to the shell windows */
|
/* globally stored handles to the shell windows */
|
||||||
HWND hwndShellWindow = 0;
|
HWND hwndShellWindow = 0;
|
||||||
|
@ -82,6 +85,8 @@ NTSTATUS FASTCALL
|
||||||
InitWindowImpl(VOID)
|
InitWindowImpl(VOID)
|
||||||
{
|
{
|
||||||
InitializeListHead(&RegisteredMessageListHead);
|
InitializeListHead(&RegisteredMessageListHead);
|
||||||
|
WndProcHandlesArray = ExAllocatePool(PagedPool,WPH_SIZE * sizeof(WndProcHandle));
|
||||||
|
WndProcHandlesArraySize = WPH_SIZE;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,6 +99,9 @@ InitWindowImpl(VOID)
|
||||||
NTSTATUS FASTCALL
|
NTSTATUS FASTCALL
|
||||||
CleanupWindowImpl(VOID)
|
CleanupWindowImpl(VOID)
|
||||||
{
|
{
|
||||||
|
ExFreePool(WndProcHandlesArray);
|
||||||
|
WndProcHandlesArray = 0;
|
||||||
|
WndProcHandlesArraySize = 0;
|
||||||
return STATUS_SUCCESS;
|
return STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1321,7 +1329,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
HMENU hMenu,
|
HMENU hMenu,
|
||||||
HINSTANCE hInstance,
|
HINSTANCE hInstance,
|
||||||
LPVOID lpParam,
|
LPVOID lpParam,
|
||||||
DWORD dwShowMode)
|
DWORD dwShowMode,
|
||||||
|
BOOL bUnicodeWindow)
|
||||||
{
|
{
|
||||||
PWINSTATION_OBJECT WinStaObject;
|
PWINSTATION_OBJECT WinStaObject;
|
||||||
PWNDCLASS_OBJECT ClassObject;
|
PWNDCLASS_OBJECT ClassObject;
|
||||||
|
@ -1460,7 +1469,12 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
||||||
WindowObject->Parent = ParentWindow;
|
WindowObject->Parent = ParentWindow;
|
||||||
WindowObject->Owner = IntGetWindowObject(OwnerWindowHandle);
|
WindowObject->Owner = IntGetWindowObject(OwnerWindowHandle);
|
||||||
WindowObject->UserData = 0;
|
WindowObject->UserData = 0;
|
||||||
|
if ((((DWORD)ClassObject->lpfnWndProcA & 0xFFFF0000) != 0xFFFF0000) || (((DWORD)ClassObject->lpfnWndProcW & 0xFFFF0000) != 0xFFFF0000))
|
||||||
|
{
|
||||||
WindowObject->Unicode = ClassObject->Unicode;
|
WindowObject->Unicode = ClassObject->Unicode;
|
||||||
|
} else {
|
||||||
|
WindowObject->Unicode = bUnicodeWindow;
|
||||||
|
}
|
||||||
WindowObject->WndProcA = ClassObject->lpfnWndProcA;
|
WindowObject->WndProcA = ClassObject->lpfnWndProcA;
|
||||||
WindowObject->WndProcW = ClassObject->lpfnWndProcW;
|
WindowObject->WndProcW = ClassObject->lpfnWndProcW;
|
||||||
WindowObject->OwnerThread = PsGetCurrentThread();
|
WindowObject->OwnerThread = PsGetCurrentThread();
|
||||||
|
@ -2787,14 +2801,14 @@ NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
|
||||||
{
|
{
|
||||||
OldValue = (LONG) WindowObject->WndProcA;
|
OldValue = (LONG) WindowObject->WndProcA;
|
||||||
WindowObject->WndProcA = (WNDPROC) NewValue;
|
WindowObject->WndProcA = (WNDPROC) NewValue;
|
||||||
WindowObject->WndProcW = (WNDPROC) NewValue + 0x80000000;
|
WindowObject->WndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,FALSE);
|
||||||
WindowObject->Unicode = FALSE;
|
WindowObject->Unicode = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
OldValue = (LONG) WindowObject->WndProcW;
|
OldValue = (LONG) WindowObject->WndProcW;
|
||||||
WindowObject->WndProcW = (WNDPROC) NewValue;
|
WindowObject->WndProcW = (WNDPROC) NewValue;
|
||||||
WindowObject->WndProcA = (WNDPROC) NewValue + 0x80000000;
|
WindowObject->WndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,TRUE);
|
||||||
WindowObject->Unicode = TRUE;
|
WindowObject->Unicode = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3741,4 +3755,85 @@ NtUserInternalGetWindowText(HWND WindowHandle, LPWSTR Text, INT MaxCount)
|
||||||
return Result;
|
return Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DWORD STDCALL
|
||||||
|
NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data)
|
||||||
|
{
|
||||||
|
WndProcHandle Entry;
|
||||||
|
if (((DWORD)wpHandle & 0xFFFF0000) == 0xFFFF0000)
|
||||||
|
{
|
||||||
|
Entry = WndProcHandlesArray[(DWORD)wpHandle & 0x0000FFFF];
|
||||||
|
Data->WindowProc = Entry.WindowProc;
|
||||||
|
Data->IsUnicode = Entry.IsUnicode;
|
||||||
|
Data->ProcessID = Entry.ProcessID;
|
||||||
|
return TRUE;
|
||||||
|
} else {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode)
|
||||||
|
{
|
||||||
|
WORD i;
|
||||||
|
WORD FreeSpot;
|
||||||
|
BOOL found;
|
||||||
|
WndProcHandle *OldArray;
|
||||||
|
WORD OldArraySize;
|
||||||
|
found = FALSE;
|
||||||
|
for (i = 0;i < WndProcHandlesArraySize;i++)
|
||||||
|
{
|
||||||
|
if (WndProcHandlesArray[i].WindowProc == NULL)
|
||||||
|
{
|
||||||
|
FreeSpot = i;
|
||||||
|
found = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
OldArray = WndProcHandlesArray;
|
||||||
|
OldArraySize = WndProcHandlesArraySize;
|
||||||
|
WndProcHandlesArray = ExAllocatePool(PagedPool,(OldArraySize + WPH_SIZE) * sizeof(WndProcHandle));
|
||||||
|
WndProcHandlesArraySize = OldArraySize + WPH_SIZE;
|
||||||
|
RtlCopyMemory(WndProcHandlesArray,OldArray,OldArraySize * sizeof(WndProcHandle));
|
||||||
|
ExFreePool(OldArray);
|
||||||
|
FreeSpot = OldArraySize + 1;
|
||||||
|
}
|
||||||
|
WndProcHandlesArray[FreeSpot].WindowProc = WindowProc;
|
||||||
|
WndProcHandlesArray[FreeSpot].IsUnicode = IsUnicode;
|
||||||
|
WndProcHandlesArray[FreeSpot].ProcessID = PsGetCurrentProcessId();
|
||||||
|
return FreeSpot + 0xFFFF0000;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
IntRemoveWndProcHandle(WNDPROC Handle)
|
||||||
|
{
|
||||||
|
WORD position;
|
||||||
|
position = (DWORD)Handle & 0x0000FFFF;
|
||||||
|
if (position > WndProcHandlesArraySize)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
WndProcHandlesArray[position].WindowProc = NULL;
|
||||||
|
WndProcHandlesArray[position].IsUnicode = FALSE;
|
||||||
|
WndProcHandlesArray[position].ProcessID = NULL;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD
|
||||||
|
IntRemoveProcessWndProcHandles(HANDLE ProcessID)
|
||||||
|
{
|
||||||
|
WORD i;
|
||||||
|
for (i = 0;i < WndProcHandlesArraySize;i++)
|
||||||
|
{
|
||||||
|
if (WndProcHandlesArray[i].ProcessID == ProcessID)
|
||||||
|
{
|
||||||
|
WndProcHandlesArray[i].WindowProc = NULL;
|
||||||
|
WndProcHandlesArray[i].IsUnicode = FALSE;
|
||||||
|
WndProcHandlesArray[i].ProcessID = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: winsta.c,v 1.40 2003/11/10 17:44:49 weiden Exp $
|
/* $Id: winsta.c,v 1.41 2003/11/11 20:28:21 gvg Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
|
@ -173,7 +173,7 @@ InitWindowStationImpl(VOID)
|
||||||
wcx.hbrBackground = NULL;
|
wcx.hbrBackground = NULL;
|
||||||
wcx.lpszMenuName = NULL;
|
wcx.lpszMenuName = NULL;
|
||||||
wcx.lpszClassName = L"DesktopWindowClass";
|
wcx.lpszClassName = L"DesktopWindowClass";
|
||||||
DesktopWindowClass = IntCreateClass(&wcx, TRUE, (RTL_ATOM)32880);
|
DesktopWindowClass = IntCreateClass(&wcx, TRUE, IntDesktopWindowProc, (RTL_ATOM)32880);
|
||||||
|
|
||||||
return(STATUS_SUCCESS);
|
return(STATUS_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue