MCPcopy Index your code
hub / github.com/rabbitstack/fibratus / QueryObjectType

Function QueryObjectType

pkg/handle/object.go:57–67  ·  view source on GitHub ↗

QueryObjectType returns the type of the specified object.

(obj windows.Handle)

Source from the content-addressed store, hash-verified

55
56// QueryObjectType returns the type of the specified object.
57func QueryObjectType(obj windows.Handle) (string, error) {
58 typeInfo, err := sys.QueryObject[sys.ObjectTypeInformation](obj, sys.ObjectTypeInformationClass)
59 if err != nil {
60 return "", fmt.Errorf("unable to query handle type: %v", err)
61 }
62 length := typeInfo.TypeName.Length
63 if length > 0 {
64 return typeInfo.TypeName.String(), nil
65 }
66 return "", errors.New("zero length handle type name encountered")
67}
68
69// QueryObjectName returns the object name of the specified object.
70func QueryObjectName(obj windows.Handle) (string, error) {

Callers 2

getHandleMethod · 0.85
TestQueryTypeFunction · 0.85

Calls 2

QueryObjectFunction · 0.92
StringMethod · 0.65

Tested by 1

TestQueryTypeFunction · 0.68