public bool CodeMarker(int nTimerID) { if (!this.IsEnabled) { return(false); } try { CodeMarkers.NativeMethods.DllPerfCodeMarker(nTimerID, (byte[])null, 0); } catch (DllNotFoundException ex) { this.state = CodeMarkers.State.DisabledDueToDllImportException; return(false); } return(true); }
public bool CodeMarkerEx(int nTimerID, byte[] aBuff) { if (!this.IsEnabled) { return(false); } if (aBuff == null) { throw new ArgumentNullException("aBuff"); } try { CodeMarkers.NativeMethods.DllPerfCodeMarker(nTimerID, aBuff, aBuff.Length); } catch (DllNotFoundException ex) { this.state = CodeMarkers.State.DisabledDueToDllImportException; return(false); } return(true); }
public void UninitializePerformanceDLL(int iApp) { if (!this.IsEnabled) { return; } this.state = CodeMarkers.State.Disabled; ushort atom = CodeMarkers.NativeMethods.FindAtom("VSCodeMarkersEnabled"); if ((int)atom != 0) { int num = (int)CodeMarkers.NativeMethods.DeleteAtom(atom); } try { CodeMarkers.NativeMethods.DllUnInitPerf(iApp); } catch (DllNotFoundException ex) { } }
public bool InitPerformanceDll(int iApp, string strRegRoot, RegistryView registryView) { if (this.IsEnabled) { return(true); } if (!CodeMarkers.UseCodeMarkers(strRegRoot, registryView)) { this.state = CodeMarkers.State.DisabledViaRegistryCheck; return(false); } try { int num = (int)CodeMarkers.NativeMethods.AddAtom("VSCodeMarkersEnabled"); CodeMarkers.NativeMethods.DllInitPerf(iApp); this.state = CodeMarkers.State.Enabled; } catch (DllNotFoundException ex) { this.state = CodeMarkers.State.DisabledDueToDllImportException; return(false); } return(true); }
private CodeMarkers() { this.state = (int)CodeMarkers.NativeMethods.FindAtom("VSCodeMarkersEnabled") != 0 ? CodeMarkers.State.Enabled : CodeMarkers.State.Disabled; }