QueryObjectType returns the type of the specified object.
(obj windows.Handle)
| 55 | |
| 56 | // QueryObjectType returns the type of the specified object. |
| 57 | func 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. |
| 70 | func QueryObjectName(obj windows.Handle) (string, error) { |