advapi32

package
v0.0.0-...-6065391 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	NameUnknown uint32 = iota
	NameFullyQualifiedDN
	NameSamCompatible
	NameDisplay
	NameUniqueId
	NameCanonical
	NameUserPrincipal
	NameCanonicalEx
	NameServicePrincipal
	NameDnsDomain
	NameGivenName
	NameSurname
)

EXTENDED_NAME_FORMAT Specifies a format for a directory service object name. https://docs.microsoft.com/en-us/windows/win32/api/secext/ne-secext-extended_name_format

View Source
const (
	LOGON32_LOGON_INTERACTIVE       uint32 = 2
	LOGON32_LOGON_NETWORK           uint32 = 3
	LOGON32_LOGON_BATCH             uint32 = 4
	LOGON32_LOGON_SERVICE           uint32 = 5
	LOGON32_LOGON_UNLOCK            uint32 = 7
	LOGON32_LOGON_NETWORK_CLEARTEXT uint32 = 8
	LOGON32_LOGON_NEW_CREDENTIALS   uint32 = 9
)

LOGON32_LOGON_ constants from winbase.h The type of logon operation to perform

View Source
const (
	LOGON32_PROVIDER_DEFAULT uint32 = iota
	LOGON32_PROVIDER_WINNT35
	LOGON32_PROVIDER_WINNT40
	LOGON32_PROVIDER_WINNT50
	LOGON32_PROVIDER_VIRTUAL
)

LOGON32_PROVIDER_ constants The logon provider

View Source
const (
	LOGON_WITH_PROFILE        uint32 = 0x1
	LOGON_NETCREDENTIALS_ONLY uint32 = 0x2
)

LOGON_ The logon option

View Source
const (
	SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001
	SE_PRIVILEGE_ENABLED            = 0x00000002
	SE_PRIVILEGE_REMOVED            = 0x00000003
	SE_PRIVILEGE_USED_FOR_ACCESS    = 0x80000000
)

PRIVILEGE_SET structure specifies a set of privileges. It is also used to indicate which, if any, privileges are held by a user or group requesting access to an object. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-privilege_set

View Source
const (
	SE_CREATE_TOKEN_NAME           string = "SeCreateTokenPrivilege"
	SE_ASSIGNPRIMARYTOKEN_NAME     string = "SeAssignPrimaryTokenPrivilege"
	SE_LOCK_MEMORY_NAME            string = "SeLockMemoryPrivilege"
	SE_INCREASE_QUOTA_NAME         string = "SeIncreaseQuotaPrivilege"
	SE_UNSOLICITED_INPUT_NAME      string = "SeUnsolicitedInputPrivilege"
	SE_MACHINE_ACCOUNT_NAME        string = "SeMachineAccountPrivilege"
	SE_TCB_NAME                    string = "SeTcbPrivilege"
	SE_SECURITY_NAME               string = "SeSecurityPrivilege"
	SE_TAKE_OWNERSHIP_NAME         string = "SeTakeOwnershipPrivilege"
	SE_LOAD_DRIVER_NAME            string = "SeLoadDriverPrivilege"
	SE_SYSTEM_PROFILE_NAME         string = "SeSystemProfilePrivilege"
	SE_SYSTEMTIME_NAME             string = "SeSystemtimePrivilege"
	SE_PROF_SINGLE_PROCESS_NAME    string = "SeProfileSingleProcessPrivilege"
	SE_INC_BASE_PRIORITY_NAME      string = "SeIncreaseBasePriorityPrivilege"
	SE_CREATE_PAGEFILE_NAME        string = "SeCreatePagefilePrivilege"
	SE_CREATE_PERMANENT_NAME       string = "SeCreatePermanentPrivilege"
	SE_BACKUP_NAME                 string = "SeBackupPrivilege"
	SE_RESTORE_NAME                string = "SeRestorePrivilege"
	SE_SHUTDOWN_NAME               string = "SeShutdownPrivilege"
	SE_DEBUG_NAME                  string = "SeDebugPrivilege"
	SE_AUDIT_NAME                  string = "SeAuditPrivilege"
	SE_SYSTEM_ENVIRONMENT_NAME     string = "SeSystemEnvironmentPrivilege"
	SE_CHANGE_NOTIFY_NAME          string = "SeChangeNotifyPrivilege"
	SE_REMOTE_SHUTDOWN_NAME        string = "SeRemoteShutdownPrivilege"
	SE_UNDOCK_NAME                 string = "SeUndockPrivilege"
	SE_SYNC_AGENT_NAME             string = "SeSyncAgentPrivilege"
	SE_ENABLE_DELEGATION_NAME      string = "SeEnableDelegationPrivilege"
	SE_MANAGE_VOLUME_NAME          string = "SeManageVolumePrivilege"
	SE_IMPERSONATE_NAME            string = "SeImpersonatePrivilege"
	SE_CREATE_GLOBAL_NAME          string = "SeCreateGlobalPrivilege"
	SE_TRUSTED_CREDMAN_ACCESS_NAME string = "SeTrustedCredManAccessPrivilege"
	SE_RELABEL_NAME                string = "SeRelabelPrivilege"
	SE_INC_WORKING_SET_NAME        string = "SeIncreaseWorkingSetPrivilege"
	SE_TIME_ZONE_NAME              string = "SeTimeZonePrivilege"
	SE_CREATE_SYMBOLIC_LINK_NAME   string = "SeCreateSymbolicLinkPrivilege"
)

