相关文章  
  • 浅谈如何利用BartPE创建PE工具盘
  • Windows Mobile 2003 Second Edition 中 ActiveSync 编程模型的增强功能
  • 在完成所有绑定后仍然有许多要进行的操作
  • 在你的企业中管理Windows和应用程序
  • 动态加载用户控件的组件
  • 小心GDI+资源泄漏 -- 猜想 测试 应对全过程
  • 浅谈 C# 中的代码协同 (Coroutine) 执行支持
  • 在 C# 中处理结构内的数组源代码分析
  • 谈 WinDbg 之 InternalCall 的使用与实现
  • 如何才能在10046event自由漫步
  •   推荐  
      科普之友首页   专利     科普      动物      植物        天文   考古   前沿科技
     您现在的位置在:  首页 >>文献 >>培训

    谈 WinDbg 之 AppDomain 的创建过程7

    br>  m_pSystemDomain = new (&g_pSystemDomainMemory) SystemDomain();
      if(m_pSystemDomain == NULL) return COR_E_OUTOFMEMORY;
      
      // 初始化 SystemDomain 对象
      HRESULT hr = m_pSystemDomain->BaseDomain::Init(); // Setup the memory heaps
      if(FAILED(hr)) return hr;
      
      m_pSystemDomain->GetInterfaceVTableMapMgr().SetShared();
      
      // 构造缺省的 AppDomain
      hr = m_pSystemDomain->CreateDefaultDomain();
      if(FAILED(hr)) return hr;
      
      // 构造 SharedDomain
      hr = SharedDomain::Attach();
      
      return hr;
      }
      
      值得注意的是,为了让 SystemDomain 的构造不会失败,SystemDomain 及其基类 BaseDomain 的构造函数都为空,而初始化代码放到 Init 方法中完成,CLR 中很多类型的代码都使用类似的模式将构造和初始化分离以保障构造成功。BaseDomain::Init 函数在 SystemDomain::Attach 中直接被调用以初始化 SystemDomain 的父类;SystemDomain::Init 函数则在上面提到的 EEStartup 函数末尾才被调用

    页码:[1] [2] [3] [4] [5] [6] [7] [8] [9]7页、共9页

         

          设为首页       |       加入收藏       |       广告服务       |       友情链接       |       版权申明      

    Copyriht 2007 - 2008 ©  科普之友 All right reserved