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

Function IsProcessPackaged

pkg/sys/process.go:110–118  ·  view source on GitHub ↗

IsProcessPackaged determines if the process is packaged by trying to resolve the package identifier.

(proc windows.Handle)

Source from the content-addressed store, hash-verified

108// IsProcessPackaged determines if the process is packaged by trying
109// to resolve the package identifier.
110func IsProcessPackaged(proc windows.Handle) (bool, error) {
111 var n uint32
112 err := GetPackageID(proc, &n, 0)
113 if err == windows.ERROR_INSUFFICIENT_BUFFER {
114 b := make([]byte, n)
115 err = GetPackageID(proc, &n, uintptr(unsafe.Pointer(&b[0])))
116 }
117 return err == nil, err
118}
119
120// IsWindowsService reports whether the process is currently executing
121// as a Windows service.

Callers 1

FindMethod · 0.92

Calls 1

GetPackageIDFunction · 0.85

Tested by

no test coverage detected