mirror of
https://github.com/reactos/reactos.git
synced 2025-04-05 21:21:33 +00:00
- [Win32k] More work on classes. Wine test drop to 35 failures from 52, now with the system class rewrite it is up to 42 failures. There is one User32 loaded so there is one User client Instance for this system. One System class per system not including Public (Global) or Private (Local) classes per process. Sorting continues.
- Tested wine (some improvements and losses), Firefox 1.15.xx and AbiWord 2.6.8. svn path=/trunk/; revision=42151
This commit is contained in:
parent
1ad4db139c
commit
194297c386
10 changed files with 66 additions and 111 deletions
|
@ -70,9 +70,6 @@
|
|||
#define NtUserSetCaretBlinkTime(uMSeconds) \
|
||||
(BOOL)NtUserCallOneParam((DWORD)uMSeconds, ONEPARAM_ROUTINE_SETCARETBLINKTIME)
|
||||
|
||||
#define NtUserRegisterUserModule(hInstance) \
|
||||
(BOOL)NtUserCallOneParam((DWORD)hInstance, ONEPARAM_ROUTINE_REGISTERUSERMODULE)
|
||||
|
||||
/*
|
||||
#define NtUserEnumClipboardFormats(format) \
|
||||
(UINT)NtUserCallOneParam(format, ONEPARAM_ROUTINE_ENUMCLIPBOARDFORMATS)
|
||||
|
|
|
@ -244,7 +244,6 @@ Init(VOID)
|
|||
gHandleEntries = SharedPtrToUser(gHandleTable->handles);
|
||||
//ERR("1 SI 0x%x : HT 0x%x : D 0x%x\n", UserCon.siClient.psi, UserCon.siClient.aheList, g_ulSharedDelta);
|
||||
|
||||
RegisterClientPFN();
|
||||
/* Allocate an index for user32 thread local data. */
|
||||
User32TlsIndex = TlsAlloc();
|
||||
if (User32TlsIndex != TLS_OUT_OF_INDEXES)
|
||||
|
@ -290,7 +289,7 @@ DllMain(
|
|||
{
|
||||
case DLL_PROCESS_ATTACH:
|
||||
User32Instance = hInstanceDll;
|
||||
if (!NtUserRegisterUserModule(hInstanceDll) ||
|
||||
if (!RegisterClientPFN() ||
|
||||
!RegisterSystemControls())
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -351,8 +350,6 @@ GetConnected(VOID)
|
|||
g_ulSharedDelta = UserCon.siClient.ulSharedDelta;
|
||||
g_psi = SharedPtrToUser(UserCon.siClient.psi);
|
||||
gHandleTable = SharedPtrToUser(UserCon.siClient.aheList);
|
||||
gHandleEntries = SharedPtrToUser(gHandleTable->handles);
|
||||
|
||||
RegisterClientPFN();
|
||||
gHandleEntries = SharedPtrToUser(gHandleTable->handles);
|
||||
|
||||
}
|
||||
|
|
|
@ -136,8 +136,6 @@ GetClassInfoA(
|
|||
WNDCLASSEXA wcex;
|
||||
BOOL retval;
|
||||
|
||||
if (!hInstance) hInstance = User32Instance;
|
||||
|
||||
retval = GetClassInfoExA(hInstance, lpClassName, &wcex);
|
||||
if (retval)
|
||||
{
|
||||
|
@ -145,7 +143,7 @@ GetClassInfoA(
|
|||
lpWndClass->lpfnWndProc = wcex.lpfnWndProc;
|
||||
lpWndClass->cbClsExtra = wcex.cbClsExtra;
|
||||
lpWndClass->cbWndExtra = wcex.cbWndExtra;
|
||||
lpWndClass->hInstance = (User32Instance == hInstance) ? 0 : wcex.hInstance;
|
||||
lpWndClass->hInstance = wcex.hInstance;
|
||||
lpWndClass->hIcon = wcex.hIcon;
|
||||
lpWndClass->hCursor = wcex.hCursor;
|
||||
lpWndClass->hbrBackground = wcex.hbrBackground;
|
||||
|
@ -169,8 +167,6 @@ GetClassInfoW(
|
|||
WNDCLASSEXW wcex;
|
||||
BOOL retval;
|
||||
|
||||
if (!hInstance) hInstance = User32Instance;
|
||||
|
||||
retval = GetClassInfoExW(hInstance, lpClassName, &wcex);
|
||||
if (retval)
|
||||
{
|
||||
|
@ -178,7 +174,7 @@ GetClassInfoW(
|
|||
lpWndClass->lpfnWndProc = wcex.lpfnWndProc;
|
||||
lpWndClass->cbClsExtra = wcex.cbClsExtra;
|
||||
lpWndClass->cbWndExtra = wcex.cbWndExtra;
|
||||
lpWndClass->hInstance = (User32Instance == hInstance) ? 0 : wcex.hInstance;
|
||||
lpWndClass->hInstance = wcex.hInstance;
|
||||
lpWndClass->hIcon = wcex.hIcon;
|
||||
lpWndClass->hCursor = wcex.hCursor;
|
||||
lpWndClass->hbrBackground = wcex.hbrBackground;
|
||||
|
|
|
@ -2988,7 +2988,6 @@ typedef struct tagKMDDELPARAM
|
|||
#define ONEPARAM_ROUTINE_GETWINDOWINSTANCE 0xfffe0010
|
||||
#define ONEPARAM_ROUTINE_CREATECURICONHANDLE 0xfffe0025 // CREATE_EMPTY_CURSOR_OBJECT ?
|
||||
#define ONEPARAM_ROUTINE_MSQSETWAKEMASK 0xfffe0027
|
||||
#define ONEPARAM_ROUTINE_REGISTERUSERMODULE 0xfffe0031
|
||||
#define ONEPARAM_ROUTINE_GETCURSORPOSITION 0xfffe0048 // use ONEPARAM_ or TWOPARAM routine ?
|
||||
#define TWOPARAM_ROUTINE_GETWINDOWRGNBOX 0xfffd0048 // user mode
|
||||
#define TWOPARAM_ROUTINE_GETWINDOWRGN 0xfffd0049 // user mode
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#ifndef __INCLUDE_NAPI_WIN32_H
|
||||
#define __INCLUDE_NAPI_WIN32_H
|
||||
|
||||
extern HINSTANCE hModClient; // This should replace (PROCESSINFO)->hModUser
|
||||
extern BOOL ClientPfnInit;
|
||||
extern HINSTANCE hModClient;
|
||||
extern HANDLE hModuleWin; // This Win32k Instance.
|
||||
extern PCLS SystemClassList;
|
||||
extern BOOL RegisteredSysClasses;
|
||||
|
||||
typedef struct _WIN32HEAP WIN32HEAP, *PWIN32HEAP;
|
||||
|
||||
|
@ -99,14 +103,11 @@ typedef struct _W32PROCESS
|
|||
typedef struct _PROCESSINFO
|
||||
{
|
||||
W32PROCESS XzyxW32Process; /* Place holder. */
|
||||
|
||||
PCLS pclsPrivateList;
|
||||
PCLS pclsPublicList;
|
||||
/* ReactOS */
|
||||
HINSTANCE hModUser;
|
||||
PCLS LocalClassList;
|
||||
PCLS GlobalClassList;
|
||||
PCLS SystemClassList;
|
||||
|
||||
UINT RegisteredSysClasses : 1;
|
||||
|
||||
|
||||
} PROCESSINFO;
|
||||
|
||||
#endif /* __INCLUDE_NAPI_WIN32_H */
|
||||
|
|
|
@ -1,21 +1,3 @@
|
|||
/*
|
||||
* 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.
|
||||
*/
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS kernel
|
||||
|
@ -35,6 +17,9 @@
|
|||
#define WARN DPRINT1
|
||||
#define ERR DPRINT1
|
||||
|
||||
PCLS SystemClassList = NULL;
|
||||
BOOL RegisteredSysClasses = FALSE;
|
||||
|
||||
static struct
|
||||
{
|
||||
int FnId;
|
||||
|
@ -137,43 +122,31 @@ void FASTCALL DestroyProcessClasses(PW32PROCESS Process )
|
|||
{
|
||||
PCLS Class;
|
||||
PPROCESSINFO pi = (PPROCESSINFO)Process;
|
||||
|
||||
|
||||
if (pi != NULL)
|
||||
{
|
||||
/* free all local classes */
|
||||
Class = pi->LocalClassList;
|
||||
Class = pi->pclsPrivateList;
|
||||
while (Class != NULL)
|
||||
{
|
||||
pi->LocalClassList = Class->pclsNext;
|
||||
pi->pclsPrivateList = Class->pclsNext;
|
||||
|
||||
ASSERT(Class->pclsBase == Class);
|
||||
IntDestroyClass(Class);
|
||||
|
||||
Class = pi->LocalClassList;
|
||||
Class = pi->pclsPrivateList;
|
||||
}
|
||||
|
||||
/* free all global classes */
|
||||
Class = pi->GlobalClassList;
|
||||
Class = pi->pclsPublicList;
|
||||
while (Class != NULL)
|
||||
{
|
||||
pi->GlobalClassList = Class->pclsNext;
|
||||
pi->pclsPublicList = Class->pclsNext;
|
||||
|
||||
ASSERT(Class->pclsBase == Class);
|
||||
IntDestroyClass(Class);
|
||||
|
||||
Class = pi->GlobalClassList;
|
||||
}
|
||||
|
||||
/* free all system classes */
|
||||
Class = pi->SystemClassList;
|
||||
while (Class != NULL)
|
||||
{
|
||||
pi->SystemClassList = Class->pclsNext;
|
||||
|
||||
ASSERT(Class->pclsBase == Class);
|
||||
IntDestroyClass(Class);
|
||||
|
||||
Class = pi->SystemClassList;
|
||||
Class = pi->pclsPublicList;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -632,11 +605,11 @@ IntDereferenceClass(IN OUT PCLS Class,
|
|||
if (BaseClass->pclsClone != NULL)
|
||||
{
|
||||
if (BaseClass->System)
|
||||
PrevLink = &pi->SystemClassList;
|
||||
PrevLink = &SystemClassList;
|
||||
else if (BaseClass->Global)
|
||||
PrevLink = &pi->GlobalClassList;
|
||||
PrevLink = &pi->pclsPublicList;
|
||||
else
|
||||
PrevLink = &pi->LocalClassList;
|
||||
PrevLink = &pi->pclsPrivateList;
|
||||
|
||||
CurrentClass = *PrevLink;
|
||||
while (CurrentClass != BaseClass)
|
||||
|
@ -810,19 +783,19 @@ IntCheckProcessDesktopClasses(IN PDESKTOP Desktop,
|
|||
|
||||
/* check all local classes */
|
||||
IntCheckDesktopClasses(Desktop,
|
||||
&pi->LocalClassList,
|
||||
&pi->pclsPrivateList,
|
||||
FreeOnFailure,
|
||||
&Ret);
|
||||
|
||||
/* check all global classes */
|
||||
IntCheckDesktopClasses(Desktop,
|
||||
&pi->GlobalClassList,
|
||||
&pi->pclsPublicList,
|
||||
FreeOnFailure,
|
||||
&Ret);
|
||||
|
||||
/* check all system classes */
|
||||
IntCheckDesktopClasses(Desktop,
|
||||
&pi->SystemClassList,
|
||||
&SystemClassList,
|
||||
FreeOnFailure,
|
||||
&Ret);
|
||||
|
||||
|
@ -892,6 +865,8 @@ IntCreateClass(IN CONST WNDCLASSEXW* lpwcx,
|
|||
Class->pclsBase = Class;
|
||||
Class->atomClassName = Atom;
|
||||
|
||||
Class->CSF_flags = dwFlags;
|
||||
|
||||
if (dwFlags & CSF_SYSTEMCLASS)
|
||||
{
|
||||
dwFlags &= ~CSF_ANSIPROC;
|
||||
|
@ -1117,7 +1092,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
|||
/* Step 1: try to find an exact match of locally registered classes */
|
||||
Class = IntFindClass(Atom,
|
||||
hInstance,
|
||||
&pi->LocalClassList,
|
||||
&pi->pclsPrivateList,
|
||||
Link);
|
||||
if (Class != NULL)
|
||||
{
|
||||
|
@ -1128,7 +1103,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
|||
is not relevant for global classes */
|
||||
Class = IntFindClass(Atom,
|
||||
NULL,
|
||||
&pi->GlobalClassList,
|
||||
&pi->pclsPublicList,
|
||||
Link);
|
||||
if (Class != NULL)
|
||||
{
|
||||
|
@ -1137,8 +1112,8 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
|||
|
||||
/* Step 3: try to find any local class registered by user32 */
|
||||
Class = IntFindClass(Atom,
|
||||
pi->hModUser,
|
||||
&pi->LocalClassList,
|
||||
hModClient,
|
||||
&pi->pclsPrivateList,
|
||||
Link);
|
||||
if (Class != NULL)
|
||||
{
|
||||
|
@ -1147,8 +1122,8 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
|||
|
||||
/* Step 4: try to find any global class registered by user32 */
|
||||
Class = IntFindClass(Atom,
|
||||
pi->hModUser,
|
||||
&pi->GlobalClassList,
|
||||
hModClient,
|
||||
&pi->pclsPublicList,
|
||||
Link);
|
||||
if (Class != NULL)
|
||||
{
|
||||
|
@ -1158,7 +1133,7 @@ IntGetClassAtom(IN PUNICODE_STRING ClassName,
|
|||
/* Step 5: try to find a system class */
|
||||
Class = IntFindClass(Atom,
|
||||
NULL,
|
||||
&pi->SystemClassList,
|
||||
&SystemClassList,
|
||||
Link);
|
||||
if (Class == NULL)
|
||||
{
|
||||
|
@ -1191,7 +1166,7 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
|
|||
|
||||
pti = PsGetCurrentThreadWin32Thread();
|
||||
ti = GetW32ThreadInfo();
|
||||
if (ti == NULL || !ti->ppi->RegisteredSysClasses)
|
||||
if (ti == NULL || !RegisteredSysClasses)
|
||||
{
|
||||
SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY);
|
||||
return (RTL_ATOM)0;
|
||||
|
@ -1240,11 +1215,11 @@ UserRegisterClass(IN CONST WNDCLASSEXW* lpwcx,
|
|||
|
||||
/* Register the class */
|
||||
if (Class->System)
|
||||
List = &pi->SystemClassList;
|
||||
List = &SystemClassList;
|
||||
else if (Class->Global)
|
||||
List = &pi->GlobalClassList;
|
||||
List = &pi->pclsPublicList;
|
||||
else
|
||||
List = &pi->LocalClassList;
|
||||
List = &pi->pclsPrivateList;
|
||||
|
||||
Class->pclsNext = *List;
|
||||
(void)InterlockedExchangePointer((PVOID*)List,
|
||||
|
@ -1763,7 +1738,7 @@ UserSetClassLongPtr(IN PCLS Class,
|
|||
if (!IntSetClassMenuName(Class,
|
||||
Value))
|
||||
{
|
||||
DPRINT("Setting the class menu name failed!\n");
|
||||
DPRINT1("Setting the class menu name failed!\n");
|
||||
}
|
||||
|
||||
/* FIXME - really return NULL? Wine does so... */
|
||||
|
@ -1841,10 +1816,10 @@ UserGetClassInfo(IN PCLS Class,
|
|||
else
|
||||
lpwcx->lpszMenuName = Class->MenuName;
|
||||
|
||||
if (Class->hModule == pi->hModUser)
|
||||
if (hInstance == hModClient)
|
||||
lpwcx->hInstance = NULL;
|
||||
else
|
||||
lpwcx->hInstance = Class->hModule;
|
||||
lpwcx->hInstance = hInstance;
|
||||
|
||||
lpwcx->lpszClassName = (LPCWSTR)((ULONG_PTR)Class->atomClassName); /* FIXME - return the string? */
|
||||
|
||||
|
@ -1865,8 +1840,11 @@ UserRegisterSystemClasses(IN ULONG Count,
|
|||
PCLS Class;
|
||||
BOOL Ret = TRUE;
|
||||
|
||||
if (pi->RegisteredSysClasses || pi->hModUser == NULL)
|
||||
if ( hModClient == NULL)
|
||||
return FALSE;
|
||||
/* Init System Classes once only*/
|
||||
if (RegisteredSysClasses)
|
||||
return TRUE;
|
||||
|
||||
RtlZeroMemory(&MenuName, sizeof(MenuName));
|
||||
|
||||
|
@ -1885,7 +1863,7 @@ UserRegisterSystemClasses(IN ULONG Count,
|
|||
wc.lpfnWndProc = SystemClasses[i].ProcW;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = SystemClasses[i].ExtraBytes;
|
||||
wc.hInstance = pi->hModUser;
|
||||
wc.hInstance = hModClient;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = SystemClasses[i].hCursor;
|
||||
wc.hbrBackground = SystemClasses[i].hBrush;
|
||||
|
@ -1911,8 +1889,8 @@ UserRegisterSystemClasses(IN ULONG Count,
|
|||
}
|
||||
|
||||
ASSERT(Class->System);
|
||||
Class->pclsNext = pi->SystemClassList;
|
||||
(void)InterlockedExchangePointer((PVOID*)&pi->SystemClassList,
|
||||
Class->pclsNext = SystemClassList;
|
||||
(void)InterlockedExchangePointer((PVOID*)&SystemClassList,
|
||||
Class);
|
||||
}
|
||||
else
|
||||
|
@ -1923,7 +1901,7 @@ UserRegisterSystemClasses(IN ULONG Count,
|
|||
}
|
||||
|
||||
if (Ret)
|
||||
pi->RegisteredSysClasses = TRUE;
|
||||
RegisteredSysClasses = TRUE;
|
||||
return Ret;
|
||||
}
|
||||
|
||||
|
@ -2294,8 +2272,8 @@ InvalidParameter:
|
|||
NULL);
|
||||
if (ClassAtom != (RTL_ATOM)0)
|
||||
{
|
||||
if (hInstance == NULL)
|
||||
hInstance = pi->hModUser;
|
||||
if (hInstance == NULL)
|
||||
hInstance = hModClient;
|
||||
|
||||
Ret = UserGetClassInfo(Class,
|
||||
lpWndClassEx,
|
||||
|
@ -2313,7 +2291,8 @@ InvalidParameter:
|
|||
(PVOID)Class->AnsiMenuName :
|
||||
(PVOID)Class->MenuName);
|
||||
}
|
||||
|
||||
// From Wine:
|
||||
/* We must return the atom of the class here instead of just TRUE. */
|
||||
/* Undocumented behavior! Return the class atom as a BOOL! */
|
||||
Ret = (BOOL)ClassAtom;
|
||||
}
|
||||
|
|
|
@ -1122,7 +1122,7 @@ NtUserCreateDesktop(
|
|||
wc.lpfnWndProc = gpsi->apfnClientW.pfnDesktopWndProc; // Use User32 Desktop Proc.
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = 0;
|
||||
wc.hInstance = pi->hModUser; // hModClient;
|
||||
wc.hInstance = hModClient;
|
||||
wc.hIcon = NULL;
|
||||
wc.hCursor = NULL;
|
||||
wc.hbrBackground = 0;
|
||||
|
@ -1140,8 +1140,8 @@ NtUserCreateDesktop(
|
|||
if (Class != NULL)
|
||||
{
|
||||
ASSERT(Class->System);
|
||||
Class->pclsNext = pi->SystemClassList;
|
||||
(void)InterlockedExchangePointer((PVOID*)&pi->SystemClassList,
|
||||
Class->pclsNext = SystemClassList;
|
||||
(void)InterlockedExchangePointer((PVOID*)&SystemClassList,
|
||||
Class);
|
||||
}
|
||||
else
|
||||
|
@ -1159,7 +1159,7 @@ NtUserCreateDesktop(
|
|||
100,
|
||||
NULL,
|
||||
NULL,
|
||||
pi->hModUser, // hModClient;
|
||||
hModClient,
|
||||
NULL,
|
||||
0,
|
||||
TRUE);
|
||||
|
|
|
@ -366,6 +366,9 @@ NtUserInitializeClientPfnArrays(
|
|||
{
|
||||
NTSTATUS Status = STATUS_SUCCESS;
|
||||
DPRINT("Enter NtUserInitializeClientPfnArrays User32 0x%x\n",hmodUser);
|
||||
|
||||
if (ClientPfnInit) return Status;
|
||||
|
||||
UserEnterExclusive();
|
||||
|
||||
_SEH2_TRY
|
||||
|
@ -378,6 +381,7 @@ NtUserInitializeClientPfnArrays(
|
|||
RtlCopyMemory(&gpsi->apfnClientWorker, pfnClientWorker, sizeof(PFNCLIENTWORKER));
|
||||
|
||||
hModClient = hmodUser;
|
||||
ClientPfnInit = TRUE;
|
||||
}
|
||||
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@ ERESOURCE UserLock;
|
|||
ATOM AtomMessage; // Window Message atom.
|
||||
BOOL gbInitialized;
|
||||
HINSTANCE hModClient = NULL;
|
||||
BOOL ClientPfnInit = FALSE;
|
||||
|
||||
/* PRIVATE FUNCTIONS *********************************************************/
|
||||
|
||||
|
|
|
@ -344,25 +344,6 @@ NtUserCallOneParam(
|
|||
case ONEPARAM_ROUTINE_GETKEYBOARDLAYOUT:
|
||||
RETURN( (DWORD)UserGetKeyboardLayout(Param));
|
||||
|
||||
case ONEPARAM_ROUTINE_REGISTERUSERMODULE:
|
||||
{
|
||||
PW32THREADINFO ti;
|
||||
|
||||
ti = GetW32ThreadInfo();
|
||||
if (ti == NULL)
|
||||
{
|
||||
DPRINT1("Cannot register user32 module instance!\n");
|
||||
SetLastWin32Error(ERROR_INVALID_PARAMETER);
|
||||
RETURN(FALSE);
|
||||
}
|
||||
|
||||
if (InterlockedCompareExchangePointer(&ti->ppi->hModUser,
|
||||
(HINSTANCE)Param,
|
||||
NULL) == NULL)
|
||||
{
|
||||
RETURN(TRUE);
|
||||
}
|
||||
}
|
||||
case ONEPARAM_ROUTINE_RELEASEDC:
|
||||
RETURN (UserReleaseDC(NULL, (HDC) Param, FALSE));
|
||||
|
||||
|
|
Loading…
Reference in a new issue