MCPcopy
hub / github.com/cilium/ebpf / WindowsProgramTypeForGUID

Function WindowsProgramTypeForGUID

types_windows.go:18–34  ·  view source on GitHub ↗

WindowsProgramTypeForGUID resolves a GUID to a ProgramType. The GUID must be in the form of "{XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}". Returns an error wrapping [os.ErrNotExist] if the GUID is not recignized.

(guid string)

Source from the content-addressed store, hash-verified

16//
17// Returns an error wrapping [os.ErrNotExist] if the GUID is not recignized.
18func WindowsProgramTypeForGUID(guid string) (ProgramType, error) {
19 progTypeGUID, err := windows.GUIDFromString(guid)
20 if err != nil {
21 return 0, fmt.Errorf("parse GUID: %w", err)
22 }
23
24 rawProgramType, err := efw.EbpfGetBpfProgramType(progTypeGUID)
25 if err != nil {
26 return 0, fmt.Errorf("get program type: %w", err)
27 }
28
29 if rawProgramType == 0 {
30 return 0, fmt.Errorf("program type not found for GUID %v: %w", guid, os.ErrNotExist)
31 }
32
33 return ProgramTypeForPlatform(platform.Windows, rawProgramType)
34}
35
36// WindowsAttachTypeForGUID resolves a GUID to an AttachType.
37//

Callers 2

Calls 2

EbpfGetBpfProgramTypeFunction · 0.92
ProgramTypeForPlatformFunction · 0.85

Tested by 2

Used in the wild real call sites across dependent graphs

searching dependent graphs…