SE_ Privilege Constants (Authorization) https://docs.microsoft.com/en-us/windows/win32/secauthz/privilege-constants

View Source
const (
	SecurityAnonymous uint32 = iota
	SecurityIdentification
	SecurityImpersonation
	SecurityDelegation
)

SECURITY_IMPERSONATION_LEVEL enumeration contains values that specify security impersonation levels. Security impersonation levels govern the degree to which a server process can act on behalf of a client process. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-security_impersonation_level

View Source
const (
	SECURITY_NULL_SID_AUTHORITY int = iota
	SECURITY_WORLD_SID_AUTHORITY
	SECURITY_LOCAL_SID_AUTHORITY
	SECURITY_CREATOR_SID_AUTHORITY
	SECURITY_NON_UNIQUE_AUTHORITY
	SECURITY_NT_AUTHORITY

	SECURITY_RESOURCE_MANAGER_AUTHORITY
)

SECURITY_ the identifier authority value identifies the agency that issued the SID. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_identifier_authority

View Source
const (
	STANDARD_RIGHTS_REQUIRED int = 0x000F0000
	TOKEN_ASSIGN_PRIMARY     int = 0x0001
	TOKEN_DUPLICATE          int = 0x0002
	TOKEN_IMPERSONATE        int = 0x0004
	TOKEN_QUERY              int = 0x0008
	TOKEN_QUERY_SOURCE       int = 0x0010
	TOKEN_ADJUST_PRIVILEGES  int = 0x0020
	TOKEN_ADJUST_GROUPS      int = 0x0040
	TOKEN_ADJUST_DEFAULT     int = 0x0080
	TOKEN_ADJUST_SESSIONID   int = 0x0100
	TOKEN_ALL_ACCESS         int = STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE | TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT
)

TOKEN_ Access Rights for Access-Token Objects https://docs.microsoft.com/en-us/windows/win32/secauthz/access-rights-for-access-token-objects https://referencesource.microsoft.com/#System.Workflow.Runtime/DebugEngine/NativeMethods.cs,ba613dc523f12d3e,references

View Source
const (
	TokenUser uint32 = iota + 1
	TokenGroups
	TokenPrivileges
	TokenOwner
	TokenPrimaryGroup
	TokenDefaultDacl
	TokenSource
	TokenType
	TokenImpersonationLevel
	TokenStatistics
	TokenRestrictedSids
	TokenSessionId
	TokenGroupsAndPrivileges
	TokenSessionReference
	TokenSandBoxInert
	TokenAuditPolicy
	TokenOrigin
	TokenElevationType
	TokenLinkedToken
	TokenElevation
	TokenHasRestrictions
	TokenAccessInformation
	TokenVirtualizationAllowed
	TokenVirtualizationEnabled
	TokenIntegrityLevel
	TokenUIAccess
	TokenMandatoryPolicy
	TokenLogonSid
	TokenIsAppContainer
	TokenCapabilities
	TokenAppContainerSid
	TokenAppContainerNumber
	TokenUserClaimAttributes
	TokenDeviceClaimAttributes
	TokenRestrictedUserClaimAttributes
	TokenRestrictedDeviceClaimAttributes
	TokenDeviceGroups
	TokenRestrictedDeviceGroups
	TokenSecurityAttributes
	TokenIsRestricted
	TokenProcessTrustLevel
	TokenPrivateNameSpace
	TokenSingletonAttributes
	TokenBnoIsolation
	TokenChildProcessFlags
	TokenIsLessPrivilegedAppContainer
	TokenIsSandboxed
	MaxTokenInfoClass
)

TOKEN_INFORMATION_CLASS enumeration contains values that specify the type of information being assigned to or retrieved from an access token. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-token_information_class

View Source
const (
	TokenPrimary uint32 = iota + 1
	TokenImpersonation
)

TOKEN_TYPE enumeration contains values that differentiate between a primary token and an impersonation token https://docs.microsoft.com/en-us/windows/win32/api/winnt/ne-winnt-token_type

typedef enum _TOKEN_TYPE {
 TokenPrimary,
 TokenImpersonation
} TOKEN_TYPE;
View Source
const (
	MAXIMUM_ALLOWED uint32 = 0x02000000
)
View Source
const (
	PROCESS_QUERY_INFORMATION uint32 = 0x0400
)

PROCESS_ Process Security and Access Rights https://docs.microsoft.com/en-us/windows/win32/procthread/process-security-and-access-rights

Variables

View Source
var Advapi32 = hostWindows.NewLazySystemDLL("Advapi32.dll")

Functions

func AdjustTokenPrivilegesN

func AdjustTokenPrivilegesN(hToken hostWindows.Token, disable bool, priv string) (err error)

AdjustTokenPrivilegesN enables or disables privileges in the specified access token. Enabling or disabling privileges in an access token requires TOKEN_ADJUST_PRIVILEGES access. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-adjusttokenprivileges

func ConvertSidToStringSidG

func ConvertSidToStringSidG(sid *hostWindows.SID, stringSid **uint16) error

ConvertSidToStringSidG function converts a security identifier (SID) to a string format suitable for display, storage, or transmission. The "G" at the end of the function name is for Golang because it uses the golang.org/x/sys/windows Go package https://docs.microsoft.com/en-us/windows/win32/api/sddl/nf-sddl-convertsidtostringsida

func ConvertSidToStringSidN

func ConvertSidToStringSidN() error

ConvertSidToStringSidN function converts a security identifier (SID) to a string format suitable for display, storage, or transmission. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/sddl/nf-sddl-convertsidtostringsida

func CreateProcessWithLogonG

func CreateProcessWithLogonG(lpUsername *uint16, lpDomain *uint16, lpPassword *uint16, dwLogonFlags uint32, lpApplicationName *uint16, lpCommandLine *uint16, dwCreationFlags uint32, lpEnvironment uintptr, lpCurrentDirectory *uint16, lpStartupInfo *hostWindows.StartupInfo, lpProcessInformation *hostWindows.ProcessInformation) error

CreateProcessWithLogonG Creates a new process and its primary thread. Then the new process runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for a specified user. The "G" at the end of the function name is for Golang because it uses the golang.org/x/sys/windows Go package https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithlogonw

func CreateProcessWithLogonN

func CreateProcessWithLogonN(lpUsername *uint16, lpDomain *uint16, lpPassword *uint16, dwLogonFlags uint32, lpApplicationName *uint16, lpCommandLine *uint16, dwCreationFlags uint32, lpEnvironment uintptr, lpCurrentDirectory *uint16, lpStartupInfo *StartupInfo, lpProcessInformation *ProcessInformation) error

CreateProcessWithLogonN Creates a new process and its primary thread. Then the new process runs the specified executable file in the security context of the specified credentials (user, domain, and password). It can optionally load the user profile for a specified user. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithlogonw

func CreateProcessWithTokenG

func CreateProcessWithTokenG(hToken hostWindows.Token, dwLogonFlags uint32, lpApplicationName *uint16, lpCommandLine *uint16, dwCreationFlags uint32, lpEnvironment uintptr, lpCurrentDirectory *uint16, lpStartupInfo *hostWindows.StartupInfo, lpProcessInformation *hostWindows.ProcessInformation) error

CreateProcessWithTokenG Creates a new process and its primary thread. The new process runs in the security context of the specified token. It can optionally load the user profile for the specified user. The "G" at the end of the function name is for Golang because it uses the golang.org/x/sys/windows Go package https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithtokenw

func CreateProcessWithTokenN

func CreateProcessWithTokenN(hToken *unsafe.Pointer, dwLogonFlags uint32, lpApplicationName *uint16, lpCommandLine *uint16, dwCreationFlags uint32, lpEnvironment uintptr, lpCurrentDirectory *uint16, lpStartupInfo *StartupInfo, lpProcessInformation *ProcessInformation) error

CreateProcessWithTokenN Creates a new process and its primary thread. The new process runs in the security context of the specified token. It can optionally load the user profile for the specified user. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-createprocesswithtokenw

func DuplicateToken

func DuplicateToken(hToken hostWindows.Token) (token hostWindows.Token, err error)

DuplicateToken creates a new access token that duplicates one already in existence. https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-duplicatetoken

func DuplicateTokenN

func DuplicateTokenN(hExistingToken *unsafe.Pointer, dwDesiredAccess uint32, ImpersonationLevel uint32, TokenType uint32) (*unsafe.Pointer, error)

DuplicateTokenN function creates a new access token that duplicates an existing token. This function can create either a primary token or an impersonation token. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-duplicatetokenex

func GetTokenInformationN

func GetTokenInformationN(TokenHandle *unsafe.Pointer, TokenInformationClass uint32) (TokenInformation *bytes.Buffer, ReturnLength uint32, err error)

GetTokenInformationN retrieves a specified type of information about an access token The calling process must have appropriate access rights to obtain the information. The caller is responsible for marshalling the bytes into the appropriate structure The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-gettokeninformation

func ImpersonateLoggedOnUserG

func ImpersonateLoggedOnUserG(hToken hostWindows.Token) (err error)

ImpersonateLoggedOnUserG lets the calling thread impersonate the security context of a logged-on user. The user is represented by a token handle. The "G" at the end of the function name is for Golang because it uses the golang.org/x/sys/windows Go package https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-impersonateloggedonuser

func ImpersonateLoggedOnUserN

func ImpersonateLoggedOnUserN(hToken *unsafe.Pointer) (err error)

ImpersonateLoggedOnUserN lets the calling thread impersonate the security context of a logged-on user. The user is represented by a token handle. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-impersonateloggedonuser

func LogonUser

func LogonUser(lpszUsername *uint16, lpszDomain *uint16, lpszPassword *uint16, dwLogonType uint32, dwLogonProvider uint32) (token *unsafe.Pointer, err error)

