Exemple #1
0
            public static bool IsEvalSafe(MDbgProcess proc)
            {
                ICorDebugThread dbgThred = proc.Threads.Active.CorThread.Raw;

                ///http://blogs.msdn.com/b/jmstall/archive/2005/11/15/funceval-rules.aspx
                ///Dangers of Eval: http://blogs.msdn.com/b/jmstall/archive/2005/03/23/400794.aspx
                CorDebugUserState pState;

                dbgThred.GetUserState(out pState);
                //CorDebugUserState.USER_NONE was identified by the experimenting
                if ((!pState.IsSet(CorDebugUserState.USER_UNSAFE_POINT) && pState.IsSet(CorDebugUserState.USER_STOPPED)) || pState == CorDebugUserState.USER_NONE)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }