Documentation ¶
Index ¶
- Constants
- Variables
- func FromUnicode(buf []byte) ([]byte, error)
- func FromUnicodeString(buf []byte) (res string, err error)
- func ToUnicode(input string) []byte
- type BindReq
- type BindRes
- type ContextItem
- type ContextList
- type ContextResItem
- type ContextResList
- type Header
- type NetServerGetInfoRequest
- type NetServerGetInfoResponse
- type NetServerInfo
- type NetServerInfo100
- type NetServerInfo101
- type NetServerInfo102
- type NetSessionEnumRequest
- type NetSessionEnumResponse
- type NetSessionInfo0
- type NetSessionInfo1
- type NetSessionInfo10
- type NetSessionInfo2
- type NetSessionInfo502
- type NetShare
- type NetShareEnum
- type NetShareEnumAllRequest
- type NetShareEnumAllResponse
- type QueryServiceConfigW
- type RChangeServiceConfigWReq
- type RChangeServiceConfigWRes
- type RCloseServiceHandleReq
- type RCloseServiceHandleRes
- type RControlServiceReq
- type RControlServiceRes
- type RCreateServiceWReq
- type RCreateServiceWRes
- type RDeleteServiceReq
- type ROpenSCManagerWReq
- type ROpenSCManagerWRes
- type ROpenServiceWReq
- type ROpenServiceWRes
- type RQueryServiceConfigWReq
- type RQueryServiceConfigWRes
- type RQueryServiceStatusReq
- type RQueryServiceStatusRes
- type RStartServiceWReq
- type RequestReq
- type RequestRes
- type ResumeHandle
- type ServiceBind
- func (sb *ServiceBind) ChangeServiceConfig(serviceName string, serviceType, startType, errorControl uint32, ...) (err error)
- func (sb *ServiceBind) CloseServiceHandle(serviceHandle []byte)
- func (sb *ServiceBind) ControlService(serviceName string, control uint32) (err error)
- func (sb *ServiceBind) CreateService(serviceName string, serviceType, startType, errorControl uint32, ...) (err error)
- func (sb *ServiceBind) DeleteService(serviceName string) (err error)
- func (sb *ServiceBind) GetServiceConfig(serviceName string) (config ServiceConfig, err error)
- func (sb *ServiceBind) GetServiceStatus(serviceName string) (status uint32, err error)
- func (sb *ServiceBind) MakeIoCtlRequest(opcode uint16, innerBuf []byte) (result []byte, err error)
- func (sb *ServiceBind) NetServerGetInfo(host string, level int) (res *NetServerInfo, err error)
- func (sb *ServiceBind) NetSessionEnum(clientName, username string, level int) (res *SessionEnum, err error)
- func (sb *ServiceBind) NetShareEnumAll(host string) (res []NetShare, err error)
- func (sb *ServiceBind) StartService(serviceName string, args []string) (err error)
- type ServiceConfig
- type ServiceStatus
- type SessionEnum
- type SessionInfoContainer0
- type SessionInfoContainer1
- type SessionInfoContainer10
- type SessionInfoContainer2
- type SessionInfoContainer502
- type ShareInfo1
- type ShareInfoContainer1
- type SyntaxId
Constants ¶
const ( PacketTypeRequest uint8 = 0 PacketTypeResponse uint8 = 2 PacketTypeBind uint8 = 11 PacketTypeBindAck uint8 = 12 )
MSRPC Packet Types
const ( PfcFirstFrag uint8 = 0x1 PfcLastFrag uint8 = 0x2 PfcPendingCancel uint8 = 0x4 // Cancel was pending at sender PfcReserved uint8 = 0x8 PfcConcMpx uint8 = 0x10 // Support concurrent multiplexing of a single connection PfcDidNotExecute uint8 = 0x20 PfcMaybe uint8 = 0x40 PfcObjectUUID uint8 = 0x80 )
C706 Section 12.6.3.1 PFC Flags
const ( MSRPCSvcCtlPipe = "svcctl" MSRPCUuidSvcCtl = "367ABB81-9844-35F1-AD32-98F038001003" MSRPCSvcCtlMajorVersion uint16 = 2 MSRPCSvcCtlMinorVersion uint16 = 0 )
const ( SvcCtlRCloseServiceHandle uint16 = 0 SvcCtlRControlService uint16 = 1 SvcCtlRDeleteService uint16 = 2 SvcCtlRQueryServiceStatus uint16 = 6 SvcCtlRChangeServiceConfigW uint16 = 11 SvcCtlRCreateServiceW uint16 = 12 SvcCtlROpenSCManagerW uint16 = 15 SvcCtlROpenServiceW uint16 = 16 SvcCtlRQueryServiceConfigW uint16 = 17 SvcCtlRStartServiceW uint16 = 19 )
MS-SCMR Operations OP Codes
const ( ServiceKernelDriver uint32 = 0x00000001 ServiceFileSystemDriver uint32 = 0x00000002 ServiceWin32OwnProcess uint32 = 0x00000010 ServiceInteractiveProcess uint32 = 0x00000100 )
MS-SCMR (svcctl) Section 2.2.15 ServiceType merged with Section 2.2.47 dwServiceType
const ( ServiceBootStart uint32 = 0x00000000 ServiceSystemStart uint32 = 0x00000001 ServiceAutoStart uint32 = 0x00000002 ServiceDemandStart uint32 = 0x00000003 ServiceDisabled uint32 = 0x00000004 )
MS-SCMR (svcctl) Table 2.2.15 StartType
const ( ServiceErrorIgnore uint32 = 0x00000000 ServiceErrorNormal uint32 = 0x00000001 ServiceErrorSevere uint32 = 0x00000002 ServiceErrorCritical uint32 = 0x00000003 )
MS-SCMR (svcctl) Table 2.2.15 ErrorControl
const ( ServiceAllAccess uint32 = 0x000F01FF //In addition to all access rights in this table, SERVICE_ALL_ACCESS includes Delete (DE), Read Control (RC), Write DACL (WD), and Write Owner (WO) access, as specified in ACCESS_MASK (section 2.4.3) of [MS-DTYP]. ServiceChangeConfig uint32 = 0x00000002 //Required to change the configuration of a service. ServiceEnumerateDependents uint32 = 0x00000008 //Required to enumerate the services installed on the server. ServiceInterrogate uint32 = 0x00000080 //Required to request immediate status from the service. ServicePauseContinue uint32 = 0x00000040 //Required to pause or continue the service. ServiceQueryConfig uint32 = 0x00000001 //Required to query the service configuration. ServiceQueryStatus uint32 = 0x00000004 //Required to request the service status. ServiceStart uint32 = 0x00000010 //Required to start the service. ServiceStop uint32 = 0x00000020 //Required to stop the service ServiceUserDefinedControl uint32 = 0x00000100 //Required to specify a user-defined control code. ServiceSetStatus uint32 = 0x00008000 //Required for a service to set its status. SCManagerLock uint32 = 0x00000008 //Required to lock the SCM database. SCManagerCreateService uint32 = 0x00000002 //Required for a service to be created. SCManagerEnumerateService uint32 = 0x00000004 //Required to enumerate a service. SCManagerConnect uint32 = 0x00000001 //Required to connect to the SCM. SCManagerQueryLockStatus uint32 = 0x00000010 //Required to query the lock status of the SCM database. SCManagerModifyBootConfig uint32 = 0x0020 //Required to call the RNotifyBootConfigStatus method. )
MS-SCMR (svcctl) Table 3.1.4
const ( ServiceContinuePending uint32 = 0x00000005 ServicePausePending uint32 = 0x00000006 ServicePaused uint32 = 0x00000007 ServiceRunning uint32 = 0x00000004 ServiceStartPending uint32 = 0x00000002 ServiceStopPending uint32 = 0x00000003 ServiceStopped uint32 = 0x00000001 )
MS-SCMR Section 2.2.47 dwCurrentState
const ( ServiceControlContinue uint32 = 0x00000003 ServiceControlInterrogate uint32 = 0x00000004 ServiceControlNetbindadd uint32 = 0x00000007 ServiceControlNetbinddisable uint32 = 0x0000000A ServiceControlNetbindenable uint32 = 0x00000009 ServiceControlNetbindremove uint32 = 0x00000008 ServiceControlParamChange uint32 = 0x00000006 ServiceControlPause uint32 = 0x00000002 ServiceControlStop uint32 = 0x00000001 )
MS-SCMR Section 3.1.4.2 dwControl
const ( ErrorSuccess uint32 = 0 // Successfully started the service ErrorFileNotFound uint32 = 2 // The system cannot find the file specified. ErrorPathNotFound uint32 = 3 // The system cannot find the path specified. ErrorAccessDenied uint32 = 5 // The SERVICE_START access right had not been granted to the caller when the RPC context handle to the service record was created. ErrorInvalidHandle uint32 = 6 // The handle is no longer valid. ErrorInvalidParameter uint32 = 87 // A parameter that was specified is invalid. ErrorInsufficientBuffer uint32 = 122 ErrorDependentServicesRunning uint32 = 1051 ErrorInvalidServiceControl uint32 = 1052 ErrorServiceRequestTimeout uint32 = 1053 // The process for the service was started, but it did not respond within an implementation-specific time-out. ErrorServiceNoThread uint32 = 1054 // A thread could not be created for the service. ErrorServiceDatabaseLocked uint32 = 1055 // The service database is locked by the call to the BlockServiceDatabase method. ErrorServiceAlreadyRunning uint32 = 1056 // The ServiceStatus.dwCurrentState in the service record is not set to SERVICE_STOPPED. ErrorInvalidServiceAccount uint32 = 1057 // The user account name specified in the lpServiceStartName parameter does not exist. ErrorServiceDisabled uint32 = 1058 // The service cannot be started because the Start field in the service record is set to SERVICE_DISABLED. ErrorCircularDependency uint32 = 1059 // A circular dependency was specified. ErrorServiceDoesNotExist uint32 = 1060 // The service record with a specified display name does not exist in the SCM database ErrorServiceCannotAcceptControl uint32 = 1061 ErrorServiceNotActive uint32 = 1062 ErrorServiceDependencyFail uint32 = 1068 // The specified service depends on another service that has failed to start. ErrorServiceLogonFailed uint32 = 1069 // The service did not start due to a logon failure. ErrorServiceMarkedForDelete uint32 = 1072 // The RDeleteService method has been called for the service record identified by the hService parameter. ErrorServiceDependencyDeleted uint32 = 1075 // The specified service depends on a service that does not exist or has been marked for deletion. ErrorDuplicateServiceName uint32 = 1078 // The lpDisplayName matches either the ServiceName or the DisplayName of another service record in the service control manager database. ErrorShutdownInProgress uint32 = 1115 // The system is shutting down. )
MS-SCMR Response codes from multiple sections: 3.1.4.2, 3.1.4.11, 3.1.4.17, 3.1.4.19
const ( MSRPCUuidSrvSvc = "4B324FC8-1670-01D3-1278-5A47BF6EE188" MSRPCSrvSvcPipe = "srvsvc" MSRPCSrvSvcMajorVersion uint16 = 3 MSRPCSrvSvcMinorVersion uint16 = 0 )
const ( SrvSvcOpNetrSessionEnum uint16 = 12 SrvSvcOpNetServerGetInfo uint16 = 21 )
MSRPC Server Service (srvsvc) Operations
const ( StypeDisktree uint32 = 0x00000000 // Disk drive StypePrintq uint32 = 0x00000001 // Print queue StypeDevice uint32 = 0x00000002 // Communication device StypeIPC uint32 = 0x00000003 // Interprocess communication (IPC) StypeClusterFS uint32 = 0x02000000 // A cluster share StypeClusterSOFS uint32 = 0x04000000 // A Scale-Out cluster share StypeClusterDFS uint32 = 0x08000000 // A DFS share in a cluster StypeSpecial uint32 = 0x80000000 // Special share reserved for interprocess communication (IPC$) or remote administration of the server (ADMIN$). Can also refer to administrative shares such as C$, D$, E$, and so forth. StypeTemporary uint32 = 0x40000000 // A temporary share that is not persisted for creation each time the file server initializes. )
const ( SRVSErrorFileNotFound uint32 = 2 SRVSErrorAccessDenied uint32 = 5 SRVSErrorNotSupported uint32 = 50 SRVSErrorDupName uint32 = 52 SRVSErrorInvalidParameter uint32 = 87 SRVSErrorInvalidLevel uint32 = 124 SRVSErrorMoreData uint32 = 234 SRVSErrorServiceDoesNotExist uint32 = 1060 SRVSErrorInvalidDomainName uint32 = 1212 SRVSNERRUnknownDevDir uint32 = 2116 SRVSNERRRedirectedPath uint32 = 2117 SRVSNERRBufTooSmall uint32 = 2123 SRVSNERRUserNotFound uint32 = 2221 SRVSNERRNetNameNotFound uint32 = 2310 SRVSNERRClientNameNotFound uint32 = 2312 SRVSNERRInvalidComputer uint32 = 2351 )
MS-SRVS Response codes from 2.2.2.10 Common Error Codes
const (
ServiceNoChange uint32 = 0xffffffff
)
MS-SCMR Section 3.1.4.11 RChangeServiceConfigW
Variables ¶
var ErrorControlStatusMap = map[uint32]string{ ServiceErrorIgnore: "SERVICE_ERROR_IGNORE", ServiceErrorNormal: "SERVICE_ERROR_NORMAL", ServiceErrorSevere: "SERIVCE_ERROR_SEVERE", ServiceErrorCritical: "SERVICE_ERROR_CRITICAL", }
var (
MSRPCUuidNdr = "8a885d04-1ceb-11c9-9fe8-08002b104860" // NDR Transfer Syntax version 2.0
)
var SRVSResponseCodeMap = map[uint32]error{ SRVSErrorFileNotFound: fmt.Errorf("The system cannot find the file specified"), SRVSErrorAccessDenied: fmt.Errorf("The user does not have access to the requested information"), SRVSErrorNotSupported: fmt.Errorf("The server does not support branch cache"), SRVSErrorDupName: fmt.Errorf("A duplicate name exists on the network"), SRVSErrorInvalidParameter: fmt.Errorf("One or more of the specified parameters is invalid"), SRVSErrorInvalidLevel: fmt.Errorf("The value that is specified for the level parameter is invalid"), SRVSErrorMoreData: fmt.Errorf("More entries are available. Specify a large enough buffer to receive all entries"), SRVSErrorServiceDoesNotExist: fmt.Errorf("The branch cache component does not exist as an installed service"), SRVSErrorInvalidDomainName: fmt.Errorf("The format of the specified NetBIOS name of a domain is invalid"), SRVSNERRUnknownDevDir: fmt.Errorf("The device or directory does not exist"), SRVSNERRRedirectedPath: fmt.Errorf("The operation is not valid for a redirected resource. The specified device name is assigned to a shared resource"), SRVSNERRDuplicateShare: fmt.Errorf("The share name is already in use on this server"), SRVSNERRBufTooSmall: fmt.Errorf("The client request succeeded. More entries are available. The buffer size that is specified by PreferedMaximumLength was too small to fit even a single entry"), SRVSNERRUserNotFound: fmt.Errorf("The user name could not be found"), SRVSNERRNetNameNotFound: fmt.Errorf("The share name does not exist"), SRVSNERRDeviceNotShared: fmt.Errorf("The device is not shared"), SRVSNERRClientNameNotFound: fmt.Errorf("A session does not exist with the computer name"), SRVSNERRInvalidComputer: fmt.Errorf("The computer name is not valid"), }
var ServiceResponseCodeMap = map[uint32]error{ ErrorSuccess: fmt.Errorf("Successfully started the service"), ErrorFileNotFound: fmt.Errorf("The system cannot find the file specified."), ErrorPathNotFound: fmt.Errorf("The system cannot find the path specified."), ErrorAccessDenied: fmt.Errorf("ERROR_ACCESS_DENIED"), ErrorInvalidHandle: fmt.Errorf("The handle is no longer valid."), ErrorInvalidParameter: fmt.Errorf("A parameter that was specified is invalid."), ErrorInsufficientBuffer: fmt.Errorf("ERROR_INSUFFICIENT_BUFFER"), ErrorDependentServicesRunning: fmt.Errorf("ERROR_DEPENDENT_SERVICES_RUNNING"), ErrorInvalidServiceControl: fmt.Errorf("ERROR_INVALID_SERVICE_CONTROL"), ErrorServiceRequestTimeout: fmt.Errorf("Error service request timeout"), ErrorServiceNoThread: fmt.Errorf("A thread could not be created for the service."), ErrorServiceDatabaseLocked: fmt.Errorf("The service database is locked by the call to the BlockServiceDatabase method."), ErrorServiceAlreadyRunning: fmt.Errorf("Service already running!"), ErrorInvalidServiceAccount: fmt.Errorf("ERROR_INVALID_SERVICE_ACCOUNT"), ErrorServiceDisabled: fmt.Errorf("ERROR_SERVICE_DISABLED"), ErrorCircularDependency: fmt.Errorf("ERROR_CIRCULAR_DEPENDENCY"), ErrorServiceDoesNotExist: fmt.Errorf("ERROR_SERVICE_DOES_NOT_EXIST"), ErrorServiceCannotAcceptControl: fmt.Errorf("ERROR_SERVICE_CANNOT_ACCEPT_CONTROL"), ErrorServiceNotActive: fmt.Errorf("ERROR_SERVICE_NOT_ACTIVE"), ErrorServiceDependencyFail: fmt.Errorf("The specified service depends on another service that has failed to start."), ErrorServiceLogonFailed: fmt.Errorf("The service did not start due to a logon failure."), ErrorServiceMarkedForDelete: fmt.Errorf("Service marked for delete."), ErrorServiceDependencyDeleted: fmt.Errorf("The specified service depends on a service that does not exist or has been marked for deletion."), ErrorDuplicateServiceName: fmt.Errorf("ERROR_DUPLICATE_SERVICE_NAME"), ErrorShutdownInProgress: fmt.Errorf("The system is shutting down."), }
var ServiceStatusMap = map[uint32]string{ ServiceContinuePending: "SERVICE_CONTINUE_PENDING", ServicePausePending: "SERVICE_PAUSE_PENDING", ServicePaused: "SERVICE_PAUSED", ServiceRunning: "SERVICE_RUNNING", ServiceStartPending: "SERVICE_START_PENDING", ServiceStopPending: "SERVICE_STOP_PENDING", ServiceStopped: "SERVICE_STOPPED", }
var ServiceTypeStatusMap = map[uint32]string{ ServiceKernelDriver: "SERVICE_KERNEL_DRIVER", ServiceFileSystemDriver: "SERVICE_FILE_SYSTEM_DRIVER", ServiceWin32OwnProcess: "SERIVCE_WIN32_OWN_PROCESS", ServiceWin32ShareProcess: "SERVICE_WIN32_SHARE_PROCESS", ServiceInteractiveProcess: "SERVICE_INTERACTIVE_PROCESS", }
StypeDisktree: "Disk Drive", StypePrintq: "Print Queue", StypeDevice: "Communication Device", StypeIPC: "IPC", StypeClusterFS: "Cluster Share", StypeClusterSOFS: "Scale-Out cluster share", StypeClusterDFS: "DFS Share in cluster", StypeSpecial: "Hidden", StypeTemporary: "Temp", }
var StartTypeStatusMap = map[uint32]string{ ServiceBootStart: "SERVICE_BOOT_START", ServiceSystemStart: "SERVICE_SYSTEM_START", ServiceAutoStart: "SERIVCE_AUTO_START", ServiceDemandStart: "SERVICE_DEMAND_START", ServiceDisabled: "SERVICE_DISABLED", }
Functions ¶
func FromUnicode ¶
func FromUnicodeString ¶
Types ¶
type BindReq ¶
type BindReq struct { Header // 16 Bytes MaxSendFragSize uint16 MaxRecvFragSize uint16 Association uint32 // A value of 0 means a request for a new Association group ContextList ContextList // p_cont_list_t }
C706 Section 12.6.4.3
func (*BindReq) MarshalBinary ¶
func (*BindReq) UnmarshalBinary ¶
type BindRes ¶
type BindRes struct { Header // 16 Bytes MaxSendFragSize uint16 MaxRecvFragSize uint16 Association uint32 SecAddrLen uint16 SecAddr []byte ResultList ContextResList }
C706 Section 12.6.4.4 (bind_ack)
func (*BindRes) MarshalBinary ¶
func (*BindRes) UnmarshalBinary ¶
type ContextItem ¶
type ContextItem struct { Id uint16 Count byte // Determined by number of items in TransferSyntax list Reserved byte // Alignment AbstractSyntax SyntaxId TransferSyntax []SyntaxId }
C706 Section 12.6.3.1
typedef struct { p_context_id_t p_cont_id; u_int8 n_transfer_syn; // number of items u_int8 reserved; // alignment pad, m.b.z. p_syntax_id_t abstract_syntax; // transfer syntax list p_syntax_id_t [size_is(n_transfer_syn)] transfer_syntaxes[]; } p_cont_elem_t;
func (*ContextItem) MarshalBinary ¶
func (self *ContextItem) MarshalBinary() (ret []byte, err error)
func (*ContextItem) UnmarshalBinary ¶
func (self *ContextItem) UnmarshalBinary(buf []byte) (err error)
type ContextList ¶
type ContextList struct { Count byte Reserved byte // Alignment Reserved2 uint16 // Alignment Items []ContextItem }
C706 Section 12.6.3.1
typedef struct { u_int8 n_context_elem; // number of items u_int8 reserved; // alignment pad, m.b.z. u_short reserved2; // alignment pad, m.b.z. p_cont_elem_t [size_is(n_cont_elem)] p_cont_elem[]; } p_cont_list_t;
func (*ContextList) MarshalBinary ¶
func (self *ContextList) MarshalBinary() (ret []byte, err error)
func (*ContextList) UnmarshalBinary ¶
func (self *ContextList) UnmarshalBinary(buf []byte) (err error)
type ContextResItem ¶
type ContextResItem struct { Result resultType Reason providerReason TransferSyntax SyntaxId }
C706 12.6.3.1
typedef struct { p_cont_def_result_t result; p_provider_reason_t reason; // only relevant if result != acceptance p_syntax_id_t transfer_syntax; // tr syntax selected 0 if result not accepted } p_result_t;
type ContextResList ¶
type ContextResList struct { Results byte // Count of ContextResItem list Reserved byte // Alignment Reserved2 uint16 // Alignment Items []ContextResItem }
C706 12.6.3.1
typedef struct { u_int8 n_results; // count u_int8 reserved; // alignment pad, m.b.z. u_int16 reserved2; // alignment pad, m.b.z. p_result_t [size_is(n_results)] p_results[]; } p_result_list_t;
func (*ContextResList) UnmarshalBinary ¶
func (self *ContextResList) UnmarshalBinary(buf []byte) (err error)
type Header ¶
type Header struct { MajorVersion byte // rpc_vers MinorVersion byte // rpc_vers_minor Type byte Flags byte Representation uint32 // NDR data representation FragLength uint16 AuthLength uint16 CallId uint32 }
Defined in C706 (DCE 1.1: Remote Procedure Call) section 12.6.3.1 as "common fields"
func (*Header) MarshalBinary ¶
func (*Header) UnmarshalBinary ¶
type NetServerGetInfoRequest ¶
NET_API_STATUS NetrServerGetInfo ( [in,string,unique] SRVSVC_HANDLE ServerName, [in] DWORD Level, [out, switch_is(Level)] LPSERVER_INFO InfoStruct );
func NewNetServerGetInfoRequest ¶
func NewNetServerGetInfoRequest(serverName string, level int) *NetServerGetInfoRequest
func (*NetServerGetInfoRequest) MarshalBinary ¶
func (self *NetServerGetInfoRequest) MarshalBinary() ([]byte, error)
func (*NetServerGetInfoRequest) UnmarshalBinary ¶
func (self *NetServerGetInfoRequest) UnmarshalBinary(buf []byte) error
type NetServerGetInfoResponse ¶
type NetServerGetInfoResponse struct { Info *NetServerInfo WindowsError uint32 }
func (*NetServerGetInfoResponse) MarshalBinary ¶
func (self *NetServerGetInfoResponse) MarshalBinary() ([]byte, error)
func (*NetServerGetInfoResponse) UnmarshalBinary ¶
func (self *NetServerGetInfoResponse) UnmarshalBinary(buf []byte) (err error)
type NetServerInfo ¶
type NetServerInfo struct { Level uint32 Pointer interface{} }
type NetServerInfo100 ¶
type NetServerInfo101 ¶
type NetServerInfo101 struct { NetServerInfo100 VersionMajor uint32 VersionMinor uint32 SvType uint32 Comment string }
type NetServerInfo102 ¶
type NetSessionEnumRequest ¶
type NetSessionEnumRequest struct { ServerName string ClientName string UserName string Info SessionEnum PreferredMaxLength uint32 ResumeHandle uint32 // Ptr to dword }
NET_API_STATUS NetrSessionEnum ( [in,string,unique] SRVSVC_HANDLE ServerName, [in,string,unique] WCHAR * ClientName, [in,string,unique] WCHAR * UserName, [in,out] PSESSION_ENUM_STRUCT InfoStruct, [in] DWORD PreferedMaximumLength, [out] DWORD * TotalEntries, [in,out,unique] DWORD * ResumeHandle );
func NewNetSessionEnumRequest ¶
func NewNetSessionEnumRequest(clientName, userName string, level uint32) *NetSessionEnumRequest
func (*NetSessionEnumRequest) MarshalBinary ¶
func (self *NetSessionEnumRequest) MarshalBinary() (res []byte, err error)
func (*NetSessionEnumRequest) UnmarshalBinary ¶
func (self *NetSessionEnumRequest) UnmarshalBinary(buf []byte) error
type NetSessionEnumResponse ¶
type NetSessionEnumResponse struct { Info SessionEnum TotalEntries uint32 // Ptr to dword ResumeHandle uint32 // Ptr to dword WindowsError uint32 }
func (*NetSessionEnumResponse) MarshalBinary ¶
func (self *NetSessionEnumResponse) MarshalBinary() ([]byte, error)
func (*NetSessionEnumResponse) UnmarshalBinary ¶
func (self *NetSessionEnumResponse) UnmarshalBinary(buf []byte) (err error)
type NetSessionInfo0 ¶
type NetSessionInfo0 struct {
Cname string
}
Could this be done in a better way? Perhaps with an interface?
type NetSessionInfo1 ¶
type NetSessionInfo10 ¶
type NetSessionInfo10 struct { NetSessionInfo0 Username string Time uint32 IdleTime uint32 }
type NetSessionInfo2 ¶
type NetSessionInfo2 struct { NetSessionInfo1 ClType string }
type NetSessionInfo502 ¶
type NetSessionInfo502 struct { NetSessionInfo2 Transport string }
type NetShareEnum ¶
type NetShareEnum struct {}
typedef struct _SHARE_ENUM_STRUCT { DWORD Level; [switch_is(Level)] SHARE_ENUM_UNION ShareInfo; } SHARE_ENUM_STRUCT,
*PSHARE_ENUM_STRUCT, *LPSHARE_ENUM_STRUCT;
type NetShareEnumAllRequest ¶
type NetShareEnumAllRequest struct {}
func NewNetShareEnumAllRequest ¶
func NewNetShareEnumAllRequest(serverName string) *NetShareEnumAllRequest
func (*NetShareEnumAllRequest) MarshalBinary ¶
func (self *NetShareEnumAllRequest) MarshalBinary() (ret []byte, err error)
func (*NetShareEnumAllRequest) UnmarshalBinary ¶
func (s *NetShareEnumAllRequest) UnmarshalBinary(buf []byte) error
type NetShareEnumAllResponse ¶
type NetShareEnumAllResponse struct {}
func (*NetShareEnumAllResponse) MarshalBinary ¶
func (s *NetShareEnumAllResponse) MarshalBinary() ([]byte, error)
func (*NetShareEnumAllResponse) UnmarshalBinary ¶
func (self *NetShareEnumAllResponse) UnmarshalBinary(buf []byte) (err error)
type QueryServiceConfigW ¶
type QueryServiceConfigW struct { ServiceType uint32 StartType uint32 ErrorControl uint32 BinaryPathName string LoadOrderGroup string TagId uint32 Dependencies string // Array? ServiceStartName string DisplayName string }
MS-SCMR Section 2.2.15
typedef struct _QUERY_SERVICE_CONFIGW { DWORD dwServiceType; DWORD dwStartType; DWORD dwErrorControl; [string,range(0, 8 * 1024)] LPWSTR lpBinaryPathName; [string,range(0, 8 * 1024)] LPWSTR lpLoadOrderGroup; DWORD dwTagId; [string,range(0, 8 * 1024)] LPWSTR lpDependencies; [string,range(0, 8 * 1024)] LPWSTR lpServiceStartName; [string,range(0, 8 * 1024)] LPWSTR lpDisplayName; } QUERY_SERVICE_CONFIGW, *LPQUERY_SERVICE_CONFIGW;
type RChangeServiceConfigWReq ¶
type RChangeServiceConfigWReq struct { ServiceHandle []byte ServiceType uint32 StartType uint32 ErrorControl uint32 BinaryPathName string LoadOrderGroup string TagId uint32 Dependencies string DependSize uint32 ServiceStartName string // RPC over SMB requires password encryption with session key // So have to encrypt the password before calling the marshal function Password []byte // []byte instead of string to support encryption PwSize uint32 DisplayName string }
DWORD RChangeServiceConfigW(
[in] SC_RPC_HANDLE hService, [in] DWORD dwServiceType, [in] DWORD dwStartType, [in] DWORD dwErrorControl, [in, string, unique, range(0, SC_MAX_PATH_LENGTH)] wchar_t* lpBinaryPathName, [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpLoadOrderGroup, [in, out, unique] LPDWORD lpdwTagId, [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] wchar_t* lpServiceStartName, [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpDisplayName
);
func (*RChangeServiceConfigWReq) MarshalBinary ¶
func (self *RChangeServiceConfigWReq) MarshalBinary() (res []byte, err error)
func (*RChangeServiceConfigWReq) UnmarshalBinary ¶
func (self *RChangeServiceConfigWReq) UnmarshalBinary(buf []byte) error
type RChangeServiceConfigWRes ¶
func (*RChangeServiceConfigWRes) MarshalBinary ¶
func (self *RChangeServiceConfigWRes) MarshalBinary() ([]byte, error)
func (*RChangeServiceConfigWRes) UnmarshalBinary ¶
func (self *RChangeServiceConfigWRes) UnmarshalBinary(buf []byte) (err error)
type RCloseServiceHandleReq ¶
type RCloseServiceHandleReq struct {
ServiceHandle []byte
}
func (*RCloseServiceHandleReq) MarshalBinary ¶
func (self *RCloseServiceHandleReq) MarshalBinary() (res []byte, err error)
func (*RCloseServiceHandleReq) UnmarshalBinary ¶
func (self *RCloseServiceHandleReq) UnmarshalBinary(buf []byte) error
type RCloseServiceHandleRes ¶
func (*RCloseServiceHandleRes) MarshalBinary ¶
func (self *RCloseServiceHandleRes) MarshalBinary() ([]byte, error)
func (*RCloseServiceHandleRes) UnmarshalBinary ¶
func (self *RCloseServiceHandleRes) UnmarshalBinary(buf []byte) (err error)
type RControlServiceReq ¶
func (*RControlServiceReq) MarshalBinary ¶
func (self *RControlServiceReq) MarshalBinary() (res []byte, err error)
func (*RControlServiceReq) UnmarshalBinary ¶
func (self *RControlServiceReq) UnmarshalBinary(buf []byte) error
type RControlServiceRes ¶
type RControlServiceRes struct { ServiceStatus *ServiceStatus ReturnValue uint32 }
func (*RControlServiceRes) MarshalBinary ¶
func (self *RControlServiceRes) MarshalBinary() ([]byte, error)
func (*RControlServiceRes) UnmarshalBinary ¶
func (self *RControlServiceRes) UnmarshalBinary(buf []byte) (err error)
type RCreateServiceWReq ¶
type RCreateServiceWReq struct { SCContextHandle []byte ServiceName string DisplayName string DesiredAccess uint32 ServiceType uint32 StartType uint32 ErrorControl uint32 BinaryPathName string LoadOrderGroup string TagId uint32 Dependencies string DependSize uint32 ServiceStartName string Password []byte PwSize uint32 }
DWORD RCreateServiceW(
[in] SC_RPC_HANDLE hSCManager, [in, string, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpServiceName, [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpDisplayName, [in] DWORD dwDesiredAccess, [in] DWORD dwServiceType, [in] DWORD dwStartType, [in] DWORD dwErrorControl, [in, string, range(0, SC_MAX_PATH_LENGTH)] wchar_t* lpBinaryPathName, [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpLoadOrderGroup, [in, out, unique] LPDWORD lpdwTagId, [in, unique, size_is(dwDependSize)] LPBYTE lpDependencies, [in, range(0, SC_MAX_DEPEND_SIZE)] DWORD dwDependSize, [in, string, unique, range(0, SC_MAX_ACCOUNT_NAME_LENGTH)] wchar_t* lpServiceStartName, [in, unique, size_is(dwPwSize)] LPBYTE lpPassword, [in, range(0, SC_MAX_PWD_SIZE)] DWORD dwPwSize, [out] LPSC_RPC_HANDLE lpServiceHandle
);
func (*RCreateServiceWReq) MarshalBinary ¶
func (self *RCreateServiceWReq) MarshalBinary() (res []byte, err error)
func (*RCreateServiceWReq) UnmarshalBinary ¶
func (self *RCreateServiceWReq) UnmarshalBinary(buf []byte) error
type RCreateServiceWRes ¶
func (*RCreateServiceWRes) MarshalBinary ¶
func (self *RCreateServiceWRes) MarshalBinary() ([]byte, error)
func (*RCreateServiceWRes) UnmarshalBinary ¶
func (self *RCreateServiceWRes) UnmarshalBinary(buf []byte) (err error)
type RDeleteServiceReq ¶
type RDeleteServiceReq struct {
ServiceHandle []byte
}
func (*RDeleteServiceReq) MarshalBinary ¶
func (self *RDeleteServiceReq) MarshalBinary() (res []byte, err error)
func (*RDeleteServiceReq) UnmarshalBinary ¶
func (self *RDeleteServiceReq) UnmarshalBinary(buf []byte) error
type ROpenSCManagerWReq ¶
DWORD ROpenSCManagerW(
[in, string, unique, range(0, SC_MAX_COMPUTER_NAME_LENGTH)] SVCCTL_HANDLEW lpMachineName, [in, string, unique, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpDatabaseName, [in] DWORD dwDesiredAccess, [out] LPSC_RPC_HANDLE lpScHandle
);
func (*ROpenSCManagerWReq) MarshalBinary ¶
func (self *ROpenSCManagerWReq) MarshalBinary() (res []byte, err error)
func (*ROpenSCManagerWReq) UnmarshalBinary ¶
func (self *ROpenSCManagerWReq) UnmarshalBinary(buf []byte) error
type ROpenSCManagerWRes ¶
func (*ROpenSCManagerWRes) MarshalBinary ¶
func (self *ROpenSCManagerWRes) MarshalBinary() ([]byte, error)
func (*ROpenSCManagerWRes) UnmarshalBinary ¶
func (self *ROpenSCManagerWRes) UnmarshalBinary(buf []byte) (err error)
type ROpenServiceWReq ¶
DWORD ROpenServiceW(
[in] SC_RPC_HANDLE hSCManager, [in, string, range(0, SC_MAX_NAME_LENGTH)] wchar_t* lpServiceName, [in] DWORD dwDesiredAccess, [out] LPSC_RPC_HANDLE lpServiceHandle
);
func (*ROpenServiceWReq) MarshalBinary ¶
func (self *ROpenServiceWReq) MarshalBinary() (res []byte, err error)
func (*ROpenServiceWReq) UnmarshalBinary ¶
func (self *ROpenServiceWReq) UnmarshalBinary(buf []byte) error
type ROpenServiceWRes ¶
func (*ROpenServiceWRes) MarshalBinary ¶
func (self *ROpenServiceWRes) MarshalBinary() ([]byte, error)
func (*ROpenServiceWRes) UnmarshalBinary ¶
func (self *ROpenServiceWRes) UnmarshalBinary(buf []byte) (err error)
type RQueryServiceConfigWReq ¶
DWORD RQueryServiceConfigW(
[in] SC_RPC_HANDLE hService, [out] LPQUERY_SERVICE_CONFIGW lpServiceConfig, [in, range(0, 1024*8)] DWORD cbBufSize, [out] LPBOUNDED_DWORD_8K pcbBytesNeeded
);
func (*RQueryServiceConfigWReq) MarshalBinary ¶
func (self *RQueryServiceConfigWReq) MarshalBinary() (res []byte, err error)
func (*RQueryServiceConfigWReq) UnmarshalBinary ¶
func (self *RQueryServiceConfigWReq) UnmarshalBinary(buf []byte) error
type RQueryServiceConfigWRes ¶
type RQueryServiceConfigWRes struct { ServiceConfig *QueryServiceConfigW BytesNeeded uint32 ErrorCode uint32 }
func (*RQueryServiceConfigWRes) MarshalBinary ¶
func (self *RQueryServiceConfigWRes) MarshalBinary() ([]byte, error)
func (*RQueryServiceConfigWRes) UnmarshalBinary ¶
func (self *RQueryServiceConfigWRes) UnmarshalBinary(buf []byte) (err error)
type RQueryServiceStatusReq ¶
type RQueryServiceStatusReq struct {
ContextHandle []byte
}
func (*RQueryServiceStatusReq) MarshalBinary ¶
func (self *RQueryServiceStatusReq) MarshalBinary() (res []byte, err error)
func (*RQueryServiceStatusReq) UnmarshalBinary ¶
func (self *RQueryServiceStatusReq) UnmarshalBinary(buf []byte) error
type RQueryServiceStatusRes ¶
type RQueryServiceStatusRes struct { ServiceStatus *ServiceStatus ReturnCode uint32 }
DWORD RQueryServiceStatus(
[in] SC_RPC_HANDLE hService, [out] LPSERVICE_STATUS lpServiceStatus
);
func (*RQueryServiceStatusRes) MarshalBinary ¶
func (self *RQueryServiceStatusRes) MarshalBinary() ([]byte, error)
func (*RQueryServiceStatusRes) UnmarshalBinary ¶
func (self *RQueryServiceStatusRes) UnmarshalBinary(buf []byte) (err error)
type RStartServiceWReq ¶
func (*RStartServiceWReq) MarshalBinary ¶
func (s *RStartServiceWReq) MarshalBinary() (res []byte, err error)
func (*RStartServiceWReq) UnmarshalBinary ¶
func (self *RStartServiceWReq) UnmarshalBinary(buf []byte) error
type RequestReq ¶
type RequestReq struct { Header // 16 bytes // AllocHint is an optional field useful for hinting required space when // sending fragmented requests AllocHint uint32 ContextId uint16 // Data representation Opnum uint16 // Optional field object uuid_t // Only present if PfcObjectUUID is set in the header flags Buffer []byte }
C706 Section 12.6.4.9
func (*RequestReq) MarshalBinary ¶
func (self *RequestReq) MarshalBinary() (ret []byte, err error)
func (*RequestReq) UnmarshalBinary ¶
func (self *RequestReq) UnmarshalBinary(buf []byte) (err error)
type RequestRes ¶
type RequestRes struct { Header // 16 bytes // This optional field AllocHint is used to hint about how much // contiguous space to allocate for fragmented requests. AllocHint uint32 ContextId uint16 CancelCount byte Reserved byte Buffer []byte }
C706 Section 12.6.4.10
func (*RequestRes) MarshalBinary ¶
func (self *RequestRes) MarshalBinary() (ret []byte, err error)
func (*RequestRes) UnmarshalBinary ¶
func (self *RequestRes) UnmarshalBinary(buf []byte) (err error)
type ResumeHandle ¶
type ServiceBind ¶
type ServiceBind struct {
// contains filtered or unexported fields
}
func (*ServiceBind) ChangeServiceConfig ¶
func (sb *ServiceBind) ChangeServiceConfig( serviceName string, serviceType, startType, errorControl uint32, binaryPathName, serviceStartName, password, displayName string) (err error)
func (*ServiceBind) CloseServiceHandle ¶
func (sb *ServiceBind) CloseServiceHandle(serviceHandle []byte)
func (*ServiceBind) ControlService ¶
func (sb *ServiceBind) ControlService(serviceName string, control uint32) (err error)
func (*ServiceBind) CreateService ¶
func (*ServiceBind) DeleteService ¶
func (sb *ServiceBind) DeleteService(serviceName string) (err error)
func (*ServiceBind) GetServiceConfig ¶
func (sb *ServiceBind) GetServiceConfig(serviceName string) (config ServiceConfig, err error)
func (*ServiceBind) GetServiceStatus ¶
func (sb *ServiceBind) GetServiceStatus(serviceName string) (status uint32, err error)
func (*ServiceBind) MakeIoCtlRequest ¶
func (sb *ServiceBind) MakeIoCtlRequest(opcode uint16, innerBuf []byte) (result []byte, err error)
func (*ServiceBind) NetServerGetInfo ¶
func (sb *ServiceBind) NetServerGetInfo(host string, level int) (res *NetServerInfo, err error)
Send a NetServerGetInfo request to the server. Level can be 100, 101, or 102
func (*ServiceBind) NetSessionEnum ¶
func (sb *ServiceBind) NetSessionEnum(clientName, username string, level int) (res *SessionEnum, err error)
Send a NetSessionEnum request to the server. Level can be 0, 1, 2, 10 or 502 But so far only level 0, 10 and 502 are implemented
func (*ServiceBind) NetShareEnumAll ¶
func (sb *ServiceBind) NetShareEnumAll(host string) (res []NetShare, err error)
func (*ServiceBind) StartService ¶
func (sb *ServiceBind) StartService(serviceName string, args []string) (err error)
type ServiceConfig ¶
type ServiceStatus ¶
type ServiceStatus struct { ServiceType uint32 CurrentState uint32 ControlsAccepted uint32 Win32ExitCode uint32 ServiceSpecificExitCode uint32 CheckPoint uint32 WaitHint uint32 }
typedef struct { DWORD dwServiceType; DWORD dwCurrentState; DWORD dwControlsAccepted; DWORD dwWin32ExitCode; DWORD dwServiceSpecificExitCode; DWORD dwCheckPoint; DWORD dwWaitHint; } SERVICE_STATUS,
*LPSERVICE_STATUS;
type SessionEnum ¶
type SessionEnum struct { Level uint32 SessionInfo interface{} }
type SessionInfoContainer0 ¶
type SessionInfoContainer0 struct { EntriesRead uint32 Buffer []NetSessionInfo0 }
Could this be done in a better way? Perhaps with an interface?
type SessionInfoContainer1 ¶
type SessionInfoContainer1 struct { EntriesRead uint32 Buffer []NetSessionInfo1 }
type SessionInfoContainer10 ¶
type SessionInfoContainer10 struct { EntriesRead uint32 Buffer []NetSessionInfo10 }
type SessionInfoContainer2 ¶
type SessionInfoContainer2 struct { EntriesRead uint32 Buffer []NetSessionInfo2 }
type SessionInfoContainer502 ¶
type SessionInfoContainer502 struct { EntriesRead uint32 Buffer []NetSessionInfo502 }
type ShareInfo1 ¶
type ShareInfo1 struct {}
type ShareInfoContainer1 ¶
type ShareInfoContainer1 struct {}
typedef struct _SHARE_INFO_1_CONTAINER { DWORD EntriesRead; [size_is(EntriesRead)] LPSHARE_INFO_1 Buffer; } SHARE_INFO_1_CONTAINER;