LogonUser attempts to log a user on to the local computer. The local computer is the computer from which LogonUser was called. You cannot use LogonUser to log on to a remote computer. You specify the user with a user name and domain and authenticate the user with a plaintext password. If the function succeeds, you receive a handle to a token that represents the logged-on user. You can then use this token handle to impersonate the specified user or, in most cases, to create a process that runs in the context of the specified user. https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-logonuserw

func LookupPrivilegeName

func LookupPrivilegeName(luid LUID) (privilege string, err error)

LookupPrivilegeName retrieves the name that corresponds to the privilege represented on a specific system by a specified locally unique identifier (LUID). https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegenamew

func LookupPrivilegeNameG

func LookupPrivilegeNameG(luid hostWindows.LUID) (privilege string, err error)

LookupPrivilegeNameG retrieves the name that corresponds to the privilege represented on a specific system by a specified locally unique identifier (LUID). The "G" at the end of the function name is for Golang because it uses the golang.org/x/sys/windows Go package https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegenamew

func OpenProcessTokenN

func OpenProcessTokenN(ProcessHandle *unsafe.Pointer, DesiredAccess int) (token *unsafe.Pointer, err error)

OpenProcessTokenN opens the access token associated with a process The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openprocesstoken

func OpenThreadTokenN

func OpenThreadTokenN(ThreadHandle *unsafe.Pointer, DesiredAccess uint32, OpenAsSelf bool) (hToken *unsafe.Pointer, err error)

OpenThreadTokenN opens the access token associated with a thread. The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-openthreadtoken

func PrivilegeCheckN

func PrivilegeCheckN(hToken *unsafe.Pointer, privs PRIVILEGE_SET) (hasPriv bool, err error)

PrivilegeCheckN determines whether a specified set of privileges are enabled in an access token The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-privilegecheck

func RevertToSelfN

func RevertToSelfN() (err error)

RevertToSelfN terminates the impersonation of a client application https://docs.microsoft.com/en-us/windows/win32/api/securitybaseapi/nf-securitybaseapi-reverttoself

func SetThreadToken

func SetThreadToken(Thread, Token unsafe.Pointer) error

SetThreadToken assigns an impersonation token to a thread. The function can also cause a thread to stop using an impersonation token. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadtoken

Types

type LUID

type LUID struct {
	LowPart  uint32
	HighPart int32
}

LUID Describes a local identifier for an adapter https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-luid

func LookupPrivilegeValueN

func LookupPrivilegeValueN(priv string) (lpLuid LUID, err error)

LookupPrivilegeValueN retrieves the locally unique identifier (LUID) used on a specified system to locally represent the specified privilege name The "N" in the function name is for Native as it avoids using external packages https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-lookupprivilegevaluew

type LUID_AND_ATTRIBUTES

type LUID_AND_ATTRIBUTES struct {
	Luid       LUID
	Attributes uint32
}

LUID_AND_ATTRIBUTES structure represents a locally unique identifier (LUID) and its attributes https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-luid_and_attributes

type PRIVILEGE_SET

type PRIVILEGE_SET struct {
	PrivilegeCount uint32 // Specifies the number of privileges in the privilege set.
	Control        uint32 // Indicates that all of the specified privileges must be held by the process requesting access. If this flag is not set, the presence of any privileges in the user's access token grants the access.
	Privilege      []LUID_AND_ATTRIBUTES
}

PRIVILEGE_SET specifies a set of privileges. It is also used to indicate which, if any, privileges are held by a user or group requesting access to an object. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-privilege_set

typedef struct _PRIVILEGE_SET {
 DWORD               PrivilegeCount;
 DWORD               Control;
 LUID_AND_ATTRIBUTES Privilege[ANYSIZE_ARRAY];
} PRIVILEGE_SET, *PPRIVILEGE_SET;

type ProcessInformation

type ProcessInformation struct {
	Process   uintptr
	Thread    uintptr
	ProcessId uint32
	ThreadId  uint32
}

ProcessInformation Contains information about a newly created process and its primary thread. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-process_information https://pkg.go.dev/golang.org/x/sys/windows#ProcessInformation

