QueryObjectName returns the object name of the specified object.
(obj windows.Handle)
| 68 | |
| 69 | // QueryObjectName returns the object name of the specified object. |
| 70 | func QueryObjectName(obj windows.Handle) (string, error) { |
| 71 | nameInfo, err := sys.QueryObject[sys.ObjectNameInformation](obj, sys.ObjectNameInformationClass) |
| 72 | if err != nil { |
| 73 | return "", fmt.Errorf("unable to query object name: %v", err) |
| 74 | } |
| 75 | length := nameInfo.ObjectName.Length |
| 76 | if length > 0 { |
| 77 | return nameInfo.ObjectName.String(), nil |
| 78 | } |
| 79 | return "", nil |
| 80 | } |
| 81 | |
| 82 | // QueryName gets the name of the underlying handle reference and extra metadata if it is available. |
| 83 | func QueryName(handle windows.Handle, typ string, withTimeout bool) (string, htypes.Meta, error) { |
no test coverage detected