-
Notifications
You must be signed in to change notification settings - Fork 2
/
server.go
105 lines (96 loc) · 5.33 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
package imsadminbase3w
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"
imsadminbase2w "github.com/oiweiwei/go-msrpc/msrpc/dcom/imsa/imsadminbase2w/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)
_ = imsadminbase2w.GoPackage
)
// IMSAdminBase3W server interface.
type IMSAdminBase3WServer interface {
// IMSAdminBase2W base class.
imsadminbase2w.IMSAdminBase2WServer
// The GetChildPaths method returns all child nodes of a specified path from a supplied
// metadata handle.
//
// Return Values: A signed 32-bit value that indicates return status. If the method
// returns a negative value, it failed. If the 12-bit facility code (bits 16–27) is
// set to 0x007, the value contains a Win32 error code in the lower 16 bits. Zero or
// positive values indicate success, with the lower 16 bits in positive nonzero values
// containing warnings or flags defined in the method implementation. For more information
// about Win32 error codes and HRESULT values, see [MS-ERREF].
//
// +--------------------------------------+----------------------------------------------------------+
// | RETURN | |
// | VALUE/CODE | DESCRIPTION |
// | | |
// +--------------------------------------+----------------------------------------------------------+
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070000 S_OK | The call was successful. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070003 ERROR_PATH_NOT_FOUND | The system cannot find the path specified. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070057 E_INVALIDARG | One or more arguments are invalid. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070005 ERROR_ACCESS_DENIED | Access is denied. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070008 ERROR_NOT_ENOUGH_MEMORY | Not enough storage is available to process this command. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x8007000E E_OUTOFMEMORY | There was not enough memory to complete the method call. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x8007007A ERROR_INSUFFICIENT_BUFFER | The data area passed to a system call is too small. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x800700A0 ERROR_BAD_ARGUMENTS | One or more arguments are not correct. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80004005 E_FAIL | An unspecified error occurred. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x80070006 E_HANDLE | An invalid handle was passed. |
// +--------------------------------------+----------------------------------------------------------+
// | 0x800CC800 MD_ERROR_NOT_INITIALIZED | Metadata has not been initialized. |
// +--------------------------------------+----------------------------------------------------------+
//
// Exceptions Thrown: No exceptions are thrown beyond those thrown by the underlying
// RPC protocol [MS-RPCE].
//
// The opnum field value for this method is 40.
GetChildPaths(context.Context, *GetChildPathsRequest) (*GetChildPathsResponse, error)
}
func RegisterIMSAdminBase3WServer(conn dcerpc.Conn, o IMSAdminBase3WServer, opts ...dcerpc.Option) {
conn.RegisterServer(NewIMSAdminBase3WServerHandle(o), append(opts, dcerpc.WithAbstractSyntax(IMSAdminBase3WSyntaxV0_0))...)
}
func NewIMSAdminBase3WServerHandle(o IMSAdminBase3WServer) dcerpc.ServerHandle {
return func(ctx context.Context, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
return IMSAdminBase3WServerHandle(ctx, o, opNum, r)
}
}
func IMSAdminBase3WServerHandle(ctx context.Context, o IMSAdminBase3WServer, opNum int, r ndr.Reader) (dcerpc.Operation, error) {
if opNum < 40 {
// IMSAdminBase2W base method.
return imsadminbase2w.IMSAdminBase2WServerHandle(ctx, o, opNum, r)
}
switch opNum {
case 40: // GetChildPaths
in := &GetChildPathsRequest{}
if err := in.UnmarshalNDR(ctx, r); err != nil {
return nil, err
}
resp, err := o.GetChildPaths(ctx, in)
return resp.xxx_ToOp(ctx), err
}
return nil, nil
}