-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.go
137 lines (121 loc) · 3.99 KB
/
server.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
package ifolderactioncollection
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"
idispatch "github.com/oiweiwei/go-msrpc/msrpc/dcom/oaut/idispatch/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)
_ = idispatch.GoPackage
)
// IFolderActionCollection server interface.
type FolderActionCollectionServer interface {
// IDispatch base class.
idispatch.DispatchServer
// Count operation.
GetCount(context.Context, *GetCountRequest) (*GetCountResponse, error)
// Item operation.
GetItem(context.Context, *GetItemRequest) (*GetItemResponse, error)
// _NewEnum operation.
Get_NewEnum(context.Context, *Get_NewEnumRequest) (*Get_NewEnumResponse, error)
// Add operation.
Add(context.Context, *AddRequest) (*AddResponse, error)
// Remove operation.
Remove(context.Context, *RemoveRequest) (*RemoveResponse, error)
// Clear operation.
Clear(context.Context, *ClearRequest) (*ClearResponse, error)
// AddRange operation.
AddRange(context.Context, *AddRangeRequest) (*AddRangeResponse, error)
// The CreateFolderAction method creates a folder action object.
//
// Return Values: This method MUST return an HRESULT with the severity bit clear on
// success as specified in [MS-ERREF]; otherwise, it MUST return one of the errors as
// defined in 2.2.1 or one of the errors as defined in [MS-ERREF] section 2.1.
CreateFolderAction(context.Context, *CreateFolderActionRequest) (*CreateFolderActionResponse, error)
}
func RegisterFolderActionCollectionServer(conn dcerpc.Conn, o FolderActionCollectionServer, opts ...dcerpc.Option) {
conn.RegisterServer(NewFolderActionCollectionServerHandle(o), append(opts, dcerpc.WithAbstractSyntax(FolderActionCollectionSyntaxV0_0))...)
}
func NewFolderActionCollectionServerHandle(o FolderActionCollectionServer) dcerpc.ServerHandle {
return func(ctx context.Context, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
return FolderActionCollectionServerHandle(ctx, o, opNum, r)
}
}
func FolderActionCollectionServerHandle(ctx context.Context, o FolderActionCollectionServer, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
if opNum < 7 {
// IDispatch base method.
return idispatch.DispatchServerHandle(ctx, o, opNum, r)
}
switch opNum {
case 7: // Count
in := &GetCountRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetCount(ctx, in)
return resp.xxx_ToOp(ctx), err
case 8: // Item
in := &GetItemRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetItem(ctx, in)
return resp.xxx_ToOp(ctx), err
case 9: // _NewEnum
in := &Get_NewEnumRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.Get_NewEnum(ctx, in)
return resp.xxx_ToOp(ctx), err
case 10: // Add
in := &AddRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.Add(ctx, in)
return resp.xxx_ToOp(ctx), err
case 11: // Remove
in := &RemoveRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.Remove(ctx, in)
return resp.xxx_ToOp(ctx), err
case 12: // Clear
in := &ClearRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.Clear(ctx, in)
return resp.xxx_ToOp(ctx), err
case 13: // AddRange
in := &AddRangeRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.AddRange(ctx, in)
return resp.xxx_ToOp(ctx), err
case 14: // CreateFolderAction
in := &CreateFolderActionRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.CreateFolderAction(ctx, in)
return resp.xxx_ToOp(ctx), err
}
return nil, nil
}