MCPcopy Create free account
hub / github.com/rabbitstack/fibratus / isSingleInstance

Method isSingleInstance

internal/bootstrap/bootstrap.go:437–444  ·  view source on GitHub ↗

isSingleInstance checks if there is a single instance of the Fibratus process running in the system. This is accomplished by creating a global event object. If such an object already exists, we can conclude Fibratus process is already running.

()

Source from the content-addressed store, hash-verified

435// an object already exists, we can conclude Fibratus process
436// is already running.
437func (f *App) isSingleInstance() bool {
438 name, err := windows.UTF16PtrFromString("Global\\Fibratus")
439 if err != nil {
440 return false
441 }
442 event, err := windows.CreateEvent(nil, 0, 0, name)
443 return event != 0 && !errors.Is(err, windows.ERROR_ALREADY_EXISTS)
444}

Callers 2

RunMethod · 0.95
WriteCaptureMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected