Author: jimtabor
Date: Sat Jul 25 02:41:22 2009
New Revision: 42185
URL:
http://svn.reactos.org/svn/reactos?rev=42185&view=rev
Log:
- [Win32k] More work on classes. ReactOS seems to return the opposite WinProc and
sometimes it is a CallProcData handle. This is confusing the class wine tests. The last
thing it should do is return CallProcData handle after attempting to find the right proc.
Fixed message class bits. Moved CallProc to CallProcData and updated related code. Started
alternate function to replace NtUserGetClassLong and NtUserGetWindowLong.
- Tested wine, Firefox 1.15.xx and AbiWord 2.6.8.
Modified:
trunk/reactos/dll/win32/user32/include/user32.h
trunk/reactos/dll/win32/user32/misc/misc.c
trunk/reactos/dll/win32/user32/windows/message.c
trunk/reactos/dll/win32/user32/windows/window.c
trunk/reactos/include/reactos/win32k/ntuser.h
trunk/reactos/subsystems/win32/win32k/include/class.h
trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c
trunk/reactos/subsystems/win32/win32k/ntuser/class.c
trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
trunk/reactos/subsystems/win32/win32k/ntuser/object.c
trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
trunk/reactos/subsystems/win32/win32k/ntuser/window.c
Modified: trunk/reactos/dll/win32/user32/include/user32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/include/u…
==============================================================================
--- trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/include/user32.h [iso-8859-1] Sat Jul 25 02:41:22 2009
@@ -108,7 +108,7 @@
return di;
}
-PCALLPROC FASTCALL ValidateCallProc(HANDLE hCallProc);
+PCALLPROCDATA FASTCALL ValidateCallProc(HANDLE hCallProc);
PWND FASTCALL ValidateHwnd(HWND hwnd);
PWND FASTCALL ValidateHwndOrDesk(HWND hwnd);
PWND FASTCALL GetThreadDesktopWnd(VOID);
Modified: trunk/reactos/dll/win32/user32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/misc/misc…
==============================================================================
--- trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/misc/misc.c [iso-8859-1] Sat Jul 25 02:41:22 2009
@@ -270,7 +270,7 @@
FASTCALL
TestWindowProcess(PWND Wnd)
{
- if (Wnd->ti == (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
+ if (Wnd->pti == (PW32THREADINFO)NtCurrentTeb()->Win32ThreadInfo)
return TRUE;
else
return (NtUserQueryWindow(Wnd->hdr.Handle, QUERY_WINDOW_UNIQUE_PROCESS_ID) ==
@@ -426,15 +426,20 @@
//
// Validate a callproc handle and return the pointer to the object.
//
-PCALLPROC
+PCALLPROCDATA
FASTCALL
ValidateCallProc(HANDLE hCallProc)
{
- PCALLPROC CallProc = ValidateHandle(hCallProc, VALIDATE_TYPE_CALLPROC);
- if (CallProc != NULL && CallProc->pi == g_ppi)
- return CallProc;
-
- return NULL;
+ PUSER_HANDLE_ENTRY pEntry;
+
+ PCALLPROCDATA CallProc = ValidateHandle(hCallProc, VALIDATE_TYPE_CALLPROC);
+
+ pEntry = GetUser32Handle(hCallProc);
+
+ if (CallProc != NULL && pEntry->ppi == g_ppi)
+ return CallProc;
+
+ return NULL;
}
//
Modified: trunk/reactos/dll/win32/user32/windows/message.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/m…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/message.c [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -1238,7 +1238,7 @@
WPARAM wParam,
LPARAM lParam)
{
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
if (lpPrevWndFunc == NULL)
{
@@ -1253,7 +1253,7 @@
CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
if (CallProc != NULL)
{
- return IntCallWindowProcA(!CallProc->Unicode, CallProc->WndProc,
+ return IntCallWindowProcA(!CallProc->Unicode,
CallProc->pfnClientPrevious,
hWnd, Msg, wParam, lParam);
}
else
@@ -1275,7 +1275,7 @@
WPARAM wParam,
LPARAM lParam)
{
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
/* FIXME - can the first parameter be NULL? */
if (lpPrevWndFunc == NULL)
@@ -1291,7 +1291,7 @@
CallProc = ValidateCallProc((HANDLE)lpPrevWndFunc);
if (CallProc != NULL)
{
- return IntCallWindowProcW(!CallProc->Unicode, CallProc->WndProc,
+ return IntCallWindowProcW(!CallProc->Unicode,
CallProc->pfnClientPrevious,
hWnd, Msg, wParam, lParam);
}
else
@@ -1340,7 +1340,7 @@
if (lpmsg->hwnd != NULL)
{
Wnd = ValidateHwnd(lpmsg->hwnd);
- if (!Wnd || SharedPtrToUser(Wnd->ti) != GetW32ThreadInfo())
+ if (!Wnd || SharedPtrToUser(Wnd->pti) != GetW32ThreadInfo())
return 0;
}
else
@@ -1401,7 +1401,7 @@
if (lpmsg->hwnd != NULL)
{
Wnd = ValidateHwnd(lpmsg->hwnd);
- if (!Wnd || SharedPtrToUser(Wnd->ti) != GetW32ThreadInfo())
+ if (!Wnd || SharedPtrToUser(Wnd->pti) != GetW32ThreadInfo())
return 0;
}
else
@@ -1801,7 +1801,7 @@
PW32THREADINFO ti = GetW32ThreadInfo();
Window = ValidateHwnd(Wnd);
- if (Window != NULL && SharedPtrToUser(Window->ti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
+ if (Window != NULL && SharedPtrToUser(Window->pti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
{
/* NOTE: We can directly send messages to the window procedure
if *all* the following conditions are met:
@@ -1865,7 +1865,7 @@
PW32THREADINFO ti = GetW32ThreadInfo();
Window = ValidateHwnd(Wnd);
- if (Window != NULL && SharedPtrToUser(Window->ti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
+ if (Window != NULL && SharedPtrToUser(Window->pti) == ti &&
!IsThreadHooked(GetWin32ClientInfo()))
{
/* NOTE: We can directly send messages to the window procedure
if *all* the following conditions are met:
Modified: trunk/reactos/dll/win32/user32/windows/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/w…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/window.c [iso-8859-1] Sat Jul 25 02:41:22 2009
@@ -1268,7 +1268,7 @@
if (!pWnd) return Ret;
- ti = SharedPtrToUser(pWnd->ti);
+ ti = SharedPtrToUser(pWnd->pti);
if (ti)
{
Modified: trunk/reactos/include/reactos/win32k/ntuser.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntu…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Sat Jul 25 02:41:22 2009
@@ -3,6 +3,7 @@
typedef struct _PROCESSINFO *PPROCESSINFO;
struct _W32THREADINFO;
+struct _DESKTOP;
struct _WND;
typedef struct _LARGE_UNICODE_STRING
@@ -89,14 +90,29 @@
WCHAR szDesktopName[1];
} DESKTOPINFO, *PDESKTOPINFO;
-typedef struct _CALLPROC
-{
+typedef enum _GETCPD
+{
+ UserGetCPDU2A = 0x01,
+ UserGetCPDA2U = 0X02,
+ UserGetCPDClass = 0X10,
+ UserGetCPDWindow = 0X20,
+ UserGetCPDDialog = 0X40,
+ UserGetCPDWndtoCls = 0X80
+} GETCPD, *PGETCPD;
+
+typedef struct _CALLPROCDATA
+{
+// PROCDESKHEAD head; // Use this once new handle manager is implemented!!!
USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is
implemented */
- struct _PROCESSINFO *pi;
- WNDPROC WndProc;
- struct _CALLPROC *Next;
- UINT Unicode : 1;
-} CALLPROC, *PCALLPROC;
+//
+ struct _CALLPROCDATA *spcpdNext;
+ WNDPROC pfnClientPrevious;
+ union
+ {
+ GETCPD wType;
+ UINT Unicode : 1;
+ };
+} CALLPROCDATA, *PCALLPROCDATA;
#define CSF_SERVERSIDEPROC 0x0001
#define CSF_ANSIPROC 0x0002
@@ -118,7 +134,7 @@
DWORD CSF_flags;
PSTR lpszClientAnsiMenuName; // For client use
PWSTR lpszClientUnicodeMenuName; // " " "
- PCALLPROC spcpdFirst;
+ PCALLPROCDATA spcpdFirst;
struct _CLS *pclsBase;
struct _CLS *pclsClone;
ULONG cWndReferenceCount;
@@ -127,7 +143,7 @@
union
{
WNDPROC WndProcExtra;
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
};
INT cbclsExtra;
INT cbwndExtra;
@@ -241,14 +257,15 @@
typedef struct _WND
{
+ //THRDESKHEAD head; // head.h == handle
USER_OBJHDR hdr; /* FIXME: Move out of the structure once new handle manager is
implemented */
/* NOTE: This structure is located in the desktop heap and will
eventually replace WINDOW_OBJECT. Right now WINDOW_OBJECT
keeps a reference to this structure until all the information
is moved to this structure */
- struct _PROCESSINFO *pi; /* FIXME: Move to object header some day */
- struct _W32THREADINFO *ti;
- struct _DESKTOP *pdesktop;
+ struct _PROCESSINFO *pi; // head.pti->ppi
+ struct _W32THREADINFO *pti; // head.pti
+ struct _DESKTOP *rpdesk; // head.rpdesk
DWORD state;
DWORD state2;
@@ -270,7 +287,7 @@
union
{
/* Pointer to a call procedure handle */
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
/* Extra Wnd proc (windows of system classes) */
WNDPROC WndProcExtra;
};
@@ -545,7 +562,7 @@
WORD fsWakeBits;
WORD fsWakeBitsJournal;
WORD fsWakeMask;
- LONG timeLastRead;
+ ULONG tickLastMsgChecked;
DWORD dwcPumpHook;
} CLIENTTHREADINFO, *PCLIENTTHREADINFO;
@@ -1379,14 +1396,16 @@
OUT PSECURITY_QUALITY_OF_SERVICE pqosPrev);
HDWP NTAPI
-NtUserDeferWindowPos(HDWP WinPosInfo,
- HWND Wnd,
- HWND WndInsertAfter,
- int x,
- int y,
- int cx,
- int cy,
- UINT Flags);
+NtUserDeferWindowPos(
+ HDWP WinPosInfo,
+ HWND Wnd,
+ HWND WndInsertAfter,
+ int x,
+ int y,
+ int cx,
+ int cy,
+ UINT Flags);
+
BOOL NTAPI
NtUserDefSetText(HWND WindowHandle, PLARGE_STRING WindowText);
@@ -1680,12 +1699,12 @@
HDC hdc,
UINT CtlMsg);
-DWORD
+ULONG_PTR
NTAPI
NtUserGetCPD(
- DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2);
+ HWND hWnd,
+ GETCPD Flags,
+ ULONG_PTR Proc);
DWORD
NTAPI
@@ -3025,7 +3044,7 @@
BOOL Indirect);
-/* Should be done in usermode */
+/* Should be done in usermode and use NtUserGetCPD. */
ULONG_PTR
NTAPI
NtUserGetClassLong(HWND hWnd, INT Offset, BOOL Ansi);
@@ -3067,7 +3086,7 @@
NTAPI
NtUserGetWindow(HWND hWnd, UINT Relationship);
-/* Should be done in usermode */
+/* Should be done in usermode and use NtUserGetCPD. */
LONG
NTAPI
NtUserGetWindowLong(HWND hWnd, DWORD Index, BOOL Ansi);
Modified: trunk/reactos/subsystems/win32/win32k/include/class.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/class.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/class.h [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -21,17 +21,17 @@
}
WNDPROC
-GetCallProcHandle(IN PCALLPROC CallProc);
+GetCallProcHandle(IN PCALLPROCDATA CallProc);
VOID
DestroyCallProc(IN PDESKTOPINFO Desktop,
- IN OUT PCALLPROC CallProc);
+ IN OUT PCALLPROCDATA CallProc);
-PCALLPROC
+PCALLPROCDATA
CloneCallProc(IN PDESKTOPINFO Desktop,
- IN PCALLPROC CallProc);
+ IN PCALLPROCDATA CallProc);
-PCALLPROC
+PCALLPROCDATA
CreateCallProc(IN PDESKTOPINFO Desktop,
IN WNDPROC WndProc,
IN BOOL Unicode,
@@ -87,7 +87,7 @@
IN PDESKTOP Desktop,
IN PPROCESSINFO pi);
-PCALLPROC
+PCALLPROCDATA
UserFindCallProc(IN PCLS Class,
IN WNDPROC WndProc,
IN BOOL bUnicode);
@@ -98,7 +98,7 @@
VOID
UserAddCallProcToClass(IN OUT PCLS Class,
- IN PCALLPROC CallProc);
+ IN PCALLPROCDATA CallProc);
BOOL
IntGetAtomFromStringOrAtom(IN PUNICODE_STRING ClassName,
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/callproc.c [iso-8859-1] Sat Jul 25
02:41:22 2009
@@ -1,27 +1,8 @@
/*
- * ReactOS W32 Subsystem
- * Copyright (C) 1998 - 2006 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: class.c 21596 2006-04-15 10:41:58Z greatlrd $
- *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* PURPOSE: Window classes
- * FILE: subsys/win32k/ntuser/class.c
+ * FILE: subsystems/win32/win32k/ntuser/class.c
* PROGRAMER: Thomas Weidenmueller <w3seek(a)reactos.com>
* REVISION HISTORY:
* 06-06-2001 CSH Created
@@ -36,7 +17,7 @@
/* CALLPROC ******************************************************************/
WNDPROC
-GetCallProcHandle(IN PCALLPROC CallProc)
+GetCallProcHandle(IN PCALLPROCDATA CallProc)
{
/* FIXME - check for 64 bit architectures... */
return (WNDPROC)((ULONG_PTR)UserObjectToHandle(CallProc) | 0xFFFF0000);
@@ -44,7 +25,7 @@
VOID
DestroyCallProc(IN PDESKTOPINFO Desktop,
- IN OUT PCALLPROC CallProc)
+ IN OUT PCALLPROCDATA CallProc)
{
/* FIXME - use new object manager! */
HANDLE Handle = UserObjectToHandle(CallProc);
@@ -53,51 +34,49 @@
otCallProc);
}
-PCALLPROC
+PCALLPROCDATA
CloneCallProc(IN PDESKTOPINFO Desktop,
- IN PCALLPROC CallProc)
+ IN PCALLPROCDATA CallProc)
{
- PCALLPROC NewCallProc;
+ PCALLPROCDATA NewCallProc;
HANDLE Handle;
/* FIXME - use new object manager! */
- NewCallProc = (PCALLPROC)UserCreateObject(gHandleTable,
+ NewCallProc = (PCALLPROCDATA)UserCreateObject(gHandleTable,
&Handle,
otCallProc,
- sizeof(CALLPROC));
+ sizeof(CALLPROCDATA));
if (NewCallProc != NULL)
{
NewCallProc->hdr.Handle = Handle; /* FIXME: Remove hack */
- NewCallProc->pi = CallProc->pi;
- NewCallProc->WndProc = CallProc->WndProc;
+ NewCallProc->pfnClientPrevious = CallProc->pfnClientPrevious;
NewCallProc->Unicode = CallProc->Unicode;
- NewCallProc->Next = NULL;
+ NewCallProc->spcpdNext = NULL;
}
return NewCallProc;
}
-PCALLPROC
+PCALLPROCDATA
CreateCallProc(IN PDESKTOPINFO Desktop,
IN WNDPROC WndProc,
IN BOOL Unicode,
IN PPROCESSINFO pi)
{
- PCALLPROC NewCallProc;
+ PCALLPROCDATA NewCallProc;
HANDLE Handle;
/* FIXME - use new object manager! */
- NewCallProc = (PCALLPROC)UserCreateObject(gHandleTable,
+ NewCallProc = (PCALLPROCDATA)UserCreateObject(gHandleTable,
&Handle,
otCallProc,
- sizeof(CALLPROC));
+ sizeof(CALLPROCDATA));
if (NewCallProc != NULL)
{
NewCallProc->hdr.Handle = Handle; /* FIXME: Remove hack */
- NewCallProc->pi = pi;
- NewCallProc->WndProc = WndProc;
+ NewCallProc->pfnClientPrevious = WndProc;
NewCallProc->Unicode = Unicode;
- NewCallProc->Next = NULL;
+ NewCallProc->spcpdNext = NULL;
}
return NewCallProc;
@@ -107,7 +86,7 @@
UserGetCallProcInfo(IN HANDLE hCallProc,
OUT PWNDPROC_INFO wpInfo)
{
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
/* NOTE: Accessing the WNDPROC_INFO structure may raise an exception! */
@@ -120,13 +99,70 @@
return FALSE;
}
+/* Use Handle pEntry->ppi!
if (CallProc->pi != GetW32ProcessInfo())
{
return FALSE;
- }
+ }*/
- wpInfo->WindowProc = CallProc->WndProc;
+ wpInfo->WindowProc = CallProc->pfnClientPrevious;
wpInfo->IsUnicode = CallProc->Unicode;
return TRUE;
}
+
+/* SYSCALLS *****************************************************************/
+
+/*
+ Retrieve the WinProcA/W or CallProcData handle for Class, Dialog or Window.
+ This Function called from user space uses Window handle for class, window
+ and dialog procs only.
+
+ Note:
+ ProcIn is the default proc from pCls/pDlg/pWnd->lpfnXxyz, caller is
+ looking for another type of proc if the original lpfnXxyz proc is preset
+ to Ansi or Unicode.
+
+ Example:
+ If pWnd is created from Ansi and lpfnXxyz is assumed to be Ansi, caller
+ will ask for Unicode Proc return Proc or CallProcData handle.
+
+ This function should replaced NtUserGetClassLong and NtUserGetWindowLong.
+ */
+ULONG_PTR
+APIENTRY
+NtUserGetCPD(
+ HWND hWnd,
+ GETCPD Flags,
+ ULONG_PTR ProcIn)
+{
+ PWINDOW_OBJECT Window;
+ PWND Wnd;
+ PCLS Class;
+ ULONG_PTR Result = 0;
+ BOOL Ansi;
+
+ UserEnterExclusive();
+ if (!(Window = UserGetWindowObject(hWnd)) || !Window->Wnd)
+ {
+ goto Cleanup;
+ }
+ Wnd = Window->Wnd;
+ Class = Wnd->pcls;
+ /* Ex: Retrieve the Unicode Proc since the default is Ansi. */
+ Ansi = (Flags & UserGetCPDA2U); // Ansi to Unicode request from user.
+
+ if ( Flags & (UserGetCPDWindow|UserGetCPDDialog))
+ {
+ Result = UserGetWindowLong( hWnd, GWL_WNDPROC, Ansi);
+ }
+ else if (Flags & (UserGetCPDClass|UserGetCPDWndtoCls))
+ {
+ Result = UserGetClassLongPtr( Class, GCLP_WNDPROC, Ansi);
+ }
+
+Cleanup:
+ UserLeave();
+ return Result;
+}
+
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/class.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/class.c [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -80,15 +80,15 @@
if (Class->pclsBase == Class)
{
- PCALLPROC CallProc, NextCallProc;
+ PCALLPROCDATA CallProc, NextCallProc;
/* Destroy allocated callproc handles */
CallProc = Class->spcpdFirst;
while (CallProc != NULL)
{
- NextCallProc = CallProc->Next;
-
- CallProc->Next = NULL;
+ NextCallProc = CallProc->spcpdNext;
+
+ CallProc->spcpdNext = NULL;
DestroyCallProc(NULL,
CallProc);
@@ -211,23 +211,23 @@
Atom);
}
-PCALLPROC
+PCALLPROCDATA
UserFindCallProc(IN PCLS Class,
IN WNDPROC WndProc,
IN BOOL bUnicode)
{
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
CallProc = Class->spcpdFirst;
while (CallProc != NULL)
{
- if (CallProc->WndProc == WndProc &&
+ if (CallProc->pfnClientPrevious == WndProc &&
CallProc->Unicode == (UINT)bUnicode)
{
return CallProc;
}
- CallProc = CallProc->Next;
+ CallProc = CallProc->spcpdNext;
}
return NULL;
@@ -235,15 +235,15 @@
VOID
UserAddCallProcToClass(IN OUT PCLS Class,
- IN PCALLPROC CallProc)
+ IN PCALLPROCDATA CallProc)
{
PCLS BaseClass;
- ASSERT(CallProc->Next == NULL);
+ ASSERT(CallProc->spcpdNext == NULL);
BaseClass = Class->pclsBase;
- ASSERT(CallProc->Next == NULL);
- CallProc->Next = BaseClass->spcpdFirst;
+ ASSERT(CallProc->spcpdNext == NULL);
+ CallProc->spcpdNext = BaseClass->spcpdFirst;
BaseClass->spcpdFirst = CallProc;
/* Update all clones */
@@ -289,21 +289,22 @@
static WNDPROC
IntGetClassWndProc(IN PCLS Class,
IN PPROCESSINFO pi,
- IN BOOL Ansi)
+ IN BOOL Ansi) // This is what we are looking for?!?
{
ASSERT(UserIsEnteredExclusive() == TRUE);
-
+ /* System Classes */
if (Class->System)
{
+ // FIXME! System class have gpsi->apfnClientA/W to pick from.
return (Ansi ? Class->WndProcExtra : Class->lpfnWndProc);
}
- else
- {
+ else
+ { /* Unicode Proc */
if (!Ansi == Class->Unicode)
{
return Class->lpfnWndProc;
}
- else
+ else // Ansi?
{
PCLS BaseClass;
@@ -318,7 +319,7 @@
}
else
{
- PCALLPROC NewCallProc;
+ PCALLPROCDATA NewCallProc;
if (pi == NULL)
return NULL;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/desktop.c [iso-8859-1] Sat Jul 25
02:41:22 2009
@@ -1118,8 +1118,8 @@
RtlZeroMemory(&WindowName, sizeof(WindowName));
wc.cbSize = sizeof(wc);
- wc.style = CS_DBLCLKS|CS_PARENTDC;
- wc.lpfnWndProc = gpsi->apfnClientW.pfnDesktopWndProc; // Use User32 Desktop Proc.
+ wc.style = 0;
+ wc.lpfnWndProc = gpsi->apfnClientW.pfnDesktopWndProc; // Use pfnMessageWindowProc
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hModClient;
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/ntstubs.c [iso-8859-1] Sat Jul 25
02:41:22 2009
@@ -264,18 +264,6 @@
HWND hwnd,
HDC hdc,
UINT CtlMsg) // Wine PaintRect: WM_CTLCOLORMSGBOX + hbrush
-{
- UNIMPLEMENTED
-
- return 0;
-}
-
-DWORD
-APIENTRY
-NtUserGetCPD(
- DWORD Unknown0,
- DWORD Unknown1,
- DWORD Unknown2)
{
UNIMPLEMENTED
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/object.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/object.c [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -27,7 +27,7 @@
#define NDEBUG
#include <debug.h>
-int usedHandles=0;
+//int usedHandles=0;
PUSER_HANDLE_TABLE gHandleTable = NULL;
@@ -55,14 +55,14 @@
{
PUSER_HANDLE_ENTRY entry;
- DPRINT("handles used %i\n",usedHandles);
+ DPRINT("handles used %i\n",gpsi->cHandleEntries);
if (ht->freelist)
{
entry = ht->freelist;
ht->freelist = entry->ptr;
- usedHandles++;
+ gpsi->cHandleEntries++;
return entry;
}
@@ -72,7 +72,7 @@
int i, iFree = 0, iWindow = 0, iMenu = 0, iCursorIcon = 0,
iHook = 0, iCallProc = 0, iAccel = 0, iMonitor = 0, iTimer = 0;
/**/
- DPRINT1("Out of user handles! Used -> %i, NM_Handle -> %d\n",
usedHandles, ht->nb_handles);
+ DPRINT1("Out of user handles! Used -> %i, NM_Handle -> %d\n",
gpsi->cHandleEntries, ht->nb_handles);
//#if 0
for(i = 0; i < ht->nb_handles; i++)
{
@@ -131,7 +131,7 @@
entry->generation = 1;
- usedHandles++;
+ gpsi->cHandleEntries++;
return entry;
}
@@ -154,7 +154,7 @@
entry->pi = NULL;
ht->freelist = entry;
- usedHandles--;
+ gpsi->cHandleEntries--;
return ret;
}
@@ -387,7 +387,7 @@
if (hdr->RefCount == 0 && hdr->destroyed)
{
-// DPRINT1("info: something destroyed bcaise of deref, in
use=%i\n",usedHandles);
+// DPRINT1("info: something destroyed bcaise of deref, in
use=%i\n",gpsi->cHandleEntries);
memset(hdr, 0x55, sizeof(USER_OBJECT_HEADER));
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/windc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/windc.c [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -418,7 +418,7 @@
// Window nz, check to see if we still own this or it is just cheap wine tonight.
if (!(Flags & DCX_CACHE))
{
- if ( Wnd->ti != GetW32ThreadInfo())
+ if ( Wnd->pti != GetW32ThreadInfo())
Flags |= DCX_CACHE; // Ah~ Not Powned! Forced to be cheap~
}
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/window.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/window.c [iso-8859-1] Sat Jul 25 02:41:22
2009
@@ -329,12 +329,12 @@
{
Wnd->strName.Length = 0;
Wnd->strName.MaximumLength = 0;
- DesktopHeapFree(Wnd->pdesktop,
+ DesktopHeapFree(Wnd->rpdesk,
Wnd->strName.Buffer);
Wnd->strName.Buffer = NULL;
}
- DesktopHeapFree(Wnd->pdesktop, Wnd);
+ DesktopHeapFree(Wnd->rpdesk, Wnd);
WindowObject->Wnd = NULL;
}
@@ -562,17 +562,17 @@
on a function that I thought is only suppose to return the current Windows
Proc? */
else
{
- PCALLPROC NewCallProc, CallProc;
+ PCALLPROCDATA NewCallProc, CallProc;
NewCallProc = UserFindCallProc(Wnd->pcls,
Wnd->lpfnWndProc,
Wnd->Unicode);
if (NewCallProc == NULL)
{
- NewCallProc = CreateCallProc(Wnd->ti->pDeskInfo,
+ NewCallProc = CreateCallProc(Wnd->pti->pDeskInfo,
Wnd->lpfnWndProc,
Wnd->Unicode,
- Wnd->ti->ppi);
+ Wnd->pti->ppi);
if (NewCallProc == NULL)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -1672,9 +1672,9 @@
Window->Wnd->hdr.Handle = hWnd; /* FIXME: Remove hack , are you sure?*/
Wnd = Window->Wnd;
- Wnd->ti = ti;
+ Wnd->pti = ti;
Wnd->pi = ti->ppi;
- Wnd->pdesktop = pti->Desktop;
+ Wnd->rpdesk = pti->Desktop;
Wnd->hWndLastActive = hWnd;
}
@@ -1770,7 +1770,7 @@
if ( NULL != WindowName->Buffer && WindowName->Length > 0 )
{
- Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->pdesktop,
+ Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->rpdesk,
WindowName->Length +
sizeof(UNICODE_NULL));
if (Wnd->strName.Buffer == NULL)
{
@@ -2239,9 +2239,9 @@
Dont understand why it does this. */
if (ClassAtom == gpsi->atomSysClass[ICLS_EDIT])
{
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
//CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, bUnicodeWindow,
Wnd->ti->ppi);
- CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode ,
Wnd->ti->ppi);
+ CallProc = CreateCallProc(NULL, Wnd->lpfnWndProc, Wnd->Unicode ,
Wnd->pti->ppi);
if (!CallProc)
{
@@ -3693,7 +3693,7 @@
BOOL Ansi)
{
WNDPROC Ret;
- PCALLPROC CallProc;
+ PCALLPROCDATA CallProc;
PWND Wnd = Window->Wnd;
/* resolve any callproc handle if possible */
@@ -3730,7 +3730,7 @@
CallProc = CreateCallProc(NULL,
Wnd->lpfnWndProc,
Wnd->Unicode,
- Wnd->ti->ppi);
+ Wnd->pti->ppi);
if (CallProc == NULL)
{
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
@@ -4820,10 +4820,10 @@
Wnd->strName.Buffer = NULL;
if (buf != NULL)
{
- DesktopHeapFree(Wnd->pdesktop, buf);
+ DesktopHeapFree(Wnd->rpdesk, buf);
}
- Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->pdesktop,
+ Wnd->strName.Buffer = DesktopHeapAlloc(Wnd->rpdesk,
UnicodeString.Length +
sizeof(UNICODE_NULL));
if (Wnd->strName.Buffer != NULL)
{