Beispiel #1
0
        bool _ICompensator._AbortRecord(_LogRecord record)
        {
            DBG.Assert(_clerk != null, "Method call made on Compensator with no clerk!");

            DBG.Info(DBG.CRM, "Compensator: abort-record");
            LogRecord R = new LogRecord(record);

            return(AbortRecord(R));
        }
        /// <include file='doc\ExportUtil.uex' path='docs/doc[@for="AppDomainHelper.IAppDomainHelper.Initialize"]/*' />
        void IAppDomainHelper.Initialize(IntPtr pUnkAD, IntPtr pfnShutdownCB, IntPtr punkPool)
        {
            _ad = (AppDomain)Marshal.GetObjectForIUnknown(pUnkAD);
            DBG.Assert(_ad == AppDomain.CurrentDomain, "Call to AppDomainHelper.Initialize in wrong AD");

            _pfnShutdownCB = pfnShutdownCB;
            _punkPool      = punkPool;
            Marshal.AddRef(_punkPool);

            _ad.DomainUnload += new EventHandler(this.OnDomainUnload);
        }
 // callback for shutdown delegate:
 private void OnDomainUnload(Object sender, EventArgs e)
 {
     DBG.Assert(AppDomain.CurrentDomain == _ad, "Call to AppDomainHelper.OnDomainUnload for wrong AD");
     // Our domain is being unloaded, it's time to call the
     // unmanaged world back...
     if (_pfnShutdownCB != IntPtr.Zero)
     {
         DBG.Info(DBG.Pool, "AppDomainHelper.OnDomainUnload: delivering callback.");
         Thunk.Proxy.CallFunction(_pfnShutdownCB, _punkPool);
         _pfnShutdownCB = IntPtr.Zero;
         Marshal.Release(_punkPool);
         _punkPool = IntPtr.Zero;
         DBG.Info(DBG.Pool, "OnDomainUnload: done.");
     }
 }
        /// <include file='doc\ExportUtil.uex' path='docs/doc[@for="AppDomainHelper.IAppDomainHelper.DoCallback"]/*' />
        void IAppDomainHelper.DoCallback(IntPtr pUnkAD, IntPtr pfnCallbackCB, IntPtr data)
        {
#if _DEBUG
            AppDomain ad = (AppDomain)Marshal.GetObjectForIUnknown(pUnkAD);
            DBG.Assert(ad == _ad, "Call to AppDomainHelper.DoCallback for wrong AD");
#endif
            // DoCallback:
            CallbackWrapper wrap = new CallbackWrapper(pfnCallbackCB, data);

            if (_ad != AppDomain.CurrentDomain)
            {
                DBG.Info(DBG.Pool, "AppDomainHelper.DoCallback: the current domain differs from the passed domain.");
                _ad.DoCallBack(new CrossAppDomainDelegate(wrap.ReceiveCallback));
                DBG.Info(DBG.Pool, "AppDomainHelper.DoCallback: done with callback.");
            }
            else
            {
                DBG.Info(DBG.Pool, "AppDomainHelper.DoCallback: the current domain matches.");
                wrap.ReceiveCallback();
            }
        }
Beispiel #5
0
 internal static String RolesFor(String target)
 {
     if (Platform.IsLessThan(Platform.W2K))
     {
         if (target == "Component")
         {
             return("RolesForPackageComponent");
         }
         else if (target == "Interface")
         {
             return("RolesForPackageComponentInterface");
         }
         else
         {
             DBG.Assert(false, "Unknown MTS role collection target.");
             return(null);
         }
     }
     else
     {
         return("RolesFor" + target);
     }
 }
Beispiel #6
0
 internal Clerk(CrmLogControl logControl)
 {
     DBG.Assert(logControl != null, "logControl object is null!");
     _control = logControl;
     _monitor = _control.GetMonitor();
 }