winapi

package
v0.0.0-...-6f85eed Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2017 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	EVENTLOG_ERROR_TYPE = 1 << iota
	EVENTLOG_WARNING_TYPE
	EVENTLOG_INFORMATION_TYPE
	EVENTLOG_AUDIT_SUCCESS
	EVENTLOG_AUDIT_FAILURE
	EVENTLOG_SUCCESS = 0
)
View Source
const (
	REG_OPTION_NON_VOLATILE = 0

	REG_CREATED_NEW_KEY     = 1
	REG_OPENED_EXISTING_KEY = 2
)
View Source
const (
	SECURITY_NULL_RID                   = 0
	SECURITY_WORLD_RID                  = 0
	SECURITY_LOCAL_RID                  = 0
	SECURITY_CREATOR_OWNER_RID          = 0
	SECURITY_CREATOR_GROUP_RID          = 1
	SECURITY_DIALUP_RID                 = 1
	SECURITY_NETWORK_RID                = 2
	SECURITY_BATCH_RID                  = 3
	SECURITY_INTERACTIVE_RID            = 4
	SECURITY_LOGON_IDS_RID              = 5
	SECURITY_SERVICE_RID                = 6
	SECURITY_LOCAL_SYSTEM_RID           = 18
	SECURITY_BUILTIN_DOMAIN_RID         = 32
	SECURITY_PRINCIPAL_SELF_RID         = 10
	SECURITY_CREATOR_OWNER_SERVER_RID   = 0x2
	SECURITY_CREATOR_GROUP_SERVER_RID   = 0x3
	SECURITY_LOGON_IDS_RID_COUNT        = 0x3
	SECURITY_ANONYMOUS_LOGON_RID        = 0x7
	SECURITY_PROXY_RID                  = 0x8
	SECURITY_ENTERPRISE_CONTROLLERS_RID = 0x9
	SECURITY_SERVER_LOGON_RID           = SECURITY_ENTERPRISE_CONTROLLERS_RID
	SECURITY_AUTHENTICATED_USER_RID     = 0xb
	SECURITY_RESTRICTED_CODE_RID        = 0xc
	SECURITY_NT_NON_UNIQUE_RID          = 0x15
)
View Source
const (
	SC_MANAGER_CONNECT = 1 << iota
	SC_MANAGER_CREATE_SERVICE
	SC_MANAGER_ENUMERATE_SERVICE
	SC_MANAGER_LOCK
	SC_MANAGER_QUERY_LOCK_STATUS
	SC_MANAGER_MODIFY_BOOT_CONFIG
	SC_MANAGER_ALL_ACCESS = 0xf003f
)
View Source
const (
	SERVICE_KERNEL_DRIVER = 1 << iota
	SERVICE_FILE_SYSTEM_DRIVER
	SERVICE_ADAPTER
	SERVICE_RECOGNIZER_DRIVER
	SERVICE_WIN32_OWN_PROCESS
	SERVICE_WIN32_SHARE_PROCESS
	SERVICE_WIN32               = SERVICE_WIN32_OWN_PROCESS | SERVICE_WIN32_SHARE_PROCESS
	SERVICE_INTERACTIVE_PROCESS = 256
	SERVICE_DRIVER              = SERVICE_KERNEL_DRIVER | SERVICE_FILE_SYSTEM_DRIVER | SERVICE_RECOGNIZER_DRIVER
	SERVICE_TYPE_ALL            = SERVICE_WIN32 | SERVICE_ADAPTER | SERVICE_DRIVER | SERVICE_INTERACTIVE_PROCESS
)
View Source
const (
	SERVICE_BOOT_START = iota
	SERVICE_SYSTEM_START
	SERVICE_AUTO_START
	SERVICE_DEMAND_START
	SERVICE_DISABLED
)
View Source
const (
	SERVICE_ERROR_IGNORE = iota
	SERVICE_ERROR_NORMAL
	SERVICE_ERROR_SEVERE
	SERVICE_ERROR_CRITICAL
)
View Source
const (
	SERVICE_STOPPED = 1 + iota
	SERVICE_START_PENDING
	SERVICE_STOP_PENDING
	SERVICE_RUNNING
	SERVICE_CONTINUE_PENDING
	SERVICE_PAUSE_PENDING
	SERVICE_PAUSED
	SERVICE_NO_CHANGE = 0xffffffff
)
View Source
const (
	SERVICE_ACCEPT_STOP = 1 << iota
	SERVICE_ACCEPT_PAUSE_CONTINUE
	SERVICE_ACCEPT_SHUTDOWN
	SERVICE_ACCEPT_PARAMCHANGE
	SERVICE_ACCEPT_NETBINDCHANGE
	SERVICE_ACCEPT_HARDWAREPROFILECHANGE
	SERVICE_ACCEPT_POWEREVENT
	SERVICE_ACCEPT_SESSIONCHANGE
)
View Source
const (
	SERVICE_CONTROL_STOP = 1 + iota
	SERVICE_CONTROL_PAUSE
	SERVICE_CONTROL_CONTINUE
	SERVICE_CONTROL_INTERROGATE
	SERVICE_CONTROL_SHUTDOWN
	SERVICE_CONTROL_PARAMCHANGE
	SERVICE_CONTROL_NETBINDADD
	SERVICE_CONTROL_NETBINDREMOVE
	SERVICE_CONTROL_NETBINDENABLE
	SERVICE_CONTROL_NETBINDDISABLE
	SERVICE_CONTROL_DEVICEEVENT
	SERVICE_CONTROL_HARDWAREPROFILECHANGE
	SERVICE_CONTROL_POWEREVENT
	SERVICE_CONTROL_SESSIONCHANGE
)
View Source
const (
	SERVICE_ACTIVE = 1 + iota
	SERVICE_INACTIVE
	SERVICE_STATE_ALL
)
View Source
const (
	SERVICE_QUERY_CONFIG = 1 << iota
	SERVICE_CHANGE_CONFIG
	SERVICE_QUERY_STATUS
	SERVICE_ENUMERATE_DEPENDENTS
	SERVICE_START
	SERVICE_STOP
	SERVICE_PAUSE_CONTINUE
	SERVICE_INTERROGATE
	SERVICE_USER_DEFINED_CONTROL
	SERVICE_ALL_ACCESS             = STANDARD_RIGHTS_REQUIRED | SERVICE_QUERY_CONFIG | SERVICE_CHANGE_CONFIG | SERVICE_QUERY_STATUS | SERVICE_ENUMERATE_DEPENDENTS | SERVICE_START | SERVICE_STOP | SERVICE_PAUSE_CONTINUE | SERVICE_INTERROGATE | SERVICE_USER_DEFINED_CONTROL
	SERVICE_RUNS_IN_SYSTEM_PROCESS = 1
	SERVICE_CONFIG_DESCRIPTION     = 1
	SERVICE_CONFIG_FAILURE_ACTIONS = 2
)
View Source
const (
	STANDARD_RIGHTS_REQUIRED = 0xf0000

	ERROR_SERVICE_SPECIFIC_ERROR syscall.Errno = 1066
)
View Source
const (
	NO_ERROR = 0
)
View Source
const (
	SC_STATUS_PROCESS_INFO = 0
)

