-
Notifications
You must be signed in to change notification settings - Fork 2
/
v0.go
350 lines (320 loc) · 10.4 KB
/
v0.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
package ieventsysteminitialize
import (
"context"
"fmt"
"strings"
"unicode/utf16"
dcerpc "github.com/oiweiwei/go-msrpc/dcerpc"
errors "github.com/oiweiwei/go-msrpc/dcerpc/errors"
uuid "github.com/oiweiwei/go-msrpc/midl/uuid"
dcom "github.com/oiweiwei/go-msrpc/msrpc/dcom"
iunknown "github.com/oiweiwei/go-msrpc/msrpc/dcom/iunknown/v0"
ndr "github.com/oiweiwei/go-msrpc/ndr"
)
var (
_ = context.Background
_ = fmt.Errorf
_ = utf16.Encode
_ = strings.TrimPrefix
_ = ndr.ZeroString
_ = (*uuid.UUID)(nil)
_ = (*dcerpc.SyntaxID)(nil)
_ = (*errors.Error)(nil)
_ = dcom.GoPackage
_ = iunknown.GoPackage
)
var (
// import guard
GoPackage = "dcom/comev"
)
var (
// IEventSystemInitialize interface identifier a0e8f27a-888c-11d1-b763-00c04fb926af
EventSystemInitializeIID = &dcom.IID{Data1: 0xa0e8f27a, Data2: 0x888c, Data3: 0x11d1, Data4: []byte{0xb7, 0x63, 0x00, 0xc0, 0x4f, 0xb9, 0x26, 0xaf}}
// Syntax UUID
EventSystemInitializeSyntaxUUID = &uuid.UUID{TimeLow: 0xa0e8f27a, TimeMid: 0x888c, TimeHiAndVersion: 0x11d1, ClockSeqHiAndReserved: 0xb7, ClockSeqLow: 0x63, Node: [6]uint8{0x0, 0xc0, 0x4f, 0xb9, 0x26, 0xaf}}
// Syntax ID
EventSystemInitializeSyntaxV0_0 = &dcerpc.SyntaxID{IfUUID: EventSystemInitializeSyntaxUUID, IfVersionMajor: 0, IfVersionMinor: 0}
)
// IEventSystemInitialize interface.
type EventSystemInitializeClient interface {
// IUnknown retrieval method.
Unknown() iunknown.UnknownClient
// The SetCOMCatalogBehaviour method controls the event system CatalogMode and RetainSubKeys
// state variables.
//
// Return Values: The server MUST return S_OK.
//
// After this method is called, the event system CatalogMode state variable will be
// true (server in catalog mode) and the RetainSubKeys variable will be set based on
// the bRetainSubKeys parameter. If the client does not call this method, the server
// will be in non-catalog mode. The Store, Remove, and RemoveS methods of IEventSystem
// will have different behavior when the server is in catalog mode. See section 3.1.1.3
// for more details.
SetCOMCatalogBehaviour(context.Context, *SetCOMCatalogBehaviourRequest, ...dcerpc.CallOption) (*SetCOMCatalogBehaviourResponse, error)
// AlterContext alters the client context.
AlterContext(context.Context, ...dcerpc.Option) error
// IPID sets the object interface identifier.
IPID(context.Context, *dcom.IPID) EventSystemInitializeClient
}
type xxx_DefaultEventSystemInitializeClient struct {
iunknown.UnknownClient
cc dcerpc.Conn
ipid *dcom.IPID
}
func (o *xxx_DefaultEventSystemInitializeClient) Unknown() iunknown.UnknownClient {
return o.UnknownClient
}
func (o *xxx_DefaultEventSystemInitializeClient) SetCOMCatalogBehaviour(ctx context.Context, in *SetCOMCatalogBehaviourRequest, opts ...dcerpc.CallOption) (*SetCOMCatalogBehaviourResponse, error) {
op := in.xxx_ToOp(ctx)
if _, ok := dcom.HasIPID(opts); !ok {
if o.ipid != nil {
opts = append(opts, dcom.WithIPID(o.ipid))
} else {
return nil, fmt.Errorf("%s: ipid is missing", op.OpName())
}
}
if err := o.cc.Invoke(ctx, op, opts...); err != nil {
return nil, err
}
out := &SetCOMCatalogBehaviourResponse{}
out.xxx_FromOp(ctx, op)
if op.Return != int32(0) {
return out, fmt.Errorf("%s: %w", op.OpName(), errors.New(ctx, op.Return))
}
return out, nil
}
func (o *xxx_DefaultEventSystemInitializeClient) AlterContext(ctx context.Context, opts ...dcerpc.Option) error {
return o.cc.AlterContext(ctx, opts...)
}
func (o *xxx_DefaultEventSystemInitializeClient) IPID(ctx context.Context, ipid *dcom.IPID) EventSystemInitializeClient {
if ipid == nil {
ipid = &dcom.IPID{}
}
return &xxx_DefaultEventSystemInitializeClient{
UnknownClient: o.UnknownClient.IPID(ctx, ipid),
cc: o.cc,
ipid: ipid,
}
}
func NewEventSystemInitializeClient(ctx context.Context, cc dcerpc.Conn, opts ...dcerpc.Option) (EventSystemInitializeClient, error) {
var err error
if !dcom.IsSuperclass(opts) {
cc, err = cc.Bind(ctx, append(opts, dcerpc.WithAbstractSyntax(EventSystemInitializeSyntaxV0_0))...)
if err != nil {
return nil, err
}
}
base, err := iunknown.NewUnknownClient(ctx, cc, append(opts, dcom.Superclass(cc))...)
if err != nil {
return nil, err
}
ipid, ok := dcom.HasIPID(opts)
if ok {
base = base.IPID(ctx, ipid)
}
return &xxx_DefaultEventSystemInitializeClient{
UnknownClient: base,
cc: cc,
ipid: ipid,
}, nil
}
// xxx_SetCOMCatalogBehaviourOperation structure represents the SetCOMCatalogBehaviour operation
type xxx_SetCOMCatalogBehaviourOperation struct {
This *dcom.ORPCThis `idl:"name:This" json:"this"`
That *dcom.ORPCThat `idl:"name:That" json:"that"`
RetainSubKeys bool `idl:"name:bRetainSubKeys" json:"retain_sub_keys"`
Return int32 `idl:"name:Return" json:"return"`
}
func (o *xxx_SetCOMCatalogBehaviourOperation) OpNum() int { return 3 }
func (o *xxx_SetCOMCatalogBehaviourOperation) OpName() string {
return "/IEventSystemInitialize/v0/SetCOMCatalogBehaviour"
}
func (o *xxx_SetCOMCatalogBehaviourOperation) xxx_PrepareRequestPayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareRequestPayload(context.Context) error }); ok {
if err := hook.AfterPrepareRequestPayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_SetCOMCatalogBehaviourOperation) MarshalNDRRequest(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareRequestPayload(ctx); err != nil {
return err
}
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This != nil {
if err := o.This.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThis{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// bRetainSubKeys {in} (1:{alias=BOOL}(int32))
{
if !o.RetainSubKeys {
if err := w.WriteData(int32(0)); err != nil {
return err
}
} else {
if err := w.WriteData(int32(1)); err != nil {
return err
}
}
}
return nil
}
func (o *xxx_SetCOMCatalogBehaviourOperation) UnmarshalNDRRequest(ctx context.Context, w ndr.Reader) error {
// This {in} (1:{alias=ORPCTHIS}(struct))
{
if o.This == nil {
o.This = &dcom.ORPCThis{}
}
if err := o.This.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// bRetainSubKeys {in} (1:{alias=BOOL}(int32))
{
var _bRetainSubKeys int32
if err := w.ReadData(&_bRetainSubKeys); err != nil {
return err
}
o.RetainSubKeys = _bRetainSubKeys != 0
}
return nil
}
func (o *xxx_SetCOMCatalogBehaviourOperation) xxx_PrepareResponsePayload(ctx context.Context) error {
if hook, ok := (interface{})(o).(interface{ AfterPrepareResponsePayload(context.Context) error }); ok {
if err := hook.AfterPrepareResponsePayload(ctx); err != nil {
return err
}
}
return nil
}
func (o *xxx_SetCOMCatalogBehaviourOperation) MarshalNDRResponse(ctx context.Context, w ndr.Writer) error {
if err := o.xxx_PrepareResponsePayload(ctx); err != nil {
return err
}
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That != nil {
if err := o.That.MarshalNDR(ctx, w); err != nil {
return err
}
} else {
if err := (&dcom.ORPCThat{}).MarshalNDR(ctx, w); err != nil {
return err
}
}
if err := w.WriteDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.WriteData(o.Return); err != nil {
return err
}
}
return nil
}
func (o *xxx_SetCOMCatalogBehaviourOperation) UnmarshalNDRResponse(ctx context.Context, w ndr.Reader) error {
// That {out} (1:{alias=ORPCTHAT}(struct))
{
if o.That == nil {
o.That = &dcom.ORPCThat{}
}
if err := o.That.UnmarshalNDR(ctx, w); err != nil {
return err
}
if err := w.ReadDeferred(); err != nil {
return err
}
}
// Return {out} (1:{alias=HRESULT, names=LONG}(int32))
{
if err := w.ReadData(&o.Return); err != nil {
return err
}
}
return nil
}
// SetCOMCatalogBehaviourRequest structure represents the SetCOMCatalogBehaviour operation request
type SetCOMCatalogBehaviourRequest struct {
// This: ORPCTHIS structure that is used to send ORPC extension data to the server.
This *dcom.ORPCThis `idl:"name:This" json:"this"`
// bRetainSubKeys: This value is copied to the RetainSubKeys state variable (see section
// 3.1.1.3) of the event system.
RetainSubKeys bool `idl:"name:bRetainSubKeys" json:"retain_sub_keys"`
}
func (o *SetCOMCatalogBehaviourRequest) xxx_ToOp(ctx context.Context) *xxx_SetCOMCatalogBehaviourOperation {
if o == nil {
return &xxx_SetCOMCatalogBehaviourOperation{}
}
return &xxx_SetCOMCatalogBehaviourOperation{
This: o.This,
RetainSubKeys: o.RetainSubKeys,
}
}
func (o *SetCOMCatalogBehaviourRequest) xxx_FromOp(ctx context.Context, op *xxx_SetCOMCatalogBehaviourOperation) {
if o == nil {
return
}
o.This = op.This
o.RetainSubKeys = op.RetainSubKeys
}
func (o *SetCOMCatalogBehaviourRequest) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRRequest(ctx, w)
}
func (o *SetCOMCatalogBehaviourRequest) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_SetCOMCatalogBehaviourOperation{}
if err := _o.UnmarshalNDRRequest(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}
// SetCOMCatalogBehaviourResponse structure represents the SetCOMCatalogBehaviour operation response
type SetCOMCatalogBehaviourResponse struct {
// That: ORPCTHAT structure that is used to return ORPC extension data to the client.
That *dcom.ORPCThat `idl:"name:That" json:"that"`
// Return: The SetCOMCatalogBehaviour return value.
Return int32 `idl:"name:Return" json:"return"`
}
func (o *SetCOMCatalogBehaviourResponse) xxx_ToOp(ctx context.Context) *xxx_SetCOMCatalogBehaviourOperation {
if o == nil {
return &xxx_SetCOMCatalogBehaviourOperation{}
}
return &xxx_SetCOMCatalogBehaviourOperation{
That: o.That,
Return: o.Return,
}
}
func (o *SetCOMCatalogBehaviourResponse) xxx_FromOp(ctx context.Context, op *xxx_SetCOMCatalogBehaviourOperation) {
if o == nil {
return
}
o.That = op.That
o.Return = op.Return
}
func (o *SetCOMCatalogBehaviourResponse) MarshalNDR(ctx context.Context, w ndr.Writer) error {
return o.xxx_ToOp(ctx).MarshalNDRResponse(ctx, w)
}
func (o *SetCOMCatalogBehaviourResponse) UnmarshalNDR(ctx context.Context, r ndr.Reader) error {
_o := &xxx_SetCOMCatalogBehaviourOperation{}
if err := _o.UnmarshalNDRResponse(ctx, r); err != nil {
return err
}
o.xxx_FromOp(ctx, _o)
return nil
}