当前位置: 首页>>代码示例>>C#>>正文


C# IDataReader.GetArchitecture方法代码示例

本文整理汇总了C#中IDataReader.GetArchitecture方法的典型用法代码示例。如果您正苦于以下问题:C# IDataReader.GetArchitecture方法的具体用法?C# IDataReader.GetArchitecture怎么用?C# IDataReader.GetArchitecture使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDataReader的用法示例。


在下文中一共展示了IDataReader.GetArchitecture方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataTargetImpl

        public DataTargetImpl(IDataReader dataReader, IDebugClient client)
        {
            if (dataReader == null)
                throw new ArgumentNullException("dataReader");

            _dataReader = dataReader;
            _client = client;
            _architecture = _dataReader.GetArchitecture();
        }
开发者ID:tomasr,项目名称:clrmd,代码行数:9,代码来源:datatargetimpl.cs

示例2: DataTargetImpl

        public DataTargetImpl(IDataReader dataReader, IDebugClient client)
        {
            if (dataReader == null)
                throw new ArgumentNullException("dataReader");

            m_dataReader = dataReader;
            m_client = client;
            m_architecture = m_dataReader.GetArchitecture();

            var sympath = SymPath._NT_SYMBOL_PATH;
            if (string.IsNullOrEmpty(sympath))
                sympath = SymPath.MicrosoftSymbolServerPath;

            m_symPath = new SymPath(sympath);
        }
开发者ID:FrenchData,项目名称:dotnetsamples,代码行数:15,代码来源:datatargetimpl.cs

示例3: GetThreadContextSize

        protected uint GetThreadContextSize(IDataReader dataReader)
        {
            uint result = 0;
            var plat = dataReader.GetArchitecture();

            if (plat == Architecture.Amd64)
                result = CONTEXT_SIZE_AMD64;
            else if (plat == Architecture.X86)
                result = CONTEXT_SIZE_X86;
            else if (plat == Architecture.Arm)
                result = CONTEXT_SIZE_ARM;
            else
                throw new InvalidOperationException("Unexpected architecture.");

            return result;
        }
开发者ID:Pavel-Durov,项目名称:Win-Handles-Querier,代码行数:16,代码来源:ThreadContextStrategy.cs

示例4: ProcessQuerierStrategy

        public ProcessQuerierStrategy(IDebugClient debugClient, IDataReader dataReader, ClrRuntime runtime)
        {
            _isDispsed = false;

            _runtime = runtime;
            _dataReader = dataReader;
            _debugClient = debugClient;

            if (dataReader.GetArchitecture() == Architecture.Amd64)//Environment.Is64BitProcess
            {
                _unmanagedStackWalkerStrategy = new Unmanaged_x64_StackWalkerStrategy(_runtime);
                _threadContextStrategy = new ThreadContext_x64_Strategy();
            }
            else
            {
                _unmanagedStackWalkerStrategy = new Unmanaged_x86_StackWalkerStrategy();
                _threadContextStrategy = new ThreadContext_x86_Strategy();
            }

            _unmanagedBlockingObjectsHandler = new UnmanagedBlockingObjectsHandler(_unmanagedStackWalkerStrategy);
        }
开发者ID:Pavel-Durov,项目名称:Win-Handles-Querier,代码行数:21,代码来源:ProcessQuerierStrategy.cs

示例5: SetThreadContext

        public override bool SetThreadContext(ThreadInfo threadInfo, IDebugAdvanced debugClient, IDataReader dataReader)
        {
            bool result = false;
            var plat = dataReader.GetArchitecture();

            if (plat == Architecture.Amd64)
            {
                throw new InvalidOperationException("Unexpected architecture.");
            }

            byte[] contextBytes = new byte[GetThreadContextSize(dataReader)];

            if (SetCurrentThreadId(threadInfo.EngineThreadId, debugClient) == DbgEng.S_OK)
            {
                var gch = GCHandle.Alloc(contextBytes, GCHandleType.Pinned);

                var h_result = ((IDebugAdvanced)debugClient).GetThreadContext(gch.AddrOfPinnedObject(), (uint)contextBytes.Length);

                if (h_result == DbgEng.S_OK)
                {
                    try
                    {
                        var structure = Marshal.PtrToStructure<CONTEXT_X86>(gch.AddrOfPinnedObject());
                        threadInfo.ContextStruct = new Model.UnifiedThreadContext(structure, threadInfo);
                        result = true;
                    }
                    finally
                    {
                        gch.Free();
                    }
                }

            }

            return result;
        }
开发者ID:Pavel-Durov,项目名称:Win-Handles-Querier,代码行数:36,代码来源:ThreadContext_x86_Strategy.cs


注:本文中的IDataReader.GetArchitecture方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。