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

ddemlsvr.h File Reference

Go to the source code of this file.

Defines

#define MF_INTERNAL   0x80000000L

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 xxxProcessDDEMLEvent (PSVR_INSTANCE_INFO psii, PEVENT_PACKET pep)
VOID xxxMessageEvent (PWND pwndTo, UINT message, WPARAM wParam, LPARAM lParam, DWORD flag, PDDEML_MSG_HOOK_DATA pdmhd)
DWORD xxxCsDdeInitialize (PHANDLE phInst, HWND *phwndEvent, LPDWORD pMonitorFlags, DWORD afCmd, PVOID pcii)
DWORD _CsUpdateInstance (HANDLE hInst, LPDWORD pMonitorFlags, DWORD afCmd)
BOOL _CsDdeUninitialize (HANDLE hInst)
VOID xxxDestroyThreadDDEObject (PTHREADINFO pti, PSVR_INSTANCE_INFO psii)
PVOID _CsValidateInstance (HANDLE hInst)
DWORD ClientEventCallback (PVOID pcii, PEVENT_PACKET pep)
DWORD ClientGetDDEHookData (UINT message, LPARAM lParam, PDDEML_MSG_HOOK_DATA pdmhd)

Variables

PSVR_INSTANCE_INFO psiiList
DWORD MonitorFlags


Define Documentation

#define MF_INTERNAL   0x80000000L
 

Definition at line 14 of file ddemlsvr.h.


Function Documentation

BOOL _CsDdeUninitialize HANDLE  hInst  ) 
 

Definition at line 110 of file ddemlsvr.c.

References BOOL, CheckCritIn, hInst, HMValidateHandleNoRip(), NULL, PtiCurrent, TRUE, TYPE_DDEACCESS, and xxxDestroyThreadDDEObject().

00112 { 00113 PSVR_INSTANCE_INFO psii; 00114 00115 CheckCritIn(); 00116 00117 psii = HMValidateHandleNoRip(hInst, TYPE_DDEACCESS); 00118 if (psii == NULL) { 00119 return TRUE; 00120 } 00121 00122 xxxDestroyThreadDDEObject(PtiCurrent(), psii); 00123 return TRUE; 00124 }

DWORD _CsUpdateInstance HANDLE  hInst,
LPDWORD  pMonitorFlags,
DWORD  afCmd
 

Definition at line 88 of file ddemlsvr.c.

References CheckCritIn, DWORD, hInst, HMValidateHandleNoRip(), MonitorFlags, NULL, TYPE_DDEACCESS, and xxxChangeMonitorFlags().

Referenced by NtUserUpdateInstance().

00092 { 00093 PSVR_INSTANCE_INFO psii; 00094 00095 CheckCritIn(); 00096 00097 psii = (PSVR_INSTANCE_INFO)HMValidateHandleNoRip(hInst, TYPE_DDEACCESS); 00098 if (psii == NULL) { 00099 return DMLERR_INVALIDPARAMETER; 00100 } 00101 xxxChangeMonitorFlags(psii, afCmd); 00102 *pMonitorFlags = MonitorFlags; 00103 return DMLERR_NO_ERROR; 00104 }

PVOID _CsValidateInstance HANDLE  hInst  ) 
 

DWORD ClientEventCallback PVOID  pcii,
PEVENT_PACKET  pep
 

Referenced by xxxEventWndProc().

DWORD ClientGetDDEHookData UINT  message,
LPARAM  lParam,
PDDEML_MSG_HOOK_DATA  pdmhd
 

Referenced by xxxDDETrackPostHook().

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 xxxCsDdeInitialize PHANDLE  phInst,
HWND *  phwndEvent,
LPDWORD  pMonitorFlags,
DWORD  afCmd,
PVOID  pcii
 

Definition at line 19 of file ddemlsvr.c.

References tagSERVERINFO::atomSysClass, CheckCritIn, CW_FLAGS_DIFFHMOD, DWORD, FALSE, gpsi, GWLP_PSII, HMAllocObject(), HMFreeObject(), hModuleWin, ICLS_DDEMLEVENT, Lock, MonitorFlags, tagSVR_INSTANCE_INFO::nextInThisThread, NULL, tagTHREADINFO::psiiList, psiiList, PtiCurrent, PtoH, tagSVR_INSTANCE_INFO::spwndEvent, SVR_INSTANCE_INFO, TYPE_DDEACCESS, VER31, xxxChangeMonitorFlags(), xxxCreateWindowEx(), and xxxSetWindowLongPtr.

Referenced by NtUserDdeInitialize().

