Author: jimtabor Date: Sun Jul 26 14:27:15 2009 New Revision: 42230
URL: http://svn.reactos.org/svn/reactos?rev=42230&view=rev Log: - Fixed event code. Remove junk too.
Modified: trunk/reactos/include/reactos/win32k/ntuser.h trunk/reactos/subsystems/win32/win32k/include/hook.h trunk/reactos/subsystems/win32/win32k/ntuser/event.c
Modified: trunk/reactos/include/reactos/win32k/ntuser.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntus... ============================================================================== --- trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] (original) +++ trunk/reactos/include/reactos/win32k/ntuser.h [iso-8859-1] Sun Jul 26 14:27:15 2009 @@ -185,6 +185,21 @@ PUNICODE_STRING pusMenuName; } CLSMENUNAME, *PCLSMENUNAME;
+typedef struct tagSBDATA +{ + INT posMin; + INT posMax; + INT page; + INT pos; +} SBDATA, *PSBDATA; + +typedef struct tagSBINFO +{ + INT WSBflags; + SBDATA Horz; + SBDATA Vert; +} SBINFO, *PSBINFO; + typedef enum _GETCPD { UserGetCPDU2A = 0x01, @@ -221,7 +236,7 @@ struct _CLS *pclsNext; RTL_ATOM atomClassName; ATOM atomNVClassName; - DWORD fnid; // New ClassId + DWORD fnid; struct _DESKTOP *rpdeskParent; PVOID pdce; DWORD CSF_flags; @@ -242,14 +257,17 @@ INT cbwndExtra; HINSTANCE hModule; HANDLE hIcon; /* FIXME - Use pointer! */ + //PCURSOR spicn; HANDLE hCursor; /* FIXME - Use pointer! */ + //PCURSOR spcur; HBRUSH hbrBackground; PWSTR lpszMenuName; // kernel use PSTR lpszAnsiClassName; // " HANDLE hIconSm; /* FIXME - Use pointer! */ + //PCURSOR spicnSm;
UINT Destroying : 1; // CSF_WOWDEFERDESTROY - UINT Unicode : 1; + UINT Unicode : 1; // !CSF_ANSIPROC UINT System : 1; // CSF_SYSTEMCLASS UINT Global : 1; // CS_GLOBALCLASS UINT MenuNameIsString : 1; @@ -382,11 +400,16 @@ /* Property list head.*/ LIST_ENTRY PropListHead; ULONG PropListItems; + /* Scrollbar info */ + PSBINFO pSBInfo; + /* system menu handle. */ + HMENU SystemMenu; + //PMENU spmenuSys; /* Window menu handle or window id */ UINT IDMenu; // Use spmenu - //PMENU spmenuSys; //PMENU spmenu; - HRGN hrgnClip; + HRGN hrgnClip; + HRGN hrgnNewFrame; /* Window name. */ UNICODE_STRING strName; /* Size of the extra data associated with the window. */
Modified: trunk/reactos/subsystems/win32/win32k/include/hook.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/inc... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/include/hook.h [iso-8859-1] Sun Jul 26 14:27:15 2009 @@ -15,6 +15,7 @@
typedef struct tagEVENTHOOK { + THRDESKHEAD head; LIST_ENTRY Chain; /* Event chain entry */ PETHREAD Thread; /* Thread owning the event */ UINT eventMin; @@ -25,8 +26,6 @@ ULONG Flags; /* Some internal flags */ ULONG_PTR offPfn; INT ihmod; - THRDESKHEAD head; // FIXME When on top it creates problems - UNICODE_STRING ModuleName; /* Module name for global events */ } EVENTHOOK, *PEVENTHOOK;
typedef struct tagEVENTTABLE
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/event.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntu... ============================================================================== --- trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] (original) +++ trunk/reactos/subsystems/win32/win32k/ntuser/event.c [iso-8859-1] Sun Jul 26 14:27:15 2009 @@ -3,9 +3,6 @@
#define NDEBUG #include <debug.h> - -#define WINEVENT_INIT 0x40000000 -#define WINEVENT_DESTROYED 0x80000000
typedef struct _EVENTPACK { @@ -176,6 +173,7 @@ LONG idChild) { PEVENTHOOK pEH; + PLIST_ENTRY pLE; LRESULT Result;
DPRINT("IntNotifyWinEvent GlobalEvents = 0x%x pWnd 0x%x\n",GlobalEvents, pWnd); @@ -186,17 +184,10 @@
if (!GlobalEvents || !GlobalEvents->Counts) return;
- if (!UserIsEntered()) return; - - pEH = (PEVENTHOOK)GlobalEvents->Events.Flink; - DPRINT("IntNotifyWinEvent pEH 0x%x\n",pEH); + pLE = GlobalEvents->Events.Flink; + pEH = CONTAINING_RECORD(pLE, EVENTHOOK, Chain); do { - if (pEH->Flags & WINEVENT_INIT) - { - DPRINT("IntNotifyWinEvent is still in INIT MODE!! pEH 0x%x\n",pEH); - } - UserReferenceObject(pEH); // Must be inside the event window. if ( (pEH->eventMin <= Event) && (pEH->eventMax >= Event)) @@ -206,7 +197,11 @@ if (!(pEH->idProcess) || !(pEH->idThread) || (NtCurrentTeb()->ClientId.UniqueProcess == (PVOID)pEH->idProcess)) { - Result = IntCallLowLevelEvent(pEH, Event, UserHMGetHandle(pWnd), idObject, idChild); + Result = IntCallLowLevelEvent( pEH, + Event, + UserHMGetHandle(pWnd), + idObject, + idChild); } }// if ^skip own thread && ((Pid && CPid == Pid && ^skip own process) || all process) else if ( !(pEH->Flags & WINEVENT_SKIPOWNTHREAD) && @@ -215,22 +210,20 @@ !(pEH->Flags & WINEVENT_SKIPOWNPROCESS)) || !pEH->idProcess ) ) { - - Result = co_IntCallEventProc( pEH->head.h, - Event, - UserHMGetHandle(pWnd), - idObject, - idChild, + Result = co_IntCallEventProc( UserHMGetHandle(pEH), + Event, + UserHMGetHandle(pWnd), + idObject, + idChild, PtrToUint(NtCurrentTeb()->ClientId.UniqueThread), - (DWORD)EngGetTickCount(), - pEH->Proc); - + (DWORD)EngGetTickCount(), + pEH->Proc); } } UserDereferenceObject(pEH); - - pEH = (PEVENTHOOK)pEH->Chain.Flink; - } while (pEH != (PEVENTHOOK)&GlobalEvents->Events.Flink); + pLE = pEH->Chain.Flink; + pEH = CONTAINING_RECORD(pLE, EVENTHOOK, Chain); + } while (pLE != &GlobalEvents->Events); }
VOID @@ -275,7 +268,6 @@ { PEVENTHOOK pEH; HWINEVENTHOOK Ret = NULL; - UNICODE_STRING ModuleName; NTSTATUS Status; HANDLE Handle; PETHREAD Thread = NULL; @@ -330,8 +322,7 @@ InsertTailList(&GlobalEvents->Events, &pEH->Chain); GlobalEvents->Counts++;
- pEH->Flags = dwflags|WINEVENT_INIT; - pEH->head.h = Handle; + UserHMGetHandle(pEH) = Handle; // pEH->head.pti =? // pEH->head.rpdesk if (Thread) @@ -342,58 +333,16 @@ pEH->eventMax = eventMax; pEH->idProcess = idProcess; pEH->idThread = idThread; + pEH->Flags = dwflags;
if (NULL != hmodWinEventProc) { - Status = MmCopyFromCaller(&ModuleName, - puString, - sizeof(UNICODE_STRING)); - - if (! NT_SUCCESS(Status)) - { - UserDereferenceObject(pEH); - IntRemoveEvent(pEH); - SetLastNtError(Status); - goto SetEventExit; - } - - pEH->ModuleName.Buffer = ExAllocatePoolWithTag(PagedPool, - ModuleName.MaximumLength, - TAG_HOOK); - - if (NULL == pEH->ModuleName.Buffer) - { - UserDereferenceObject(pEH); - IntRemoveEvent(pEH); - SetLastWin32Error(ERROR_NOT_ENOUGH_MEMORY); - goto SetEventExit; - } - - pEH->ModuleName.MaximumLength = ModuleName.MaximumLength; - - Status = MmCopyFromCaller(pEH->ModuleName.Buffer, - ModuleName.Buffer, - ModuleName.MaximumLength); - - if (! NT_SUCCESS(Status)) - { - ExFreePoolWithTag(pEH->ModuleName.Buffer, TAG_HOOK); - UserDereferenceObject(pEH); - IntRemoveEvent(pEH); - SetLastNtError(Status); - goto SetEventExit; - } - - pEH->ModuleName.Length = ModuleName.Length; - pEH->offPfn = (ULONG_PTR)((char *)lpfnWinEventProc - (char *)hmodWinEventProc); pEH->ihmod = (INT)hmodWinEventProc; pEH->Proc = lpfnWinEventProc; } else pEH->Proc = lpfnWinEventProc; - - pEH->Flags &= ~WINEVENT_INIT;
UserDereferenceObject(pEH);