-
Notifications
You must be signed in to change notification settings - Fork 1
/
safearray_func.go
233 lines (201 loc) · 6.6 KB
/
safearray_func.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
// +build !windows
package safearray
import "unsafe"
import "github.com/go-ole/com"
// AccessData returns raw array.
//
// AKA: SafeArrayAccessData in Windows API.
func AccessData(safearray *COMArray) (uintptr, error) {
return uintptr(unsafe.Pointer(safearray)), NotImplementedError
}
// UnaccessData releases raw array.
//
// AKA: SafeArrayUnaccessData in Windows API.
func UnaccessData(safearray *COMArray) error {
return NotImplementedError
}
// AllocateArrayData allocates SafeArray.
//
// AKA: SafeArrayAllocData in Windows API.
func AllocateArrayData(safearray *COMArray) error {
return NotImplementedError
}
// AllocateArrayDescriptor allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptor in Windows API.
func AllocateArrayDescriptor(dimensions uint32) (*COMArray, error) {
return nil, NotImplementedError
}
// AllocateArrayDescriptorEx allocates SafeArray.
//
// AKA: SafeArrayAllocDescriptorEx in Windows API.
func AllocateArrayDescriptorEx(variantType com.VariantType, dimensions uint32) (*COMArray, error) {
return nil, NotImplementedError
}
// Duplicate returns copy of SafeArray.
//
// AKA: SafeArrayCopy in Windows API.
func Duplicate(original *COMArray) (*COMArray, error) {
return nil, NotImplementedError
}
// DuplicateData duplicates SafeArray into another SafeArray object.
//
// AKA: SafeArrayCopyData in Windows API.
func DuplicateData(original, duplicate *COMArray) error {
return NotImplementedError
}
// CreateArray creates SafeArray.
//
// AKA: SafeArrayCreate in Windows API.
func CreateArray(variantType com.VariantType, dimensions uint32, bounds *Bounds) (*COMArray, error) {
return nil, NotImplementedError
}
// CreateArrayEx creates SafeArray.
//
// AKA: SafeArrayCreateEx in Windows API.
func CreateArrayEx(variantType com.VariantType, dimensions uint32, bounds *Bounds, extra uintptr) (*COMArray, error) {
return nil, NotImplementedError
}
// CreateArrayVector creates SafeArray.
//
// AKA: SafeArrayCreateVector in Windows API.
func CreateArrayVector(variantType com.VariantType, lowerBound int32, length uint32) (*COMArray, error) {
return nil, NotImplementedError
}
// CreateArrayVectorEx creates SafeArray.
//
// AKA: SafeArrayCreateVectorEx in Windows API.
func CreateArrayVectorEx(variantType com.VariantType, lowerBound int32, length uint32, extra uintptr) (*COMArray, error) {
return nil, NotImplementedError
}
// Destroy destroys SafeArray object.
//
// AKA: SafeArrayDestroy in Windows API.
func Destroy(safearray *COMArray) error {
return NotImplementedError
}
// DestroyData destroys SafeArray object.
//
// AKA: SafeArrayDestroyData in Windows API.
func DestroyData(safearray *COMArray) error {
return NotImplementedError
}
// DestroyDescriptor destroys SafeArray object.
//
// AKA: SafeArrayDestroyDescriptor in Windows API.
func DestroyDescriptor(safearray *COMArray) error {
return NotImplementedError
}
// GetDimensions is the amount of dimensions in the SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetDim in Windows API.
func GetDimensions(safearray *COMArray) (uint32, error) {
return *uint32(0), NotImplementedError
}
// GetElementSize is the element size in bytes.
//
// AKA: SafeArrayGetElemsize in Windows API.
func GetElementSize(safearray *COMArray) (uint32, error) {
return *uint32(0), NotImplementedError
}
// GetElement retrieves element at given index.
func GetElement(safearray *COMArray, index int64) (interface{}, error) {
return nil, NotImplementedError
}
// GetElementDirect retrieves element value at given index.
//
// AKA: SafeArrayGetElement in Windows API.
func GetElementDirect(safearray *COMArray, index int64, element interface{}) error {
return NotImplementedError
}
// GetInterfaceID is the InterfaceID of the elements in the SafeArray.
//
// AKA: SafeArrayGetIID in Windows API.
func GetInterfaceID(safearray *COMArray) (*com.GUID, error) {
return nil, NotImplementedError
}
// GetLowerBound returns lower bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetLBound in Windows API.
func GetLowerBound(safearray *COMArray, dimension uint32) (int64, error) {
return int64(0), NotImplementedError
}
// GetUpperBound returns upper bounds of SafeArray.
//
// SafeArrays may have multiple dimensions. Meaning, it could be
// multidimensional array.
//
// AKA: SafeArrayGetUBound in Windows API.
func GetUpperBound(safearray *COMArray, dimension uint32) (int64, error) {
return int64(0), NotImplementedError
}
// GetVariantType returns data type of SafeArray.
//
// AKA: SafeArrayGetVartype in Windows API.
func GetVariantType(safearray *COMArray) (com.VariantType, error) {
return com.NullVariantType, NotImplementedError
}
// Lock locks SafeArray for reading to modify SafeArray.
//
// This must be called during some calls to ensure that another process does not
// read or write to the SafeArray during editing.
//
// AKA: SafeArrayLock in Windows API.
func Lock(safearray *COMArray) error {
return NotImplementedError
}
// Unlock unlocks SafeArray for reading.
//
// AKA: SafeArrayUnlock in Windows API.
func Unlock(safearray *COMArray) error {
return NotImplementedError
}
// GetPointerOfIndex gets a pointer to an array element.
//
// AKA: SafeArrayPtrOfIndex in Windows API.
func GetPointerOfIndex(safearray *COMArray, index int64) (uintptr, error) {
return uintptr(0), NotImplementedError
}
// SetInterfaceID sets the GUID of the interface for the specified safe
// array.
//
// AKA: SafeArraySetIID in Windows API.
func SetInterfaceID(safearray *COMArray, interfaceID *com.GUID) error {
return NotImplementedError
}
// ResetDimensions changes the right-most (least significant) bound of the
// specified safe array.
//
// AKA: SafeArrayRedim in Windows API.
func ResetDimensions(safearray *COMArray, bounds *Bounds) error {
return NotImplementedError
}
// PutElement stores the data element at the specified location in the
// array.
//
// AKA: SafeArrayPutElement in Windows API.
func PutElement(safearray *COMArray, index int64, element interface{}) error {
return NotImplementedError
}
// GetRecordInfo accesses IRecordInfo info for custom types.
//
// AKA: SafeArrayGetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func GetRecordInfo(safearray *COMArray) (interface{}, error) {
return nil, NotImplementedError
}
// SetRecordInfo mutates IRecordInfo info for custom types.
//
// AKA: SafeArraySetRecordInfo in Windows API.
//
// XXX: Must implement IRecordInfo interface for this to return.
func SetRecordInfo(safearray *COMArray, recordInfo interface{}) (err error) {
return NotImplementedError
}