mi: deliver query results through MI callbacks (#2666)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-10 23:15:42 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 839d32c7d5
commit 96fdb6f779
7 changed files with 1093 additions and 72 deletions
+19
View File
@@ -74,6 +74,25 @@ type ClassDecl struct {
OwningClass uintptr
}
// clone returns a copy of the instance that stays valid until it is deleted.
//
// https://learn.microsoft.com/en-us/windows/win32/api/mi/nf-mi-mi_instance_clone
func (instance *Instance) clone() (*Instance, error) {
if instance == nil || instance.ft == nil {
return nil, ErrNotInitialized
}
var clone *Instance
r0, _, _ := syscall.SyscallN(instance.ft.Clone, uintptr(unsafe.Pointer(instance)), uintptr(unsafe.Pointer(&clone)))
if result := ResultError(r0); !errors.Is(result, MI_RESULT_OK) {
return nil, result
}
return clone, nil
}
func (instance *Instance) Delete() error {
if instance == nil || instance.ft == nil {
return ErrNotInitialized