win

package
v1.4.0-beta2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	LDAP_PORT           = 389
	LDAP_SUCCESS        = 0
	LDAP_OPT_SIGN       = 0x95
	LDAP_OPT_ENCRYPT    = 0x96
	LDAP_OPT_ON         = 1
	LDAP_SCOPE_BASE     = 0x00
	LDAP_SCOPE_ONELEVEL = 0x01
	LDAP_AUTH_NEGOTIATE = 0x0486 // LDAP_AUTH_OTHERKIND (0x86) | 0x0400
)

from winldap.h

View Source
const (
	PolicyAccountDomainInformation = 5
	PolicyDnsDomainInformation     = 12
)
View Source
const (
	POLICY_VIEW_LOCAL_INFORMATION   = 0x00000001
	POLICY_VIEW_AUDIT_INFORMATION   = 0x00000002
	POLICY_GET_PRIVATE_INFORMATION  = 0x00000004
	POLICY_TRUST_ADMIN              = 0x00000008
	POLICY_CREATE_ACCOUNT           = 0x00000010
	POLICY_CREATE_SECRET            = 0x00000020
	POLICY_CREATE_PRIVILEGE         = 0x00000040
	POLICY_SET_DEFAULT_QUOTA_LIMITS = 0x00000080
	POLICY_SET_AUDIT_REQUIREMENTS   = 0x00000100
	POLICY_AUDIT_LOG_ADMIN          = 0x00000200
	POLICY_SERVER_ADMIN             = 0x00000400
	POLICY_LOOKUP_NAMES             = 0x00000800
	POLICY_NOTIFICATION             = 0x00001000
)
View Source
const (
	AdministratorUIDFromFUSE = 197108 // This is calcuated from the SID of Administrator user on Windows. //0x30000 + 500
	AdminstratorsGIDFromFUSE = 544    //  S-1-5-32-544
	SystemUIDFromFUSE        = 18     //  S-1-5-32-18
)
View Source
const (
	DS_DOMAIN_DIRECT_INBOUND  = 0x0001
	DS_DOMAIN_DIRECT_OUTBOUND = 0x0002
	DS_DOMAIN_IN_FOREST       = 0x0008
)

Variables

This section is empty.

Functions

func ConvertSidStrToUid

func ConvertSidStrToUid(sidStr string) (int, error)

func GetCurrentGID

func GetCurrentGID() int

func GetCurrentGroupName

func GetCurrentGroupName() string

func GetCurrentUID

func GetCurrentUID() int

func GetCurrentUserPrimaryGroupSID

func GetCurrentUserPrimaryGroupSID() (*windows.SID, error)

func GetCurrentUserSID

func GetCurrentUserSID() (*windows.SID, error)

func GetSidName

func GetSidName(sid *windows.SID, withDomain bool) string

func IsProcessElevated

func IsProcessElevated() (bool, error)

func IsRelativeSid

func IsRelativeSid(sid1 *windows.SID, sid2 *windows.SID) bool

func LdapClose

func LdapClose(handle uintptr)

func LdapConnect

func LdapConnect(host string) (uintptr, error)

func LdapGetDefaultNamingContext

func LdapGetDefaultNamingContext(handle uintptr) (string, error)

func LdapGetTrustPosixOffset

func LdapGetTrustPosixOffset(
	handle uintptr,
	context string,
	domain string,
) (string, error)

func LdapGetValue

func LdapGetValue(
	handle uintptr,
	base string,
	scope uint32,
	filter string,
	attribute string,
) (string, error)

Types

type DS_DOMAIN_TRUSTSW

type DS_DOMAIN_TRUSTSW struct {
	NetbiosDomainName *uint16      // LPWSTR
	DnsDomainName     *uint16      // LPWSTR
	Flags             uint32       // ULONG
	ParentIndex       uint32       // ULONG
	TrustType         uint32       // ULONG
	TrustAttributes   uint32       // ULONG
	DomainSid         *windows.SID // PSID
	DomainGuid        windows.GUID // GUID
}

type GUID

type GUID struct {
	Data1 uint32
	Data2 uint16
	Data3 uint16
	Data4 [8]byte
}

type LSA_OBJECT_ATTRIBUTES

type LSA_OBJECT_ATTRIBUTES struct {
	Length                   uint32
	RootDirectory            windows.Handle
	ObjectName               uintptr
	Attributes               uint32
	SecurityDescriptor       uintptr
	SecurityQualityOfService uintptr
}

type UNICODE_STRING

type UNICODE_STRING struct {
	Length        uint16
	MaximumLength uint16
	Buffer        *uint16
}

Jump to

Keyboard shortcuts

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