1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 //*****************************************************************************
5 // File: ShimCallback.cpp
9 // The V3 ICD debugging APIs have a lower abstraction level than V2.
10 // This provides V2 ICD debugging functionality on top of the V3 debugger object.
11 //*****************************************************************************
23 // Callback that shim provides, which then queues up the events.
25 ShimProxyCallback::ShimProxyCallback(ShimProcess * pShim)
32 ULONG ShimProxyCallback::AddRef()
34 InterlockedIncrement(&m_cRef);
37 ULONG ShimProxyCallback::Release()
39 LONG ref = InterlockedDecrement(&m_cRef);
48 HRESULT ShimProxyCallback::QueryInterface(REFIID riid, void **ppInterface)
50 if (riid == IID_ICorDebugManagedCallback)
52 *ppInterface = static_cast<ICorDebugManagedCallback*>(this);
54 else if (riid == IID_ICorDebugManagedCallback2)
56 *ppInterface = static_cast<ICorDebugManagedCallback2*>(this);
58 else if (riid == IID_ICorDebugManagedCallback3)
60 *ppInterface = static_cast<ICorDebugManagedCallback3*>(this);
62 else if (riid == IID_IUnknown)
64 *ppInterface = static_cast<IUnknown*>(static_cast<ICorDebugManagedCallback*>(this));
77 // Map from an old frame to a new one.
80 // pThread - thread that frame is on
81 // pOldFrame - old frame before the continue, may have gotten neutered.
84 // a new, non-neutered frame that matches the old frame.
87 // Called by event handlers below (which are considered Outside the RS).
88 // No adjust of reference, Thread already has reference.
89 // @dbgtodo shim-stackwalks: this is used for exception callbacks, which may change for V3.
90 ICorDebugFrame * UpdateFrame(ICorDebugThread * pThread, ICorDebugFrame * pOldFrame)
92 PUBLIC_API_ENTRY_FOR_SHIM(NULL);
94 RSExtSmartPtr<ICorDebugFrame> pNewFrame;
98 CordbFrame * pFrame = static_cast<CordbFrame *> (pOldFrame);
101 FramePointer fp = pFrame->GetFramePointer();
103 CordbThread * pThread2 = static_cast<CordbThread *> (pThread);
104 pThread2->FindFrame(&pNewFrame, fp);
111 // Do not throw out of this function. Doing so means that the debugger never gets a chance to
112 // continue the debuggee process. This will lead to a hang. Instead, try to make a best effort to
113 // continue with a NULL ICDFrame. VS is able to handle this gracefully.
114 pNewFrame.Assign(NULL);
116 EX_END_CATCH(SwallowAllExceptions);
124 // Below this was autogenerated
127 // Implementation of ICorDebugManagedCallback::Breakpoint
128 HRESULT ShimProxyCallback::Breakpoint(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugBreakpoint * pBreakpoint)
130 m_pShim->PreDispatchEvent();
131 class BreakpointEvent : public ManagedEvent
133 // callbacks parameters. These are strong references
134 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
135 RSExtSmartPtr<ICorDebugThread > m_pThread;
136 RSExtSmartPtr<ICorDebugBreakpoint > m_pBreakpoint;
140 BreakpointEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugBreakpoint * pBreakpoint) :
141 ManagedEvent(pThread)
143 this->m_pAppDomain.Assign(pAppDomain);
144 this->m_pThread.Assign(pThread);
145 this->m_pBreakpoint.Assign(pBreakpoint);
148 HRESULT Dispatch(DispatchArgs args)
150 return args.GetCallback1()->Breakpoint(m_pAppDomain, m_pThread, m_pBreakpoint);
152 }; // end class BreakpointEvent
154 m_pShim->GetManagedEventQueue()->QueueEvent(new BreakpointEvent(pAppDomain, pThread, pBreakpoint));
156 } // end of methodICorDebugManagedCallback::Breakpoint
159 // Implementation of ICorDebugManagedCallback::StepComplete
160 HRESULT ShimProxyCallback::StepComplete(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugStepper * pStepper, CorDebugStepReason reason)
162 m_pShim->PreDispatchEvent();
163 class StepCompleteEvent : public ManagedEvent
165 // callbacks parameters. These are strong references
166 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
167 RSExtSmartPtr<ICorDebugThread > m_pThread;
168 RSExtSmartPtr<ICorDebugStepper > m_pStepper;
169 CorDebugStepReason m_reason;
173 StepCompleteEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugStepper * pStepper, CorDebugStepReason reason) :
174 ManagedEvent(pThread)
176 this->m_pAppDomain.Assign(pAppDomain);
177 this->m_pThread.Assign(pThread);
178 this->m_pStepper.Assign(pStepper);
179 this->m_reason = reason;
182 HRESULT Dispatch(DispatchArgs args)
184 return args.GetCallback1()->StepComplete(m_pAppDomain, m_pThread, m_pStepper, m_reason);
186 }; // end class StepCompleteEvent
188 m_pShim->GetManagedEventQueue()->QueueEvent(new StepCompleteEvent(pAppDomain, pThread, pStepper, reason));
190 } // end of methodICorDebugManagedCallback::StepComplete
193 // Implementation of ICorDebugManagedCallback::Break
194 HRESULT ShimProxyCallback::Break(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread)
196 m_pShim->PreDispatchEvent();
197 class BreakEvent : public ManagedEvent
199 // callbacks parameters. These are strong references
200 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
201 RSExtSmartPtr<ICorDebugThread > m_pThread;
205 BreakEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread) :
206 ManagedEvent(pThread)
208 this->m_pAppDomain.Assign(pAppDomain);
209 this->m_pThread.Assign(pThread);
212 HRESULT Dispatch(DispatchArgs args)
214 return args.GetCallback1()->Break(m_pAppDomain, m_pThread);
216 }; // end class BreakEvent
218 m_pShim->GetManagedEventQueue()->QueueEvent(new BreakEvent(pAppDomain, pThread));
220 } // end of methodICorDebugManagedCallback::Break
223 // Implementation of ICorDebugManagedCallback::Exception
224 HRESULT ShimProxyCallback::Exception(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, BOOL fUnhandled)
226 m_pShim->PreDispatchEvent();
227 class ExceptionEvent : public ManagedEvent
229 // callbacks parameters. These are strong references
230 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
231 RSExtSmartPtr<ICorDebugThread > m_pThread;
236 ExceptionEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, BOOL fUnhandled) :
237 ManagedEvent(pThread)
239 this->m_pAppDomain.Assign(pAppDomain);
240 this->m_pThread.Assign(pThread);
241 this->m_fUnhandled = fUnhandled;
244 HRESULT Dispatch(DispatchArgs args)
246 return args.GetCallback1()->Exception(m_pAppDomain, m_pThread, m_fUnhandled);
248 }; // end class ExceptionEvent
250 m_pShim->GetManagedEventQueue()->QueueEvent(new ExceptionEvent(pAppDomain, pThread, fUnhandled));
252 } // end of methodICorDebugManagedCallback::Exception
255 // Implementation of ICorDebugManagedCallback::EvalComplete
256 HRESULT ShimProxyCallback::EvalComplete(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugEval * pEval)
258 m_pShim->PreDispatchEvent();
259 class EvalCompleteEvent : public ManagedEvent
261 // callbacks parameters. These are strong references
262 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
263 RSExtSmartPtr<ICorDebugThread > m_pThread;
264 RSExtSmartPtr<ICorDebugEval > m_pEval;
268 EvalCompleteEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugEval * pEval) :
269 ManagedEvent(pThread)
271 this->m_pAppDomain.Assign(pAppDomain);
272 this->m_pThread.Assign(pThread);
273 this->m_pEval.Assign(pEval);
276 HRESULT Dispatch(DispatchArgs args)
278 return args.GetCallback1()->EvalComplete(m_pAppDomain, m_pThread, m_pEval);
280 }; // end class EvalCompleteEvent
282 m_pShim->GetManagedEventQueue()->QueueEvent(new EvalCompleteEvent(pAppDomain, pThread, pEval));
284 } // end of methodICorDebugManagedCallback::EvalComplete
287 // Implementation of ICorDebugManagedCallback::EvalException
288 HRESULT ShimProxyCallback::EvalException(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugEval * pEval)
290 m_pShim->PreDispatchEvent();
291 class EvalExceptionEvent : public ManagedEvent
293 // callbacks parameters. These are strong references
294 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
295 RSExtSmartPtr<ICorDebugThread > m_pThread;
296 RSExtSmartPtr<ICorDebugEval > m_pEval;
300 EvalExceptionEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugEval * pEval) :
301 ManagedEvent(pThread)
303 this->m_pAppDomain.Assign(pAppDomain);
304 this->m_pThread.Assign(pThread);
305 this->m_pEval.Assign(pEval);
308 HRESULT Dispatch(DispatchArgs args)
310 return args.GetCallback1()->EvalException(m_pAppDomain, m_pThread, m_pEval);
312 }; // end class EvalExceptionEvent
314 m_pShim->GetManagedEventQueue()->QueueEvent(new EvalExceptionEvent(pAppDomain, pThread, pEval));
316 } // end of methodICorDebugManagedCallback::EvalException
319 // Implementation of ICorDebugManagedCallback::CreateProcess
320 // This will only be called for a Real create-process event.
321 HRESULT ShimProxyCallback::CreateProcess(ICorDebugProcess * pProcess)
323 m_pShim->PreDispatchEvent(true);
324 QueueCreateProcess(pProcess);
328 void ShimProxyCallback::QueueCreateProcess(ICorDebugProcess * pProcess)
330 class CreateProcessEvent : public ManagedEvent
332 // callbacks parameters. These are strong references
333 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
337 CreateProcessEvent(ICorDebugProcess * pProcess, ShimProcess * pShim) :
341 this->m_pProcess.Assign(pProcess);
344 HRESULT Dispatch(DispatchArgs args)
346 // signal that we are in the callback--this will be cleared in code:CordbProcess::ContinueInternal
347 m_pShim->SetInCreateProcess(true);
348 return args.GetCallback1()->CreateProcess(m_pProcess);
351 // we need access to the shim in Dispatch so we can set the InCreateProcess flag to keep track of
352 // when we are actually in the callback. We need this information to be able to emulate
353 // the hresult logic in v2.0.
354 ShimProcess * m_pShim;
355 }; // end class CreateProcessEvent
357 if (!m_pShim->RemoveDuplicateCreationEventIfPresent(pProcess))
359 m_pShim->GetManagedEventQueue()->QueueEvent(new CreateProcessEvent(pProcess, m_pShim));
361 } // end of methodICorDebugManagedCallback::CreateProcess
364 // Implementation of ICorDebugManagedCallback::ExitProcess
365 HRESULT ShimProxyCallback::ExitProcess(ICorDebugProcess * pProcess)
367 m_pShim->PreDispatchEvent();
368 class ExitProcessEvent : public ManagedEvent
370 // callbacks parameters. These are strong references
371 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
375 ExitProcessEvent(ICorDebugProcess * pProcess) :
378 this->m_pProcess.Assign(pProcess);
381 HRESULT Dispatch(DispatchArgs args)
383 return args.GetCallback1()->ExitProcess(m_pProcess);
385 }; // end class ExitProcessEvent
387 m_pShim->RemoveDuplicateCreationEventIfPresent(pProcess);
388 m_pShim->GetManagedEventQueue()->QueueEvent(new ExitProcessEvent(pProcess));
390 } // end of methodICorDebugManagedCallback::ExitProcess
393 // Implementation of ICorDebugManagedCallback::CreateThread
394 HRESULT ShimProxyCallback::CreateThread(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread)
396 m_pShim->PreDispatchEvent();
397 class CreateThreadEvent : public ManagedEvent
399 // callbacks parameters. These are strong references
400 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
401 RSExtSmartPtr<ICorDebugThread > m_pThread;
405 CreateThreadEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread) :
406 ManagedEvent(pThread)
408 this->m_pAppDomain.Assign(pAppDomain);
409 this->m_pThread.Assign(pThread);
412 HRESULT Dispatch(DispatchArgs args)
414 return args.GetCallback1()->CreateThread(m_pAppDomain, m_pThread);
416 }; // end class CreateThreadEvent
418 if (!m_pShim->RemoveDuplicateCreationEventIfPresent(pThread))
420 m_pShim->GetManagedEventQueue()->QueueEvent(new CreateThreadEvent(pAppDomain, pThread));
423 } // end of methodICorDebugManagedCallback::CreateThread
426 // Implementation of ICorDebugManagedCallback::ExitThread
427 HRESULT ShimProxyCallback::ExitThread(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread)
429 m_pShim->PreDispatchEvent();
430 class ExitThreadEvent : public ManagedEvent
432 // callbacks parameters. These are strong references
433 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
434 RSExtSmartPtr<ICorDebugThread > m_pThread;
438 ExitThreadEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread) :
439 ManagedEvent(pThread)
441 this->m_pAppDomain.Assign(pAppDomain);
442 this->m_pThread.Assign(pThread);
445 HRESULT Dispatch(DispatchArgs args)
447 return args.GetCallback1()->ExitThread(m_pAppDomain, m_pThread);
449 }; // end class ExitThreadEvent
451 m_pShim->RemoveDuplicateCreationEventIfPresent(pThread);
452 m_pShim->GetManagedEventQueue()->QueueEvent(new ExitThreadEvent(pAppDomain, pThread));
454 } // end of methodICorDebugManagedCallback::ExitThread
457 // Called from fake attach events.
460 // pAppDomain - appdomain for the LoadModule debug event
461 // pModule - module being loaded.
464 // See code:ShimProcess::QueueFakeAttachEvents
465 // This is the fake version of code:ShimProxyCallback::LoadModule.
466 // It sends an IPC event to go in process to collect information that we can't yet get via
467 // DAC from out-of-proc.
468 void ShimProxyCallback::FakeLoadModule(ICorDebugAppDomain *pAppDomain, ICorDebugModule *pModule)
470 class FakeLoadModuleEvent : public ManagedEvent
472 // callbacks parameters. These are strong references
473 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
474 RSExtSmartPtr<ICorDebugModule > m_pModule;
478 FakeLoadModuleEvent(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule, ShimProcess * pShim) :
482 this->m_pAppDomain.Assign(pAppDomain);
483 this->m_pModule.Assign(pModule);
486 HRESULT Dispatch(DispatchArgs args)
488 // signal that we are in the callback--this will be cleared in code:CordbProcess::ContinueInternal
489 m_pShim->SetInLoadModule(true);
490 return args.GetCallback1()->LoadModule(m_pAppDomain, m_pModule);
493 // we need access to the shim in Dispatch so we can set the InLoadModule flag to keep track
494 // when we are actually in the callback. We need this information to be able to emulate
495 // the hresult logic in v2.0.
496 ShimProcess * m_pShim;
497 }; // end class LoadModuleEvent
499 m_pShim->GetManagedEventQueue()->QueueEvent(new FakeLoadModuleEvent(pAppDomain, pModule, m_pShim));
500 } // end of methodICorDebugManagedCallback::LoadModule
503 // Implementation of ICorDebugManagedCallback::LoadModule
504 HRESULT ShimProxyCallback::LoadModule(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule)
506 m_pShim->PreDispatchEvent();
507 class LoadModuleEvent : public ManagedEvent
509 // callbacks parameters. These are strong references
510 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
511 RSExtSmartPtr<ICorDebugModule > m_pModule;
515 LoadModuleEvent(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule) :
518 this->m_pAppDomain.Assign(pAppDomain);
519 this->m_pModule.Assign(pModule);
522 HRESULT Dispatch(DispatchArgs args)
524 return args.GetCallback1()->LoadModule(m_pAppDomain, m_pModule);
526 }; // end class LoadModuleEvent
528 if (!m_pShim->RemoveDuplicateCreationEventIfPresent(pModule))
530 m_pShim->GetManagedEventQueue()->QueueEvent(new LoadModuleEvent(pAppDomain, pModule));
533 } // end of methodICorDebugManagedCallback::LoadModule
536 // Implementation of ICorDebugManagedCallback::UnloadModule
537 HRESULT ShimProxyCallback::UnloadModule(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule)
539 m_pShim->PreDispatchEvent();
540 class UnloadModuleEvent : public ManagedEvent
542 // callbacks parameters. These are strong references
543 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
544 RSExtSmartPtr<ICorDebugModule > m_pModule;
548 UnloadModuleEvent(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule) :
551 this->m_pAppDomain.Assign(pAppDomain);
552 this->m_pModule.Assign(pModule);
555 HRESULT Dispatch(DispatchArgs args)
557 return args.GetCallback1()->UnloadModule(m_pAppDomain, m_pModule);
559 }; // end class UnloadModuleEvent
561 m_pShim->RemoveDuplicateCreationEventIfPresent(pModule);
562 m_pShim->GetManagedEventQueue()->QueueEvent(new UnloadModuleEvent(pAppDomain, pModule));
564 } // end of methodICorDebugManagedCallback::UnloadModule
567 // Implementation of ICorDebugManagedCallback::LoadClass
568 HRESULT ShimProxyCallback::LoadClass(ICorDebugAppDomain * pAppDomain, ICorDebugClass * pClass)
570 m_pShim->PreDispatchEvent();
571 class LoadClassEvent : public ManagedEvent
573 // callbacks parameters. These are strong references
574 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
575 RSExtSmartPtr<ICorDebugClass > m_pClass;
579 LoadClassEvent(ICorDebugAppDomain * pAppDomain, ICorDebugClass * pClass) :
582 this->m_pAppDomain.Assign(pAppDomain);
583 this->m_pClass.Assign(pClass);
586 HRESULT Dispatch(DispatchArgs args)
588 return args.GetCallback1()->LoadClass(m_pAppDomain, m_pClass);
590 }; // end class LoadClassEvent
592 m_pShim->GetManagedEventQueue()->QueueEvent(new LoadClassEvent(pAppDomain, pClass));
594 } // end of methodICorDebugManagedCallback::LoadClass
597 // Implementation of ICorDebugManagedCallback::UnloadClass
598 HRESULT ShimProxyCallback::UnloadClass(ICorDebugAppDomain * pAppDomain, ICorDebugClass * pClass)
600 m_pShim->PreDispatchEvent();
601 class UnloadClassEvent : public ManagedEvent
603 // callbacks parameters. These are strong references
604 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
605 RSExtSmartPtr<ICorDebugClass > m_pClass;
609 UnloadClassEvent(ICorDebugAppDomain * pAppDomain, ICorDebugClass * pClass) :
612 this->m_pAppDomain.Assign(pAppDomain);
613 this->m_pClass.Assign(pClass);
616 HRESULT Dispatch(DispatchArgs args)
618 return args.GetCallback1()->UnloadClass(m_pAppDomain, m_pClass);
620 }; // end class UnloadClassEvent
622 m_pShim->GetManagedEventQueue()->QueueEvent(new UnloadClassEvent(pAppDomain, pClass));
624 } // end of methodICorDebugManagedCallback::UnloadClass
627 // Implementation of ICorDebugManagedCallback::DebuggerError
628 HRESULT ShimProxyCallback::DebuggerError(ICorDebugProcess * pProcess, HRESULT errorHR, DWORD errorCode)
630 m_pShim->PreDispatchEvent();
631 class DebuggerErrorEvent : public ManagedEvent
633 // callbacks parameters. These are strong references
634 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
640 DebuggerErrorEvent(ICorDebugProcess * pProcess, HRESULT errorHR, DWORD errorCode) :
643 this->m_pProcess.Assign(pProcess);
644 this->m_errorHR = errorHR;
645 this->m_errorCode = errorCode;
648 HRESULT Dispatch(DispatchArgs args)
650 return args.GetCallback1()->DebuggerError(m_pProcess, m_errorHR, m_errorCode);
652 }; // end class DebuggerErrorEvent
654 m_pShim->GetManagedEventQueue()->QueueEvent(new DebuggerErrorEvent(pProcess, errorHR, errorCode));
656 } // end of methodICorDebugManagedCallback::DebuggerError
659 // Implementation of ICorDebugManagedCallback::LogMessage
660 HRESULT ShimProxyCallback::LogMessage(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, __in LPWSTR pLogSwitchName, __in LPWSTR pMessage)
662 m_pShim->PreDispatchEvent();
663 class LogMessageEvent : public ManagedEvent
665 // callbacks parameters. These are strong references
666 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
667 RSExtSmartPtr<ICorDebugThread > m_pThread;
669 StringCopyHolder m_pLogSwitchName;
670 StringCopyHolder m_pMessage;
674 LogMessageEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, LPCWSTR pLogSwitchName, LPCWSTR pMessage) :
675 ManagedEvent(pThread)
677 this->m_pAppDomain.Assign(pAppDomain);
678 this->m_pThread.Assign(pThread);
679 this->m_lLevel = lLevel;
680 this->m_pLogSwitchName.AssignCopy(pLogSwitchName);
681 this->m_pMessage.AssignCopy(pMessage);
684 HRESULT Dispatch(DispatchArgs args)
686 return args.GetCallback1()->LogMessage(m_pAppDomain, m_pThread, m_lLevel, const_cast<WCHAR*>((const WCHAR*)m_pLogSwitchName), const_cast<WCHAR*>((const WCHAR*)m_pMessage));
688 }; // end class LogMessageEvent
690 m_pShim->GetManagedEventQueue()->QueueEvent(new LogMessageEvent(pAppDomain, pThread, lLevel, pLogSwitchName, pMessage));
692 } // end of methodICorDebugManagedCallback::LogMessage
695 // Implementation of ICorDebugManagedCallback::LogSwitch
696 HRESULT ShimProxyCallback::LogSwitch(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, __in LPWSTR pLogSwitchName, __in LPWSTR pParentName)
698 m_pShim->PreDispatchEvent();
699 class LogSwitchEvent : public ManagedEvent
701 // callbacks parameters. These are strong references
702 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
703 RSExtSmartPtr<ICorDebugThread > m_pThread;
706 StringCopyHolder m_pLogSwitchName;
707 StringCopyHolder m_pParentName;
711 LogSwitchEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, LONG lLevel, ULONG ulReason, LPCWSTR pLogSwitchName, LPCWSTR pParentName) :
712 ManagedEvent(pThread)
714 this->m_pAppDomain.Assign(pAppDomain);
715 this->m_pThread.Assign(pThread);
716 this->m_lLevel = lLevel;
717 this->m_ulReason = ulReason;
718 this->m_pLogSwitchName.AssignCopy(pLogSwitchName);
719 this->m_pParentName.AssignCopy(pParentName);
722 HRESULT Dispatch(DispatchArgs args)
724 return args.GetCallback1()->LogSwitch(m_pAppDomain, m_pThread, m_lLevel, m_ulReason, const_cast<WCHAR*>((const WCHAR*)m_pLogSwitchName), const_cast<WCHAR*>((const WCHAR*)m_pParentName));
726 }; // end class LogSwitchEvent
728 m_pShim->GetManagedEventQueue()->QueueEvent(new LogSwitchEvent(pAppDomain, pThread, lLevel, ulReason, pLogSwitchName, pParentName));
730 } // end of methodICorDebugManagedCallback::LogSwitch
733 // Implementation of ICorDebugManagedCallback::CreateAppDomain
734 HRESULT ShimProxyCallback::CreateAppDomain(ICorDebugProcess * pProcess, ICorDebugAppDomain * pAppDomain)
736 m_pShim->PreDispatchEvent();
737 class CreateAppDomainEvent : public ManagedEvent
739 // callbacks parameters. These are strong references
740 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
741 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
745 CreateAppDomainEvent(ICorDebugProcess * pProcess, ICorDebugAppDomain * pAppDomain) :
748 this->m_pProcess.Assign(pProcess);
749 this->m_pAppDomain.Assign(pAppDomain);
752 HRESULT Dispatch(DispatchArgs args)
754 return args.GetCallback1()->CreateAppDomain(m_pProcess, m_pAppDomain);
756 }; // end class CreateAppDomainEvent
758 if (!m_pShim->RemoveDuplicateCreationEventIfPresent(pAppDomain))
760 m_pShim->GetManagedEventQueue()->QueueEvent(new CreateAppDomainEvent(pProcess, pAppDomain));
763 } // end of methodICorDebugManagedCallback::CreateAppDomain
766 // Implementation of ICorDebugManagedCallback::ExitAppDomain
767 HRESULT ShimProxyCallback::ExitAppDomain(ICorDebugProcess * pProcess, ICorDebugAppDomain * pAppDomain)
769 m_pShim->PreDispatchEvent();
770 class ExitAppDomainEvent : public ManagedEvent
772 // callbacks parameters. These are strong references
773 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
774 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
778 ExitAppDomainEvent(ICorDebugProcess * pProcess, ICorDebugAppDomain * pAppDomain) :
781 this->m_pProcess.Assign(pProcess);
782 this->m_pAppDomain.Assign(pAppDomain);
785 HRESULT Dispatch(DispatchArgs args)
787 return args.GetCallback1()->ExitAppDomain(m_pProcess, m_pAppDomain);
789 }; // end class ExitAppDomainEvent
791 m_pShim->RemoveDuplicateCreationEventIfPresent(pAppDomain);
792 m_pShim->GetManagedEventQueue()->QueueEvent(new ExitAppDomainEvent(pProcess, pAppDomain));
794 } // end of methodICorDebugManagedCallback::ExitAppDomain
797 // Implementation of ICorDebugManagedCallback::LoadAssembly
798 HRESULT ShimProxyCallback::LoadAssembly(ICorDebugAppDomain * pAppDomain, ICorDebugAssembly * pAssembly)
800 m_pShim->PreDispatchEvent();
801 class LoadAssemblyEvent : public ManagedEvent
803 // callbacks parameters. These are strong references
804 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
805 RSExtSmartPtr<ICorDebugAssembly > m_pAssembly;
809 LoadAssemblyEvent(ICorDebugAppDomain * pAppDomain, ICorDebugAssembly * pAssembly) :
812 this->m_pAppDomain.Assign(pAppDomain);
813 this->m_pAssembly.Assign(pAssembly);
816 HRESULT Dispatch(DispatchArgs args)
818 return args.GetCallback1()->LoadAssembly(m_pAppDomain, m_pAssembly);
820 }; // end class LoadAssemblyEvent
822 if (!m_pShim->RemoveDuplicateCreationEventIfPresent(pAssembly))
824 m_pShim->GetManagedEventQueue()->QueueEvent(new LoadAssemblyEvent(pAppDomain, pAssembly));
827 } // end of methodICorDebugManagedCallback::LoadAssembly
830 // Implementation of ICorDebugManagedCallback::UnloadAssembly
831 HRESULT ShimProxyCallback::UnloadAssembly(ICorDebugAppDomain * pAppDomain, ICorDebugAssembly * pAssembly)
833 m_pShim->PreDispatchEvent();
834 class UnloadAssemblyEvent : public ManagedEvent
836 // callbacks parameters. These are strong references
837 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
838 RSExtSmartPtr<ICorDebugAssembly > m_pAssembly;
842 UnloadAssemblyEvent(ICorDebugAppDomain * pAppDomain, ICorDebugAssembly * pAssembly) :
845 this->m_pAppDomain.Assign(pAppDomain);
846 this->m_pAssembly.Assign(pAssembly);
849 HRESULT Dispatch(DispatchArgs args)
851 return args.GetCallback1()->UnloadAssembly(m_pAppDomain, m_pAssembly);
853 }; // end class UnloadAssemblyEvent
855 m_pShim->RemoveDuplicateCreationEventIfPresent(pAssembly);
856 m_pShim->GetManagedEventQueue()->QueueEvent(new UnloadAssemblyEvent(pAppDomain, pAssembly));
858 } // end of methodICorDebugManagedCallback::UnloadAssembly
861 // Implementation of ICorDebugManagedCallback::ControlCTrap
862 HRESULT ShimProxyCallback::ControlCTrap(ICorDebugProcess * pProcess)
864 m_pShim->PreDispatchEvent();
865 class ControlCTrapEvent : public ManagedEvent
867 // callbacks parameters. These are strong references
868 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
872 ControlCTrapEvent(ICorDebugProcess * pProcess) :
875 this->m_pProcess.Assign(pProcess);
878 HRESULT Dispatch(DispatchArgs args)
880 return args.GetCallback1()->ControlCTrap(m_pProcess);
882 }; // end class ControlCTrapEvent
884 m_pShim->GetManagedEventQueue()->QueueEvent(new ControlCTrapEvent(pProcess));
886 } // end of methodICorDebugManagedCallback::ControlCTrap
889 // Implementation of ICorDebugManagedCallback::NameChange
890 HRESULT ShimProxyCallback::NameChange(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread)
892 m_pShim->PreDispatchEvent();
893 class NameChangeEvent : public ManagedEvent
895 // callbacks parameters. These are strong references
896 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
897 RSExtSmartPtr<ICorDebugThread > m_pThread;
901 NameChangeEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread) :
902 ManagedEvent(pThread)
904 this->m_pAppDomain.Assign(pAppDomain);
905 this->m_pThread.Assign(pThread);
908 HRESULT Dispatch(DispatchArgs args)
910 return args.GetCallback1()->NameChange(m_pAppDomain, m_pThread);
912 }; // end class NameChangeEvent
914 m_pShim->GetManagedEventQueue()->QueueEvent(new NameChangeEvent(pAppDomain, pThread));
916 } // end of methodICorDebugManagedCallback::NameChange
919 // Implementation of ICorDebugManagedCallback::UpdateModuleSymbols
920 HRESULT ShimProxyCallback::UpdateModuleSymbols(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule, IStream * pSymbolStream)
922 m_pShim->PreDispatchEvent();
923 class UpdateModuleSymbolsEvent : public ManagedEvent
925 // callbacks parameters. These are strong references
926 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
927 RSExtSmartPtr<ICorDebugModule > m_pModule;
928 RSExtSmartPtr<IStream > m_pSymbolStream;
932 UpdateModuleSymbolsEvent(ICorDebugAppDomain * pAppDomain, ICorDebugModule * pModule, IStream * pSymbolStream) :
935 this->m_pAppDomain.Assign(pAppDomain);
936 this->m_pModule.Assign(pModule);
937 this->m_pSymbolStream.Assign(pSymbolStream);
940 HRESULT Dispatch(DispatchArgs args)
942 return args.GetCallback1()->UpdateModuleSymbols(m_pAppDomain, m_pModule, m_pSymbolStream);
944 }; // end class UpdateModuleSymbolsEvent
946 m_pShim->GetManagedEventQueue()->QueueEvent(new UpdateModuleSymbolsEvent(pAppDomain, pModule, pSymbolStream));
948 } // end of methodICorDebugManagedCallback::UpdateModuleSymbols
951 // Implementation of ICorDebugManagedCallback::EditAndContinueRemap
952 HRESULT ShimProxyCallback::EditAndContinueRemap(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pFunction, BOOL fAccurate)
954 m_pShim->PreDispatchEvent();
955 class EditAndContinueRemapEvent : public ManagedEvent
957 // callbacks parameters. These are strong references
958 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
959 RSExtSmartPtr<ICorDebugThread > m_pThread;
960 RSExtSmartPtr<ICorDebugFunction > m_pFunction;
965 EditAndContinueRemapEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pFunction, BOOL fAccurate) :
966 ManagedEvent(pThread)
968 this->m_pAppDomain.Assign(pAppDomain);
969 this->m_pThread.Assign(pThread);
970 this->m_pFunction.Assign(pFunction);
971 this->m_fAccurate = fAccurate;
974 HRESULT Dispatch(DispatchArgs args)
976 return args.GetCallback1()->EditAndContinueRemap(m_pAppDomain, m_pThread, m_pFunction, m_fAccurate);
978 }; // end class EditAndContinueRemapEvent
980 m_pShim->GetManagedEventQueue()->QueueEvent(new EditAndContinueRemapEvent(pAppDomain, pThread, pFunction, fAccurate));
982 } // end of methodICorDebugManagedCallback::EditAndContinueRemap
985 // Implementation of ICorDebugManagedCallback::BreakpointSetError
986 HRESULT ShimProxyCallback::BreakpointSetError(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugBreakpoint * pBreakpoint, DWORD dwError)
988 m_pShim->PreDispatchEvent();
989 class BreakpointSetErrorEvent : public ManagedEvent
991 // callbacks parameters. These are strong references
992 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
993 RSExtSmartPtr<ICorDebugThread > m_pThread;
994 RSExtSmartPtr<ICorDebugBreakpoint > m_pBreakpoint;
999 BreakpointSetErrorEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugBreakpoint * pBreakpoint, DWORD dwError) :
1000 ManagedEvent(pThread)
1002 this->m_pAppDomain.Assign(pAppDomain);
1003 this->m_pThread.Assign(pThread);
1004 this->m_pBreakpoint.Assign(pBreakpoint);
1005 this->m_dwError = dwError;
1008 HRESULT Dispatch(DispatchArgs args)
1010 return args.GetCallback1()->BreakpointSetError(m_pAppDomain, m_pThread, m_pBreakpoint, m_dwError);
1012 }; // end class BreakpointSetErrorEvent
1014 m_pShim->GetManagedEventQueue()->QueueEvent(new BreakpointSetErrorEvent(pAppDomain, pThread, pBreakpoint, dwError));
1016 } // end of methodICorDebugManagedCallback::BreakpointSetError
1019 // Implementation of ICorDebugManagedCallback2::FunctionRemapOpportunity
1020 HRESULT ShimProxyCallback::FunctionRemapOpportunity(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pOldFunction, ICorDebugFunction * pNewFunction, ULONG32 oldILOffset)
1022 m_pShim->PreDispatchEvent();
1023 class FunctionRemapOpportunityEvent : public ManagedEvent
1025 // callbacks parameters. These are strong references
1026 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
1027 RSExtSmartPtr<ICorDebugThread > m_pThread;
1028 RSExtSmartPtr<ICorDebugFunction > m_pOldFunction;
1029 RSExtSmartPtr<ICorDebugFunction > m_pNewFunction;
1030 ULONG32 m_oldILOffset;
1034 FunctionRemapOpportunityEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pOldFunction, ICorDebugFunction * pNewFunction, ULONG32 oldILOffset) :
1035 ManagedEvent(pThread)
1037 this->m_pAppDomain.Assign(pAppDomain);
1038 this->m_pThread.Assign(pThread);
1039 this->m_pOldFunction.Assign(pOldFunction);
1040 this->m_pNewFunction.Assign(pNewFunction);
1041 this->m_oldILOffset = oldILOffset;
1044 HRESULT Dispatch(DispatchArgs args)
1046 return args.GetCallback2()->FunctionRemapOpportunity(m_pAppDomain, m_pThread, m_pOldFunction, m_pNewFunction, m_oldILOffset);
1048 }; // end class FunctionRemapOpportunityEvent
1050 m_pShim->GetManagedEventQueue()->QueueEvent(new FunctionRemapOpportunityEvent(pAppDomain, pThread, pOldFunction, pNewFunction, oldILOffset));
1052 } // end of methodICorDebugManagedCallback2::FunctionRemapOpportunity
1055 // Implementation of ICorDebugManagedCallback2::CreateConnection
1056 HRESULT ShimProxyCallback::CreateConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId, __in LPWSTR pConnectionName)
1058 m_pShim->PreDispatchEvent();
1059 class CreateConnectionEvent : public ManagedEvent
1061 // callbacks parameters. These are strong references
1062 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
1063 CONNID m_dwConnectionId;
1064 StringCopyHolder m_pConnectionName;
1068 CreateConnectionEvent(ICorDebugProcess * pProcess, CONNID dwConnectionId, LPCWSTR pConnectionName) :
1071 this->m_pProcess.Assign(pProcess);
1072 this->m_dwConnectionId = dwConnectionId;
1073 this->m_pConnectionName.AssignCopy(pConnectionName);
1076 HRESULT Dispatch(DispatchArgs args)
1078 return args.GetCallback2()->CreateConnection(m_pProcess, m_dwConnectionId, const_cast<WCHAR*>((const WCHAR*)m_pConnectionName));
1080 }; // end class CreateConnectionEvent
1082 m_pShim->GetManagedEventQueue()->QueueEvent(new CreateConnectionEvent(pProcess, dwConnectionId, pConnectionName));
1084 } // end of methodICorDebugManagedCallback2::CreateConnection
1087 // Implementation of ICorDebugManagedCallback2::ChangeConnection
1088 HRESULT ShimProxyCallback::ChangeConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId)
1090 m_pShim->PreDispatchEvent();
1091 class ChangeConnectionEvent : public ManagedEvent
1093 // callbacks parameters. These are strong references
1094 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
1095 CONNID m_dwConnectionId;
1099 ChangeConnectionEvent(ICorDebugProcess * pProcess, CONNID dwConnectionId) :
1102 this->m_pProcess.Assign(pProcess);
1103 this->m_dwConnectionId = dwConnectionId;
1106 HRESULT Dispatch(DispatchArgs args)
1108 return args.GetCallback2()->ChangeConnection(m_pProcess, m_dwConnectionId);
1110 }; // end class ChangeConnectionEvent
1112 m_pShim->GetManagedEventQueue()->QueueEvent(new ChangeConnectionEvent(pProcess, dwConnectionId));
1114 } // end of methodICorDebugManagedCallback2::ChangeConnection
1117 // Implementation of ICorDebugManagedCallback2::DestroyConnection
1118 HRESULT ShimProxyCallback::DestroyConnection(ICorDebugProcess * pProcess, CONNID dwConnectionId)
1120 m_pShim->PreDispatchEvent();
1121 class DestroyConnectionEvent : public ManagedEvent
1123 // callbacks parameters. These are strong references
1124 RSExtSmartPtr<ICorDebugProcess > m_pProcess;
1125 CONNID m_dwConnectionId;
1129 DestroyConnectionEvent(ICorDebugProcess * pProcess, CONNID dwConnectionId) :
1132 this->m_pProcess.Assign(pProcess);
1133 this->m_dwConnectionId = dwConnectionId;
1136 HRESULT Dispatch(DispatchArgs args)
1138 return args.GetCallback2()->DestroyConnection(m_pProcess, m_dwConnectionId);
1140 }; // end class DestroyConnectionEvent
1142 m_pShim->GetManagedEventQueue()->QueueEvent(new DestroyConnectionEvent(pProcess, dwConnectionId));
1144 } // end of methodICorDebugManagedCallback2::DestroyConnection
1148 // Implementation of ICorDebugManagedCallback2::Exception
1149 HRESULT ShimProxyCallback::Exception(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFrame * pFrame, ULONG32 nOffset, CorDebugExceptionCallbackType dwEventType, DWORD dwFlags)
1151 m_pShim->PreDispatchEvent();
1152 class ExceptionEvent : public ManagedEvent
1154 // callbacks parameters. These are strong references
1155 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
1156 RSExtSmartPtr<ICorDebugThread > m_pThread;
1157 RSExtSmartPtr<ICorDebugFrame > m_pFrame;
1159 CorDebugExceptionCallbackType m_dwEventType;
1164 ExceptionEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFrame * pFrame, ULONG32 nOffset, CorDebugExceptionCallbackType dwEventType, DWORD dwFlags) :
1165 ManagedEvent(pThread)
1167 this->m_pAppDomain.Assign(pAppDomain);
1168 this->m_pThread.Assign(pThread);
1169 this->m_pFrame.Assign(pFrame);
1170 this->m_nOffset = nOffset;
1171 this->m_dwEventType = dwEventType;
1172 this->m_dwFlags = dwFlags;
1175 HRESULT Dispatch(DispatchArgs args)
1177 return args.GetCallback2()->Exception(m_pAppDomain, m_pThread, UpdateFrame(m_pThread, m_pFrame), m_nOffset, m_dwEventType, m_dwFlags);
1179 }; // end class ExceptionEvent
1181 m_pShim->GetManagedEventQueue()->QueueEvent(new ExceptionEvent(pAppDomain, pThread, pFrame, nOffset, dwEventType, dwFlags));
1183 } // end of methodICorDebugManagedCallback2::Exception
1186 // Implementation of ICorDebugManagedCallback2::ExceptionUnwind
1187 HRESULT ShimProxyCallback::ExceptionUnwind(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, CorDebugExceptionUnwindCallbackType dwEventType, DWORD dwFlags)
1189 m_pShim->PreDispatchEvent();
1190 class ExceptionUnwindEvent : public ManagedEvent
1192 // callbacks parameters. These are strong references
1193 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
1194 RSExtSmartPtr<ICorDebugThread > m_pThread;
1195 CorDebugExceptionUnwindCallbackType m_dwEventType;
1200 ExceptionUnwindEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, CorDebugExceptionUnwindCallbackType dwEventType, DWORD dwFlags) :
1201 ManagedEvent(pThread)
1203 this->m_pAppDomain.Assign(pAppDomain);
1204 this->m_pThread.Assign(pThread);
1205 this->m_dwEventType = dwEventType;
1206 this->m_dwFlags = dwFlags;
1209 HRESULT Dispatch(DispatchArgs args)
1211 return args.GetCallback2()->ExceptionUnwind(m_pAppDomain, m_pThread, m_dwEventType, m_dwFlags);
1213 }; // end class ExceptionUnwindEvent
1215 m_pShim->GetManagedEventQueue()->QueueEvent(new ExceptionUnwindEvent(pAppDomain, pThread, dwEventType, dwFlags));
1217 } // end of methodICorDebugManagedCallback2::ExceptionUnwind
1220 // Implementation of ICorDebugManagedCallback2::FunctionRemapComplete
1221 HRESULT ShimProxyCallback::FunctionRemapComplete(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pFunction)
1223 m_pShim->PreDispatchEvent();
1224 class FunctionRemapCompleteEvent : public ManagedEvent
1226 // callbacks parameters. These are strong references
1227 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
1228 RSExtSmartPtr<ICorDebugThread > m_pThread;
1229 RSExtSmartPtr<ICorDebugFunction > m_pFunction;
1233 FunctionRemapCompleteEvent(ICorDebugAppDomain * pAppDomain, ICorDebugThread * pThread, ICorDebugFunction * pFunction) :
1234 ManagedEvent(pThread)
1236 this->m_pAppDomain.Assign(pAppDomain);
1237 this->m_pThread.Assign(pThread);
1238 this->m_pFunction.Assign(pFunction);
1241 HRESULT Dispatch(DispatchArgs args)
1243 return args.GetCallback2()->FunctionRemapComplete(m_pAppDomain, m_pThread, m_pFunction);
1245 }; // end class FunctionRemapCompleteEvent
1247 m_pShim->GetManagedEventQueue()->QueueEvent(new FunctionRemapCompleteEvent(pAppDomain, pThread, pFunction));
1249 } // end of methodICorDebugManagedCallback2::FunctionRemapComplete
1252 // Implementation of ICorDebugManagedCallback2::MDANotification
1253 HRESULT ShimProxyCallback::MDANotification(ICorDebugController * pController, ICorDebugThread * pThread, ICorDebugMDA * pMDA)
1255 m_pShim->PreDispatchEvent();
1256 class MDANotificationEvent : public ManagedEvent
1258 // callbacks parameters. These are strong references
1259 RSExtSmartPtr<ICorDebugController > m_pController;
1260 RSExtSmartPtr<ICorDebugThread > m_pThread;
1261 RSExtSmartPtr<ICorDebugMDA > m_pMDA;
1265 MDANotificationEvent(ICorDebugController * pController, ICorDebugThread * pThread, ICorDebugMDA * pMDA) :
1266 ManagedEvent(pThread)
1268 this->m_pController.Assign(pController);
1269 this->m_pThread.Assign(pThread);
1270 this->m_pMDA.Assign(pMDA);
1273 HRESULT Dispatch(DispatchArgs args)
1275 return args.GetCallback2()->MDANotification(m_pController, m_pThread, m_pMDA);
1277 }; // end class MDANotificationEvent
1279 m_pShim->GetManagedEventQueue()->QueueEvent(new MDANotificationEvent(pController, pThread, pMDA));
1281 } // end of methodICorDebugManagedCallback2::MDANotification
1283 // Implementation of ICorDebugManagedCallback3::CustomNotification
1286 // pThread - thread on which the notification occurred
1287 // pAppDomain - appDomain in which the notification occurred
1288 // Return value: S_OK
1289 HRESULT ShimProxyCallback::CustomNotification(ICorDebugThread * pThread, ICorDebugAppDomain * pAppDomain)
1291 m_pShim->PreDispatchEvent();
1292 class CustomNotificationEvent : public ManagedEvent
1294 // callbacks parameters. These are strong references
1295 RSExtSmartPtr<ICorDebugAppDomain > m_pAppDomain;
1296 RSExtSmartPtr<ICorDebugThread > m_pThread;
1300 CustomNotificationEvent(ICorDebugThread * pThread, ICorDebugAppDomain * pAppDomain) :
1301 ManagedEvent(pThread)
1303 this->m_pAppDomain.Assign(pAppDomain);
1304 this->m_pThread.Assign(pThread);
1307 HRESULT Dispatch(DispatchArgs args)
1309 return args.GetCallback3()->CustomNotification(m_pThread, m_pAppDomain);
1311 }; // end class CustomNotificationEvent
1313 m_pShim->GetManagedEventQueue()->QueueEvent(new CustomNotificationEvent(pThread, pAppDomain));