mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +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
|
||||
NtUserCreateLocalMemHandle 4
|
||||
NtUserCreateMenu 0
|
||||
NtUserCreateWindowEx 13
|
||||
NtUserCreateWindowEx 14
|
||||
NtUserCreateWindowStation 6
|
||||
NtUserDdeGetQualityOfService 3
|
||||
NtUserDdeInitialize 5
|
||||
|
@ -563,6 +563,7 @@ NtUserGetParent 1
|
|||
NtUserGetWindow 2
|
||||
NtUserGetLastActivePopup 1
|
||||
NtUserGetShellWindow 0
|
||||
NtUserDereferenceWndProcHandle 2
|
||||
# DirectDraw system calls
|
||||
NtGdiD3dContextCreate 4
|
||||
NtGdiD3dContextDestroy 1
|
||||
|
|
|
@ -312,7 +312,8 @@ NtUserCreateWindowEx(
|
|||
HMENU hMenu,
|
||||
HINSTANCE hInstance,
|
||||
LPVOID lpParam,
|
||||
DWORD Unknown12);
|
||||
DWORD dwShowMode,
|
||||
BOOL bUnicodeWindow);
|
||||
|
||||
HWINSTA
|
||||
STDCALL
|
||||
|
@ -1190,7 +1191,7 @@ RTL_ATOM
|
|||
STDCALL
|
||||
NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
|
||||
BOOL bUnicodeClass,
|
||||
DWORD Unknown3,
|
||||
WNDPROC wpExtra,
|
||||
DWORD Unknown4,
|
||||
DWORD Unknown5);
|
||||
|
||||
|
@ -1832,7 +1833,15 @@ NtUserGetWindow(HWND hWnd, UINT Relationship);
|
|||
|
||||
HWND STDCALL
|
||||
NtUserGetLastActivePopup(HWND hWnd);
|
||||
typedef struct _WndProcHandle
|
||||
{
|
||||
WNDPROC WindowProc;
|
||||
BOOL IsUnicode;
|
||||
HANDLE ProcessID;
|
||||
} WndProcHandle;
|
||||
|
||||
DWORD STDCALL
|
||||
NtUserDereferenceWndProcHandle(WNDPROC wpHandle, WndProcHandle *Data);
|
||||
#endif /* __WIN32K_NTUSER_H */
|
||||
|
||||
/* 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
|
||||
* PROJECT: ReactOS User32
|
||||
|
@ -11,30 +11,34 @@
|
|||
|
||||
#include "windows.h"
|
||||
#include "user32/regcontrol.h"
|
||||
#include "win32k/ntuser.h"
|
||||
|
||||
static void RegisterBuiltinClass(const struct builtin_class_descr *Descr)
|
||||
{
|
||||
WNDCLASSW wc;
|
||||
WNDCLASSEXW wc;
|
||||
ATOM Class;
|
||||
|
||||
wc.cbSize = sizeof(WNDCLASSEXW);
|
||||
wc.lpszClassName = Descr->name;
|
||||
wc.lpfnWndProc = Descr->procW;
|
||||
wc.style = Descr->style;
|
||||
wc.hInstance = NULL;
|
||||
wc.hIcon = NULL;
|
||||
wc.hIconSm = NULL;
|
||||
wc.hCursor = LoadCursorW(NULL, Descr->cursor);
|
||||
wc.hbrBackground = Descr->brush;
|
||||
wc.lpszMenuName = NULL;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = Descr->extra;
|
||||
|
||||
|
||||
#if 0
|
||||
if(IS_ATOM(wc.lpszClassName))
|
||||
DbgPrint("Registering built-in class atom=0x%x\n", wc.lpszClassName);
|
||||
else
|
||||
DbgPrint("Registering built-in class %wS\n", wc.lpszClassName);
|
||||
#endif
|
||||
Class = RegisterClassW(&wc);
|
||||
Class = NtUserRegisterClassExWOW(&wc,TRUE,Descr->procA,0,0);
|
||||
#if 0
|
||||
DbgPrint("RegisterClassW = %d\n", Class);
|
||||
#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
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -524,7 +524,7 @@ RegisterClassExA(CONST WNDCLASSEXA *lpwcx)
|
|||
wndclass.lpszMenuName = MenuName;
|
||||
}
|
||||
|
||||
Atom = NtUserRegisterClassExWOW ( &wndclass, FALSE, 0, 0, 0 );
|
||||
Atom = NtUserRegisterClassExWOW ( &wndclass, FALSE, (WNDPROC)0, 0, 0 );
|
||||
|
||||
/* free strings if neccessary */
|
||||
if ( MenuName ) HEAP_free ( MenuName );
|
||||
|
@ -582,7 +582,7 @@ RegisterClassExW(CONST WNDCLASSEXW *lpwcx)
|
|||
wndclass.lpszMenuName = MenuName;
|
||||
}
|
||||
|
||||
Atom = NtUserRegisterClassExWOW ( &wndclass, TRUE, 0, 0, 0 );
|
||||
Atom = NtUserRegisterClassExWOW ( &wndclass, TRUE, (WNDPROC)0, 0, 0 );
|
||||
|
||||
/* free strings if neccessary */
|
||||
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
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -398,29 +398,25 @@ CallWindowProcA(WNDPROC lpPrevWndFunc,
|
|||
MSG UnicodeMsg;
|
||||
LRESULT Result;
|
||||
BOOL IsHandle;
|
||||
WndProcHandle wphData;
|
||||
|
||||
if ((DWORD)lpPrevWndFunc > 0x80000000)
|
||||
{
|
||||
lpPrevWndFunc -= 0x80000000;
|
||||
IsHandle = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsHandle = FALSE;
|
||||
}
|
||||
|
||||
IsHandle = NtUserDereferenceWndProcHandle(lpPrevWndFunc,&wphData);
|
||||
AnsiMsg.hwnd = hWnd;
|
||||
AnsiMsg.message = Msg;
|
||||
AnsiMsg.wParam = wParam;
|
||||
AnsiMsg.lParam = lParam;
|
||||
|
||||
if (IsWindowUnicode(hWnd))
|
||||
if (!IsHandle)
|
||||
{
|
||||
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
||||
} else {
|
||||
if (wphData.IsUnicode)
|
||||
{
|
||||
if (!MsgiAnsiToUnicodeMessage(&UnicodeMsg, &AnsiMsg))
|
||||
{
|
||||
return(FALSE);
|
||||
}
|
||||
Result = lpPrevWndFunc(hWnd, Msg, wParam, lParam);
|
||||
Result = wphData.WindowProc(UnicodeMsg.hwnd, UnicodeMsg.message,
|
||||
UnicodeMsg.wParam, UnicodeMsg.lParam);
|
||||
if (!MsgiAnsiToUnicodeReply(&UnicodeMsg, &AnsiMsg, &Result))
|
||||
{
|
||||
return(FALSE);
|
||||
|
@ -429,7 +425,8 @@ CallWindowProcA(WNDPROC lpPrevWndFunc,
|
|||
}
|
||||
else
|
||||
{
|
||||
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
||||
return(wphData.WindowProc(hWnd, Msg, wParam, lParam));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,26 +442,25 @@ CallWindowProcW(WNDPROC lpPrevWndFunc,
|
|||
LPARAM lParam)
|
||||
{
|
||||
BOOL IsHandle;
|
||||
if ((DWORD)lpPrevWndFunc > 0x80000000)
|
||||
WndProcHandle wphData;
|
||||
|
||||
IsHandle = NtUserDereferenceWndProcHandle(lpPrevWndFunc,&wphData);
|
||||
if (!IsHandle)
|
||||
{
|
||||
lpPrevWndFunc-= 0x80000000;
|
||||
IsHandle = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsHandle = FALSE;
|
||||
}
|
||||
if (!IsWindowUnicode(hWnd))
|
||||
return(lpPrevWndFunc(hWnd, Msg, wParam, lParam));
|
||||
} else {
|
||||
if (!wphData.IsUnicode)
|
||||
{
|
||||
LRESULT Result;
|
||||
User32ConvertToAsciiMessage(&Msg, &wParam, &lParam);
|
||||
Result = lpPrevWndFunc(hWnd, Msg, wParam, lParam);
|
||||
Result = wphData.WindowProc(hWnd, Msg, wParam, lParam);
|
||||
User32FreeAsciiConvertedMessage(Msg, wParam, lParam);
|
||||
return(Result);
|
||||
}
|
||||
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
|
||||
* PROJECT: ReactOS user32.dll
|
||||
|
@ -501,7 +501,8 @@ CreateWindowExA(DWORD dwExStyle,
|
|||
hMenu,
|
||||
hInstance,
|
||||
lpParam,
|
||||
sw);
|
||||
sw,
|
||||
FALSE);
|
||||
|
||||
#if 0
|
||||
DbgPrint("[window] NtUserCreateWindowEx() == %d\n", Handle);
|
||||
|
@ -631,7 +632,8 @@ CreateWindowExW(DWORD dwExStyle,
|
|||
hMenu,
|
||||
hInstance,
|
||||
lpParam,
|
||||
sw);
|
||||
sw,
|
||||
TRUE);
|
||||
|
||||
return (HWND)Handle;
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ ClassReferenceClassByNameOrAtom(PWNDCLASS_OBJECT *Class,
|
|||
PWNDCLASS_OBJECT FASTCALL
|
||||
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
||||
BOOL bUnicodeClass,
|
||||
WNDPROC wpExtra,
|
||||
RTL_ATOM Atom);
|
||||
struct _WINDOW_OBJECT;
|
||||
ULONG FASTCALL
|
||||
|
|
|
@ -192,6 +192,9 @@ WINLOCK_TYPE FASTCALL IntSuspendWinLock();
|
|||
VOID FASTCALL IntRestoreWinLock(WINLOCK_TYPE Type);
|
||||
inline BOOL IntInitializeWinLock();
|
||||
inline VOID IntDeleteWinLock();
|
||||
DWORD IntRemoveWndProcHandle(WNDPROC Handle);
|
||||
DWORD IntRemoveProcessWndProcHandles(HANDLE ProcessID);
|
||||
DWORD IntAddWndProcHandle(WNDPROC WindowProc, BOOL IsUnicode);
|
||||
|
||||
#endif /* __WIN32K_WINDOW_H */
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
*/
|
||||
|
@ -94,7 +94,7 @@ Win32kProcessCallback (struct _EPROCESS *Process,
|
|||
DbgPrint (" Destroy process\n");
|
||||
DbgPrint (" IRQ level: %lu\n", KeGetCurrentIrql ());
|
||||
#endif
|
||||
|
||||
IntRemoveProcessWndProcHandles((HANDLE)Process->UniqueProcessId);
|
||||
IntCleanupMenus(Process, Win32Process);
|
||||
|
||||
CleanupForProcess(Process, Process->UniqueProcessId);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -291,6 +291,7 @@ NtUserGetWOWClass(DWORD Unknown0,
|
|||
PWNDCLASS_OBJECT FASTCALL
|
||||
IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
||||
BOOL bUnicodeClass,
|
||||
WNDPROC wpExtra,
|
||||
RTL_ATOM Atom)
|
||||
{
|
||||
PWNDCLASS_OBJECT ClassObject;
|
||||
|
@ -326,15 +327,28 @@ IntCreateClass(CONST WNDCLASSEXW *lpwcx,
|
|||
ClassObject->Unicode = bUnicodeClass;
|
||||
ClassObject->hIconSm = lpwcx->hIconSm;
|
||||
ClassObject->lpszClassName = (PUNICODE_STRING)(ULONG)Atom;
|
||||
if (wpExtra == 0) {
|
||||
if (bUnicodeClass)
|
||||
{
|
||||
ClassObject->lpfnWndProcW = lpwcx->lpfnWndProc;
|
||||
ClassObject->lpfnWndProcA = lpwcx->lpfnWndProc+0x80000000;
|
||||
ClassObject->lpfnWndProcA = (WNDPROC)IntAddWndProcHandle(lpwcx->lpfnWndProc,TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
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))
|
||||
{
|
||||
|
@ -363,7 +377,7 @@ RTL_ATOM STDCALL
|
|||
NtUserRegisterClassExWOW(
|
||||
CONST WNDCLASSEXW *lpwcx,
|
||||
BOOL bUnicodeClass,
|
||||
DWORD Unknown3,
|
||||
WNDPROC wpExtra,
|
||||
DWORD Unknown4,
|
||||
DWORD Unknown5)
|
||||
|
||||
|
@ -374,6 +388,7 @@ NtUserRegisterClassExWOW(
|
|||
* lpwcx = Win32 extended window class structure
|
||||
* bUnicodeClass = Whether to send ANSI or unicode strings
|
||||
* to window procedures
|
||||
* wpExtra = Extra window procedure, if this is not null, its used for the second window procedure for standard controls.
|
||||
* RETURNS:
|
||||
* Atom identifying the new class
|
||||
*/
|
||||
|
@ -412,7 +427,7 @@ NtUserRegisterClassExWOW(
|
|||
{
|
||||
Atom = (RTL_ATOM)(ULONG)lpwcx->lpszClassName;
|
||||
}
|
||||
ClassObject = IntCreateClass(lpwcx, bUnicodeClass, Atom);
|
||||
ClassObject = IntCreateClass(lpwcx, bUnicodeClass, wpExtra, Atom);
|
||||
if (ClassObject == NULL)
|
||||
{
|
||||
if (!IS_ATOM(lpwcx->lpszClassName))
|
||||
|
@ -575,13 +590,13 @@ IntSetClassLong(PWINDOW_OBJECT WindowObject, ULONG Offset, LONG dwNewLong, BOOL
|
|||
if (Ansi)
|
||||
{
|
||||
WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong;
|
||||
WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong+0x80000000;
|
||||
WindowObject->Class->lpfnWndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,FALSE);
|
||||
WindowObject->Class->Unicode = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
WindowObject->Class->lpfnWndProcW = (WNDPROC)dwNewLong;
|
||||
WindowObject->Class->lpfnWndProcA = (WNDPROC)dwNewLong+0x80000000;
|
||||
WindowObject->Class->lpfnWndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)dwNewLong,TRUE);
|
||||
WindowObject->Class->Unicode = TRUE;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -109,22 +109,11 @@ NtUserDispatchMessage(CONST MSG* UnsafeMsg)
|
|||
/* FIXME: Call hook procedures. */
|
||||
|
||||
/* Call the window procedure. */
|
||||
if (WindowObject->Unicode == TRUE)
|
||||
{
|
||||
Result = IntCallWindowProc(WindowObject->WndProcW,
|
||||
Msg.hwnd,
|
||||
Msg.message,
|
||||
Msg.wParam,
|
||||
Msg.lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = IntCallWindowProc(WindowObject->WndProcA,
|
||||
Msg.hwnd,
|
||||
Msg.message,
|
||||
Msg.wParam,
|
||||
Msg.lParam);
|
||||
}
|
||||
|
||||
return Result;
|
||||
}
|
||||
|
@ -531,15 +520,8 @@ IntSendMessage(HWND hWnd,
|
|||
return Result;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Window->Unicode == TRUE)
|
||||
{
|
||||
Result = IntCallWindowProc(Window->WndProcW, hWnd, Msg, wParam, lParam);
|
||||
}
|
||||
else
|
||||
{
|
||||
Result = IntCallWindowProc(Window->WndProcA, hWnd, Msg, wParam, lParam);
|
||||
}
|
||||
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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -261,7 +261,7 @@ NtUserCallTwoParam(
|
|||
case TWOPARAM_ROUTINE_SETCARETPOS:
|
||||
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);
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
return 0;
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -62,9 +62,12 @@ typedef struct _REGISTERED_MESSAGE
|
|||
} REGISTERED_MESSAGE, *PREGISTERED_MESSAGE;
|
||||
|
||||
static LIST_ENTRY RegisteredMessageListHead;
|
||||
static WndProcHandle *WndProcHandlesArray = 0;
|
||||
static WORD WndProcHandlesArraySize = 0;
|
||||
|
||||
#define REGISTERED_MESSAGE_MIN 0xc000
|
||||
#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 */
|
||||
HWND hwndShellWindow = 0;
|
||||
|
@ -82,6 +85,8 @@ NTSTATUS FASTCALL
|
|||
InitWindowImpl(VOID)
|
||||
{
|
||||
InitializeListHead(&RegisteredMessageListHead);
|
||||
WndProcHandlesArray = ExAllocatePool(PagedPool,WPH_SIZE * sizeof(WndProcHandle));
|
||||
WndProcHandlesArraySize = WPH_SIZE;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -94,6 +99,9 @@ InitWindowImpl(VOID)
|
|||
NTSTATUS FASTCALL
|
||||
CleanupWindowImpl(VOID)
|
||||
{
|
||||
ExFreePool(WndProcHandlesArray);
|
||||
WndProcHandlesArray = 0;
|
||||
WndProcHandlesArraySize = 0;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
|
@ -1321,7 +1329,8 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
|||
HMENU hMenu,
|
||||
HINSTANCE hInstance,
|
||||
LPVOID lpParam,
|
||||
DWORD dwShowMode)
|
||||
DWORD dwShowMode,
|
||||
BOOL bUnicodeWindow)
|
||||
{
|
||||
PWINSTATION_OBJECT WinStaObject;
|
||||
PWNDCLASS_OBJECT ClassObject;
|
||||
|
@ -1460,7 +1469,12 @@ NtUserCreateWindowEx(DWORD dwExStyle,
|
|||
WindowObject->Parent = ParentWindow;
|
||||
WindowObject->Owner = IntGetWindowObject(OwnerWindowHandle);
|
||||
WindowObject->UserData = 0;
|
||||
if ((((DWORD)ClassObject->lpfnWndProcA & 0xFFFF0000) != 0xFFFF0000) || (((DWORD)ClassObject->lpfnWndProcW & 0xFFFF0000) != 0xFFFF0000))
|
||||
{
|
||||
WindowObject->Unicode = ClassObject->Unicode;
|
||||
} else {
|
||||
WindowObject->Unicode = bUnicodeWindow;
|
||||
}
|
||||
WindowObject->WndProcA = ClassObject->lpfnWndProcA;
|
||||
WindowObject->WndProcW = ClassObject->lpfnWndProcW;
|
||||
WindowObject->OwnerThread = PsGetCurrentThread();
|
||||
|
@ -2787,14 +2801,14 @@ NtUserSetWindowLong(HWND hWnd, DWORD Index, LONG NewValue, BOOL Ansi)
|
|||
{
|
||||
OldValue = (LONG) WindowObject->WndProcA;
|
||||
WindowObject->WndProcA = (WNDPROC) NewValue;
|
||||
WindowObject->WndProcW = (WNDPROC) NewValue + 0x80000000;
|
||||
WindowObject->WndProcW = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,FALSE);
|
||||
WindowObject->Unicode = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
OldValue = (LONG) WindowObject->WndProcW;
|
||||
WindowObject->WndProcW = (WNDPROC) NewValue;
|
||||
WindowObject->WndProcA = (WNDPROC) NewValue + 0x80000000;
|
||||
WindowObject->WndProcA = (WNDPROC) IntAddWndProcHandle((WNDPROC)NewValue,TRUE);
|
||||
WindowObject->Unicode = TRUE;
|
||||
}
|
||||
break;
|
||||
|
@ -3741,4 +3755,85 @@ NtUserInternalGetWindowText(HWND WindowHandle, LPWSTR Text, INT MaxCount)
|
|||
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 */
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
* along with this program; if not, write to the Free Software
|
||||
* 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
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -173,7 +173,7 @@ InitWindowStationImpl(VOID)
|
|||
wcx.hbrBackground = NULL;
|
||||
wcx.lpszMenuName = NULL;
|
||||
wcx.lpszClassName = L"DesktopWindowClass";
|
||||
DesktopWindowClass = IntCreateClass(&wcx, TRUE, (RTL_ATOM)32880);
|
||||
DesktopWindowClass = IntCreateClass(&wcx, TRUE, IntDesktopWindowProc, (RTL_ATOM)32880);
|
||||
|
||||
return(STATUS_SUCCESS);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue