Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

event.c File Reference

#include "precomp.h"

Go to the source code of this file.

Classes

struct  tagMONITOR_COUNT

Defines

#define C_MONITOR_COUNT   10
#define MONITORED_FLAGS
#define pep   ((PEVENT_PACKET)lParam)
#define pmsgs   ((MONMSGSTRUCT *)&pep->Data)

Typedefs

typedef tagMONITOR_COUNT MONITOR_COUNT
typedef tagMONITOR_COUNTPMONITOR_COUNT

Functions

VOID xxxChangeMonitorFlags (PSVR_INSTANCE_INFO psii, DWORD afCmdNew)
DWORD xxxCsEvent (PEVENT_PACKET pep, WORD cbEventData)
LRESULT xxxEventWndProc (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
VOID xxxMessageEvent (PWND pwndTo, UINT message, WPARAM wParam, LPARAM lParam, DWORD flag, PDDEML_MSG_HOOK_DATA pdmhd)

Variables

DWORD MonitorFlags = 0
MONITOR_COUNT aMonitorCount [C_MONITOR_COUNT]


Define Documentation

#define C_MONITOR_COUNT   10
 

Definition at line 26 of file w32/ntuser/kernel/event.c.

Referenced by xxxChangeMonitorFlags().

#define MONITORED_FLAGS
 

Value:

MF_HSZ_INFO | \ MF_SENDMSGS | \ MF_POSTMSGS | \ MF_CALLBACKS | \ MF_ERRORS | \ MF_LINKS | \ MF_CONV | \ CBF_SKIP_REGISTRATIONS | \ CBF_SKIP_UNREGISTRATIONS | \ MF_INTERNAL

Definition at line 41 of file w32/ntuser/kernel/event.c.

Referenced by xxxChangeMonitorFlags().

#define pep   ((PEVENT_PACKET)lParam)
 

Referenced by _ClientEventCallback(), CheckAllowForeground(), DoCallback(), dwrWorker(), Event(), MonitorConv(), MonitorLink(), MonitorStringHandle(), NtUserEvent(), SetLastDDEMLError(), xxxAllowSetForegroundWindow(), xxxCsEvent(), xxxEventWndProc(), and xxxMessageEvent().

#define pmsgs   ((MONMSGSTRUCT *)&pep->Data)
 

Referenced by xxxMessageEvent().


Typedef Documentation

typedef struct tagMONITOR_COUNT MONITOR_COUNT
 

typedef struct tagMONITOR_COUNT * PMONITOR_COUNT
 


Function Documentation

VOID xxxChangeMonitorFlags PSVR_INSTANCE_INFO  psii,
DWORD  afCmdNew
 

Definition at line 64 of file w32/ntuser/kernel/event.c.

References tagSVR_INSTANCE_INFO::afCmd, aMonitorCount, C_MONITOR_COUNT, tagEVENT_PACKET::cbEventData, CheckCritIn, tagEVENT_PACKET::Data, DWORD, tagEVENT_PACKET::EventType, FALSE, tagMONITOR_COUNT::flag, tagEVENT_PACKET::fSense, tagMONITOR_COUNT::iCount, MONITORED_FLAGS, MonitorFlags, VOID(), and xxxCsEvent().

Referenced by _CsUpdateInstance(), xxxCsDdeInitialize(), and xxxEventWndProc().

00067 { 00068 int i; 00069 DWORD dwChangedFlags; 00070 DWORD OldMonitorFlags; 00071 00072 CheckCritIn(); 00073 00074 dwChangedFlags = psii->afCmd ^ afCmdNew; 00075 if (!(dwChangedFlags & MONITORED_FLAGS)) { 00076 return; 00077 } 00078 psii->afCmd = afCmdNew; 00079 00080 OldMonitorFlags = MonitorFlags; 00081 MonitorFlags = 0; 00082 for (i = 0; i < C_MONITOR_COUNT; i++) { 00083 if (dwChangedFlags & aMonitorCount[i].flag) { 00084 if (aMonitorCount[i].flag & afCmdNew) { 00085 aMonitorCount[i].iCount++; 00086 } else { 00087 aMonitorCount[i].iCount--; 00088 } 00089 } 00090 if (aMonitorCount[i].iCount) { 00091 MonitorFlags |= aMonitorCount[i].flag; 00092 } 00093 } 00094 if (OldMonitorFlags != MonitorFlags) { 00095 EVENT_PACKET ep; 00096 00097 ep.EventType = 0; 00098 ep.fSense = FALSE; 00099 ep.cbEventData = sizeof(DWORD); 00100 ep.Data = MonitorFlags; 00101 xxxCsEvent(&ep, sizeof(DWORD)); 00102 } 00103 }

DWORD xxxCsEvent PEVENT_PACKET  pep,
WORD  cbEventData
 

Definition at line 120 of file w32/ntuser/kernel/event.c.

References tagSVR_INSTANCE_INFO::afCmd, tagEVENT_PACKET::cbEventData, CheckCritIn, DWORD, tagEVENT_PACKET::EventType, FALSE, tagEVENT_PACKET::fSense, tagSVR_INSTANCE_INFO::next, NULL, pep, psiiList, PtiCurrent, PtoH, tagSVR_INSTANCE_INFO::spwndEvent, ThreadLockAlwaysWithPti, ThreadLockPool, ThreadUnlock, ThreadUnlockAndFreePool, ValidateHwnd, and xxxSendMessage().

Referenced by NtUserEvent(), xxxChangeMonitorFlags(), and xxxMessageEvent().

00122 { 00123 PSVR_INSTANCE_INFO psiiT; 00124 PEVENT_PACKET pep2; 00125 HWND *ahwndEvent = NULL; 00126 PWND pwnd; 00127 int cHwndAllocated, i, cTargets; 00128 TL tlpwnd; 00129 TL tlpep2; 00130 TL tlahwndEvent; 00131 ULONG cbEventPacket; 00132 PTHREADINFO pti = PtiCurrent(); 00133 00134 CheckCritIn(); 00135 00136 /* 00137 * Copy pep info to a server side stable area 00138 */ 00139 cbEventPacket = cbEventData + sizeof(EVENT_PACKET) - sizeof(DWORD); 00140 pep2 = (PEVENT_PACKET)UserAllocPoolWithQuota(cbEventPacket, TAG_DDE5); 00141 if (pep2 == NULL) { 00142 return DMLERR_MEMORY_ERROR; 00143 } 00144 try { 00145 RtlCopyMemory((LPSTR)pep2, (LPSTR)pep, cbEventPacket); 00146 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00147 UserFreePool(pep2); 00148 return DMLERR_INVALIDPARAMETER; 00149 } 00150 00151 pep2->cbEventData = cbEventData; 00152 cTargets = 0; 00153 cHwndAllocated = 0; 00154 00155 for (psiiT = psiiList; psiiT != NULL; psiiT = psiiT->next) { 00156 // 00157 // Don't bother with event windows for instances who's flags 00158 // indicate they're not interrested in the event. 00159 // 00160 if (((psiiT->afCmd & pep2->EventType) && !pep2->fSense) || 00161 (!(psiiT->afCmd & pep2->EventType) && pep2->fSense)) { 00162 continue; 00163 } 00164 00165 if (cTargets >= cHwndAllocated) { 00166 if (ahwndEvent == NULL) { 00167 cHwndAllocated = 8; 00168 ahwndEvent = (HWND *)UserAllocPoolWithQuota( 00169 sizeof(HWND) * cHwndAllocated, 00170 TAG_DDE6); 00171 } else { 00172 DWORD dwSize = cHwndAllocated * sizeof(HWND); 00173 HWND *ahwndEventT = ahwndEvent; 00174 00175 cHwndAllocated += 8; 00176 ahwndEvent = (HWND *)UserReAllocPoolWithQuota(ahwndEvent, dwSize, 00177 sizeof(HWND) * cHwndAllocated, TAG_DDE7); 00178 if (ahwndEvent == NULL) { 00179 UserFreePool(ahwndEventT); 00180 } 00181 } 00182 if (ahwndEvent == NULL) { 00183 UserFreePool(pep2); 00184 return DMLERR_MEMORY_ERROR; 00185 } 00186 } 00187 ahwndEvent[cTargets++] = PtoH(psiiT->spwndEvent); 00188 } 00189 00190 ThreadLockPool(pti, pep2, &tlpep2); 00191 if (ahwndEvent != NULL) { 00192 ThreadLockPool(pti, ahwndEvent, &tlahwndEvent); 00193 for (i = 0; i < cTargets; i++) { 00194 /* 00195 * We need to change contexts for the callback 00196 */ 00197 pwnd = ValidateHwnd(ahwndEvent[i]); 00198 if (pwnd != NULL) { 00199 ThreadLockAlwaysWithPti(pti, pwnd, &tlpwnd); 00200 xxxSendMessage(pwnd, WM_DDEMLEVENT, 0, (LPARAM)pep2); 00201 ThreadUnlock(&tlpwnd); 00202 } 00203 } 00204 ThreadUnlockAndFreePool(pti, &tlahwndEvent); 00205 } 00206 ThreadUnlockAndFreePool(pti, &tlpep2); 00207 00208 return DMLERR_NO_ERROR; 00209 }

LRESULT xxxEventWndProc PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 224 of file w32/ntuser/kernel/event.c.

References _GetWindowLongPtr, tagSVR_INSTANCE_INFO::afCmd, CheckCritIn, CheckLock, ClientEventCallback(), GWLP_PSII, HMValidateHandleNoRip(), NULL, tagSVR_INSTANCE_INFO::pcii, pep, TYPE_DDEACCESS, xxxChangeMonitorFlags(), and xxxDefWindowProc().

Referenced by LW_RegisterWindows().

00229 { 00230 PSVR_INSTANCE_INFO psii; 00231 00232 CheckCritIn(); 00233 CheckLock(pwnd); 00234 00235 psii = HMValidateHandleNoRip((HANDLE)_GetWindowLongPtr(pwnd, GWLP_PSII), 00236 TYPE_DDEACCESS); 00237 if (psii == NULL) { 00238 goto CallDWP; 00239 } 00240 00241 switch (message) { 00242 case WM_DDEMLEVENT: 00243 #define pep ((PEVENT_PACKET)lParam) 00244 if (((psii->afCmd & pep->EventType) && pep->fSense) || 00245 (!(psii->afCmd & pep->EventType) && !pep->fSense)) { 00246 ClientEventCallback(psii->pcii, pep); 00247 } 00248 #undef pep 00249 break; 00250 00251 case WM_DESTROY: 00252 xxxChangeMonitorFlags(psii, 0); 00253 break; 00254 00255 default: 00256 CallDWP: 00257 return xxxDefWindowProc(pwnd, message, wParam, lParam); 00258 } 00259 return 0; 00260 }

VOID xxxMessageEvent PWND  pwndTo,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
DWORD  flag,
PDDEML_MSG_HOOK_DATA  pdmhd
 

Definition at line 275 of file w32/ntuser/kernel/event.c.

References CheckCritIn, DWORD, GETPTI, NtGetTickCount(), NULL, pep, pmsgs, PtiCurrent, PtoH, RevalidateHwnd, ThreadLockPool, ThreadUnlockAndFreePool, TRUE, VOID(), and xxxCsEvent().

Referenced by xxxDDETrackPostHook(), and xxxDDETrackSendHook().

00282 { 00283 PEVENT_PACKET pep; 00284 PWND pwndFrom; 00285 TL tlpep; 00286 PTHREADINFO pti; 00287 00288 CheckCritIn(); 00289 00290 pep = (PEVENT_PACKET)UserAllocPoolWithQuota(sizeof(EVENT_PACKET) - 00291 sizeof(DWORD) + sizeof(MONMSGSTRUCT), TAG_DDE8); 00292 if (pep == NULL) { 00293 return; 00294 } 00295 pep->EventType = flag; 00296 pep->fSense = TRUE; 00297 pep->cbEventData = sizeof(MONMSGSTRUCT); 00298 #define pmsgs ((MONMSGSTRUCT *)&pep->Data) 00299 pmsgs->cb = sizeof(MONMSGSTRUCT); 00300 pmsgs->hwndTo = PtoH(pwndTo); 00301 pmsgs->dwTime = NtGetTickCount(); 00302 00303 pwndFrom = RevalidateHwnd((HWND)wParam); 00304 if (pwndFrom != NULL) { 00305 pmsgs->hTask = GETPTI(pwndFrom)->pEThread->Cid.UniqueThread; 00306 } else { 00307 pmsgs->hTask = 0; 00308 } 00309 00310 pmsgs->wMsg = message; 00311 pmsgs->wParam = wParam; 00312 pmsgs->lParam = lParam; 00313 if (pdmhd != NULL) { 00314 pmsgs->dmhd = *pdmhd; 00315 } 00316 #undef pmsgs 00317 pti = PtiCurrent(); 00318 ThreadLockPool(pti, pep, &tlpep); 00319 xxxCsEvent(pep, sizeof(MONMSGSTRUCT)); 00320 ThreadUnlockAndFreePool(pti, &tlpep); 00321 }


Variable Documentation

MONITOR_COUNT aMonitorCount[C_MONITOR_COUNT]
 

Initial value:

{ { 0, MF_HSZ_INFO }, { 0, MF_SENDMSGS }, { 0, MF_POSTMSGS }, { 0, MF_CALLBACKS }, { 0, MF_ERRORS }, { 0, MF_LINKS }, { 0, MF_CONV }, { 0, CBF_SKIP_REGISTRATIONS }, { 0, CBF_SKIP_UNREGISTRATIONS }, { 0, MF_INTERNAL }, }

Definition at line 28 of file w32/ntuser/kernel/event.c.

Referenced by xxxChangeMonitorFlags().

DWORD MonitorFlags = 0
 

Definition at line 19 of file w32/ntuser/kernel/event.c.

Referenced by _CsUpdateInstance(), xxxChangeMonitorFlags(), xxxCsDdeInitialize(), xxxDDETrackPostHook(), and xxxDDETrackSendHook().


Generated on Sat May 15 19:43:33 2004 for test by doxygen 1.3.7