Variables

View Source
var (
	SECURITY_NULL_SID_AUTHORITY        = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 0}}
	SECURITY_WORLD_SID_AUTHORITY       = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 1}}
	SECURITY_LOCAL_SID_AUTHORITY       = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 2}}
	SECURITY_CREATOR_SID_AUTHORITY     = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 3}}
	SECURITY_NON_UNIQUE_AUTHORITY      = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 4}}
	SECURITY_NT_AUTHORITY              = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 5}}
	SECURITY_MANDATORY_LABEL_AUTHORITY = SidIdentifierAuthority{[6]byte{0, 0, 0, 0, 0, 16}}
)

Functions

func AllocateAndInitializeSid

func AllocateAndInitializeSid(identAuth *SidIdentifierAuthority, subAuth byte, subAuth0 uint32, subAuth1 uint32, subAuth2 uint32, subAuth3 uint32, subAuth4 uint32, subAuth5 uint32, subAuth6 uint32, subAuth7 uint32, sid **syscall.SID) (err error)

func ChangeServiceConfig

func ChangeServiceConfig(service syscall.Handle, serviceType uint32, startType uint32, errorControl uint32, binaryPathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16, displayName *uint16) (err error)

func ChangeServiceConfig2

func ChangeServiceConfig2(service syscall.Handle, infoLevel uint32, info *byte) (err error)

