-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.go
128 lines (115 loc) · 4.85 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
package ifsrmpropertydefinition2
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"
ifsrmpropertydefinition "github.com/oiweiwei/go-msrpc/msrpc/dcom/fsrm/ifsrmpropertydefinition/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)
_ = ifsrmpropertydefinition.GoPackage
)
// IFsrmPropertyDefinition2 server interface.
type PropertyDefinition2Server interface {
// IFsrmPropertyDefinition base class.
ifsrmpropertydefinition.PropertyDefinitionServer
// The PropertyDefinitionFlags (get) method returns the Property Definition.Global,
// Property Definition.Secure, and Property Definition.Deprecated values for the object.
//
// Return Values: The method MUST return zero on success, or a nonzero error code on
// failure.
//
// +-------------------------+------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-------------------------+------------------------------------------------+
// +-------------------------+------------------------------------------------+
// | 0x80070057 E_INVALIDARG | The propertyDefinitionFlags parameter is NULL. |
// +-------------------------+------------------------------------------------+
GetPropertyDefinitionFlags(context.Context, *GetPropertyDefinitionFlagsRequest) (*GetPropertyDefinitionFlagsResponse, error)
// DisplayName operation.
GetDisplayName(context.Context, *GetDisplayNameRequest) (*GetDisplayNameResponse, error)
// DisplayName operation.
SetDisplayName(context.Context, *SetDisplayNameRequest) (*SetDisplayNameResponse, error)
// AppliesTo operation.
GetAppliesTo(context.Context, *GetAppliesToRequest) (*GetAppliesToResponse, error)
// The ValueDefinitions (get) method returns the property definitions Possible Values.
//
// Return Values: The method MUST return zero on success, or a nonzero error code on
// failure.
//
// +-------------------------+-----------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +-------------------------+-----------------------------------------+
// +-------------------------+-----------------------------------------+
// | 0x80070057 E_INVALIDARG | The valueDefinitions parameter is NULL. |
// +-------------------------+-----------------------------------------+
GetValueDefinitions(context.Context, *GetValueDefinitionsRequest) (*GetValueDefinitionsResponse, error)
}
func RegisterPropertyDefinition2Server(conn dcerpc.Conn, o PropertyDefinition2Server, opts ...dcerpc.Option) {
conn.RegisterServer(NewPropertyDefinition2ServerHandle(o), append(opts, dcerpc.WithAbstractSyntax(PropertyDefinition2SyntaxV0_0))...)
}
func NewPropertyDefinition2ServerHandle(o PropertyDefinition2Server) dcerpc.ServerHandle {
return func(ctx context.Context, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
return PropertyDefinition2ServerHandle(ctx, o, opNum, r)
}
}
func PropertyDefinition2ServerHandle(ctx context.Context, o PropertyDefinition2Server, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
if opNum < 22 {
// IFsrmPropertyDefinition base method.
return ifsrmpropertydefinition.PropertyDefinitionServerHandle(ctx, o, opNum, r)
}
switch opNum {
case 22: // PropertyDefinitionFlags
in := &GetPropertyDefinitionFlagsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetPropertyDefinitionFlags(ctx, in)
return resp.xxx_ToOp(ctx), err
case 23: // DisplayName
in := &GetDisplayNameRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetDisplayName(ctx, in)
return resp.xxx_ToOp(ctx), err
case 24: // DisplayName
in := &SetDisplayNameRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.SetDisplayName(ctx, in)
return resp.xxx_ToOp(ctx), err
case 25: // AppliesTo
in := &GetAppliesToRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetAppliesTo(ctx, in)
return resp.xxx_ToOp(ctx), err
case 26: // ValueDefinitions
in := &GetValueDefinitionsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetValueDefinitions(ctx, in)
return resp.xxx_ToOp(ctx), err
}
return nil, nil
}