@@ -6,7 +6,6 @@ package edge
6
6
import (
7
7
"log"
8
8
"runtime"
9
- "syscall"
10
9
"unsafe"
11
10
12
11
"github.com/jchv/go-webview2/internal/w32"
@@ -57,59 +56,6 @@ func createCoreWebView2EnvironmentWithOptions(browserExecutableFolder, userDataF
57
56
)
58
57
}
59
58
60
- // ComProc stores a COM procedure.
61
- type ComProc uintptr
62
-
63
- // NewComProc creates a new COM proc from a Go function.
64
- func NewComProc (fn interface {}) ComProc {
65
- return ComProc (windows .NewCallback (fn ))
66
- }
67
-
68
- //go:uintptrescapes
69
- // Call calls a COM procedure.
70
- func (p ComProc ) Call (a ... uintptr ) (r1 , r2 uintptr , lastErr error ) {
71
- // The magic uintptrescapes comment is needed to prevent moving uintptr(unsafe.Pointer(p)) so calls to .Call() also
72
- // satisfy the unsafe.Pointer rule "(4) Conversion of a Pointer to a uintptr when calling syscall.Syscall."
73
- // Otherwise it might be that pointers get moved, especially pointer onto the Go stack which might grow dynamically.
74
- // See https://pkg.go.dev/unsafe#Pointer and https://github.com/golang/go/issues/34474
75
- switch len (a ) {
76
- case 0 :
77
- return syscall .Syscall (uintptr (p ), 0 , 0 , 0 , 0 )
78
- case 1 :
79
- return syscall .Syscall (uintptr (p ), 1 , a [0 ], 0 , 0 )
80
- case 2 :
81
- return syscall .Syscall (uintptr (p ), 2 , a [0 ], a [1 ], 0 )
82
- case 3 :
83
- return syscall .Syscall (uintptr (p ), 3 , a [0 ], a [1 ], a [2 ])
84
- case 4 :
85
- return syscall .Syscall6 (uintptr (p ), 4 , a [0 ], a [1 ], a [2 ], a [3 ], 0 , 0 )
86
- case 5 :
87
- return syscall .Syscall6 (uintptr (p ), 5 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], 0 )
88
- case 6 :
89
- return syscall .Syscall6 (uintptr (p ), 6 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ])
90
- case 7 :
91
- return syscall .Syscall9 (uintptr (p ), 7 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], 0 , 0 )
92
- case 8 :
93
- return syscall .Syscall9 (uintptr (p ), 8 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], 0 )
94
- case 9 :
95
- return syscall .Syscall9 (uintptr (p ), 9 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ])
96
- case 10 :
97
- return syscall .Syscall12 (uintptr (p ), 10 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], 0 , 0 )
98
- case 11 :
99
- return syscall .Syscall12 (uintptr (p ), 11 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], a [10 ], 0 )
100
- case 12 :
101
- return syscall .Syscall12 (uintptr (p ), 12 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], a [10 ], a [11 ])
102
- case 13 :
103
- return syscall .Syscall15 (uintptr (p ), 13 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], a [10 ], a [11 ], a [12 ], 0 , 0 )
104
- case 14 :
105
- return syscall .Syscall15 (uintptr (p ), 14 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], a [10 ], a [11 ], a [12 ], a [13 ], 0 )
106
- case 15 :
107
- return syscall .Syscall15 (uintptr (p ), 15 , a [0 ], a [1 ], a [2 ], a [3 ], a [4 ], a [5 ], a [6 ], a [7 ], a [8 ], a [9 ], a [10 ], a [11 ], a [12 ], a [13 ], a [14 ])
108
- default :
109
- panic ("too many arguments" )
110
- }
111
- }
112
-
113
59
// IUnknown
114
60
115
61
type _IUnknownVtbl struct {
0 commit comments