forked from microsoft/wmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththisNAMESPACE.go
81 lines (69 loc) · 1.94 KB
/
thisNAMESPACE.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
// Copyright 2019 (c) Microsoft Corporation.
// Licensed under the MIT license.
//
// Author:
// Auto Generated on 9/18/2020 using wmigen
// Source root.msdtc
//////////////////////////////////////////////
package msdtc
import (
"github.com/microsoft/wmi/pkg/base/query"
"github.com/microsoft/wmi/pkg/errors"
cim "github.com/microsoft/wmi/pkg/wmiinstance"
"reflect"
)
// __thisNAMESPACE struct
type __thisNAMESPACE struct {
*__SystemClass
//
SECURITY_DESCRIPTOR []uint8
}
func New__thisNAMESPACEEx1(instance *cim.WmiInstance) (newInstance *__thisNAMESPACE, err error) {
tmp, err := New__SystemClassEx1(instance)
if err != nil {
return
}
newInstance = &__thisNAMESPACE{
__SystemClass: tmp,
}
return
}
func New__thisNAMESPACEEx6(hostName string,
wmiNamespace string,
userName string,
password string,
domainName string,
query *query.WmiQuery) (newInstance *__thisNAMESPACE, err error) {
tmp, err := New__SystemClassEx6(hostName, wmiNamespace, userName, password, domainName, query)
if err != nil {
return
}
newInstance = &__thisNAMESPACE{
__SystemClass: tmp,
}
return
}
// SetSECURITY_DESCRIPTOR sets the value of SECURITY_DESCRIPTOR for the instance
func (instance *__thisNAMESPACE) SetPropertySECURITY_DESCRIPTOR(value []uint8) (err error) {
return instance.SetProperty("SECURITY_DESCRIPTOR", (value))
}
// GetSECURITY_DESCRIPTOR gets the value of SECURITY_DESCRIPTOR for the instance
func (instance *__thisNAMESPACE) GetPropertySECURITY_DESCRIPTOR() (value []uint8, err error) {
retValue, err := instance.GetProperty("SECURITY_DESCRIPTOR")
if err != nil {
return
}
if retValue == nil {
// Doesn't have any value. Return empty
return
}
for _, interfaceValue := range retValue.([]interface{}) {
valuetmp, ok := interfaceValue.(uint8)
if !ok {
err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue))
return
}
value = append(value, uint8(valuetmp))
}
return
}