00025 { 00026 PSVR_INSTANCE_INFO psii; 00027 PTHREADINFO ptiCurrent = PtiCurrent(); 00028 00029 CheckCritIn(); 00030 00031 psii = (PSVR_INSTANCE_INFO)HMAllocObject(PtiCurrent(), NULL, 00032 TYPE_DDEACCESS, sizeof(SVR_INSTANCE_INFO)); 00033 if (psii == NULL) { 00034 return DMLERR_SYS_ERROR; 00035 } 00036 00037 /* 00038 * We have to tell CreateWindow that window is not created for the same 00039 * module has the app, (CW_FLAGS_DIFFHMOD), so CreateWindow doesn't 00040 * assign a hotkey to this window. Other window are done in the 00041 * client-server thunk 00042 */ 00043 Lock(&(psii->spwndEvent), xxxCreateWindowEx( 00044 0, 00045 (PLARGE_STRING)gpsi->atomSysClass[ICLS_DDEMLEVENT], 00046 NULL, 00047 WS_POPUP | WS_CHILD, 00048 0, 0, 0, 0, 00049 (PWND)NULL, 00050 (PMENU)NULL, 00051 hModuleWin, 00052 NULL, 00053 CW_FLAGS_DIFFHMOD | VER31)); 00054 00055 if (psii->spwndEvent == NULL) { 00056 HMFreeObject((PVOID)psii); 00057 return DMLERR_SYS_ERROR; 00058 } 00059 /* 00060 * This GWL offset does NOT leave the critical section! 00061 */ 00062 xxxSetWindowLongPtr(psii->spwndEvent, GWLP_PSII, (LONG_PTR)PtoH(psii), FALSE); 00063 psii->afCmd = 0; 00064 psii->pcii = pcii; 00065 // 00066 // Link into global list 00067 // 00068 psii->next = psiiList; 00069 psiiList = psii; 00070 00071 // 00072 // Link into per-process list 00073 // 00074 psii->nextInThisThread = ptiCurrent->psiiList; 00075 ptiCurrent->psiiList = psii; 00076 00077 *phInst = PtoH(psii); 00078 *phwndEvent = PtoH(psii->spwndEvent); 00079 xxxChangeMonitorFlags(psii, afCmd); // sets psii->afCmd; 00080 *pMonitorFlags = MonitorFlags; 00081 return DMLERR_NO_ERROR; 00082 }

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 }

VOID xxxDestroyThreadDDEObject PTHREADINFO  pti,
PSVR_INSTANCE_INFO  psii
 

Definition at line 127 of file ddemlsvr.c.

References CheckCritIn, HMFreeObject(), HMIsMarkDestroy, HMMarkObjectDestroy(), tagSVR_INSTANCE_INFO::next, tagSVR_INSTANCE_INFO::nextInThisThread, NULL, tagTHREADINFO::psiiList, psiiList, tagSVR_INSTANCE_INFO::spwndEvent, Unlock, VOID(), and xxxDestroyWindow().

Referenced by _CsDdeUninitialize(), NtUserDdeInitialize(), and xxxDestroyThreadInfo().

00130 { 00131 PSVR_INSTANCE_INFO psiiT; 00132 00133 CheckCritIn(); 00134 00135 if (HMIsMarkDestroy(psii)) { 00136 return; 00137 } 00138 00139 // 00140 // Unlink psii from the global list. 00141 // 00142 if (psii == psiiList) { 00143 psiiList = psii->next; 00144 } else { 00145 for (psiiT = psiiList; psiiT->next != psii; psiiT = psiiT->next) { 00146 UserAssert(psiiT->next != NULL); 00147 } 00148 psiiT->next = psii->next; 00149 } 00150 // psii->next = NULL; 00151 00152 // 00153 // Unlink psii from the per-process list. 00154 // 00155 if (psii == pti->psiiList) { 00156 pti->psiiList = psii->nextInThisThread; 00157 } else { 00158 for (psiiT = pti->psiiList; psiiT->nextInThisThread != psii; psiiT = psiiT->nextInThisThread) { 00159 UserAssert(psiiT->nextInThisThread != NULL); 00160 } 00161 psiiT->nextInThisThread = psii->nextInThisThread; 00162 } 00163 // psii->nextInThisThread = NULL; 00164 00165 if (HMMarkObjectDestroy(psii)) { 00166 xxxDestroyWindow(psii->spwndEvent); 00167 Unlock(&(psii->spwndEvent)); 00168 00169 HMFreeObject(psii); 00170 } 00171 }

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 }

VOID xxxProcessDDEMLEvent PSVR_INSTANCE_INFO  psii,
PEVENT_PACKET  pep
 


Variable Documentation

DWORD MonitorFlags
 

Definition at line 19 of file ddemlsvr.h.

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

PSVR_INSTANCE_INFO psiiList
 

Definition at line 18 of file ddemlsvr.h.

Referenced by xxxCsDdeInitialize(), xxxCsEvent(), and xxxDestroyThreadDDEObject().


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