func CloseServiceHandle

func CloseServiceHandle(handle syscall.Handle) (err error)

func ControlService

func ControlService(service syscall.Handle, control uint32, status *SERVICE_STATUS) (err error)

func CreateEvent

func CreateEvent(eventAttrs *syscall.SecurityAttributes, manualReset uint32, initialState uint32, name *uint16) (handle syscall.Handle, err error)

func CreateService

func CreateService(mgr syscall.Handle, serviceName *uint16, displayName *uint16, access uint32, srvType uint32, startType uint32, errCtl uint32, pathName *uint16, loadOrderGroup *uint16, tagId *uint32, dependencies *uint16, serviceStartName *uint16, password *uint16) (handle syscall.Handle, err error)

func DeleteService

func DeleteService(service syscall.Handle) (err error)

func DeregisterEventSource

func DeregisterEventSource(handle syscall.Handle) (err error)

func EqualSid

func EqualSid(sid1 *syscall.SID, sid2 *syscall.SID) (isEqual bool)

func FreeSid

func FreeSid(sid *syscall.SID) (err error)

func GetCurrentThreadId

func GetCurrentThreadId() (id uint32)

func OpenSCManager

func OpenSCManager(machineName *uint16, databaseName *uint16, access uint32) (handle syscall.Handle, err error)

func OpenService

func OpenService(mgr syscall.Handle, serviceName *uint16, access uint32) (handle syscall.Handle, err error)

func QueryServiceConfig

func QueryServiceConfig(service syscall.Handle, serviceConfig *QUERY_SERVICE_CONFIG, bufSize uint32, bytesNeeded *uint32) (err error)

func QueryServiceConfig2

func QueryServiceConfig2(service syscall.Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error)

func QueryServiceStatus

func QueryServiceStatus(service syscall.Handle, status *SERVICE_STATUS) (err error)

func RegCreateKeyEx

func RegCreateKeyEx(key syscall.Handle, subkey *uint16, reserved uint32, class *uint16, options uint32, desired uint32, sa *syscall.SecurityAttributes, result *syscall.Handle, disposition *uint32) (regerrno error)

func RegDeleteKey

func RegDeleteKey(key syscall.Handle, subkey *uint16) (regerrno error)

func RegSetValueEx

func RegSetValueEx(key syscall.Handle, valueName *uint16, reserved uint32, vtype uint32, buf *byte, bufsize uint32) (regerrno error)

func RegisterEventSource

func RegisterEventSource(uncServerName *uint16, sourceName *uint16) (handle syscall.Handle, err error)

func ReportEvent

func ReportEvent(log syscall.Handle, etype uint16, category uint16, eventId uint32, usrSId uintptr, numStrings uint16, dataSize uint32, strings **uint16, rawData *byte) (err error)

func SetEvent

func SetEvent(event syscall.Handle) (err error)

func SetServiceStatus

func SetServiceStatus(service syscall.Handle, serviceStatus *SERVICE_STATUS) (err error)

func StartService

func StartService(service syscall.Handle, numArgs uint32, argVectors **uint16) (err error)

func StartServiceCtrlDispatcher

func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error)

Types

type QUERY_SERVICE_CONFIG

type QUERY_SERVICE_CONFIG struct {
	ServiceType      uint32
	StartType        uint32
	ErrorControl     uint32
	BinaryPathName   *uint16
	LoadOrderGroup   *uint16
	TagId            uint32
	Dependencies     *uint16
	ServiceStartName *uint16
	DisplayName      *uint16
}

type SERVICE_DESCRIPTION

type SERVICE_DESCRIPTION struct {
	Description *uint16
}

type SERVICE_STATUS

type SERVICE_STATUS struct {
	ServiceType             uint32
	CurrentState            uint32
	ControlsAccepted        uint32
	Win32ExitCode           uint32
	ServiceSpecificExitCode uint32
	CheckPoint              uint32
	WaitHint                uint32
}

type SERVICE_TABLE_ENTRY

type SERVICE_TABLE_ENTRY struct {
	ServiceName *uint16
	ServiceProc uintptr
}

type SidIdentifierAuthority

type SidIdentifierAuthority struct {
	Value [6]byte
}

type Tokengroups

type Tokengroups struct {
	GroupCount uint32
	Groups     [1]syscall.SIDAndAttributes
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL