-
Notifications
You must be signed in to change notification settings - Fork 56
/
ienumunknown.go
59 lines (51 loc) · 1.02 KB
/
ienumunknown.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// +build windows
package clr
import (
"syscall"
"unsafe"
)
type IEnumUnknown struct {
vtbl *IEnumUnknownVtbl
}
type IEnumUnknownVtbl struct {
QueryInterface uintptr
AddRef uintptr
Release uintptr
Next uintptr
Skip uintptr
Reset uintptr
Clone uintptr
}
func NewIEnumUnknownFromPtr(ppv uintptr) *IEnumUnknown {
return (*IEnumUnknown)(unsafe.Pointer(ppv))
}
func (obj *IEnumUnknown) AddRef() uintptr {
ret, _, _ := syscall.Syscall(
obj.vtbl.AddRef,
1,
uintptr(unsafe.Pointer(obj)),
0,
0)
return ret
}
func (obj *IEnumUnknown) Release() uintptr {
ret, _, _ := syscall.Syscall(
obj.vtbl.Release,
1,
uintptr(unsafe.Pointer(obj)),
0,
0)
return ret
}
func (obj *IEnumUnknown) Next(celt uint32, pEnumRuntime *uintptr, pCeltFetched *uint32) uintptr {
ret, _, _ := syscall.Syscall6(
obj.vtbl.Next,
4,
uintptr(unsafe.Pointer(obj)),
uintptr(celt),
uintptr(unsafe.Pointer(pEnumRuntime)),
uintptr(unsafe.Pointer(pCeltFetched)),
0,
0)
return ret
}