type SID

type SID struct {
}

SID The security identifier (SID) structure is a variable-length structure used to uniquely identify users or groups. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid

typedef struct _SID {
 BYTE                     Revision;
 BYTE                     SubAuthorityCount;
 SID_IDENTIFIER_AUTHORITY IdentifierAuthority;

#if ...

DWORD                    *SubAuthority[];

#else

DWORD                    SubAuthority[ANYSIZE_ARRAY];

#endif } SID, *PISID;

type SID_AND_ATTRIBUTES

type SID_AND_ATTRIBUTES struct {
	Sid        *SID
	Attributes uint32
}

SID_AND_ATTRIBUTES structure represents a security identifier (SID) and its attributes. SIDs are used to uniquely identify users or groups https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_and_attributes typedef struct _SID_AND_ATTRIBUTES { #if ...

PISID Sid;

#else

PSID  Sid;

#endif

 DWORD Attributes;
} SID_AND_ATTRIBUTES, *PSID_AND_ATTRIBUTES;

type SID_IDENTIFIER_AUTHORITY

type SID_IDENTIFIER_AUTHORITY struct {
	Value [6]byte
}

SID_IDENTIFIER_AUTHORITY represents the top-level authority of a security identifier (SID). https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-sid_identifier_authority

typedef struct _SID_IDENTIFIER_AUTHORITY {
 BYTE Value[6];
} SID_IDENTIFIER_AUTHORITY, *PSID_IDENTIFIER_AUTHORITY;

type StartupInfo

type StartupInfo struct {
	Cb uint32

	Desktop       *uint16
	Title         *uint16
	X             uint32
	Y             uint32
	XSize         uint32
	YSize         uint32
	XCountChars   uint32
	YCountChars   uint32
	FillAttribute uint32
	Flags         uint32
	ShowWindow    uint16

	StdInput  uintptr
	StdOutput uintptr
	StdErr    uintptr
	// contains filtered or unexported fields
}

StartupInfo specifies the window station, desktop, standard handles, and appearance of the main window for a process at creation time. https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa https://pkg.go.dev/golang.org/x/sys/windows#StartupInfo

type TOKEN_PRIVILEGES

type TOKEN_PRIVILEGES struct {
	PrivilegeCount uint32
	Privileges     [1]LUID_AND_ATTRIBUTES
}

TOKEN_PRIVILEGES contains information about a set of privileges for an access token https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-token_privileges

type TOKEN_STATISTICS

type TOKEN_STATISTICS struct {
	TokenId            LUID
	AuthenticationId   LUID
	ExpirationTime     int64
	TokenType          uint32 // Enum of TokenPrimary 0 or TokenImpersonation 1
	ImpersonationLevel uint32 // Enum
	DynamicCharged     uint32
	DynamicAvailable   uint32
	GroupCount         uint32
	PrivilegeCount     uint32
	ModifiedId         LUID
}

TOKEN_STATISTICS contains information about an access token https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-token_statistics

typedef struct _TOKEN_STATISTICS {
 LUID                         TokenId;
 LUID                         AuthenticationId;
 LARGE_INTEGER                ExpirationTime;
 TOKEN_TYPE                   TokenType;
 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel;
 DWORD                        DynamicCharged;
 DWORD                        DynamicAvailable;
 DWORD                        GroupCount;
 DWORD                        PrivilegeCount;
 LUID                         ModifiedId;
} TOKEN_STATISTICS, *PTOKEN_STATISTICS;

type TOKEN_USER

type TOKEN_USER struct {
	User SID_AND_ATTRIBUTES
}

TOKEN_USER structure identifies the user associated with an access token https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-token_user

typedef struct _TOKEN_USER {
 SID_AND_ATTRIBUTES User;
} TOKEN_USER, *PTOKEN_USER;

Jump to

Keyboard shortcuts

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