Beispiel #1
0
 internal static int GetGlobalCounter(GlobalPerfCounter counter)
 {
     if (_global != IntPtr.Zero)
     {
         return(UnsafeNativeMethods.PerfGetCounter(_global, (int)counter));
     }
     return(-1);
 }
Beispiel #2
0
        // It's important that this be debug only. We don't want production
        // code to access shared memory that another process could corrupt.
#if DBG
        internal static int GetCounter(AppPerfCounter counter)
        {
            if (_instance != null)
            {
                return(UnsafeNativeMethods.PerfGetCounter(_instance.UnsafeHandle, (int)counter));
            }
            else
            {
                return(-1);
            }
        }
        // It's important that this be debug only. We don't want production
        // code to access shared memory that another process could corrupt.
#if DBG
        internal /*public*/ static int GetCounter(AppPerfCounter counter)
        {
            return(UnsafeNativeMethods.PerfGetCounter(_instance, (int)counter));
        }