windows

package
v0.0.0-...-63da651 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2022 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Rendered for windows/amd64

Overview

Package windows contains an interface to the low-level operating system primitives. OS details vary depending on the underlying system, and by default, godoc will display the OS-specific documentation for the current system. If you want godoc to display syscall documentation for another system, set $GOOS and $GOARCH to the desired system. For example, if you want to view documentation for freebsd/arm on linux/amd64, set $GOOS to freebsd and $GOARCH to arm.

The primary use of this package is inside other packages that provide a more portable interface to the system, such as "os", "time" and "net". Use those packages rather than this one if you can.

For details of the functions and data types in this package consult the manuals for the appropriate operating system.

These calls return err == nil to indicate success; otherwise err represents an operating system error describing the failure and holds a value of type syscall.Errno.

Index

Constants

View Source
const (
	EVENTLOG_SUCCESS          = 0
	EVENTLOG_ERROR_TYPE       = 1
	EVENTLOG_WARNING_TYPE     = 2
	EVENTLOG_INFORMATION_TYPE = 4
	EVENTLOG_AUDIT_SUCCESS    = 8
	EVENTLOG_AUDIT_FAILURE    = 16
)
View Source
const (
	NameUnknown          = 0
	NameFullyQualifiedDN = 1
	NameSamCompatible    = 2
	NameDisplay          = 3
	NameUniqueId         = 6
	NameCanonical        = 7
	NameUserPrincipal    = 8
	NameCanonicalEx      = 9
	NameServicePrincipal = 10
	NameDnsDomain        = 12
)
View Source
const (
	// do not reorder
	NetSetupUnknownStatus = iota
	NetSetupUnjoined
	NetSetupWorkgroupName
	NetSetupDomainName
)
View Source
const (
	// do not reorder
	SidTypeUser = 1 + iota
	SidTypeGroup
	SidTypeDomain
	SidTypeAlias
	SidTypeWellKnownGroup
	SidTypeDeletedAccount
	SidTypeInvalid
	SidTypeUnknown
	SidTypeComputer
	SidTypeLabel
)
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 (
	DOMAIN_ALIAS_RID_ADMINS                         = 0x220
	DOMAIN_ALIAS_RID_USERS                          = 0x221
	DOMAIN_ALIAS_RID_GUESTS                         = 0x222
	DOMAIN_ALIAS_RID_POWER_USERS                    = 0x223
	DOMAIN_ALIAS_RID_ACCOUNT_OPS                    = 0x224
	DOMAIN_ALIAS_RID_SYSTEM_OPS                     = 0x225
	DOMAIN_ALIAS_RID_PRINT_OPS                      = 0x226
	DOMAIN_ALIAS_RID_BACKUP_OPS                     = 0x227
	DOMAIN_ALIAS_RID_REPLICATOR                     = 0x228
	DOMAIN_ALIAS_RID_RAS_SERVERS                    = 0x229
	DOMAIN_ALIAS_RID_PREW2KCOMPACCESS               = 0x22a
	DOMAIN_ALIAS_RID_REMOTE_DESKTOP_USERS           = 0x22b
	DOMAIN_ALIAS_RID_NETWORK_CONFIGURATION_OPS      = 0x22c
	DOMAIN_ALIAS_RID_INCOMING_FOREST_TRUST_BUILDERS = 0x22d
	DOMAIN_ALIAS_RID_MONITORING_USERS               = 0x22e
	DOMAIN_ALIAS_RID_LOGGING_USERS                  = 0x22f
	DOMAIN_ALIAS_RID_AUTHORIZATIONACCESS            = 0x230
	DOMAIN_ALIAS_RID_TS_LICENSE_SERVERS             = 0x231
	DOMAIN_ALIAS_RID_DCOM_USERS                     = 0x232
	DOMAIN_ALIAS_RID_IUSERS                         = 0x238
	DOMAIN_ALIAS_RID_CRYPTO_OPERATORS               = 0x239
	DOMAIN_ALIAS_RID_CACHEABLE_PRINCIPALS_GROUP     = 0x23b
	DOMAIN_ALIAS_RID_NON_CACHEABLE_PRINCIPALS_GROUP = 0x23c
	DOMAIN_ALIAS_RID_EVENT_LOG_READERS_GROUP        = 0x23d
	DOMAIN_ALIAS_RID_CERTSVC_DCOM_ACCESS_GROUP      = 0x23e
)

Predefined domain-relative RIDs for local groups. See https://msdn.microsoft.com/en-us/library/windows/desktop/aa379649(v=vs.85).aspx

View Source
const (
	WinNullSid                                    = 0
	WinWorldSid                                   = 1
	WinLocalSid                                   = 2
	WinCreatorOwnerSid                            = 3
	WinCreatorGroupSid                            = 4
	WinCreatorOwnerServerSid                      = 5
	WinCreatorGroupServerSid                      = 6
	WinNtAuthoritySid                             = 7
	WinDialupSid                                  = 8
	WinNetworkSid                                 = 9
	WinBatchSid                                   = 10
	WinInteractiveSid                             = 11
	WinServiceSid                                 = 12
	WinAnonymousSid                               = 13
	WinProxySid                                   = 14
	WinEnterpriseControllersSid                   = 15
	WinSelfSid                                    = 16
	WinAuthenticatedUserSid                       = 17
	WinRestrictedCodeSid                          = 18
	WinTerminalServerSid                          = 19
	WinRemoteLogonIdSid                           = 20
	WinLogonIdsSid                                = 21
	WinLocalSystemSid                             = 22
	WinLocalServiceSid                            = 23
	WinNetworkServiceSid                          = 24
	WinBuiltinDomainSid                           = 25
	WinBuiltinAdministratorsSid                   = 26
	WinBuiltinUsersSid                            = 27
	WinBuiltinGuestsSid                           = 28
	WinBuiltinPowerUsersSid                       = 29
	WinBuiltinAccountOperatorsSid                 = 30
	WinBuiltinSystemOperatorsSid                  = 31
	WinBuiltinPrintOperatorsSid                   = 32
	WinBuiltinBackupOperatorsSid                  = 33
	WinBuiltinReplicatorSid                       = 34
	WinBuiltinPreWindows2000CompatibleAccessSid   = 35
	WinBuiltinRemoteDesktopUsersSid               = 36
	WinBuiltinNetworkConfigurationOperatorsSid    = 37
	WinAccountAdministratorSid                    = 38
	WinAccountGuestSid                            = 39
	WinAccountKrbtgtSid                           = 40
	WinAccountDomainAdminsSid                     = 41
	WinAccountDomainUsersSid                      = 42
	WinAccountDomainGuestsSid                     = 43
	WinAccountComputersSid                        = 44
	WinAccountControllersSid                      = 45
	WinAccountCertAdminsSid                       = 46
	WinAccountSchemaAdminsSid                     = 47
	WinAccountEnterpriseAdminsSid                 = 48
	WinAccountPolicyAdminsSid                     = 49
	WinAccountRasAndIasServersSid                 = 50
	WinNTLMAuthenticationSid                      = 51
	WinDigestAuthenticationSid                    = 52
	WinSChannelAuthenticationSid                  = 53
	WinThisOrganizationSid                        = 54
	WinOtherOrganizationSid                       = 55
	WinBuiltinIncomingForestTrustBuildersSid      = 56
	WinBuiltinPerfMonitoringUsersSid              = 57
	WinBuiltinPerfLoggingUsersSid                 = 58
	WinBuiltinAuthorizationAccessSid              = 59
	WinBuiltinTerminalServerLicenseServersSid     = 60
	WinBuiltinDCOMUsersSid                        = 61
	WinBuiltinIUsersSid                           = 62
	WinIUserSid                                   = 63
	WinBuiltinCryptoOperatorsSid                  = 64
	WinUntrustedLabelSid                          = 65
	WinLowLabelSid                                = 66
	WinMediumLabelSid                             = 67
	WinHighLabelSid                               = 68
	WinSystemLabelSid                             = 69
	WinWriteRestrictedCodeSid                     = 70
	WinCreatorOwnerRightsSid                      = 71
	WinCacheablePrincipalsGroupSid                = 72
	WinNonCacheablePrincipalsGroupSid             = 73
	WinEnterpriseReadonlyControllersSid           = 74
	WinAccountReadonlyControllersSid              = 75
	WinBuiltinEventLogReadersGroup                = 76
	WinNewEnterpriseReadonlyControllersSid        = 77
	WinBuiltinCertSvcDComAccessGroup              = 78
	WinMediumPlusLabelSid                         = 79
	WinLocalLogonSid                              = 80
	WinConsoleLogonSid                            = 81
	WinThisOrganizationCertificateSid             = 82
	WinApplicationPackageAuthoritySid             = 83
	WinBuiltinAnyPackageSid                       = 84
	WinCapabilityInternetClientSid                = 85
	WinCapabilityInternetClientServerSid          = 86
	WinCapabilityPrivateNetworkClientServerSid    = 87
	WinCapabilityPicturesLibrarySid               = 88
	WinCapabilityVideosLibrarySid                 = 89
	WinCapabilityMusicLibrarySid                  = 90
	WinCapabilityDocumentsLibrarySid              = 91
	WinCapabilitySharedUserCertificatesSid        = 92
	WinCapabilityEnterpriseAuthenticationSid      = 93
	WinCapabilityRemovableStorageSid              = 94
	WinBuiltinRDSRemoteAccessServersSid           = 95
	WinBuiltinRDSEndpointServersSid               = 96
	WinBuiltinRDSManagementServersSid             = 97
	WinUserModeDriversSid                         = 98
	WinBuiltinHyperVAdminsSid                     = 99
	WinAccountCloneableControllersSid             = 100
	WinBuiltinAccessControlAssistanceOperatorsSid = 101
	WinBuiltinRemoteManagementUsersSid            = 102
	WinAuthenticationAuthorityAssertedSid         = 103
	WinAuthenticationServiceAssertedSid           = 104
	WinLocalAccountSid                            = 105
	WinLocalAccountAndAdministratorSid            = 106
	WinAccountProtectedUsersSid                   = 107
	WinCapabilityAppointmentsSid                  = 108
	WinCapabilityContactsSid                      = 109
	WinAccountDefaultSystemManagedSid             = 110
	WinBuiltinDefaultSystemManagedGroupSid        = 111
	WinBuiltinStorageReplicaAdminsSid             = 112
	WinAccountKeyAdminsSid                        = 113
	WinAccountEnterpriseKeyAdminsSid              = 114
	WinAuthenticationKeyTrustSid                  = 115
	WinAuthenticationKeyPropertyMFASid            = 116
	WinAuthenticationKeyPropertyAttestationSid    = 117
	WinAuthenticationFreshKeyAuthSid              = 118
	WinBuiltinDeviceOwnersSid                     = 119
)
View Source
const (
	// do not reorder
	TOKEN_ASSIGN_PRIMARY = 1 << iota
	TOKEN_DUPLICATE
	TOKEN_IMPERSONATE
	TOKEN_QUERY
	TOKEN_QUERY_SOURCE
	TOKEN_ADJUST_PRIVILEGES
	TOKEN_ADJUST_GROUPS
	TOKEN_ADJUST_DEFAULT
	TOKEN_ADJUST_SESSIONID

	TOKEN_ALL_ACCESS = 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_ADJUST_SESSIONID
	TOKEN_READ  = STANDARD_RIGHTS_READ | TOKEN_QUERY
	TOKEN_WRITE = STANDARD_RIGHTS_WRITE |
		TOKEN_ADJUST_PRIVILEGES |
		TOKEN_ADJUST_GROUPS |
		TOKEN_ADJUST_DEFAULT
	TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE
)
View Source
const (
	// do not reorder
	TokenUser = 1 + iota
	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
	MaxTokenInfoClass
)
View Source
const (
	SE_GROUP_MANDATORY          = 0x00000001
	SE_GROUP_ENABLED_BY_DEFAULT = 0x00000002
	SE_GROUP_ENABLED            = 0x00000004
	SE_GROUP_OWNER              = 0x00000008
	SE_GROUP_USE_FOR_DENY_ONLY  = 0x00000010
	SE_GROUP_INTEGRITY          = 0x00000020
	SE_GROUP_INTEGRITY_ENABLED  = 0x00000040
	SE_GROUP_LOGON_ID           = 0xC0000000
	SE_GROUP_RESOURCE           = 0x20000000
	SE_GROUP_VALID_ATTRIBUTES   = SE_GROUP_MANDATORY | SE_GROUP_ENABLED_BY_DEFAULT | SE_GROUP_ENABLED | SE_GROUP_OWNER | SE_GROUP_USE_FOR_DENY_ONLY | SE_GROUP_LOGON_ID | SE_GROUP_RESOURCE | SE_GROUP_INTEGRITY | SE_GROUP_INTEGRITY_ENABLED
)

Group attributes inside of Tokengroups.Groups[i].Attributes

View Source
const (
	SE_PRIVILEGE_ENABLED_BY_DEFAULT = 0x00000001
	SE_PRIVILEGE_ENABLED            = 0x00000002
	SE_PRIVILEGE_REMOVED            = 0x00000004
	SE_PRIVILEGE_USED_FOR_ACCESS    = 0x80000000
	SE_PRIVILEGE_VALID_ATTRIBUTES   = SE_PRIVILEGE_ENABLED_BY_DEFAULT | SE_PRIVILEGE_ENABLED | SE_PRIVILEGE_REMOVED | SE_PRIVILEGE_USED_FOR_ACCESS
)

Privilege attributes

View Source
const (
	TokenPrimary       = 1
	TokenImpersonation = 2
)

Token types

View Source
const (
	SecurityAnonymous      = 0
	SecurityIdentification = 1
	SecurityImpersonation  = 2
	SecurityDelegation     = 3
)

Impersonation levels

View Source
const (
	WTS_CONSOLE_CONNECT        = 0x1
	WTS_CONSOLE_DISCONNECT     = 0x2
	WTS_REMOTE_CONNECT         = 0x3
	WTS_REMOTE_DISCONNECT      = 0x4
	WTS_SESSION_LOGON          = 0x5
	WTS_SESSION_LOGOFF         = 0x6
	WTS_SESSION_LOCK           = 0x7
	WTS_SESSION_UNLOCK         = 0x8
	WTS_SESSION_REMOTE_CONTROL = 0x9
	WTS_SESSION_CREATE         = 0xa
	WTS_SESSION_TERMINATE      = 0xb
)
View Source
const (
	WTSActive       = 0
	WTSConnected    = 1
	WTSConnectQuery = 2
	WTSShadow       = 3
	WTSDisconnected = 4
	WTSIdle         = 5
	WTSListen       = 6
	WTSReset        = 7
	WTSDown         = 8
	WTSInit         = 9
)
View Source
const (
	SECURITY_STATIC_TRACKING  = 0
	SECURITY_DYNAMIC_TRACKING = 1
)

Constants for the ContextTrackingMode field of SECURITY_QUALITY_OF_SERVICE.

View Source
const (
	SE_UNKNOWN_OBJECT_TYPE     = 0
	SE_FILE_OBJECT             = 1
	SE_SERVICE                 = 2
	SE_PRINTER                 = 3
	SE_REGISTRY_KEY            = 4
	SE_LMSHARE                 = 5
	SE_KERNEL_OBJECT           = 6
	SE_WINDOW_OBJECT           = 7
	SE_DS_OBJECT               = 8
	SE_DS_OBJECT_ALL           = 9
	SE_PROVIDER_DEFINED_OBJECT = 10
	SE_WMIGUID_OBJECT          = 11
	SE_REGISTRY_WOW64_32KEY    = 12
	SE_REGISTRY_WOW64_64KEY    = 13
)

Constants for type SE_OBJECT_TYPE

View Source
const (
	OWNER_SECURITY_INFORMATION            = 0x00000001
	GROUP_SECURITY_INFORMATION            = 0x00000002
	DACL_SECURITY_INFORMATION             = 0x00000004
	SACL_SECURITY_INFORMATION             = 0x00000008
	LABEL_SECURITY_INFORMATION            = 0x00000010
	ATTRIBUTE_SECURITY_INFORMATION        = 0x00000020
	SCOPE_SECURITY_INFORMATION            = 0x00000040
	BACKUP_SECURITY_INFORMATION           = 0x00010000
	PROTECTED_DACL_SECURITY_INFORMATION   = 0x80000000
	PROTECTED_SACL_SECURITY_INFORMATION   = 0x40000000
	UNPROTECTED_DACL_SECURITY_INFORMATION = 0x20000000
	UNPROTECTED_SACL_SECURITY_INFORMATION = 0x10000000
)

Constants for type SECURITY_INFORMATION

View Source
const (
	SE_OWNER_DEFAULTED       = 0x0001
	SE_GROUP_DEFAULTED       = 0x0002
	SE_DACL_PRESENT          = 0x0004
	SE_DACL_DEFAULTED        = 0x0008
	SE_SACL_PRESENT          = 0x0010
	SE_SACL_DEFAULTED        = 0x0020
	SE_DACL_AUTO_INHERIT_REQ = 0x0100
	SE_SACL_AUTO_INHERIT_REQ = 0x0200
	SE_DACL_AUTO_INHERITED   = 0x0400
	SE_SACL_AUTO_INHERITED   = 0x0800
	SE_DACL_PROTECTED        = 0x1000
	SE_SACL_PROTECTED        = 0x2000
	SE_RM_CONTROL_VALID      = 0x4000
	SE_SELF_RELATIVE         = 0x8000
)

Constants for type SECURITY_DESCRIPTOR_CONTROL

View Source
const (
	DELETE                   = 0x00010000
	READ_CONTROL             = 0x00020000
	WRITE_DAC                = 0x00040000
	WRITE_OWNER              = 0x00080000
	SYNCHRONIZE              = 0x00100000
	STANDARD_RIGHTS_REQUIRED = 0x000F0000
	STANDARD_RIGHTS_READ     = READ_CONTROL
	STANDARD_RIGHTS_WRITE    = READ_CONTROL
	STANDARD_RIGHTS_EXECUTE  = READ_CONTROL
	STANDARD_RIGHTS_ALL      = 0x001F0000
	SPECIFIC_RIGHTS_ALL      = 0x0000FFFF
	ACCESS_SYSTEM_SECURITY   = 0x01000000
	MAXIMUM_ALLOWED          = 0x02000000
	GENERIC_READ             = 0x80000000
	GENERIC_WRITE            = 0x40000000
	GENERIC_EXECUTE          = 0x20000000
	GENERIC_ALL              = 0x10000000
)

Constants for type ACCESS_MASK

View Source
const (
	NOT_USED_ACCESS   = 0
	GRANT_ACCESS      = 1
	SET_ACCESS        = 2
	DENY_ACCESS       = 3
	REVOKE_ACCESS     = 4
	SET_AUDIT_SUCCESS = 5
	SET_AUDIT_FAILURE = 6
)

Constants for type ACCESS_MODE

View Source
const (
	NO_INHERITANCE                     = 0x0
	SUB_OBJECTS_ONLY_INHERIT           = 0x1
	SUB_CONTAINERS_ONLY_INHERIT        = 0x2
	SUB_CONTAINERS_AND_OBJECTS_INHERIT = 0x3
	INHERIT_NO_PROPAGATE               = 0x4
	INHERIT_ONLY                       = 0x8
	INHERITED_ACCESS_ENTRY             = 0x10
	INHERITED_PARENT                   = 0x10000000
	INHERITED_GRANDPARENT              = 0x20000000
	OBJECT_INHERIT_ACE                 = 0x1
	CONTAINER_INHERIT_ACE              = 0x2
	NO_PROPAGATE_INHERIT_ACE           = 0x4
	INHERIT_ONLY_ACE                   = 0x8
	INHERITED_ACE                      = 0x10
	VALID_INHERIT_FLAGS                = 0x1F
)

Constants for AceFlags and Inheritance fields

View Source
const (
	NO_MULTIPLE_TRUSTEE    = 0
	TRUSTEE_IS_IMPERSONATE = 1
)

Constants for MULTIPLE_TRUSTEE_OPERATION

View Source
const (
	TRUSTEE_IS_SID              = 0
	TRUSTEE_IS_NAME             = 1
	TRUSTEE_BAD_FORM            = 2
	TRUSTEE_IS_OBJECTS_AND_SID  = 3
	TRUSTEE_IS_OBJECTS_AND_NAME = 4
)

Constants for TRUSTEE_FORM

View Source
const (
	TRUSTEE_IS_UNKNOWN          = 0
	TRUSTEE_IS_USER             = 1
	TRUSTEE_IS_GROUP            = 2
	TRUSTEE_IS_DOMAIN           = 3
	TRUSTEE_IS_ALIAS            = 4
	TRUSTEE_IS_WELL_KNOWN_GROUP = 5
	TRUSTEE_IS_DELETED          = 6
	TRUSTEE_IS_INVALID          = 7
	TRUSTEE_IS_COMPUTER         = 8
)

Constants for TRUSTEE_TYPE

View Source
const (
	ACE_OBJECT_TYPE_PRESENT           = 0x1
	ACE_INHERITED_OBJECT_TYPE_PRESENT = 0x2
)

Constants for ObjectsPresent field

View Source
const (
	// Invented values to support what package os expects.
	O_RDONLY   = 0x00000
	O_WRONLY   = 0x00001
	O_RDWR     = 0x00002
	O_CREAT    = 0x00040
	O_EXCL     = 0x00080
	O_NOCTTY   = 0x00100
	O_TRUNC    = 0x00200
	O_NONBLOCK = 0x00800
	O_APPEND   = 0x00400
	O_SYNC     = 0x01000
	O_ASYNC    = 0x02000
	O_CLOEXEC  = 0x80000
)
View Source
const (
	// More invented values for signals
	SIGHUP  = Signal(0x1)
	SIGINT  = Signal(0x2)
	SIGQUIT = Signal(0x3)
	SIGILL  = Signal(0x4)
	SIGTRAP = Signal(0x5)
	SIGABRT = Signal(0x6)
	SIGBUS  = Signal(0x7)
	SIGFPE  = Signal(0x8)
	SIGKILL = Signal(0x9)
	SIGSEGV = Signal(0xb)
	SIGPIPE = Signal(0xd)
	SIGALRM = Signal(0xe)
	SIGTERM = Signal(0xf)
)
View Source
const (
	FILE_READ_DATA        = 0x00000001
	FILE_READ_ATTRIBUTES  = 0x00000080
	FILE_READ_EA          = 0x00000008
	FILE_WRITE_DATA       = 0x00000002
	FILE_WRITE_ATTRIBUTES = 0x00000100
	FILE_WRITE_EA         = 0x00000010
	FILE_APPEND_DATA      = 0x00000004
	FILE_EXECUTE          = 0x00000020

	FILE_GENERIC_READ    = STANDARD_RIGHTS_READ | FILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | SYNCHRONIZE
	FILE_GENERIC_WRITE   = STANDARD_RIGHTS_WRITE | FILE_WRITE_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | FILE_APPEND_DATA | SYNCHRONIZE
	FILE_GENERIC_EXECUTE = STANDARD_RIGHTS_EXECUTE | FILE_READ_ATTRIBUTES | FILE_EXECUTE | SYNCHRONIZE

	FILE_LIST_DIRECTORY = 0x00000001
	FILE_TRAVERSE       = 0x00000020

	FILE_SHARE_READ   = 0x00000001
	FILE_SHARE_WRITE  = 0x00000002
	FILE_SHARE_DELETE = 0x00000004

	FILE_ATTRIBUTE_READONLY              = 0x00000001
	FILE_ATTRIBUTE_HIDDEN                = 0x00000002
	FILE_ATTRIBUTE_SYSTEM                = 0x00000004
	FILE_ATTRIBUTE_DIRECTORY             = 0x00000010
	FILE_ATTRIBUTE_ARCHIVE               = 0x00000020
	FILE_ATTRIBUTE_DEVICE                = 0x00000040
	FILE_ATTRIBUTE_NORMAL                = 0x00000080
	FILE_ATTRIBUTE_TEMPORARY             = 0x00000100
	FILE_ATTRIBUTE_SPARSE_FILE           = 0x00000200
	FILE_ATTRIBUTE_REPARSE_POINT         = 0x00000400
	FILE_ATTRIBUTE_COMPRESSED            = 0x00000800
	FILE_ATTRIBUTE_OFFLINE               = 0x00001000
	FILE_ATTRIBUTE_NOT_CONTENT_INDEXED   = 0x00002000
	FILE_ATTRIBUTE_ENCRYPTED             = 0x00004000
	FILE_ATTRIBUTE_INTEGRITY_STREAM      = 0x00008000
	FILE_ATTRIBUTE_VIRTUAL               = 0x00010000
	FILE_ATTRIBUTE_NO_SCRUB_DATA         = 0x00020000
	FILE_ATTRIBUTE_RECALL_ON_OPEN        = 0x00040000
	FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS = 0x00400000

	INVALID_FILE_ATTRIBUTES = 0xffffffff

	CREATE_NEW        = 1
	CREATE_ALWAYS     = 2
	OPEN_EXISTING     = 3
	OPEN_ALWAYS       = 4
	TRUNCATE_EXISTING = 5

	FILE_FLAG_OPEN_REQUIRING_OPLOCK = 0x00040000
	FILE_FLAG_FIRST_PIPE_INSTANCE   = 0x00080000
	FILE_FLAG_OPEN_NO_RECALL        = 0x00100000
	FILE_FLAG_OPEN_REPARSE_POINT    = 0x00200000
	FILE_FLAG_SESSION_AWARE         = 0x00800000
	FILE_FLAG_POSIX_SEMANTICS       = 0x01000000
	FILE_FLAG_BACKUP_SEMANTICS      = 0x02000000
	FILE_FLAG_DELETE_ON_CLOSE       = 0x04000000
	FILE_FLAG_SEQUENTIAL_SCAN       = 0x08000000
	FILE_FLAG_RANDOM_ACCESS         = 0x10000000
	FILE_FLAG_NO_BUFFERING          = 0x20000000
	FILE_FLAG_OVERLAPPED            = 0x40000000
	FILE_FLAG_WRITE_THROUGH         = 0x80000000

	HANDLE_FLAG_INHERIT    = 0x00000001
	STARTF_USESTDHANDLES   = 0x00000100
	STARTF_USESHOWWINDOW   = 0x00000001
	DUPLICATE_CLOSE_SOURCE = 0x00000001
	DUPLICATE_SAME_ACCESS  = 0x00000002

	STD_INPUT_HANDLE  = -10 & (1<<32 - 1)
	STD_OUTPUT_HANDLE = -11 & (1<<32 - 1)
	STD_ERROR_HANDLE  = -12 & (1<<32 - 1)

	FILE_BEGIN   = 0
	FILE_CURRENT = 1
	FILE_END     = 2

	LANG_ENGLISH       = 0x09
	SUBLANG_ENGLISH_US = 0x01

	FORMAT_MESSAGE_ALLOCATE_BUFFER = 256
	FORMAT_MESSAGE_IGNORE_INSERTS  = 512
	FORMAT_MESSAGE_FROM_STRING     = 1024
	FORMAT_MESSAGE_FROM_HMODULE    = 2048
	FORMAT_MESSAGE_FROM_SYSTEM     = 4096
	FORMAT_MESSAGE_ARGUMENT_ARRAY  = 8192
	FORMAT_MESSAGE_MAX_WIDTH_MASK  = 255

	MAX_PATH      = 260
	MAX_LONG_PATH = 32768

	MAX_MODULE_NAME32 = 255

	MAX_COMPUTERNAME_LENGTH = 15

	MAX_DHCPV6_DUID_LENGTH = 130

	MAX_DNS_SUFFIX_STRING_LENGTH = 256

	TIME_ZONE_ID_UNKNOWN  = 0
	TIME_ZONE_ID_STANDARD = 1

	TIME_ZONE_ID_DAYLIGHT = 2
	IGNORE                = 0
	INFINITE              = 0xffffffff

	WAIT_ABANDONED = 0x00000080
	WAIT_OBJECT_0  = 0x00000000
	WAIT_FAILED    = 0xFFFFFFFF

	// Access rights for process.
	PROCESS_CREATE_PROCESS            = 0x0080
	PROCESS_CREATE_THREAD             = 0x0002
	PROCESS_DUP_HANDLE                = 0x0040
	PROCESS_QUERY_INFORMATION         = 0x0400
	PROCESS_QUERY_LIMITED_INFORMATION = 0x1000
	PROCESS_SET_INFORMATION           = 0x0200
	PROCESS_SET_QUOTA                 = 0x0100
	PROCESS_SUSPEND_RESUME            = 0x0800
	PROCESS_TERMINATE                 = 0x0001
	PROCESS_VM_OPERATION              = 0x0008
	PROCESS_VM_READ                   = 0x0010
	PROCESS_VM_WRITE                  = 0x0020

	// Access rights for thread.
	THREAD_DIRECT_IMPERSONATION      = 0x0200
	THREAD_GET_CONTEXT               = 0x0008
	THREAD_IMPERSONATE               = 0x0100
	THREAD_QUERY_INFORMATION         = 0x0040
	THREAD_QUERY_LIMITED_INFORMATION = 0x0800
	THREAD_SET_CONTEXT               = 0x0010
	THREAD_SET_INFORMATION           = 0x0020
	THREAD_SET_LIMITED_INFORMATION   = 0x0400
	THREAD_SET_THREAD_TOKEN          = 0x0080
	THREAD_SUSPEND_RESUME            = 0x0002
	THREAD_TERMINATE                 = 0x0001

	FILE_MAP_COPY    = 0x01
	FILE_MAP_WRITE   = 0x02
	FILE_MAP_READ    = 0x04
	FILE_MAP_EXECUTE = 0x20

	CTRL_C_EVENT        = 0
	CTRL_BREAK_EVENT    = 1
	CTRL_CLOSE_EVENT    = 2
	CTRL_LOGOFF_EVENT   = 5
	CTRL_SHUTDOWN_EVENT = 6

	// Windows reserves errors >= 1<<29 for application use.
	APPLICATION_ERROR = 1 << 29
)
View Source
const (
	// Process creation flags.
	CREATE_BREAKAWAY_FROM_JOB        = 0x01000000
	CREATE_DEFAULT_ERROR_MODE        = 0x04000000
	CREATE_NEW_CONSOLE               = 0x00000010
	CREATE_NEW_PROCESS_GROUP         = 0x00000200
	CREATE_NO_WINDOW                 = 0x08000000
	CREATE_PROTECTED_PROCESS         = 0x00040000
	CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000
	CREATE_SEPARATE_WOW_VDM          = 0x00000800
	CREATE_SHARED_WOW_VDM            = 0x00001000
	CREATE_SUSPENDED                 = 0x00000004
	CREATE_UNICODE_ENVIRONMENT       = 0x00000400
	DEBUG_ONLY_THIS_PROCESS          = 0x00000002
	DEBUG_PROCESS                    = 0x00000001
	DETACHED_PROCESS                 = 0x00000008
	EXTENDED_STARTUPINFO_PRESENT     = 0x00080000
	INHERIT_PARENT_AFFINITY          = 0x00010000
)
View Source
const (
	// attributes for ProcThreadAttributeList
	PROC_THREAD_ATTRIBUTE_PARENT_PROCESS    = 0x00020000
	PROC_THREAD_ATTRIBUTE_HANDLE_LIST       = 0x00020002
	PROC_THREAD_ATTRIBUTE_GROUP_AFFINITY    = 0x00030003
	PROC_THREAD_ATTRIBUTE_PREFERRED_NODE    = 0x00020004
	PROC_THREAD_ATTRIBUTE_IDEAL_PROCESSOR   = 0x00030005
	PROC_THREAD_ATTRIBUTE_MITIGATION_POLICY = 0x00020007
	PROC_THREAD_ATTRIBUTE_UMS_THREAD        = 0x00030006
	PROC_THREAD_ATTRIBUTE_PROTECTION_LEVEL  = 0x0002000b
)
View Source
const (
	// flags for CreateToolhelp32Snapshot
	TH32CS_SNAPHEAPLIST = 0x01
	TH32CS_SNAPPROCESS  = 0x02
	TH32CS_SNAPTHREAD   = 0x04
	TH32CS_SNAPMODULE   = 0x08
	TH32CS_SNAPMODULE32 = 0x10
	TH32CS_SNAPALL      = TH32CS_SNAPHEAPLIST | TH32CS_SNAPMODULE | TH32CS_SNAPPROCESS | TH32CS_SNAPTHREAD
	TH32CS_INHERIT      = 0x80000000
)
View Source
const (
	// flags for EnumProcessModulesEx
	LIST_MODULES_32BIT   = 0x01
	LIST_MODULES_64BIT   = 0x02
	LIST_MODULES_ALL     = 0x03
	LIST_MODULES_DEFAULT = 0x00
)
View Source
const (
	// filters for ReadDirectoryChangesW and FindFirstChangeNotificationW
	FILE_NOTIFY_CHANGE_FILE_NAME   = 0x001
	FILE_NOTIFY_CHANGE_DIR_NAME    = 0x002
	FILE_NOTIFY_CHANGE_ATTRIBUTES  = 0x004
	FILE_NOTIFY_CHANGE_SIZE        = 0x008
	FILE_NOTIFY_CHANGE_LAST_WRITE  = 0x010
	FILE_NOTIFY_CHANGE_LAST_ACCESS = 0x020
	FILE_NOTIFY_CHANGE_CREATION    = 0x040
	FILE_NOTIFY_CHANGE_SECURITY    = 0x100
)
View Source
const (
	// do not reorder
	FILE_ACTION_ADDED = iota + 1
	FILE_ACTION_REMOVED
	FILE_ACTION_MODIFIED
	FILE_ACTION_RENAMED_OLD_NAME
	FILE_ACTION_RENAMED_NEW_NAME
)
View Source
const (
	// wincrypt.h
	/* certenrolld_begin -- PROV_RSA_*/
	PROV_RSA_FULL      = 1
	PROV_RSA_SIG       = 2
	PROV_DSS           = 3
	PROV_FORTEZZA      = 4
	PROV_MS_EXCHANGE   = 5
	PROV_SSL           = 6
	PROV_RSA_SCHANNEL  = 12
	PROV_DSS_DH        = 13
	PROV_EC_ECDSA_SIG  = 14
	PROV_EC_ECNRA_SIG  = 15
	PROV_EC_ECDSA_FULL = 16
	PROV_EC_ECNRA_FULL = 17
	PROV_DH_SCHANNEL   = 18
	PROV_SPYRUS_LYNKS  = 20
	PROV_RNG           = 21
	PROV_INTEL_SEC     = 22
	PROV_REPLACE_OWF   = 23
	PROV_RSA_AES       = 24

	/* dwFlags definitions for CryptAcquireContext */
	CRYPT_VERIFYCONTEXT              = 0xF0000000
	CRYPT_NEWKEYSET                  = 0x00000008
	CRYPT_DELETEKEYSET               = 0x00000010
	CRYPT_MACHINE_KEYSET             = 0x00000020
	CRYPT_SILENT                     = 0x00000040
	CRYPT_DEFAULT_CONTAINER_OPTIONAL = 0x00000080

	/* Flags for PFXImportCertStore */
	CRYPT_EXPORTABLE                   = 0x00000001
	CRYPT_USER_PROTECTED               = 0x00000002
	CRYPT_USER_KEYSET                  = 0x00001000
	PKCS12_PREFER_CNG_KSP              = 0x00000100
	PKCS12_ALWAYS_CNG_KSP              = 0x00000200
	PKCS12_ALLOW_OVERWRITE_KEY         = 0x00004000
	PKCS12_NO_PERSIST_KEY              = 0x00008000
	PKCS12_INCLUDE_EXTENDED_PROPERTIES = 0x00000010

	/* Flags for CryptAcquireCertificatePrivateKey */
	CRYPT_ACQUIRE_CACHE_FLAG             = 0x00000001
	CRYPT_ACQUIRE_USE_PROV_INFO_FLAG     = 0x00000002
	CRYPT_ACQUIRE_COMPARE_KEY_FLAG       = 0x00000004
	CRYPT_ACQUIRE_NO_HEALING             = 0x00000008
	CRYPT_ACQUIRE_SILENT_FLAG            = 0x00000040
	CRYPT_ACQUIRE_WINDOW_HANDLE_FLAG     = 0x00000080
	CRYPT_ACQUIRE_NCRYPT_KEY_FLAGS_MASK  = 0x00070000
	CRYPT_ACQUIRE_ALLOW_NCRYPT_KEY_FLAG  = 0x00010000
	CRYPT_ACQUIRE_PREFER_NCRYPT_KEY_FLAG = 0x00020000
	CRYPT_ACQUIRE_ONLY_NCRYPT_KEY_FLAG   = 0x00040000

	/* pdwKeySpec for CryptAcquireCertificatePrivateKey */
	AT_KEYEXCHANGE       = 1
	AT_SIGNATURE         = 2
	CERT_NCRYPT_KEY_SPEC = 0xFFFFFFFF

	/* Default usage match type is AND with value zero */
	USAGE_MATCH_TYPE_AND = 0
	USAGE_MATCH_TYPE_OR  = 1

	/* msgAndCertEncodingType values for CertOpenStore function */
	X509_ASN_ENCODING   = 0x00000001
	PKCS_7_ASN_ENCODING = 0x00010000

	/* storeProvider values for CertOpenStore function */
	CERT_STORE_PROV_MSG               = 1
	CERT_STORE_PROV_MEMORY            = 2
	CERT_STORE_PROV_FILE              = 3
	CERT_STORE_PROV_REG               = 4
	CERT_STORE_PROV_PKCS7             = 5
	CERT_STORE_PROV_SERIALIZED        = 6
	CERT_STORE_PROV_FILENAME_A        = 7
	CERT_STORE_PROV_FILENAME_W        = 8
	CERT_STORE_PROV_FILENAME          = CERT_STORE_PROV_FILENAME_W
	CERT_STORE_PROV_SYSTEM_A          = 9
	CERT_STORE_PROV_SYSTEM_W          = 10
	CERT_STORE_PROV_SYSTEM            = CERT_STORE_PROV_SYSTEM_W
	CERT_STORE_PROV_COLLECTION        = 11
	CERT_STORE_PROV_SYSTEM_REGISTRY_A = 12
	CERT_STORE_PROV_SYSTEM_REGISTRY_W = 13
	CERT_STORE_PROV_SYSTEM_REGISTRY   = CERT_STORE_PROV_SYSTEM_REGISTRY_W
	CERT_STORE_PROV_PHYSICAL_W        = 14
	CERT_STORE_PROV_PHYSICAL          = CERT_STORE_PROV_PHYSICAL_W
	CERT_STORE_PROV_SMART_CARD_W      = 15
	CERT_STORE_PROV_SMART_CARD        = CERT_STORE_PROV_SMART_CARD_W
	CERT_STORE_PROV_LDAP_W            = 16
	CERT_STORE_PROV_LDAP              = CERT_STORE_PROV_LDAP_W
	CERT_STORE_PROV_PKCS12            = 17

	/* store characteristics (low WORD of flag) for CertOpenStore function */
	CERT_STORE_NO_CRYPT_RELEASE_FLAG            = 0x00000001
	CERT_STORE_SET_LOCALIZED_NAME_FLAG          = 0x00000002
	CERT_STORE_DEFER_CLOSE_UNTIL_LAST_FREE_FLAG = 0x00000004
	CERT_STORE_DELETE_FLAG                      = 0x00000010
	CERT_STORE_UNSAFE_PHYSICAL_FLAG             = 0x00000020
	CERT_STORE_SHARE_STORE_FLAG                 = 0x00000040
	CERT_STORE_SHARE_CONTEXT_FLAG               = 0x00000080
	CERT_STORE_MANIFOLD_FLAG                    = 0x00000100
	CERT_STORE_ENUM_ARCHIVED_FLAG               = 0x00000200
	CERT_STORE_UPDATE_KEYID_FLAG                = 0x00000400
	CERT_STORE_BACKUP_RESTORE_FLAG              = 0x00000800
	CERT_STORE_MAXIMUM_ALLOWED_FLAG             = 0x00001000
	CERT_STORE_CREATE_NEW_FLAG                  = 0x00002000
	CERT_STORE_OPEN_EXISTING_FLAG               = 0x00004000
	CERT_STORE_READONLY_FLAG                    = 0x00008000

	/* store locations (high WORD of flag) for CertOpenStore function */
	CERT_SYSTEM_STORE_CURRENT_USER               = 0x00010000
	CERT_SYSTEM_STORE_LOCAL_MACHINE              = 0x00020000
	CERT_SYSTEM_STORE_CURRENT_SERVICE            = 0x00040000
	CERT_SYSTEM_STORE_SERVICES                   = 0x00050000
	CERT_SYSTEM_STORE_USERS                      = 0x00060000
	CERT_SYSTEM_STORE_CURRENT_USER_GROUP_POLICY  = 0x00070000
	CERT_SYSTEM_STORE_LOCAL_MACHINE_GROUP_POLICY = 0x00080000
	CERT_SYSTEM_STORE_LOCAL_MACHINE_ENTERPRISE   = 0x00090000
	CERT_SYSTEM_STORE_UNPROTECTED_FLAG           = 0x40000000
	CERT_SYSTEM_STORE_RELOCATE_FLAG              = 0x80000000

	/* Miscellaneous high-WORD flags for CertOpenStore function */
	CERT_REGISTRY_STORE_REMOTE_FLAG      = 0x00010000
	CERT_REGISTRY_STORE_SERIALIZED_FLAG  = 0x00020000
	CERT_REGISTRY_STORE_ROAMING_FLAG     = 0x00040000
	CERT_REGISTRY_STORE_MY_IE_DIRTY_FLAG = 0x00080000
	CERT_REGISTRY_STORE_LM_GPT_FLAG      = 0x01000000
	CERT_REGISTRY_STORE_CLIENT_GPT_FLAG  = 0x80000000
	CERT_FILE_STORE_COMMIT_ENABLE_FLAG   = 0x00010000
	CERT_LDAP_STORE_SIGN_FLAG            = 0x00010000
	CERT_LDAP_STORE_AREC_EXCLUSIVE_FLAG  = 0x00020000
	CERT_LDAP_STORE_OPENED_FLAG          = 0x00040000
	CERT_LDAP_STORE_UNBIND_FLAG          = 0x00080000

	/* addDisposition values for CertAddCertificateContextToStore function */
	CERT_STORE_ADD_NEW                                 = 1
	CERT_STORE_ADD_USE_EXISTING                        = 2
	CERT_STORE_ADD_REPLACE_EXISTING                    = 3
	CERT_STORE_ADD_ALWAYS                              = 4
	CERT_STORE_ADD_REPLACE_EXISTING_INHERIT_PROPERTIES = 5
	CERT_STORE_ADD_NEWER                               = 6
	CERT_STORE_ADD_NEWER_INHERIT_PROPERTIES            = 7

	/* ErrorStatus values for CertTrustStatus struct */
	CERT_TRUST_NO_ERROR                          = 0x00000000
	CERT_TRUST_IS_NOT_TIME_VALID                 = 0x00000001
	CERT_TRUST_IS_REVOKED                        = 0x00000004
	CERT_TRUST_IS_NOT_SIGNATURE_VALID            = 0x00000008
	CERT_TRUST_IS_NOT_VALID_FOR_USAGE            = 0x00000010
	CERT_TRUST_IS_UNTRUSTED_ROOT                 = 0x00000020
	CERT_TRUST_REVOCATION_STATUS_UNKNOWN         = 0x00000040
	CERT_TRUST_IS_CYCLIC                         = 0x00000080
	CERT_TRUST_INVALID_EXTENSION                 = 0x00000100
	CERT_TRUST_INVALID_POLICY_CONSTRAINTS        = 0x00000200
	CERT_TRUST_INVALID_BASIC_CONSTRAINTS         = 0x00000400
	CERT_TRUST_INVALID_NAME_CONSTRAINTS          = 0x00000800
	CERT_TRUST_HAS_NOT_SUPPORTED_NAME_CONSTRAINT = 0x00001000
	CERT_TRUST_HAS_NOT_DEFINED_NAME_CONSTRAINT   = 0x00002000
	CERT_TRUST_HAS_NOT_PERMITTED_NAME_CONSTRAINT = 0x00004000
	CERT_TRUST_HAS_EXCLUDED_NAME_CONSTRAINT      = 0x00008000
	CERT_TRUST_IS_PARTIAL_CHAIN                  = 0x00010000
	CERT_TRUST_CTL_IS_NOT_TIME_VALID             = 0x00020000
	CERT_TRUST_CTL_IS_NOT_SIGNATURE_VALID        = 0x00040000
	CERT_TRUST_CTL_IS_NOT_VALID_FOR_USAGE        = 0x00080000
	CERT_TRUST_HAS_WEAK_SIGNATURE                = 0x00100000
	CERT_TRUST_IS_OFFLINE_REVOCATION             = 0x01000000
	CERT_TRUST_NO_ISSUANCE_CHAIN_POLICY          = 0x02000000
	CERT_TRUST_IS_EXPLICIT_DISTRUST              = 0x04000000
	CERT_TRUST_HAS_NOT_SUPPORTED_CRITICAL_EXT    = 0x08000000

	/* InfoStatus values for CertTrustStatus struct */
	CERT_TRUST_HAS_EXACT_MATCH_ISSUER        = 0x00000001
	CERT_TRUST_HAS_KEY_MATCH_ISSUER          = 0x00000002
	CERT_TRUST_HAS_NAME_MATCH_ISSUER         = 0x00000004
	CERT_TRUST_IS_SELF_SIGNED                = 0x00000008
	CERT_TRUST_HAS_PREFERRED_ISSUER          = 0x00000100
	CERT_TRUST_HAS_ISSUANCE_CHAIN_POLICY     = 0x00000400
	CERT_TRUST_HAS_VALID_NAME_CONSTRAINTS    = 0x00000400
	CERT_TRUST_IS_PEER_TRUSTED               = 0x00000800
	CERT_TRUST_HAS_CRL_VALIDITY_EXTENDED     = 0x00001000
	CERT_TRUST_IS_FROM_EXCLUSIVE_TRUST_STORE = 0x00002000
	CERT_TRUST_IS_CA_TRUSTED                 = 0x00004000
	CERT_TRUST_IS_COMPLEX_CHAIN              = 0x00010000

	/* Certificate Information Flags */
	CERT_INFO_VERSION_FLAG                 = 1
	CERT_INFO_SERIAL_NUMBER_FLAG           = 2
	CERT_INFO_SIGNATURE_ALGORITHM_FLAG     = 3
	CERT_INFO_ISSUER_FLAG                  = 4
	CERT_INFO_NOT_BEFORE_FLAG              = 5
	CERT_INFO_NOT_AFTER_FLAG               = 6
	CERT_INFO_SUBJECT_FLAG                 = 7
	CERT_INFO_SUBJECT_PUBLIC_KEY_INFO_FLAG = 8
	CERT_INFO_ISSUER_UNIQUE_ID_FLAG        = 9
	CERT_INFO_SUBJECT_UNIQUE_ID_FLAG       = 10
	CERT_INFO_EXTENSION_FLAG               = 11

	/* dwFindType for CertFindCertificateInStore  */
	CERT_COMPARE_MASK                     = 0xFFFF
	CERT_COMPARE_SHIFT                    = 16
	CERT_COMPARE_ANY                      = 0
	CERT_COMPARE_SHA1_HASH                = 1
	CERT_COMPARE_NAME                     = 2
	CERT_COMPARE_ATTR                     = 3
	CERT_COMPARE_MD5_HASH                 = 4
	CERT_COMPARE_PROPERTY                 = 5
	CERT_COMPARE_PUBLIC_KEY               = 6
	CERT_COMPARE_HASH                     = CERT_COMPARE_SHA1_HASH
	CERT_COMPARE_NAME_STR_A               = 7
	CERT_COMPARE_NAME_STR_W               = 8
	CERT_COMPARE_KEY_SPEC                 = 9
	CERT_COMPARE_ENHKEY_USAGE             = 10
	CERT_COMPARE_CTL_USAGE                = CERT_COMPARE_ENHKEY_USAGE
	CERT_COMPARE_SUBJECT_CERT             = 11
	CERT_COMPARE_ISSUER_OF                = 12
	CERT_COMPARE_EXISTING                 = 13
	CERT_COMPARE_SIGNATURE_HASH           = 14
	CERT_COMPARE_KEY_IDENTIFIER           = 15
	CERT_COMPARE_CERT_ID                  = 16
	CERT_COMPARE_CROSS_CERT_DIST_POINTS   = 17
	CERT_COMPARE_PUBKEY_MD5_HASH          = 18
	CERT_COMPARE_SUBJECT_INFO_ACCESS      = 19
	CERT_COMPARE_HASH_STR                 = 20
	CERT_COMPARE_HAS_PRIVATE_KEY          = 21
	CERT_FIND_ANY                         = (CERT_COMPARE_ANY << CERT_COMPARE_SHIFT)
	CERT_FIND_SHA1_HASH                   = (CERT_COMPARE_SHA1_HASH << CERT_COMPARE_SHIFT)
	CERT_FIND_MD5_HASH                    = (CERT_COMPARE_MD5_HASH << CERT_COMPARE_SHIFT)
	CERT_FIND_SIGNATURE_HASH              = (CERT_COMPARE_SIGNATURE_HASH << CERT_COMPARE_SHIFT)
	CERT_FIND_KEY_IDENTIFIER              = (CERT_COMPARE_KEY_IDENTIFIER << CERT_COMPARE_SHIFT)
	CERT_FIND_HASH                        = CERT_FIND_SHA1_HASH
	CERT_FIND_PROPERTY                    = (CERT_COMPARE_PROPERTY << CERT_COMPARE_SHIFT)
	CERT_FIND_PUBLIC_KEY                  = (CERT_COMPARE_PUBLIC_KEY << CERT_COMPARE_SHIFT)
	CERT_FIND_SUBJECT_NAME                = (CERT_COMPARE_NAME<<CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
	CERT_FIND_SUBJECT_ATTR                = (CERT_COMPARE_ATTR<<CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
	CERT_FIND_ISSUER_NAME                 = (CERT_COMPARE_NAME<<CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
	CERT_FIND_ISSUER_ATTR                 = (CERT_COMPARE_ATTR<<CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
	CERT_FIND_SUBJECT_STR_A               = (CERT_COMPARE_NAME_STR_A<<CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
	CERT_FIND_SUBJECT_STR_W               = (CERT_COMPARE_NAME_STR_W<<CERT_COMPARE_SHIFT | CERT_INFO_SUBJECT_FLAG)
	CERT_FIND_SUBJECT_STR                 = CERT_FIND_SUBJECT_STR_W
	CERT_FIND_ISSUER_STR_A                = (CERT_COMPARE_NAME_STR_A<<CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
	CERT_FIND_ISSUER_STR_W                = (CERT_COMPARE_NAME_STR_W<<CERT_COMPARE_SHIFT | CERT_INFO_ISSUER_FLAG)
	CERT_FIND_ISSUER_STR                  = CERT_FIND_ISSUER_STR_W
	CERT_FIND_KEY_SPEC                    = (CERT_COMPARE_KEY_SPEC << CERT_COMPARE_SHIFT)
	CERT_FIND_ENHKEY_USAGE                = (CERT_COMPARE_ENHKEY_USAGE << CERT_COMPARE_SHIFT)
	CERT_FIND_CTL_USAGE                   = CERT_FIND_ENHKEY_USAGE
	CERT_FIND_SUBJECT_CERT                = (CERT_COMPARE_SUBJECT_CERT << CERT_COMPARE_SHIFT)
	CERT_FIND_ISSUER_OF                   = (CERT_COMPARE_ISSUER_OF << CERT_COMPARE_SHIFT)
	CERT_FIND_EXISTING                    = (CERT_COMPARE_EXISTING << CERT_COMPARE_SHIFT)
	CERT_FIND_CERT_ID                     = (CERT_COMPARE_CERT_ID << CERT_COMPARE_SHIFT)
	CERT_FIND_CROSS_CERT_DIST_POINTS      = (CERT_COMPARE_CROSS_CERT_DIST_POINTS << CERT_COMPARE_SHIFT)
	CERT_FIND_PUBKEY_MD5_HASH             = (CERT_COMPARE_PUBKEY_MD5_HASH << CERT_COMPARE_SHIFT)
	CERT_FIND_SUBJECT_INFO_ACCESS         = (CERT_COMPARE_SUBJECT_INFO_ACCESS << CERT_COMPARE_SHIFT)
	CERT_FIND_HASH_STR                    = (CERT_COMPARE_HASH_STR << CERT_COMPARE_SHIFT)
	CERT_FIND_HAS_PRIVATE_KEY             = (CERT_COMPARE_HAS_PRIVATE_KEY << CERT_COMPARE_SHIFT)
	CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG  = 0x1
	CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG  = 0x2
	CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG = 0x4
	CERT_FIND_NO_ENHKEY_USAGE_FLAG        = 0x8
	CERT_FIND_OR_ENHKEY_USAGE_FLAG        = 0x10
	CERT_FIND_VALID_ENHKEY_USAGE_FLAG     = 0x20
	CERT_FIND_OPTIONAL_CTL_USAGE_FLAG     = CERT_FIND_OPTIONAL_ENHKEY_USAGE_FLAG
	CERT_FIND_EXT_ONLY_CTL_USAGE_FLAG     = CERT_FIND_EXT_ONLY_ENHKEY_USAGE_FLAG
	CERT_FIND_PROP_ONLY_CTL_USAGE_FLAG    = CERT_FIND_PROP_ONLY_ENHKEY_USAGE_FLAG
	CERT_FIND_NO_CTL_USAGE_FLAG           = CERT_FIND_NO_ENHKEY_USAGE_FLAG
	CERT_FIND_OR_CTL_USAGE_FLAG           = CERT_FIND_OR_ENHKEY_USAGE_FLAG
	CERT_FIND_VALID_CTL_USAGE_FLAG        = CERT_FIND_VALID_ENHKEY_USAGE_FLAG

	/* policyOID values for CertVerifyCertificateChainPolicy function */
	CERT_CHAIN_POLICY_BASE              = 1
	CERT_CHAIN_POLICY_AUTHENTICODE      = 2
	CERT_CHAIN_POLICY_AUTHENTICODE_TS   = 3
	CERT_CHAIN_POLICY_SSL               = 4
	CERT_CHAIN_POLICY_BASIC_CONSTRAINTS = 5
	CERT_CHAIN_POLICY_NT_AUTH           = 6
	CERT_CHAIN_POLICY_MICROSOFT_ROOT    = 7
	CERT_CHAIN_POLICY_EV                = 8
	CERT_CHAIN_POLICY_SSL_F12           = 9

	/* flag for dwFindType CertFindChainInStore  */
	CERT_CHAIN_FIND_BY_ISSUER = 1

	/* dwFindFlags for CertFindChainInStore when dwFindType == CERT_CHAIN_FIND_BY_ISSUER */
	CERT_CHAIN_FIND_BY_ISSUER_COMPARE_KEY_FLAG    = 0x0001
	CERT_CHAIN_FIND_BY_ISSUER_COMPLEX_CHAIN_FLAG  = 0x0002
	CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_URL_FLAG = 0x0004
	CERT_CHAIN_FIND_BY_ISSUER_LOCAL_MACHINE_FLAG  = 0x0008
	CERT_CHAIN_FIND_BY_ISSUER_NO_KEY_FLAG         = 0x4000
	CERT_CHAIN_FIND_BY_ISSUER_CACHE_ONLY_FLAG     = 0x8000

	/* Certificate Store close flags */
	CERT_CLOSE_STORE_FORCE_FLAG = 0x00000001
	CERT_CLOSE_STORE_CHECK_FLAG = 0x00000002

	/* CryptQueryObject object type */
	CERT_QUERY_OBJECT_FILE = 1
	CERT_QUERY_OBJECT_BLOB = 2

	/* CryptQueryObject content type flags */
	CERT_QUERY_CONTENT_CERT                    = 1
	CERT_QUERY_CONTENT_CTL                     = 2
	CERT_QUERY_CONTENT_CRL                     = 3
	CERT_QUERY_CONTENT_SERIALIZED_STORE        = 4
	CERT_QUERY_CONTENT_SERIALIZED_CERT         = 5
	CERT_QUERY_CONTENT_SERIALIZED_CTL          = 6
	CERT_QUERY_CONTENT_SERIALIZED_CRL          = 7
	CERT_QUERY_CONTENT_PKCS7_SIGNED            = 8
	CERT_QUERY_CONTENT_PKCS7_UNSIGNED          = 9
	CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED      = 10
	CERT_QUERY_CONTENT_PKCS10                  = 11
	CERT_QUERY_CONTENT_PFX                     = 12
	CERT_QUERY_CONTENT_CERT_PAIR               = 13
	CERT_QUERY_CONTENT_PFX_AND_LOAD            = 14
	CERT_QUERY_CONTENT_FLAG_CERT               = (1 << CERT_QUERY_CONTENT_CERT)
	CERT_QUERY_CONTENT_FLAG_CTL                = (1 << CERT_QUERY_CONTENT_CTL)
	CERT_QUERY_CONTENT_FLAG_CRL                = (1 << CERT_QUERY_CONTENT_CRL)
	CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE   = (1 << CERT_QUERY_CONTENT_SERIALIZED_STORE)
	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT    = (1 << CERT_QUERY_CONTENT_SERIALIZED_CERT)
	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL     = (1 << CERT_QUERY_CONTENT_SERIALIZED_CTL)
	CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL     = (1 << CERT_QUERY_CONTENT_SERIALIZED_CRL)
	CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED       = (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED)
	CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED     = (1 << CERT_QUERY_CONTENT_PKCS7_UNSIGNED)
	CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED = (1 << CERT_QUERY_CONTENT_PKCS7_SIGNED_EMBED)
	CERT_QUERY_CONTENT_FLAG_PKCS10             = (1 << CERT_QUERY_CONTENT_PKCS10)
	CERT_QUERY_CONTENT_FLAG_PFX                = (1 << CERT_QUERY_CONTENT_PFX)
	CERT_QUERY_CONTENT_FLAG_CERT_PAIR          = (1 << CERT_QUERY_CONTENT_CERT_PAIR)
	CERT_QUERY_CONTENT_FLAG_PFX_AND_LOAD       = (1 << CERT_QUERY_CONTENT_PFX_AND_LOAD)
	CERT_QUERY_CONTENT_FLAG_ALL                = (CERT_QUERY_CONTENT_FLAG_CERT | CERT_QUERY_CONTENT_FLAG_CTL | CERT_QUERY_CONTENT_FLAG_CRL | CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CTL | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CRL | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED_EMBED | CERT_QUERY_CONTENT_FLAG_PKCS10 | CERT_QUERY_CONTENT_FLAG_PFX | CERT_QUERY_CONTENT_FLAG_CERT_PAIR)
	CERT_QUERY_CONTENT_FLAG_ALL_ISSUER_CERT    = (CERT_QUERY_CONTENT_FLAG_CERT | CERT_QUERY_CONTENT_FLAG_SERIALIZED_STORE | CERT_QUERY_CONTENT_FLAG_SERIALIZED_CERT | CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED | CERT_QUERY_CONTENT_FLAG_PKCS7_UNSIGNED)

	/* CryptQueryObject format type flags */
	CERT_QUERY_FORMAT_BINARY                     = 1
	CERT_QUERY_FORMAT_BASE64_ENCODED             = 2
	CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED      = 3
	CERT_QUERY_FORMAT_FLAG_BINARY                = (1 << CERT_QUERY_FORMAT_BINARY)
	CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED        = (1 << CERT_QUERY_FORMAT_BASE64_ENCODED)
	CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED = (1 << CERT_QUERY_FORMAT_ASN_ASCII_HEX_ENCODED)
	CERT_QUERY_FORMAT_FLAG_ALL                   = (CERT_QUERY_FORMAT_FLAG_BINARY | CERT_QUERY_FORMAT_FLAG_BASE64_ENCODED | CERT_QUERY_FORMAT_FLAG_ASN_ASCII_HEX_ENCODED)

	/* CertGetNameString name types */
	CERT_NAME_EMAIL_TYPE            = 1
	CERT_NAME_RDN_TYPE              = 2
	CERT_NAME_ATTR_TYPE             = 3
	CERT_NAME_SIMPLE_DISPLAY_TYPE   = 4
	CERT_NAME_FRIENDLY_DISPLAY_TYPE = 5
	CERT_NAME_DNS_TYPE              = 6
	CERT_NAME_URL_TYPE              = 7
	CERT_NAME_UPN_TYPE              = 8

	/* CertGetNameString flags */
	CERT_NAME_ISSUER_FLAG              = 0x1
	CERT_NAME_DISABLE_IE4_UTF8_FLAG    = 0x10000
	CERT_NAME_SEARCH_ALL_NAMES_FLAG    = 0x2
	CERT_NAME_STR_ENABLE_PUNYCODE_FLAG = 0x00200000

	/* AuthType values for SSLExtraCertChainPolicyPara struct */
	AUTHTYPE_CLIENT = 1
	AUTHTYPE_SERVER = 2

	/* Checks values for SSLExtraCertChainPolicyPara struct */
	SECURITY_FLAG_IGNORE_REVOCATION        = 0x00000080
	SECURITY_FLAG_IGNORE_UNKNOWN_CA        = 0x00000100
	SECURITY_FLAG_IGNORE_WRONG_USAGE       = 0x00000200
	SECURITY_FLAG_IGNORE_CERT_CN_INVALID   = 0x00001000
	SECURITY_FLAG_IGNORE_CERT_DATE_INVALID = 0x00002000

	/* Flags for Crypt[Un]ProtectData */
	CRYPTPROTECT_UI_FORBIDDEN      = 0x1
	CRYPTPROTECT_LOCAL_MACHINE     = 0x4
	CRYPTPROTECT_CRED_SYNC         = 0x8
	CRYPTPROTECT_AUDIT             = 0x10
	CRYPTPROTECT_NO_RECOVERY       = 0x20
	CRYPTPROTECT_VERIFY_PROTECTION = 0x40
	CRYPTPROTECT_CRED_REGENERATE   = 0x80

	/* Flags for CryptProtectPromptStruct */
	CRYPTPROTECT_PROMPT_ON_UNPROTECT   = 1
	CRYPTPROTECT_PROMPT_ON_PROTECT     = 2
	CRYPTPROTECT_PROMPT_RESERVED       = 4
	CRYPTPROTECT_PROMPT_STRONG         = 8
	CRYPTPROTECT_PROMPT_REQUIRE_STRONG = 16
)
View Source
const (
	// flags for SetErrorMode
	SEM_FAILCRITICALERRORS     = 0x0001
	SEM_NOALIGNMENTFAULTEXCEPT = 0x0004
	SEM_NOGPFAULTERRORBOX      = 0x0002
	SEM_NOOPENFILEERRORBOX     = 0x8000
)
View Source
const (
	// Priority class.
	ABOVE_NORMAL_PRIORITY_CLASS   = 0x00008000
	BELOW_NORMAL_PRIORITY_CLASS   = 0x00004000
	HIGH_PRIORITY_CLASS           = 0x00000080
	IDLE_PRIORITY_CLASS           = 0x00000040
	NORMAL_PRIORITY_CLASS         = 0x00000020
	PROCESS_MODE_BACKGROUND_BEGIN = 0x00100000
	PROCESS_MODE_BACKGROUND_END   = 0x00200000
	REALTIME_PRIORITY_CLASS       = 0x00000100
)
View Source
const (
	WTD_UI_ALL    = 1
	WTD_UI_NONE   = 2
	WTD_UI_NOBAD  = 3
	WTD_UI_NOGOOD = 4

	WTD_REVOKE_NONE       = 0
	WTD_REVOKE_WHOLECHAIN = 1

	WTD_CHOICE_FILE    = 1
	WTD_CHOICE_CATALOG = 2
	WTD_CHOICE_BLOB    = 3
	WTD_CHOICE_SIGNER  = 4
	WTD_CHOICE_CERT    = 5

	WTD_STATEACTION_IGNORE           = 0x00000000
	WTD_STATEACTION_VERIFY           = 0x00000001
	WTD_STATEACTION_CLOSE            = 0x00000002
	WTD_STATEACTION_AUTO_CACHE       = 0x00000003
	WTD_STATEACTION_AUTO_CACHE_FLUSH = 0x00000004

	WTD_USE_IE4_TRUST_FLAG                  = 0x1
	WTD_NO_IE4_CHAIN_FLAG                   = 0x2
	WTD_NO_POLICY_USAGE_FLAG                = 0x4
	WTD_REVOCATION_CHECK_NONE               = 0x10
	WTD_REVOCATION_CHECK_END_CERT           = 0x20
	WTD_REVOCATION_CHECK_CHAIN              = 0x40
	WTD_REVOCATION_CHECK_CHAIN_EXCLUDE_ROOT = 0x80
	WTD_SAFER_FLAG                          = 0x100
	WTD_HASH_ONLY_FLAG                      = 0x200
	WTD_USE_DEFAULT_OSVER_CHECK             = 0x400
	WTD_LIFETIME_SIGNING_FLAG               = 0x800
	WTD_CACHE_ONLY_URL_RETRIEVAL            = 0x1000
	WTD_DISABLE_MD2_MD4                     = 0x2000
	WTD_MOTW                                = 0x4000

	WTD_UICONTEXT_EXECUTE = 0
	WTD_UICONTEXT_INSTALL = 1
)

wintrust.h constants for WinVerifyTrustEx

View Source
const (
	GetFileExInfoStandard = 0
	GetFileExMaxInfoLevel = 1
)
View Source
const (
	// winuser.h
	SW_HIDE            = 0
	SW_NORMAL          = 1
	SW_SHOWNORMAL      = 1
	SW_SHOWMINIMIZED   = 2
	SW_SHOWMAXIMIZED   = 3
	SW_MAXIMIZE        = 3
	SW_SHOWNOACTIVATE  = 4
	SW_SHOW            = 5
	SW_MINIMIZE        = 6
	SW_SHOWMINNOACTIVE = 7
	SW_SHOWNA          = 8
	SW_RESTORE         = 9
	SW_SHOWDEFAULT     = 10
	SW_FORCEMINIMIZE   = 11
)

ShowWindow constants

View Source
const (
	AF_UNSPEC  = 0
	AF_UNIX    = 1
	AF_INET    = 2
	AF_NETBIOS = 17
	AF_INET6   = 23
	AF_IRDA    = 26
	AF_BTH     = 32

	SOCK_STREAM    = 1
	SOCK_DGRAM     = 2
	SOCK_RAW       = 3
	SOCK_RDM       = 4
	SOCK_SEQPACKET = 5

	IPPROTO_IP      = 0
	IPPROTO_ICMP    = 1
	IPPROTO_IGMP    = 2
	BTHPROTO_RFCOMM = 3
	IPPROTO_TCP     = 6
	IPPROTO_UDP     = 17
	IPPROTO_IPV6    = 41
	IPPROTO_ICMPV6  = 58
	IPPROTO_RM      = 113

	SOL_SOCKET                = 0xffff
	SO_REUSEADDR              = 4
	SO_KEEPALIVE              = 8
	SO_DONTROUTE              = 16
	SO_BROADCAST              = 32
	SO_LINGER                 = 128
	SO_RCVBUF                 = 0x1002
	SO_RCVTIMEO               = 0x1006
	SO_SNDBUF                 = 0x1001
	SO_UPDATE_ACCEPT_CONTEXT  = 0x700b
	SO_UPDATE_CONNECT_CONTEXT = 0x7010

	IOC_OUT                            = 0x40000000
	IOC_IN                             = 0x80000000
	IOC_VENDOR                         = 0x18000000
	IOC_INOUT                          = IOC_IN | IOC_OUT
	IOC_WS2                            = 0x08000000
	SIO_GET_EXTENSION_FUNCTION_POINTER = IOC_INOUT | IOC_WS2 | 6
	SIO_KEEPALIVE_VALS                 = IOC_IN | IOC_VENDOR | 4
	SIO_UDP_CONNRESET                  = IOC_IN | IOC_VENDOR | 12

	IP_HDRINCL         = 0x2
	IP_TOS             = 0x3
	IP_TTL             = 0x4
	IP_MULTICAST_IF    = 0x9
	IP_MULTICAST_TTL   = 0xa
	IP_MULTICAST_LOOP  = 0xb
	IP_ADD_MEMBERSHIP  = 0xc
	IP_DROP_MEMBERSHIP = 0xd
	IP_PKTINFO         = 0x13

	IPV6_V6ONLY         = 0x1b
	IPV6_UNICAST_HOPS   = 0x4
	IPV6_MULTICAST_IF   = 0x9
	IPV6_MULTICAST_HOPS = 0xa
	IPV6_MULTICAST_LOOP = 0xb
	IPV6_JOIN_GROUP     = 0xc
	IPV6_LEAVE_GROUP    = 0xd
	IPV6_PKTINFO        = 0x13

	MSG_OOB       = 0x1
	MSG_PEEK      = 0x2
	MSG_DONTROUTE = 0x4
	MSG_WAITALL   = 0x8

	MSG_TRUNC  = 0x0100
	MSG_CTRUNC = 0x0200
	MSG_BCAST  = 0x0400
	MSG_MCAST  = 0x0800

	SOMAXCONN = 0x7fffffff

	TCP_NODELAY = 1

	SHUT_RD   = 0
	SHUT_WR   = 1
	SHUT_RDWR = 2

	WSADESCRIPTION_LEN = 256
	WSASYS_STATUS_LEN  = 128
)
View Source
const (
	WSA_FLAG_OVERLAPPED             = 0x01
	WSA_FLAG_MULTIPOINT_C_ROOT      = 0x02
	WSA_FLAG_MULTIPOINT_C_LEAF      = 0x04
	WSA_FLAG_MULTIPOINT_D_ROOT      = 0x08
	WSA_FLAG_MULTIPOINT_D_LEAF      = 0x10
	WSA_FLAG_ACCESS_SYSTEM_SECURITY = 0x40
	WSA_FLAG_NO_HANDLE_INHERIT      = 0x80
	WSA_FLAG_REGISTERED_IO          = 0x100
)

Flags for WSASocket

View Source
const (
	S_IFMT   = 0x1f000
	S_IFIFO  = 0x1000
	S_IFCHR  = 0x2000
	S_IFDIR  = 0x4000
	S_IFBLK  = 0x6000
	S_IFREG  = 0x8000
	S_IFLNK  = 0xa000
	S_IFSOCK = 0xc000
	S_ISUID  = 0x800
	S_ISGID  = 0x400
	S_ISVTX  = 0x200
	S_IRUSR  = 0x100
	S_IWRITE = 0x80
	S_IWUSR  = 0x80
	S_IXUSR  = 0x40
)

Invented values to support what package os expects.

View Source
const (
	FILE_TYPE_CHAR    = 0x0002
	FILE_TYPE_DISK    = 0x0001
	FILE_TYPE_PIPE    = 0x0003
	FILE_TYPE_REMOTE  = 0x8000
	FILE_TYPE_UNKNOWN = 0x0000
)
View Source
const (
	DNS_TYPE_A       = 0x0001
	DNS_TYPE_NS      = 0x0002
	DNS_TYPE_MD      = 0x0003
	DNS_TYPE_MF      = 0x0004
	DNS_TYPE_CNAME   = 0x0005
	DNS_TYPE_SOA     = 0x0006
	DNS_TYPE_MB      = 0x0007
	DNS_TYPE_MG      = 0x0008
	DNS_TYPE_MR      = 0x0009
	DNS_TYPE_NULL    = 0x000a
	DNS_TYPE_WKS     = 0x000b
	DNS_TYPE_PTR     = 0x000c
	DNS_TYPE_HINFO   = 0x000d
	DNS_TYPE_MINFO   = 0x000e
	DNS_TYPE_MX      = 0x000f
	DNS_TYPE_TEXT    = 0x0010
	DNS_TYPE_RP      = 0x0011
	DNS_TYPE_AFSDB   = 0x0012
	DNS_TYPE_X25     = 0x0013
	DNS_TYPE_ISDN    = 0x0014
	DNS_TYPE_RT      = 0x0015
	DNS_TYPE_NSAP    = 0x0016
	DNS_TYPE_NSAPPTR = 0x0017
	DNS_TYPE_SIG     = 0x0018
	DNS_TYPE_KEY     = 0x0019
	DNS_TYPE_PX      = 0x001a
	DNS_TYPE_GPOS    = 0x001b
	DNS_TYPE_AAAA    = 0x001c
	DNS_TYPE_LOC     = 0x001d
	DNS_TYPE_NXT     = 0x001e
	DNS_TYPE_EID     = 0x001f
	DNS_TYPE_NIMLOC  = 0x0020
	DNS_TYPE_SRV     = 0x0021
	DNS_TYPE_ATMA    = 0x0022
	DNS_TYPE_NAPTR   = 0x0023
	DNS_TYPE_KX      = 0x0024
	DNS_TYPE_CERT    = 0x0025
	DNS_TYPE_A6      = 0x0026
	DNS_TYPE_DNAME   = 0x0027
	DNS_TYPE_SINK    = 0x0028
	DNS_TYPE_OPT     = 0x0029
	DNS_TYPE_DS      = 0x002B
	DNS_TYPE_RRSIG   = 0x002E
	DNS_TYPE_NSEC    = 0x002F
	DNS_TYPE_DNSKEY  = 0x0030
	DNS_TYPE_DHCID   = 0x0031
	DNS_TYPE_UINFO   = 0x0064
	DNS_TYPE_UID     = 0x0065
	DNS_TYPE_GID     = 0x0066
	DNS_TYPE_UNSPEC  = 0x0067
	DNS_TYPE_ADDRS   = 0x00f8
	DNS_TYPE_TKEY    = 0x00f9
	DNS_TYPE_TSIG    = 0x00fa
	DNS_TYPE_IXFR    = 0x00fb
	DNS_TYPE_AXFR    = 0x00fc
	DNS_TYPE_MAILB   = 0x00fd
	DNS_TYPE_MAILA   = 0x00fe
	DNS_TYPE_ALL     = 0x00ff
	DNS_TYPE_ANY     = 0x00ff
	DNS_TYPE_WINS    = 0xff01
	DNS_TYPE_WINSR   = 0xff02
	DNS_TYPE_NBSTAT  = 0xff01
)
View Source
const (
	// flags inside DNSRecord.Dw
	DnsSectionQuestion   = 0x0000
	DnsSectionAnswer     = 0x0001
	DnsSectionAuthority  = 0x0002
	DnsSectionAdditional = 0x0003
)
View Source
const (
	TF_DISCONNECT         = 1
	TF_REUSE_SOCKET       = 2
	TF_WRITE_BEHIND       = 4
	TF_USE_DEFAULT_WORKER = 0
	TF_USE_SYSTEM_THREAD  = 16
	TF_USE_KERNEL_APC     = 32
)
View Source
const (
	IFF_UP           = 1
	IFF_BROADCAST    = 2
	IFF_LOOPBACK     = 4
	IFF_POINTTOPOINT = 8
	IFF_MULTICAST    = 16
)
View Source
const (
	// do not reorder
	HKEY_CLASSES_ROOT = 0x80000000 + iota
	HKEY_CURRENT_USER
	HKEY_LOCAL_MACHINE
	HKEY_USERS
	HKEY_PERFORMANCE_DATA
	HKEY_CURRENT_CONFIG
	HKEY_DYN_DATA

	KEY_QUERY_VALUE        = 1
	KEY_SET_VALUE          = 2
	KEY_CREATE_SUB_KEY     = 4
	KEY_ENUMERATE_SUB_KEYS = 8
	KEY_NOTIFY             = 16
	KEY_CREATE_LINK        = 32
	KEY_WRITE              = 0x20006
	KEY_EXECUTE            = 0x20019
	KEY_READ               = 0x20019
	KEY_WOW64_64KEY        = 0x0100
	KEY_WOW64_32KEY        = 0x0200
	KEY_ALL_ACCESS         = 0xf003f
)
View Source
const (
	// do not reorder
	REG_NONE = iota
	REG_SZ
	REG_EXPAND_SZ
	REG_BINARY
	REG_DWORD_LITTLE_ENDIAN
	REG_DWORD_BIG_ENDIAN
	REG_LINK
	REG_MULTI_SZ
	REG_RESOURCE_LIST
	REG_FULL_RESOURCE_DESCRIPTOR
	REG_RESOURCE_REQUIREMENTS_LIST
	REG_QWORD_LITTLE_ENDIAN
	REG_DWORD = REG_DWORD_LITTLE_ENDIAN
	REG_QWORD = REG_QWORD_LITTLE_ENDIAN
)
View Source
const (
	EVENT_MODIFY_STATE = 0x0002
	EVENT_ALL_ACCESS   = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3

	MUTANT_QUERY_STATE = 0x0001
	MUTANT_ALL_ACCESS  = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | MUTANT_QUERY_STATE

	SEMAPHORE_MODIFY_STATE = 0x0002
	SEMAPHORE_ALL_ACCESS   = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x3

	TIMER_QUERY_STATE  = 0x0001
	TIMER_MODIFY_STATE = 0x0002
	TIMER_ALL_ACCESS   = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | TIMER_QUERY_STATE | TIMER_MODIFY_STATE

	MUTEX_MODIFY_STATE = MUTANT_QUERY_STATE
	MUTEX_ALL_ACCESS   = MUTANT_ALL_ACCESS

	CREATE_EVENT_MANUAL_RESET  = 0x1
	CREATE_EVENT_INITIAL_SET   = 0x2
	CREATE_MUTEX_INITIAL_OWNER = 0x1
)
View Source
const (
	AI_PASSIVE     = 1
	AI_CANONNAME   = 2
	AI_NUMERICHOST = 4
)
View Source
const (
	FILE_SKIP_COMPLETION_PORT_ON_SUCCESS = 1
	FILE_SKIP_SET_EVENT_ON_HANDLE        = 2
)
View Source
const (
	WSAPROTOCOL_LEN    = 255
	MAX_PROTOCOL_CHAIN = 7
	BASE_PROTOCOL      = 1
	LAYERED_PROTOCOL   = 0

	XP1_CONNECTIONLESS           = 0x00000001
	XP1_GUARANTEED_DELIVERY      = 0x00000002
	XP1_GUARANTEED_ORDER         = 0x00000004
	XP1_MESSAGE_ORIENTED         = 0x00000008
	XP1_PSEUDO_STREAM            = 0x00000010
	XP1_GRACEFUL_CLOSE           = 0x00000020
	XP1_EXPEDITED_DATA           = 0x00000040
	XP1_CONNECT_DATA             = 0x00000080
	XP1_DISCONNECT_DATA          = 0x00000100
	XP1_SUPPORT_BROADCAST        = 0x00000200
	XP1_SUPPORT_MULTIPOINT       = 0x00000400
	XP1_MULTIPOINT_CONTROL_PLANE = 0x00000800
	XP1_MULTIPOINT_DATA_PLANE    = 0x00001000
	XP1_QOS_SUPPORTED            = 0x00002000
	XP1_UNI_SEND                 = 0x00008000
	XP1_UNI_RECV                 = 0x00010000
	XP1_IFS_HANDLES              = 0x00020000
	XP1_PARTIAL_MESSAGE          = 0x00040000
	XP1_SAN_SUPPORT_SDP          = 0x00080000

	PFL_MULTIPLE_PROTO_ENTRIES  = 0x00000001
	PFL_RECOMMENDED_PROTO_ENTRY = 0x00000002
	PFL_HIDDEN                  = 0x00000004
	PFL_MATCHES_PROTOCOL_ZERO   = 0x00000008
	PFL_NETWORKDIRECT_PROVIDER  = 0x00000010
)
View Source
const (
	FSCTL_CREATE_OR_GET_OBJECT_ID             = 0x0900C0
	FSCTL_DELETE_OBJECT_ID                    = 0x0900A0
	FSCTL_DELETE_REPARSE_POINT                = 0x0900AC
	FSCTL_DUPLICATE_EXTENTS_TO_FILE           = 0x098344
	FSCTL_DUPLICATE_EXTENTS_TO_FILE_EX        = 0x0983E8
	FSCTL_FILESYSTEM_GET_STATISTICS           = 0x090060
	FSCTL_FILE_LEVEL_TRIM                     = 0x098208
	FSCTL_FIND_FILES_BY_SID                   = 0x09008F
	FSCTL_GET_COMPRESSION                     = 0x09003C
	FSCTL_GET_INTEGRITY_INFORMATION           = 0x09027C
	FSCTL_GET_NTFS_VOLUME_DATA                = 0x090064
	FSCTL_GET_REFS_VOLUME_DATA                = 0x0902D8
	FSCTL_GET_OBJECT_ID                       = 0x09009C
	FSCTL_GET_REPARSE_POINT                   = 0x0900A8
	FSCTL_GET_RETRIEVAL_POINTER_COUNT         = 0x09042B
	FSCTL_GET_RETRIEVAL_POINTERS              = 0x090073
	FSCTL_GET_RETRIEVAL_POINTERS_AND_REFCOUNT = 0x0903D3
	FSCTL_IS_PATHNAME_VALID                   = 0x09002C
	FSCTL_LMR_SET_LINK_TRACKING_INFORMATION   = 0x1400EC
	FSCTL_MARK_HANDLE                         = 0x0900FC
	FSCTL_OFFLOAD_READ                        = 0x094264
	FSCTL_OFFLOAD_WRITE                       = 0x098268
	FSCTL_PIPE_PEEK                           = 0x11400C
	FSCTL_PIPE_TRANSCEIVE                     = 0x11C017
	FSCTL_PIPE_WAIT                           = 0x110018
	FSCTL_QUERY_ALLOCATED_RANGES              = 0x0940CF
	FSCTL_QUERY_FAT_BPB                       = 0x090058
	FSCTL_QUERY_FILE_REGIONS                  = 0x090284
	FSCTL_QUERY_ON_DISK_VOLUME_INFO           = 0x09013C
	FSCTL_QUERY_SPARING_INFO                  = 0x090138
	FSCTL_READ_FILE_USN_DATA                  = 0x0900EB
	FSCTL_RECALL_FILE                         = 0x090117
	FSCTL_REFS_STREAM_SNAPSHOT_MANAGEMENT     = 0x090440
	FSCTL_SET_COMPRESSION                     = 0x09C040
	FSCTL_SET_DEFECT_MANAGEMENT               = 0x098134
	FSCTL_SET_ENCRYPTION                      = 0x0900D7
	FSCTL_SET_INTEGRITY_INFORMATION           = 0x09C280
	FSCTL_SET_INTEGRITY_INFORMATION_EX        = 0x090380
	FSCTL_SET_OBJECT_ID                       = 0x090098
	FSCTL_SET_OBJECT_ID_EXTENDED              = 0x0900BC
	FSCTL_SET_REPARSE_POINT                   = 0x0900A4
	FSCTL_SET_SPARSE                          = 0x0900C4
	FSCTL_SET_ZERO_DATA                       = 0x0980C8
	FSCTL_SET_ZERO_ON_DEALLOCATION            = 0x090194
	FSCTL_SIS_COPYFILE                        = 0x090100
	FSCTL_WRITE_USN_CLOSE_RECORD              = 0x0900EF

	MAXIMUM_REPARSE_DATA_BUFFER_SIZE = 16 * 1024
	IO_REPARSE_TAG_MOUNT_POINT       = 0xA0000003
	IO_REPARSE_TAG_SYMLINK           = 0xA000000C
	SYMBOLIC_LINK_FLAG_DIRECTORY     = 0x1
)
View Source
const (
	ComputerNameNetBIOS                   = 0
	ComputerNameDnsHostname               = 1
	ComputerNameDnsDomain                 = 2
	ComputerNameDnsFullyQualified         = 3
	ComputerNamePhysicalNetBIOS           = 4
	ComputerNamePhysicalDnsHostname       = 5
	ComputerNamePhysicalDnsDomain         = 6
	ComputerNamePhysicalDnsFullyQualified = 7
	ComputerNameMax                       = 8
)
View Source
const (
	MB_OK                   = 0x00000000
	MB_OKCANCEL             = 0x00000001
	MB_ABORTRETRYIGNORE     = 0x00000002
	MB_YESNOCANCEL          = 0x00000003
	MB_YESNO                = 0x00000004
	MB_RETRYCANCEL          = 0x00000005
	MB_CANCELTRYCONTINUE    = 0x00000006
	MB_ICONHAND             = 0x00000010
	MB_ICONQUESTION         = 0x00000020
	MB_ICONEXCLAMATION      = 0x00000030
	MB_ICONASTERISK         = 0x00000040
	MB_USERICON             = 0x00000080
	MB_ICONWARNING          = MB_ICONEXCLAMATION
	MB_ICONERROR            = MB_ICONHAND
	MB_ICONINFORMATION      = MB_ICONASTERISK
	MB_ICONSTOP             = MB_ICONHAND
	MB_DEFBUTTON1           = 0x00000000
	MB_DEFBUTTON2           = 0x00000100
	MB_DEFBUTTON3           = 0x00000200
	MB_DEFBUTTON4           = 0x00000300
	MB_APPLMODAL            = 0x00000000
	MB_SYSTEMMODAL          = 0x00001000
	MB_TASKMODAL            = 0x00002000
	MB_HELP                 = 0x00004000
	MB_NOFOCUS              = 0x00008000
	MB_SETFOREGROUND        = 0x00010000
	MB_DEFAULT_DESKTOP_ONLY = 0x00020000
	MB_TOPMOST              = 0x00040000
	MB_RIGHT                = 0x00080000
	MB_RTLREADING           = 0x00100000
	MB_SERVICE_NOTIFICATION = 0x00200000
)

For MessageBox()

View Source
const (
	MOVEFILE_REPLACE_EXISTING      = 0x1
	MOVEFILE_COPY_ALLOWED          = 0x2
	MOVEFILE_DELAY_UNTIL_REBOOT    = 0x4
	MOVEFILE_WRITE_THROUGH         = 0x8
	MOVEFILE_CREATE_HARDLINK       = 0x10
	MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x20
)
View Source
const (
	IF_TYPE_OTHER              = 1
	IF_TYPE_ETHERNET_CSMACD    = 6
	IF_TYPE_ISO88025_TOKENRING = 9
	IF_TYPE_PPP                = 23
	IF_TYPE_SOFTWARE_LOOPBACK  = 24
	IF_TYPE_ATM                = 37
	IF_TYPE_IEEE80211          = 71
	IF_TYPE_TUNNEL             = 131
	IF_TYPE_IEEE1394           = 144
)
View Source
const (
	IfOperStatusUp             = 1
	IfOperStatusDown           = 2
	IfOperStatusTesting        = 3
	IfOperStatusUnknown        = 4
	IfOperStatusDormant        = 5
	IfOperStatusNotPresent     = 6
	IfOperStatusLowerLayerDown = 7
)
View Source
const (
	ENABLE_PROCESSED_INPUT        = 0x1
	ENABLE_LINE_INPUT             = 0x2
	ENABLE_ECHO_INPUT             = 0x4
	ENABLE_WINDOW_INPUT           = 0x8
	ENABLE_MOUSE_INPUT            = 0x10
	ENABLE_INSERT_MODE            = 0x20
	ENABLE_QUICK_EDIT_MODE        = 0x40
	ENABLE_EXTENDED_FLAGS         = 0x80
	ENABLE_AUTO_POSITION          = 0x100
	ENABLE_VIRTUAL_TERMINAL_INPUT = 0x200

	ENABLE_PROCESSED_OUTPUT            = 0x1
	ENABLE_WRAP_AT_EOL_OUTPUT          = 0x2
	ENABLE_VIRTUAL_TERMINAL_PROCESSING = 0x4
	DISABLE_NEWLINE_AUTO_RETURN        = 0x8
	ENABLE_LVB_GRID_WORLDWIDE          = 0x10
)
View Source
const (
	// flags for JOBOBJECT_BASIC_LIMIT_INFORMATION.LimitFlags
	JOB_OBJECT_LIMIT_ACTIVE_PROCESS             = 0x00000008
	JOB_OBJECT_LIMIT_AFFINITY                   = 0x00000010
	JOB_OBJECT_LIMIT_BREAKAWAY_OK               = 0x00000800
	JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x00000400
	JOB_OBJECT_LIMIT_JOB_MEMORY                 = 0x00000200
	JOB_OBJECT_LIMIT_JOB_TIME                   = 0x00000004
	JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE          = 0x00002000
	JOB_OBJECT_LIMIT_PRESERVE_JOB_TIME          = 0x00000040
	JOB_OBJECT_LIMIT_PRIORITY_CLASS             = 0x00000020
	JOB_OBJECT_LIMIT_PROCESS_MEMORY             = 0x00000100
	JOB_OBJECT_LIMIT_PROCESS_TIME               = 0x00000002
	JOB_OBJECT_LIMIT_SCHEDULING_CLASS           = 0x00000080
	JOB_OBJECT_LIMIT_SILENT_BREAKAWAY_OK        = 0x00001000
	JOB_OBJECT_LIMIT_SUBSET_AFFINITY            = 0x00004000
	JOB_OBJECT_LIMIT_WORKINGSET                 = 0x00000001
)
View Source
const (
	// UIRestrictionsClass
	JOB_OBJECT_UILIMIT_DESKTOP          = 0x00000040
	JOB_OBJECT_UILIMIT_DISPLAYSETTINGS  = 0x00000010
	JOB_OBJECT_UILIMIT_EXITWINDOWS      = 0x00000080
	JOB_OBJECT_UILIMIT_GLOBALATOMS      = 0x00000020
	JOB_OBJECT_UILIMIT_HANDLES          = 0x00000001
	JOB_OBJECT_UILIMIT_READCLIPBOARD    = 0x00000002
	JOB_OBJECT_UILIMIT_SYSTEMPARAMETERS = 0x00000008
	JOB_OBJECT_UILIMIT_WRITECLIPBOARD   = 0x00000004
)
View Source
const (
	// JobObjectInformationClass
	JobObjectAssociateCompletionPortInformation = 7
	JobObjectBasicLimitInformation              = 2
	JobObjectBasicUIRestrictions                = 4
	JobObjectCpuRateControlInformation          = 15
	JobObjectEndOfJobTimeInformation            = 6
	JobObjectExtendedLimitInformation           = 9
	JobObjectGroupInformation                   = 11
	JobObjectGroupInformationEx                 = 14
	JobObjectLimitViolationInformation2         = 35
	JobObjectNetRateControlInformation          = 32
	JobObjectNotificationLimitInformation       = 12
	JobObjectNotificationLimitInformation2      = 34
	JobObjectSecurityLimitInformation           = 5
)
View Source
const (
	KF_FLAG_DEFAULT                          = 0x00000000
	KF_FLAG_FORCE_APP_DATA_REDIRECTION       = 0x00080000
	KF_FLAG_RETURN_FILTER_REDIRECTION_TARGET = 0x00040000
	KF_FLAG_FORCE_PACKAGE_REDIRECTION        = 0x00020000
	KF_FLAG_NO_PACKAGE_REDIRECTION           = 0x00010000
	KF_FLAG_FORCE_APPCONTAINER_REDIRECTION   = 0x00020000
	KF_FLAG_NO_APPCONTAINER_REDIRECTION      = 0x00010000
	KF_FLAG_CREATE                           = 0x00008000
	KF_FLAG_DONT_VERIFY                      = 0x00004000
	KF_FLAG_DONT_UNEXPAND                    = 0x00002000
	KF_FLAG_NO_ALIAS                         = 0x00001000
	KF_FLAG_INIT                             = 0x00000800
	KF_FLAG_DEFAULT_PATH                     = 0x00000400
	KF_FLAG_NOT_PARENT_RELATIVE              = 0x00000200
	KF_FLAG_SIMPLE_IDLIST                    = 0x00000100
	KF_FLAG_ALIAS_ONLY                       = 0x80000000
)
View Source
const (
	EWX_LOGOFF          = 0x00000000
	EWX_SHUTDOWN        = 0x00000001
	EWX_REBOOT          = 0x00000002
	EWX_FORCE           = 0x00000004
	EWX_POWEROFF        = 0x00000008
	EWX_FORCEIFHUNG     = 0x00000010
	EWX_QUICKRESOLVE    = 0x00000020
	EWX_RESTARTAPPS     = 0x00000040
	EWX_HYBRID_SHUTDOWN = 0x00400000
	EWX_BOOTOPTIONS     = 0x01000000

	SHTDN_REASON_FLAG_COMMENT_REQUIRED          = 0x01000000
	SHTDN_REASON_FLAG_DIRTY_PROBLEM_ID_REQUIRED = 0x02000000
	SHTDN_REASON_FLAG_CLEAN_UI                  = 0x04000000
	SHTDN_REASON_FLAG_DIRTY_UI                  = 0x08000000
	SHTDN_REASON_FLAG_USER_DEFINED              = 0x40000000
	SHTDN_REASON_FLAG_PLANNED                   = 0x80000000
	SHTDN_REASON_MAJOR_OTHER                    = 0x00000000
	SHTDN_REASON_MAJOR_NONE                     = 0x00000000
	SHTDN_REASON_MAJOR_HARDWARE                 = 0x00010000
	SHTDN_REASON_MAJOR_OPERATINGSYSTEM          = 0x00020000
	SHTDN_REASON_MAJOR_SOFTWARE                 = 0x00030000
	SHTDN_REASON_MAJOR_APPLICATION              = 0x00040000
	SHTDN_REASON_MAJOR_SYSTEM                   = 0x00050000
	SHTDN_REASON_MAJOR_POWER                    = 0x00060000
	SHTDN_REASON_MAJOR_LEGACY_API               = 0x00070000
	SHTDN_REASON_MINOR_OTHER                    = 0x00000000
	SHTDN_REASON_MINOR_NONE                     = 0x000000ff
	SHTDN_REASON_MINOR_MAINTENANCE              = 0x00000001
	SHTDN_REASON_MINOR_INSTALLATION             = 0x00000002
	SHTDN_REASON_MINOR_UPGRADE                  = 0x00000003
	SHTDN_REASON_MINOR_RECONFIG                 = 0x00000004
	SHTDN_REASON_MINOR_HUNG                     = 0x00000005
	SHTDN_REASON_MINOR_UNSTABLE                 = 0x00000006
	SHTDN_REASON_MINOR_DISK                     = 0x00000007
	SHTDN_REASON_MINOR_PROCESSOR                = 0x00000008
	SHTDN_REASON_MINOR_NETWORKCARD              = 0x00000009
	SHTDN_REASON_MINOR_POWER_SUPPLY             = 0x0000000a
	SHTDN_REASON_MINOR_CORDUNPLUGGED            = 0x0000000b
	SHTDN_REASON_MINOR_ENVIRONMENT              = 0x0000000c
	SHTDN_REASON_MINOR_HARDWARE_DRIVER          = 0x0000000d
	SHTDN_REASON_MINOR_OTHERDRIVER              = 0x0000000e
	SHTDN_REASON_MINOR_BLUESCREEN               = 0x0000000F
	SHTDN_REASON_MINOR_SERVICEPACK              = 0x00000010
	SHTDN_REASON_MINOR_HOTFIX                   = 0x00000011
	SHTDN_REASON_MINOR_SECURITYFIX              = 0x00000012
	SHTDN_REASON_MINOR_SECURITY                 = 0x00000013
	SHTDN_REASON_MINOR_NETWORK_CONNECTIVITY     = 0x00000014
	SHTDN_REASON_MINOR_WMI                      = 0x00000015
	SHTDN_REASON_MINOR_SERVICEPACK_UNINSTALL    = 0x00000016
	SHTDN_REASON_MINOR_HOTFIX_UNINSTALL         = 0x00000017
	SHTDN_REASON_MINOR_SECURITYFIX_UNINSTALL    = 0x00000018
	SHTDN_REASON_MINOR_MMC                      = 0x00000019
	SHTDN_REASON_MINOR_SYSTEMRESTORE            = 0x0000001a
	SHTDN_REASON_MINOR_TERMSRV                  = 0x00000020
	SHTDN_REASON_MINOR_DC_PROMOTION             = 0x00000021
	SHTDN_REASON_MINOR_DC_DEMOTION              = 0x00000022
	SHTDN_REASON_UNKNOWN                        = SHTDN_REASON_MINOR_NONE
	SHTDN_REASON_LEGACY_API                     = SHTDN_REASON_MAJOR_LEGACY_API | SHTDN_REASON_FLAG_PLANNED
	SHTDN_REASON_VALID_BIT_MASK                 = 0xc0ffffff

	SHUTDOWN_NORETRY = 0x1
)
View Source
const (
	GET_MODULE_HANDLE_EX_FLAG_PIN                = 1
	GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT = 2
	GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS       = 4
)

Flags used for GetModuleHandleEx

View Source
const (
	MUI_LANGUAGE_ID                    = 0x4
	MUI_LANGUAGE_NAME                  = 0x8
	MUI_MERGE_SYSTEM_FALLBACK          = 0x10
	MUI_MERGE_USER_FALLBACK            = 0x20
	MUI_UI_FALLBACK                    = MUI_MERGE_SYSTEM_FALLBACK | MUI_MERGE_USER_FALLBACK
	MUI_THREAD_LANGUAGES               = 0x40
	MUI_CONSOLE_FILTER                 = 0x100
	MUI_COMPLEX_SCRIPT_FILTER          = 0x200
	MUI_RESET_FILTERS                  = 0x001
	MUI_USER_PREFERRED_UI_LANGUAGES    = 0x10
	MUI_USE_INSTALLED_LANGUAGES        = 0x20
	MUI_USE_SEARCH_ALL_LANGUAGES       = 0x40
	MUI_LANG_NEUTRAL_PE_FILE           = 0x100
	MUI_NON_LANG_NEUTRAL_FILE          = 0x200
	MUI_MACHINE_LANGUAGE_SETTINGS      = 0x400
	MUI_FILETYPE_NOT_LANGUAGE_NEUTRAL  = 0x001
	MUI_FILETYPE_LANGUAGE_NEUTRAL_MAIN = 0x002
	MUI_FILETYPE_LANGUAGE_NEUTRAL_MUI  = 0x004
	MUI_QUERY_TYPE                     = 0x001
	MUI_QUERY_CHECKSUM                 = 0x002
	MUI_QUERY_LANGUAGE_NAME            = 0x004
	MUI_QUERY_RESOURCE_TYPES           = 0x008
	MUI_FILEINFO_VERSION               = 0x001

	MUI_FULL_LANGUAGE      = 0x01
	MUI_PARTIAL_LANGUAGE   = 0x02
	MUI_LIP_LANGUAGE       = 0x04
	MUI_LANGUAGE_INSTALLED = 0x20
	MUI_LANGUAGE_LICENSED  = 0x40
)

MUI function flag values

View Source
const (
	FileBasicInfo                  = 0
	FileStandardInfo               = 1
	FileNameInfo                   = 2
	FileRenameInfo                 = 3
	FileDispositionInfo            = 4
	FileAllocationInfo             = 5
	FileEndOfFileInfo              = 6
	FileStreamInfo                 = 7
	FileCompressionInfo            = 8
	FileAttributeTagInfo           = 9
	FileIdBothDirectoryInfo        = 10
	FileIdBothDirectoryRestartInfo = 11
	FileIoPriorityHintInfo         = 12
	FileRemoteProtocolInfo         = 13
	FileFullDirectoryInfo          = 14
	FileFullDirectoryRestartInfo   = 15
	FileStorageInfo                = 16
	FileAlignmentInfo              = 17
	FileIdInfo                     = 18
	FileIdExtdDirectoryInfo        = 19
	FileIdExtdDirectoryRestartInfo = 20
	FileDispositionInfoEx          = 21
	FileRenameInfoEx               = 22
	FileCaseSensitiveInfo          = 23
	FileNormalizedNameInfo         = 24
)

FILE_INFO_BY_HANDLE_CLASS constants for SetFileInformationByHandle/GetFileInformationByHandleEx

View Source
const (
	DONT_RESOLVE_DLL_REFERENCES               = 0x1
	LOAD_LIBRARY_AS_DATAFILE                  = 0x2
	LOAD_WITH_ALTERED_SEARCH_PATH             = 0x8
	LOAD_IGNORE_CODE_AUTHZ_LEVEL              = 0x10
	LOAD_LIBRARY_AS_IMAGE_RESOURCE            = 0x20
	LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE        = 0x40
	LOAD_LIBRARY_REQUIRE_SIGNED_TARGET        = 0x80
	LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR          = 0x100
	LOAD_LIBRARY_SEARCH_APPLICATION_DIR       = 0x200
	LOAD_LIBRARY_SEARCH_USER_DIRS             = 0x400
	LOAD_LIBRARY_SEARCH_SYSTEM32              = 0x800
	LOAD_LIBRARY_SEARCH_DEFAULT_DIRS          = 0x1000
	LOAD_LIBRARY_SAFE_CURRENT_DIRS            = 0x00002000
	LOAD_LIBRARY_SEARCH_SYSTEM32_NO_FORWARDER = 0x00004000
	LOAD_LIBRARY_OS_INTEGRITY_CONTINUITY      = 0x00008000
)

LoadLibrary flags for determining from where to search for a DLL

View Source
const (
	// REG_NOTIFY_CHANGE_NAME notifies the caller if a subkey is added or deleted.
	REG_NOTIFY_CHANGE_NAME = 0x00000001

	// REG_NOTIFY_CHANGE_ATTRIBUTES notifies the caller of changes to the attributes of the key, such as the security descriptor information.
	REG_NOTIFY_CHANGE_ATTRIBUTES = 0x00000002

	// REG_NOTIFY_CHANGE_LAST_SET notifies the caller of changes to a value of the key. This can include adding or deleting a value, or changing an existing value.
	REG_NOTIFY_CHANGE_LAST_SET = 0x00000004

	// REG_NOTIFY_CHANGE_SECURITY notifies the caller of changes to the security descriptor of the key.
	REG_NOTIFY_CHANGE_SECURITY = 0x00000008

	// REG_NOTIFY_THREAD_AGNOSTIC indicates that the lifetime of the registration must not be tied to the lifetime of the thread issuing the RegNotifyChangeKeyValue call. Note: This flag value is only supported in Windows 8 and later.
	REG_NOTIFY_THREAD_AGNOSTIC = 0x10000000
)

RegNotifyChangeKeyValue notifyFilter flags.

View Source
const (
	OBJ_INHERIT                       = 0x00000002
	OBJ_PERMANENT                     = 0x00000010
	OBJ_EXCLUSIVE                     = 0x00000020
	OBJ_CASE_INSENSITIVE              = 0x00000040
	OBJ_OPENIF                        = 0x00000080
	OBJ_OPENLINK                      = 0x00000100
	OBJ_KERNEL_HANDLE                 = 0x00000200
	OBJ_FORCE_ACCESS_CHECK            = 0x00000400
	OBJ_IGNORE_IMPERSONATED_DEVICEMAP = 0x00000800
	OBJ_DONT_REPARSE                  = 0x00001000
	OBJ_VALID_ATTRIBUTES              = 0x00001FF2
)

Values for the Attributes member of OBJECT_ATTRIBUTES.

View Source
const (
	// CreateDisposition flags for NtCreateFile and NtCreateNamedPipeFile.
	FILE_SUPERSEDE           = 0x00000000
	FILE_OPEN                = 0x00000001
	FILE_CREATE              = 0x00000002
	FILE_OPEN_IF             = 0x00000003
	FILE_OVERWRITE           = 0x00000004
	FILE_OVERWRITE_IF        = 0x00000005
	FILE_MAXIMUM_DISPOSITION = 0x00000005

	// CreateOptions flags for NtCreateFile and NtCreateNamedPipeFile.
	FILE_DIRECTORY_FILE            = 0x00000001
	FILE_WRITE_THROUGH             = 0x00000002
	FILE_SEQUENTIAL_ONLY           = 0x00000004
	FILE_NO_INTERMEDIATE_BUFFERING = 0x00000008
	FILE_SYNCHRONOUS_IO_ALERT      = 0x00000010
	FILE_SYNCHRONOUS_IO_NONALERT   = 0x00000020
	FILE_NON_DIRECTORY_FILE        = 0x00000040
	FILE_CREATE_TREE_CONNECTION    = 0x00000080
	FILE_COMPLETE_IF_OPLOCKED      = 0x00000100
	FILE_NO_EA_KNOWLEDGE           = 0x00000200
	FILE_OPEN_REMOTE_INSTANCE      = 0x00000400
	FILE_RANDOM_ACCESS             = 0x00000800
	FILE_DELETE_ON_CLOSE           = 0x00001000
	FILE_OPEN_BY_FILE_ID           = 0x00002000
	FILE_OPEN_FOR_BACKUP_INTENT    = 0x00004000
	FILE_NO_COMPRESSION            = 0x00008000
	FILE_OPEN_REQUIRING_OPLOCK     = 0x00010000
	FILE_DISALLOW_EXCLUSIVE        = 0x00020000
	FILE_RESERVE_OPFILTER          = 0x00100000
	FILE_OPEN_REPARSE_POINT        = 0x00200000
	FILE_OPEN_NO_RECALL            = 0x00400000
	FILE_OPEN_FOR_FREE_SPACE_QUERY = 0x00800000

	FILE_PIPE_BYTE_STREAM_TYPE = 0x00000000
	FILE_PIPE_MESSAGE_TYPE     = 0x00000001

	FILE_PIPE_ACCEPT_REMOTE_CLIENTS = 0x00000000
	FILE_PIPE_REJECT_REMOTE_CLIENTS = 0x00000002

	FILE_PIPE_TYPE_VALID_MASK = 0x00000003

	FILE_PIPE_BYTE_STREAM_MODE = 0x00000000
	FILE_PIPE_MESSAGE_MODE     = 0x00000001

	FILE_PIPE_QUEUE_OPERATION    = 0x00000000
	FILE_PIPE_COMPLETE_OPERATION = 0x00000001

	FILE_PIPE_INBOUND     = 0x00000000
	FILE_PIPE_OUTBOUND    = 0x00000001
	FILE_PIPE_FULL_DUPLEX = 0x00000002

	FILE_PIPE_DISCONNECTED_STATE = 0x00000001
	FILE_PIPE_LISTENING_STATE    = 0x00000002
	FILE_PIPE_CONNECTED_STATE    = 0x00000003
	FILE_PIPE_CLOSING_STATE      = 0x00000004

	FILE_PIPE_CLIENT_END = 0x00000000
	FILE_PIPE_SERVER_END = 0x00000001
)
View Source
const (
	// FileInformationClass for NtSetInformationFile
	FileBasicInformation                         = 4
	FileRenameInformation                        = 10
	FileDispositionInformation                   = 13
	FilePositionInformation                      = 14
	FileEndOfFileInformation                     = 20
	FileValidDataLengthInformation               = 39
	FileShortNameInformation                     = 40
	FileIoPriorityHintInformation                = 43
	FileReplaceCompletionInformation             = 61
	FileDispositionInformationEx                 = 64
	FileCaseSensitiveInformation                 = 71
	FileLinkInformation                          = 72
	FileCaseSensitiveInformationForceAccessCheck = 75
	FileKnownFolderInformation                   = 76

	// Flags for FILE_RENAME_INFORMATION
	FILE_RENAME_REPLACE_IF_EXISTS                    = 0x00000001
	FILE_RENAME_POSIX_SEMANTICS                      = 0x00000002
	FILE_RENAME_SUPPRESS_PIN_STATE_INHERITANCE       = 0x00000004
	FILE_RENAME_SUPPRESS_STORAGE_RESERVE_INHERITANCE = 0x00000008
	FILE_RENAME_NO_INCREASE_AVAILABLE_SPACE          = 0x00000010
	FILE_RENAME_NO_DECREASE_AVAILABLE_SPACE          = 0x00000020
	FILE_RENAME_PRESERVE_AVAILABLE_SPACE             = 0x00000030
	FILE_RENAME_IGNORE_READONLY_ATTRIBUTE            = 0x00000040
	FILE_RENAME_FORCE_RESIZE_TARGET_SR               = 0x00000080
	FILE_RENAME_FORCE_RESIZE_SOURCE_SR               = 0x00000100
	FILE_RENAME_FORCE_RESIZE_SR                      = 0x00000180

	// Flags for FILE_DISPOSITION_INFORMATION_EX
	FILE_DISPOSITION_DO_NOT_DELETE             = 0x00000000
	FILE_DISPOSITION_DELETE                    = 0x00000001
	FILE_DISPOSITION_POSIX_SEMANTICS           = 0x00000002
	FILE_DISPOSITION_FORCE_IMAGE_SECTION_CHECK = 0x00000004
	FILE_DISPOSITION_ON_CLOSE                  = 0x00000008
	FILE_DISPOSITION_IGNORE_READONLY_ATTRIBUTE = 0x00000010

	// Flags for FILE_CASE_SENSITIVE_INFORMATION
	FILE_CS_FLAG_CASE_SENSITIVE_DIR = 0x00000001

	// Flags for FILE_LINK_INFORMATION
	FILE_LINK_REPLACE_IF_EXISTS                    = 0x00000001
	FILE_LINK_POSIX_SEMANTICS                      = 0x00000002
	FILE_LINK_SUPPRESS_STORAGE_RESERVE_INHERITANCE = 0x00000008
	FILE_LINK_NO_INCREASE_AVAILABLE_SPACE          = 0x00000010
	FILE_LINK_NO_DECREASE_AVAILABLE_SPACE          = 0x00000020
	FILE_LINK_PRESERVE_AVAILABLE_SPACE             = 0x00000030
	FILE_LINK_IGNORE_READONLY_ATTRIBUTE            = 0x00000040
	FILE_LINK_FORCE_RESIZE_TARGET_SR               = 0x00000080
	FILE_LINK_FORCE_RESIZE_SOURCE_SR               = 0x00000100
	FILE_LINK_FORCE_RESIZE_SR                      = 0x00000180
)
View Source
const (
	ProcessBasicInformation = iota
	ProcessQuotaLimits
	ProcessIoCounters
	ProcessVmCounters
	ProcessTimes
	ProcessBasePriority
	ProcessRaisePriority
	ProcessDebugPort
	ProcessExceptionPort
	ProcessAccessToken
	ProcessLdtInformation
	ProcessLdtSize
	ProcessDefaultHardErrorMode
	ProcessIoPortHandlers
	ProcessPooledUsageAndLimits
	ProcessWorkingSetWatch
	ProcessUserModeIOPL
	ProcessEnableAlignmentFaultFixup
	ProcessPriorityClass
	ProcessWx86Information
	ProcessHandleCount
	ProcessAffinityMask
	ProcessPriorityBoost
	ProcessDeviceMap
	ProcessSessionInformation
	ProcessForegroundInformation
	ProcessWow64Information
	ProcessImageFileName
	ProcessLUIDDeviceMapsEnabled
	ProcessBreakOnTermination
	ProcessDebugObjectHandle
	ProcessDebugFlags
	ProcessHandleTracing
	ProcessIoPriority
	ProcessExecuteFlags
	ProcessTlsInformation
	ProcessCookie
	ProcessImageInformation
	ProcessCycleTime
	ProcessPagePriority
	ProcessInstrumentationCallback
	ProcessThreadStackAllocation
	ProcessWorkingSetWatchEx
	ProcessImageFileNameWin32
	ProcessImageFileMapping
	ProcessAffinityUpdateMode
	ProcessMemoryAllocationMode
	ProcessGroupInformation
	ProcessTokenVirtualizationEnabled
	ProcessConsoleHostProcess
	ProcessWindowInformation
	ProcessHandleInformation
	ProcessMitigationPolicy
	ProcessDynamicFunctionTableInformation
	ProcessHandleCheckingMode
	ProcessKeepAliveCount
	ProcessRevokeFileHandles
	ProcessWorkingSetControl
	ProcessHandleTable
	ProcessCheckStackExtentsMode
	ProcessCommandLineInformation
	ProcessProtectionInformation
	ProcessMemoryExhaustion
	ProcessFaultInformation
	ProcessTelemetryIdInformation
	ProcessCommitReleaseInformation
	ProcessDefaultCpuSetsInformation
	ProcessAllowedCpuSetsInformation
	ProcessSubsystemProcess
	ProcessJobMemoryInformation
	ProcessInPrivate
	ProcessRaiseUMExceptionOnInvalidHandleClose
	ProcessIumChallengeResponse
	ProcessChildProcessInformation
	ProcessHighGraphicsPriorityInformation
	ProcessSubsystemInformation
	ProcessEnergyValues
	ProcessActivityThrottleState
	ProcessActivityThrottlePolicy
	ProcessWin32kSyscallFilterInformation
	ProcessDisableSystemAllowedCpuSets
	ProcessWakeInformation
	ProcessEnergyTrackingState
	ProcessManageWritesToExecutableMemory
	ProcessCaptureTrustletLiveDump
	ProcessTelemetryCoverage
	ProcessEnclaveInformation
	ProcessEnableReadWriteVmLogging
	ProcessUptimeInformation
	ProcessImageSection
	ProcessDebugAuthInformation
	ProcessSystemResourceManagement
	ProcessSequenceNumber
	ProcessLoaderDetour
	ProcessSecurityDomainInformation
	ProcessCombineSecurityDomainsInformation
	ProcessEnableLogging
	ProcessLeapSecondInformation
	ProcessFiberShadowStackAllocation
	ProcessFreeFiberShadowStackAllocation
	ProcessAltSystemCallInformation
	ProcessDynamicEHContinuationTargets
	ProcessDynamicEnforcedCetCompatibleRanges
)

ProcessInformationClasses for NtQueryInformationProcess and NtSetInformationProcess.

View Source
const (
	SystemBasicInformation = iota
	SystemProcessorInformation
	SystemPerformanceInformation
	SystemTimeOfDayInformation
	SystemPathInformation
	SystemProcessInformation
	SystemCallCountInformation
	SystemDeviceInformation
	SystemProcessorPerformanceInformation
	SystemFlagsInformation
	SystemCallTimeInformation
	SystemModuleInformation
	SystemLocksInformation
	SystemStackTraceInformation
	SystemPagedPoolInformation
	SystemNonPagedPoolInformation
	SystemHandleInformation
	SystemObjectInformation
	SystemPageFileInformation
	SystemVdmInstemulInformation
	SystemVdmBopInformation
	SystemFileCacheInformation
	SystemPoolTagInformation
	SystemInterruptInformation
	SystemDpcBehaviorInformation
	SystemFullMemoryInformation
	SystemLoadGdiDriverInformation
	SystemUnloadGdiDriverInformation
	SystemTimeAdjustmentInformation
	SystemSummaryMemoryInformation
	SystemMirrorMemoryInformation
	SystemPerformanceTraceInformation

	SystemExceptionInformation
	SystemCrashDumpStateInformation
	SystemKernelDebuggerInformation
	SystemContextSwitchInformation
	SystemRegistryQuotaInformation
	SystemExtendServiceTableInformation
	SystemPrioritySeperation
	SystemVerifierAddDriverInformation
	SystemVerifierRemoveDriverInformation
	SystemProcessorIdleInformation
	SystemLegacyDriverInformation
	SystemCurrentTimeZoneInformation
	SystemLookasideInformation
	SystemTimeSlipNotification
	SystemSessionCreate
	SystemSessionDetach
	SystemSessionInformation
	SystemRangeStartInformation
	SystemVerifierInformation
	SystemVerifierThunkExtend
	SystemSessionProcessInformation
	SystemLoadGdiDriverInSystemSpace
	SystemNumaProcessorMap
	SystemPrefetcherInformation
	SystemExtendedProcessInformation
	SystemRecommendedSharedDataAlignment
	SystemComPlusPackage
	SystemNumaAvailableMemory
	SystemProcessorPowerInformation
	SystemEmulationBasicInformation
	SystemEmulationProcessorInformation
	SystemExtendedHandleInformation
	SystemLostDelayedWriteInformation
	SystemBigPoolInformation
	SystemSessionPoolTagInformation
	SystemSessionMappedViewInformation
	SystemHotpatchInformation
	SystemObjectSecurityMode
	SystemWatchdogTimerHandler
	SystemWatchdogTimerInformation
	SystemLogicalProcessorInformation
	SystemWow64SharedInformationObsolete
	SystemRegisterFirmwareTableInformationHandler
	SystemFirmwareTableInformation
	SystemModuleInformationEx
	SystemVerifierTriageInformation
	SystemSuperfetchInformation
	SystemMemoryListInformation
	SystemFileCacheInformationEx
	SystemThreadPriorityClientIdInformation
	SystemProcessorIdleCycleTimeInformation
	SystemVerifierCancellationInformation
	SystemProcessorPowerInformationEx
	SystemRefTraceInformation
	SystemSpecialPoolInformation
	SystemProcessIdInformation
	SystemErrorPortInformation
	SystemBootEnvironmentInformation
	SystemHypervisorInformation
	SystemVerifierInformationEx
	SystemTimeZoneInformation
	SystemImageFileExecutionOptionsInformation
	SystemCoverageInformation
	SystemPrefetchPatchInformation
	SystemVerifierFaultsInformation
	SystemSystemPartitionInformation
	SystemSystemDiskInformation
	SystemProcessorPerformanceDistribution
	SystemNumaProximityNodeInformation
	SystemDynamicTimeZoneInformation
	SystemCodeIntegrityInformation
	SystemProcessorMicrocodeUpdateInformation
	SystemProcessorBrandString
	SystemVirtualAddressInformation
	SystemLogicalProcessorAndGroupInformation
	SystemProcessorCycleTimeInformation
	SystemStoreInformation
	SystemRegistryAppendString
	SystemAitSamplingValue
	SystemVhdBootInformation
	SystemCpuQuotaInformation
	SystemNativeBasicInformation

	SystemLowPriorityIoInformation
	SystemTpmBootEntropyInformation
	SystemVerifierCountersInformation
	SystemPagedPoolInformationEx
	SystemSystemPtesInformationEx
	SystemNodeDistanceInformation
	SystemAcpiAuditInformation
	SystemBasicPerformanceInformation
	SystemQueryPerformanceCounterInformation
	SystemSessionBigPoolInformation
	SystemBootGraphicsInformation
	SystemScrubPhysicalMemoryInformation
	SystemBadPageInformation
	SystemProcessorProfileControlArea
	SystemCombinePhysicalMemoryInformation
	SystemEntropyInterruptTimingCallback
	SystemConsoleInformation
	SystemPlatformBinaryInformation
	SystemThrottleNotificationInformation
	SystemHypervisorProcessorCountInformation
	SystemDeviceDataInformation
	SystemDeviceDataEnumerationInformation
	SystemMemoryTopologyInformation
	SystemMemoryChannelInformation
	SystemBootLogoInformation
	SystemProcessorPerformanceInformationEx

	SystemSecureBootPolicyInformation
	SystemPageFileInformationEx
	SystemSecureBootInformation
	SystemEntropyInterruptTimingRawInformation
	SystemPortableWorkspaceEfiLauncherInformation
	SystemFullProcessInformation
	SystemKernelDebuggerInformationEx
	SystemBootMetadataInformation
	SystemSoftRebootInformation
	SystemElamCertificateInformation
	SystemOfflineDumpConfigInformation
	SystemProcessorFeaturesInformation
	SystemRegistryReconciliationInformation
	SystemEdidInformation
	SystemManufacturingInformation
	SystemEnergyEstimationConfigInformation
	SystemHypervisorDetailInformation
	SystemProcessorCycleStatsInformation
	SystemVmGenerationCountInformation
	SystemTrustedPlatformModuleInformation
	SystemKernelDebuggerFlags
	SystemCodeIntegrityPolicyInformation
	SystemIsolatedUserModeInformation
	SystemHardwareSecurityTestInterfaceResultsInformation
	SystemSingleModuleInformation
	SystemAllowedCpuSetsInformation
	SystemDmaProtectionInformation
	SystemInterruptCpuSetsInformation
	SystemSecureBootPolicyFullInformation
	SystemCodeIntegrityPolicyFullInformation
	SystemAffinitizedInterruptProcessorInformation
	SystemRootSiloInformation
)

SystemInformationClasses for NtQuerySystemInformation and NtSetSystemInformation

View Source
const (
	LMEM_FIXED          = 0x0
	LMEM_MOVEABLE       = 0x2
	LMEM_NOCOMPACT      = 0x10
	LMEM_NODISCARD      = 0x20
	LMEM_ZEROINIT       = 0x40
	LMEM_MODIFY         = 0x80
	LMEM_DISCARDABLE    = 0xf00
	LMEM_VALID_FLAGS    = 0xf72
	LMEM_INVALID_HANDLE = 0x8000
	LHND                = LMEM_MOVEABLE | LMEM_ZEROINIT
	LPTR                = LMEM_FIXED | LMEM_ZEROINIT
	NONZEROLHND         = LMEM_MOVEABLE
	NONZEROLPTR         = LMEM_FIXED
)

Constants for LocalAlloc flags.

View Source
const (
	PIPE_ACCESS_INBOUND  = 0x1
	PIPE_ACCESS_OUTBOUND = 0x2
	PIPE_ACCESS_DUPLEX   = 0x3

	PIPE_CLIENT_END = 0x0
	PIPE_SERVER_END = 0x1

	PIPE_WAIT                  = 0x0
	PIPE_NOWAIT                = 0x1
	PIPE_READMODE_BYTE         = 0x0
	PIPE_READMODE_MESSAGE      = 0x2
	PIPE_TYPE_BYTE             = 0x0
	PIPE_TYPE_MESSAGE          = 0x4
	PIPE_ACCEPT_REMOTE_CLIENTS = 0x0
	PIPE_REJECT_REMOTE_CLIENTS = 0x8

	PIPE_UNLIMITED_INSTANCES = 255
)

Constants for the CreateNamedPipe-family of functions.

View Source
const (
	SECURITY_ANONYMOUS      = SecurityAnonymous << 16
	SECURITY_IDENTIFICATION = SecurityIdentification << 16
	SECURITY_IMPERSONATION  = SecurityImpersonation << 16
	SECURITY_DELEGATION     = SecurityDelegation << 16

	SECURITY_CONTEXT_TRACKING = 0x40000
	SECURITY_EFFECTIVE_ONLY   = 0x80000

	SECURITY_SQOS_PRESENT     = 0x100000
	SECURITY_VALID_SQOS_FLAGS = 0x1f0000
)

Constants for security attributes when opening named pipes.

View Source
const (
	CLSCTX_INPROC_SERVER          = 0x1
	CLSCTX_INPROC_HANDLER         = 0x2
	CLSCTX_LOCAL_SERVER           = 0x4
	CLSCTX_INPROC_SERVER16        = 0x8
	CLSCTX_REMOTE_SERVER          = 0x10
	CLSCTX_INPROC_HANDLER16       = 0x20
	CLSCTX_RESERVED1              = 0x40
	CLSCTX_RESERVED2              = 0x80
	CLSCTX_RESERVED3              = 0x100
	CLSCTX_RESERVED4              = 0x200
	CLSCTX_NO_CODE_DOWNLOAD       = 0x400
	CLSCTX_RESERVED5              = 0x800
	CLSCTX_NO_CUSTOM_MARSHAL      = 0x1000
	CLSCTX_ENABLE_CODE_DOWNLOAD   = 0x2000
	CLSCTX_NO_FAILURE_LOG         = 0x4000
	CLSCTX_DISABLE_AAA            = 0x8000
	CLSCTX_ENABLE_AAA             = 0x10000
	CLSCTX_FROM_DEFAULT_CONTEXT   = 0x20000
	CLSCTX_ACTIVATE_32_BIT_SERVER = 0x40000
	CLSCTX_ACTIVATE_64_BIT_SERVER = 0x80000
	CLSCTX_ENABLE_CLOAKING        = 0x100000
	CLSCTX_APPCONTAINER           = 0x400000
	CLSCTX_ACTIVATE_AAA_AS_IU     = 0x800000
	CLSCTX_PS_DLL                 = 0x80000000

	COINIT_MULTITHREADED     = 0x0
	COINIT_APARTMENTTHREADED = 0x2
	COINIT_DISABLE_OLE1DDE   = 0x4
	COINIT_SPEED_OVER_MEMORY = 0x8
)
View Source
const (
	DWMWA_NCRENDERING_ENABLED            = 1
	DWMWA_NCRENDERING_POLICY             = 2
	DWMWA_TRANSITIONS_FORCEDISABLED      = 3
	DWMWA_ALLOW_NCPAINT                  = 4
	DWMWA_CAPTION_BUTTON_BOUNDS          = 5
	DWMWA_NONCLIENT_RTL_LAYOUT           = 6
	DWMWA_FORCE_ICONIC_REPRESENTATION    = 7
	DWMWA_FLIP3D_POLICY                  = 8
	DWMWA_EXTENDED_FRAME_BOUNDS          = 9
	DWMWA_HAS_ICONIC_BITMAP              = 10
	DWMWA_DISALLOW_PEEK                  = 11
	DWMWA_EXCLUDED_FROM_PEEK             = 12
	DWMWA_CLOAK                          = 13
	DWMWA_CLOAKED                        = 14
	DWMWA_FREEZE_REPRESENTATION          = 15
	DWMWA_PASSIVE_UPDATE_MODE            = 16
	DWMWA_USE_HOSTBACKDROPBRUSH          = 17
	DWMWA_USE_IMMERSIVE_DARK_MODE        = 20
	DWMWA_WINDOW_CORNER_PREFERENCE       = 33
	DWMWA_BORDER_COLOR                   = 34
	DWMWA_CAPTION_COLOR                  = 35
	DWMWA_TEXT_COLOR                     = 36
	DWMWA_VISIBLE_FRAME_BORDER_THICKNESS = 37
)
View Source
const ALL_PROCESSOR_GROUPS = 0xFFFF
View Source
const GAA_FLAG_INCLUDE_PREFIX = 0x00000010
View Source
const MAXLEN_IFDESCR = 256
View Source
const MAXLEN_PHYSADDR = 8
View Source
const MAX_ADAPTER_ADDRESS_LENGTH = 8
View Source
const MAX_ADAPTER_DESCRIPTION_LENGTH = 128
View Source
const MAX_ADAPTER_NAME_LENGTH = 256
View Source
const MAX_INTERFACE_NAME_LEN = 256
View Source
const PROCESS_NAME_NATIVE = 1

Flag for QueryFullProcessImageName.

View Source
const SIO_GET_INTERFACE_LIST = 0x4004747F
View Source
const SizeofModuleEntry32 = unsafe.Sizeof(ModuleEntry32{})
View Source
const UNIX_PATH_MAX = 108 // defined in afunix.h

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}}
)
View Source
var (
	OID_PKIX_KP_SERVER_AUTH = []byte("1.3.6.1.5.5.7.3.1\x00")
	OID_SERVER_GATED_CRYPTO = []byte("1.3.6.1.4.1.311.10.3.3\x00")
	OID_SGC_NETSCAPE        = []byte("2.16.840.1.113730.4.1\x00")

	WINTRUST_ACTION_GENERIC_VERIFY_V2 = GUID{
		Data1: 0xaac56b,
		Data2: 0xcd44,
		Data3: 0x11d0,
		Data4: [8]byte{0x8c, 0xc2, 0x0, 0xc0, 0x4f, 0xc2, 0x95, 0xee},
	}
)
View Source
var (
	FOLDERID_NetworkFolder          = &KNOWNFOLDERID{0xd20beec4, 0x5ca8, 0x4905, [8]byte{0xae, 0x3b, 0xbf, 0x25, 0x1e, 0xa0, 0x9b, 0x53}}
	FOLDERID_ComputerFolder         = &KNOWNFOLDERID{0x0ac0837c, 0xbbf8, 0x452a, [8]byte{0x85, 0x0d, 0x79, 0xd0, 0x8e, 0x66, 0x7c, 0xa7}}
	FOLDERID_InternetFolder         = &KNOWNFOLDERID{0x4d9f7874, 0x4e0c, 0x4904, [8]byte{0x96, 0x7b, 0x40, 0xb0, 0xd2, 0x0c, 0x3e, 0x4b}}
	FOLDERID_ControlPanelFolder     = &KNOWNFOLDERID{0x82a74aeb, 0xaeb4, 0x465c, [8]byte{0xa0, 0x14, 0xd0, 0x97, 0xee, 0x34, 0x6d, 0x63}}
	FOLDERID_PrintersFolder         = &KNOWNFOLDERID{0x76fc4e2d, 0xd6ad, 0x4519, [8]byte{0xa6, 0x63, 0x37, 0xbd, 0x56, 0x06, 0x81, 0x85}}
	FOLDERID_SyncManagerFolder      = &KNOWNFOLDERID{0x43668bf8, 0xc14e, 0x49b2, [8]byte{0x97, 0xc9, 0x74, 0x77, 0x84, 0xd7, 0x84, 0xb7}}
	FOLDERID_SyncSetupFolder        = &KNOWNFOLDERID{0x0f214138, 0xb1d3, 0x4a90, [8]byte{0xbb, 0xa9, 0x27, 0xcb, 0xc0, 0xc5, 0x38, 0x9a}}
	FOLDERID_ConflictFolder         = &KNOWNFOLDERID{0x4bfefb45, 0x347d, 0x4006, [8]byte{0xa5, 0xbe, 0xac, 0x0c, 0xb0, 0x56, 0x71, 0x92}}
	FOLDERID_SyncResultsFolder      = &KNOWNFOLDERID{0x289a9a43, 0xbe44, 0x4057, [8]byte{0xa4, 0x1b, 0x58, 0x7a, 0x76, 0xd7, 0xe7, 0xf9}}
	FOLDERID_RecycleBinFolder       = &KNOWNFOLDERID{0xb7534046, 0x3ecb, 0x4c18, [8]byte{0xbe, 0x4e, 0x64, 0xcd, 0x4c, 0xb7, 0xd6, 0xac}}
	FOLDERID_ConnectionsFolder      = &KNOWNFOLDERID{0x6f0cd92b, 0x2e97, 0x45d1, [8]byte{0x88, 0xff, 0xb0, 0xd1, 0x86, 0xb8, 0xde, 0xdd}}
	FOLDERID_Fonts                  = &KNOWNFOLDERID{0xfd228cb7, 0xae11, 0x4ae3, [8]byte{0x86, 0x4c, 0x16, 0xf3, 0x91, 0x0a, 0xb8, 0xfe}}
	FOLDERID_Desktop                = &KNOWNFOLDERID{0xb4bfcc3a, 0xdb2c, 0x424c, [8]byte{0xb0, 0x29, 0x7f, 0xe9, 0x9a, 0x87, 0xc6, 0x41}}
	FOLDERID_Startup                = &KNOWNFOLDERID{0xb97d20bb, 0xf46a, 0x4c97, [8]byte{0xba, 0x10, 0x5e, 0x36, 0x08, 0x43, 0x08, 0x54}}
	FOLDERID_Programs               = &KNOWNFOLDERID{0xa77f5d77, 0x2e2b, 0x44c3, [8]byte{0xa6, 0xa2, 0xab, 0xa6, 0x01, 0x05, 0x4a, 0x51}}
	FOLDERID_StartMenu              = &KNOWNFOLDERID{0x625b53c3, 0xab48, 0x4ec1, [8]byte{0xba, 0x1f, 0xa1, 0xef, 0x41, 0x46, 0xfc, 0x19}}
	FOLDERID_Recent                 = &KNOWNFOLDERID{0xae50c081, 0xebd2, 0x438a, [8]byte{0x86, 0x55, 0x8a, 0x09, 0x2e, 0x34, 0x98, 0x7a}}
	FOLDERID_SendTo                 = &KNOWNFOLDERID{0x8983036c, 0x27c0, 0x404b, [8]byte{0x8f, 0x08, 0x10, 0x2d, 0x10, 0xdc, 0xfd, 0x74}}
	FOLDERID_Documents              = &KNOWNFOLDERID{0xfdd39ad0, 0x238f, 0x46af, [8]byte{0xad, 0xb4, 0x6c, 0x85, 0x48, 0x03, 0x69, 0xc7}}
	FOLDERID_Favorites              = &KNOWNFOLDERID{0x1777f761, 0x68ad, 0x4d8a, [8]byte{0x87, 0xbd, 0x30, 0xb7, 0x59, 0xfa, 0x33, 0xdd}}
	FOLDERID_NetHood                = &KNOWNFOLDERID{0xc5abbf53, 0xe17f, 0x4121, [8]byte{0x89, 0x00, 0x86, 0x62, 0x6f, 0xc2, 0xc9, 0x73}}
	FOLDERID_PrintHood              = &KNOWNFOLDERID{0x9274bd8d, 0xcfd1, 0x41c3, [8]byte{0xb3, 0x5e, 0xb1, 0x3f, 0x55, 0xa7, 0x58, 0xf4}}
	FOLDERID_Templates              = &KNOWNFOLDERID{0xa63293e8, 0x664e, 0x48db, [8]byte{0xa0, 0x79, 0xdf, 0x75, 0x9e, 0x05, 0x09, 0xf7}}
	FOLDERID_CommonStartup          = &KNOWNFOLDERID{0x82a5ea35, 0xd9cd, 0x47c5, [8]byte{0x96, 0x29, 0xe1, 0x5d, 0x2f, 0x71, 0x4e, 0x6e}}
	FOLDERID_CommonPrograms         = &KNOWNFOLDERID{0x0139d44e, 0x6afe, 0x49f2, [8]byte{0x86, 0x90, 0x3d, 0xaf, 0xca, 0xe6, 0xff, 0xb8}}
	FOLDERID_CommonStartMenu        = &KNOWNFOLDERID{0xa4115719, 0xd62e, 0x491d, [8]byte{0xaa, 0x7c, 0xe7, 0x4b, 0x8b, 0xe3, 0xb0, 0x67}}
	FOLDERID_PublicDesktop          = &KNOWNFOLDERID{0xc4aa340d, 0xf20f, 0x4863, [8]byte{0xaf, 0xef, 0xf8, 0x7e, 0xf2, 0xe6, 0xba, 0x25}}
	FOLDERID_ProgramData            = &KNOWNFOLDERID{0x62ab5d82, 0xfdc1, 0x4dc3, [8]byte{0xa9, 0xdd, 0x07, 0x0d, 0x1d, 0x49, 0x5d, 0x97}}
	FOLDERID_CommonTemplates        = &KNOWNFOLDERID{0xb94237e7, 0x57ac, 0x4347, [8]byte{0x91, 0x51, 0xb0, 0x8c, 0x6c, 0x32, 0xd1, 0xf7}}
	FOLDERID_PublicDocuments        = &KNOWNFOLDERID{0xed4824af, 0xdce4, 0x45a8, [8]byte{0x81, 0xe2, 0xfc, 0x79, 0x65, 0x08, 0x36, 0x34}}
	FOLDERID_RoamingAppData         = &KNOWNFOLDERID{0x3eb685db, 0x65f9, 0x4cf6, [8]byte{0xa0, 0x3a, 0xe3, 0xef, 0x65, 0x72, 0x9f, 0x3d}}
	FOLDERID_LocalAppData           = &KNOWNFOLDERID{0xf1b32785, 0x6fba, 0x4fcf, [8]byte{0x9d, 0x55, 0x7b, 0x8e, 0x7f, 0x15, 0x70, 0x91}}
	FOLDERID_LocalAppDataLow        = &KNOWNFOLDERID{0xa520a1a4, 0x1780, 0x4ff6, [8]byte{0xbd, 0x18, 0x16, 0x73, 0x43, 0xc5, 0xaf, 0x16}}
	FOLDERID_InternetCache          = &KNOWNFOLDERID{0x352481e8, 0x33be, 0x4251, [8]byte{0xba, 0x85, 0x60, 0x07, 0xca, 0xed, 0xcf, 0x9d}}
	FOLDERID_Cookies                = &KNOWNFOLDERID{0x2b0f765d, 0xc0e9, 0x4171, [8]byte{0x90, 0x8e, 0x08, 0xa6, 0x11, 0xb8, 0x4f, 0xf6}}
	FOLDERID_History                = &KNOWNFOLDERID{0xd9dc8a3b, 0xb784, 0x432e, [8]byte{0xa7, 0x81, 0x5a, 0x11, 0x30, 0xa7, 0x59, 0x63}}
	FOLDERID_System                 = &KNOWNFOLDERID{0x1ac14e77, 0x02e7, 0x4e5d, [8]byte{0xb7, 0x44, 0x2e, 0xb1, 0xae, 0x51, 0x98, 0xb7}}
	FOLDERID_SystemX86              = &KNOWNFOLDERID{0xd65231b0, 0xb2f1, 0x4857, [8]byte{0xa4, 0xce, 0xa8, 0xe7, 0xc6, 0xea, 0x7d, 0x27}}
	FOLDERID_Windows                = &KNOWNFOLDERID{0xf38bf404, 0x1d43, 0x42f2, [8]byte{0x93, 0x05, 0x67, 0xde, 0x0b, 0x28, 0xfc, 0x23}}
	FOLDERID_Profile                = &KNOWNFOLDERID{0x5e6c858f, 0x0e22, 0x4760, [8]byte{0x9a, 0xfe, 0xea, 0x33, 0x17, 0xb6, 0x71, 0x73}}
	FOLDERID_Pictures               = &KNOWNFOLDERID{0x33e28130, 0x4e1e, 0x4676, [8]byte{0x83, 0x5a, 0x98, 0x39, 0x5c, 0x3b, 0xc3, 0xbb}}
	FOLDERID_ProgramFilesX86        = &KNOWNFOLDERID{0x7c5a40ef, 0xa0fb, 0x4bfc, [8]byte{0x87, 0x4a, 0xc0, 0xf2, 0xe0, 0xb9, 0xfa, 0x8e}}
	FOLDERID_ProgramFilesCommonX86  = &KNOWNFOLDERID{0xde974d24, 0xd9c6, 0x4d3e, [8]byte{0xbf, 0x91, 0xf4, 0x45, 0x51, 0x20, 0xb9, 0x17}}
	FOLDERID_ProgramFilesX64        = &KNOWNFOLDERID{0x6d809377, 0x6af0, 0x444b, [8]byte{0x89, 0x57, 0xa3, 0x77, 0x3f, 0x02, 0x20, 0x0e}}
	FOLDERID_ProgramFilesCommonX64  = &KNOWNFOLDERID{0x6365d5a7, 0x0f0d, 0x45e5, [8]byte{0x87, 0xf6, 0x0d, 0xa5, 0x6b, 0x6a, 0x4f, 0x7d}}
	FOLDERID_ProgramFiles           = &KNOWNFOLDERID{0x905e63b6, 0xc1bf, 0x494e, [8]byte{0xb2, 0x9c, 0x65, 0xb7, 0x32, 0xd3, 0xd2, 0x1a}}
	FOLDERID_ProgramFilesCommon     = &KNOWNFOLDERID{0xf7f1ed05, 0x9f6d, 0x47a2, [8]byte{0xaa, 0xae, 0x29, 0xd3, 0x17, 0xc6, 0xf0, 0x66}}
	FOLDERID_UserProgramFiles       = &KNOWNFOLDERID{0x5cd7aee2, 0x2219, 0x4a67, [8]byte{0xb8, 0x5d, 0x6c, 0x9c, 0xe1, 0x56, 0x60, 0xcb}}
	FOLDERID_UserProgramFilesCommon = &KNOWNFOLDERID{0xbcbd3057, 0xca5c, 0x4622, [8]byte{0xb4, 0x2d, 0xbc, 0x56, 0xdb, 0x0a, 0xe5, 0x16}}
	FOLDERID_AdminTools             = &KNOWNFOLDERID{0x724ef170, 0xa42d, 0x4fef, [8]byte{0x9f, 0x26, 0xb6, 0x0e, 0x84, 0x6f, 0xba, 0x4f}}
	FOLDERID_CommonAdminTools       = &KNOWNFOLDERID{0xd0384e7d, 0xbac3, 0x4797, [8]byte{0x8f, 0x14, 0xcb, 0xa2, 0x29, 0xb3, 0x92, 0xb5}}
	FOLDERID_Music                  = &KNOWNFOLDERID{0x4bd8d571, 0x6d19, 0x48d3, [8]byte{0xbe, 0x97, 0x42, 0x22, 0x20, 0x08, 0x0e, 0x43}}
	FOLDERID_Videos                 = &KNOWNFOLDERID{0x18989b1d, 0x99b5, 0x455b, [8]byte{0x84, 0x1c, 0xab, 0x7c, 0x74, 0xe4, 0xdd, 0xfc}}
	FOLDERID_Ringtones              = &KNOWNFOLDERID{0xc870044b, 0xf49e, 0x4126, [8]byte{0xa9, 0xc3, 0xb5, 0x2a, 0x1f, 0xf4, 0x11, 0xe8}}
	FOLDERID_PublicPictures         = &KNOWNFOLDERID{0xb6ebfb86, 0x6907, 0x413c, [8]byte{0x9a, 0xf7, 0x4f, 0xc2, 0xab, 0xf0, 0x7c, 0xc5}}
	FOLDERID_PublicMusic            = &KNOWNFOLDERID{0x3214fab5, 0x9757, 0x4298, [8]byte{0xbb, 0x61, 0x92, 0xa9, 0xde, 0xaa, 0x44, 0xff}}
	FOLDERID_PublicVideos           = &KNOWNFOLDERID{0x2400183a, 0x6185, 0x49fb, [8]byte{0xa2, 0xd8, 0x4a, 0x39, 0x2a, 0x60, 0x2b, 0xa3}}
	FOLDERID_PublicRingtones        = &KNOWNFOLDERID{0xe555ab60, 0x153b, 0x4d17, [8]byte{0x9f, 0x04, 0xa5, 0xfe, 0x99, 0xfc, 0x15, 0xec}}
	FOLDERID_ResourceDir            = &KNOWNFOLDERID{0x8ad10c31, 0x2adb, 0x4296, [8]byte{0xa8, 0xf7, 0xe4, 0x70, 0x12, 0x32, 0xc9, 0x72}}
	FOLDERID_LocalizedResourcesDir  = &KNOWNFOLDERID{0x2a00375e, 0x224c, 0x49de, [8]byte{0xb8, 0xd1, 0x44, 0x0d, 0xf7, 0xef, 0x3d, 0xdc}}
	FOLDERID_CommonOEMLinks         = &KNOWNFOLDERID{0xc1bae2d0, 0x10df, 0x4334, [8]byte{0xbe, 0xdd, 0x7a, 0xa2, 0x0b, 0x22, 0x7a, 0x9d}}
	FOLDERID_CDBurning              = &KNOWNFOLDERID{0x9e52ab10, 0xf80d, 0x49df, [8]byte{0xac, 0xb8, 0x43, 0x30, 0xf5, 0x68, 0x78, 0x55}}
	FOLDERID_UserProfiles           = &KNOWNFOLDERID{0x0762d272, 0xc50a, 0x4bb0, [8]byte{0xa3, 0x82, 0x69, 0x7d, 0xcd, 0x72, 0x9b, 0x80}}
	FOLDERID_Playlists              = &KNOWNFOLDERID{0xde92c1c7, 0x837f, 0x4f69, [8]byte{0xa3, 0xbb, 0x86, 0xe6, 0x31, 0x20, 0x4a, 0x23}}
	FOLDERID_SamplePlaylists        = &KNOWNFOLDERID{0x15ca69b3, 0x30ee, 0x49c1, [8]byte{0xac, 0xe1, 0x6b, 0x5e, 0xc3, 0x72, 0xaf, 0xb5}}
	FOLDERID_SampleMusic            = &KNOWNFOLDERID{0xb250c668, 0xf57d, 0x4ee1, [8]byte{0xa6, 0x3c, 0x29, 0x0e, 0xe7, 0xd1, 0xaa, 0x1f}}
	FOLDERID_SamplePictures         = &KNOWNFOLDERID{0xc4900540, 0x2379, 0x4c75, [8]byte{0x84, 0x4b, 0x64, 0xe6, 0xfa, 0xf8, 0x71, 0x6b}}
	FOLDERID_SampleVideos           = &KNOWNFOLDERID{0x859ead94, 0x2e85, 0x48ad, [8]byte{0xa7, 0x1a, 0x09, 0x69, 0xcb, 0x56, 0xa6, 0xcd}}
	FOLDERID_PhotoAlbums            = &KNOWNFOLDERID{0x69d2cf90, 0xfc33, 0x4fb7, [8]byte{0x9a, 0x0c, 0xeb, 0xb0, 0xf0, 0xfc, 0xb4, 0x3c}}
	FOLDERID_Public                 = &KNOWNFOLDERID{0xdfdf76a2, 0xc82a, 0x4d63, [8]byte{0x90, 0x6a, 0x56, 0x44, 0xac, 0x45, 0x73, 0x85}}
	FOLDERID_ChangeRemovePrograms   = &KNOWNFOLDERID{0xdf7266ac, 0x9274, 0x4867, [8]byte{0x8d, 0x55, 0x3b, 0xd6, 0x61, 0xde, 0x87, 0x2d}}
	FOLDERID_AppUpdates             = &KNOWNFOLDERID{0xa305ce99, 0xf527, 0x492b, [8]byte{0x8b, 0x1a, 0x7e, 0x76, 0xfa, 0x98, 0xd6, 0xe4}}
	FOLDERID_AddNewPrograms         = &KNOWNFOLDERID{0xde61d971, 0x5ebc, 0x4f02, [8]byte{0xa3, 0xa9, 0x6c, 0x82, 0x89, 0x5e, 0x5c, 0x04}}
	FOLDERID_Downloads              = &KNOWNFOLDERID{0x374de290, 0x123f, 0x4565, [8]byte{0x91, 0x64, 0x39, 0xc4, 0x92, 0x5e, 0x46, 0x7b}}
	FOLDERID_PublicDownloads        = &KNOWNFOLDERID{0x3d644c9b, 0x1fb8, 0x4f30, [8]byte{0x9b, 0x45, 0xf6, 0x70, 0x23, 0x5f, 0x79, 0xc0}}
	FOLDERID_SavedSearches          = &KNOWNFOLDERID{0x7d1d3a04, 0xdebb, 0x4115, [8]byte{0x95, 0xcf, 0x2f, 0x29, 0xda, 0x29, 0x20, 0xda}}
	FOLDERID_QuickLaunch            = &KNOWNFOLDERID{0x52a4f021, 0x7b75, 0x48a9, [8]byte{0x9f, 0x6b, 0x4b, 0x87, 0xa2, 0x10, 0xbc, 0x8f}}
	FOLDERID_Contacts               = &KNOWNFOLDERID{0x56784854, 0xc6cb, 0x462b, [8]byte{0x81, 0x69, 0x88, 0xe3, 0x50, 0xac, 0xb8, 0x82}}
	FOLDERID_SidebarParts           = &KNOWNFOLDERID{0xa75d362e, 0x50fc, 0x4fb7, [8]byte{0xac, 0x2c, 0xa8, 0xbe, 0xaa, 0x31, 0x44, 0x93}}
	FOLDERID_SidebarDefaultParts    = &KNOWNFOLDERID{0x7b396e54, 0x9ec5, 0x4300, [8]byte{0xbe, 0x0a, 0x24, 0x82, 0xeb, 0xae, 0x1a, 0x26}}
	FOLDERID_PublicGameTasks        = &KNOWNFOLDERID{0xdebf2536, 0xe1a8, 0x4c59, [8]byte{0xb6, 0xa2, 0x41, 0x45, 0x86, 0x47, 0x6a, 0xea}}
	FOLDERID_GameTasks              = &KNOWNFOLDERID{0x054fae61, 0x4dd8, 0x4787, [8]byte{0x80, 0xb6, 0x09, 0x02, 0x20, 0xc4, 0xb7, 0x00}}
	FOLDERID_SavedGames             = &KNOWNFOLDERID{0x4c5c32ff, 0xbb9d, 0x43b0, [8]byte{0xb5, 0xb4, 0x2d, 0x72, 0xe5, 0x4e, 0xaa, 0xa4}}
	FOLDERID_Games                  = &KNOWNFOLDERID{0xcac52c1a, 0xb53d, 0x4edc, [8]byte{0x92, 0xd7, 0x6b, 0x2e, 0x8a, 0xc1, 0x94, 0x34}}
	FOLDERID_SEARCH_MAPI            = &KNOWNFOLDERID{0x98ec0e18, 0x2098, 0x4d44, [8]byte{0x86, 0x44, 0x66, 0x97, 0x93, 0x15, 0xa2, 0x81}}
	FOLDERID_SEARCH_CSC             = &KNOWNFOLDERID{0xee32e446, 0x31ca, 0x4aba, [8]byte{0x81, 0x4f, 0xa5, 0xeb, 0xd2, 0xfd, 0x6d, 0x5e}}
	FOLDERID_Links                  = &KNOWNFOLDERID{0xbfb9d5e0, 0xc6a9, 0x404c, [8]byte{0xb2, 0xb2, 0xae, 0x6d, 0xb6, 0xaf, 0x49, 0x68}}
	FOLDERID_UsersFiles             = &KNOWNFOLDERID{0xf3ce0f7c, 0x4901, 0x4acc, [8]byte{0x86, 0x48, 0xd5, 0xd4, 0x4b, 0x04, 0xef, 0x8f}}
	FOLDERID_UsersLibraries         = &KNOWNFOLDERID{0xa302545d, 0xdeff, 0x464b, [8]byte{0xab, 0xe8, 0x61, 0xc8, 0x64, 0x8d, 0x93, 0x9b}}
	FOLDERID_SearchHome             = &KNOWNFOLDERID{0x190337d1, 0xb8ca, 0x4121, [8]byte{0xa6, 0x39, 0x6d, 0x47, 0x2d, 0x16, 0x97, 0x2a}}
	FOLDERID_OriginalImages         = &KNOWNFOLDERID{0x2c36c0aa, 0x5812, 0x4b87, [8]byte{0xbf, 0xd0, 0x4c, 0xd0, 0xdf, 0xb1, 0x9b, 0x39}}
	FOLDERID_DocumentsLibrary       = &KNOWNFOLDERID{0x7b0db17d, 0x9cd2, 0x4a93, [8]byte{0x97, 0x33, 0x46, 0xcc, 0x89, 0x02, 0x2e, 0x7c}}
	FOLDERID_MusicLibrary           = &KNOWNFOLDERID{0x2112ab0a, 0xc86a, 0x4ffe, [8]byte{0xa3, 0x68, 0x0d, 0xe9, 0x6e, 0x47, 0x01, 0x2e}}
	FOLDERID_PicturesLibrary        = &KNOWNFOLDERID{0xa990ae9f, 0xa03b, 0x4e80, [8]byte{0x94, 0xbc, 0x99, 0x12, 0xd7, 0x50, 0x41, 0x04}}
	FOLDERID_VideosLibrary          = &KNOWNFOLDERID{0x491e922f, 0x5643, 0x4af4, [8]byte{0xa7, 0xeb, 0x4e, 0x7a, 0x13, 0x8d, 0x81, 0x74}}
	FOLDERID_RecordedTVLibrary      = &KNOWNFOLDERID{0x1a6fdba2, 0xf42d, 0x4358, [8]byte{0xa7, 0x98, 0xb7, 0x4d, 0x74, 0x59, 0x26, 0xc5}}
	FOLDERID_HomeGroup              = &KNOWNFOLDERID{0x52528a6b, 0xb9e3, 0x4add, [8]byte{0xb6, 0x0d, 0x58, 0x8c, 0x2d, 0xba, 0x84, 0x2d}}
	FOLDERID_HomeGroupCurrentUser   = &KNOWNFOLDERID{0x9b74b6a3, 0x0dfd, 0x4f11, [8]byte{0x9e, 0x78, 0x5f, 0x78, 0x00, 0xf2, 0xe7, 0x72}}
	FOLDERID_DeviceMetadataStore    = &KNOWNFOLDERID{0x5ce4a5e9, 0xe4eb, 0x479d, [8]byte{0xb8, 0x9f, 0x13, 0x0c, 0x02, 0x88, 0x61, 0x55}}
	FOLDERID_Libraries              = &KNOWNFOLDERID{0x1b3ea5dc, 0xb587, 0x4786, [8]byte{0xb4, 0xef, 0xbd, 0x1d, 0xc3, 0x32, 0xae, 0xae}}
	FOLDERID_PublicLibraries        = &KNOWNFOLDERID{0x48daf80b, 0xe6cf, 0x4f4e, [8]byte{0xb8, 0x00, 0x0e, 0x69, 0xd8, 0x4e, 0xe3, 0x84}}
	FOLDERID_UserPinned             = &KNOWNFOLDERID{0x9e3995ab, 0x1f9c, 0x4f13, [8]byte{0xb8, 0x27, 0x48, 0xb2, 0x4b, 0x6c, 0x71, 0x74}}
	FOLDERID_ImplicitAppShortcuts   = &KNOWNFOLDERID{0xbcb5256f, 0x79f6, 0x4cee, [8]byte{0xb7, 0x25, 0xdc, 0x34, 0xe4, 0x02, 0xfd, 0x46}}
	FOLDERID_AccountPictures        = &KNOWNFOLDERID{0x008ca0b1, 0x55b4, 0x4c56, [8]byte{0xb8, 0xa8, 0x4d, 0xe4, 0xb2, 0x99, 0xd3, 0xbe}}
	FOLDERID_PublicUserTiles        = &KNOWNFOLDERID{0x0482af6c, 0x08f1, 0x4c34, [8]byte{0x8c, 0x90, 0xe1, 0x7e, 0xc9, 0x8b, 0x1e, 0x17}}
	FOLDERID_AppsFolder             = &KNOWNFOLDERID{0x1e87508d, 0x89c2, 0x42f0, [8]byte{0x8a, 0x7e, 0x64, 0x5a, 0x0f, 0x50, 0xca, 0x58}}
	FOLDERID_StartMenuAllPrograms   = &KNOWNFOLDERID{0xf26305ef, 0x6948, 0x40b9, [8]byte{0xb2, 0x55, 0x81, 0x45, 0x3d, 0x09, 0xc7, 0x85}}
	FOLDERID_CommonStartMenuPlaces  = &KNOWNFOLDERID{0xa440879f, 0x87a0, 0x4f7d, [8]byte{0xb7, 0x00, 0x02, 0x07, 0xb9, 0x66, 0x19, 0x4a}}
	FOLDERID_ApplicationShortcuts   = &KNOWNFOLDERID{0xa3918781, 0xe5f2, 0x4890, [8]byte{0xb3, 0xd9, 0xa7, 0xe5, 0x43, 0x32, 0x32, 0x8c}}
	FOLDERID_RoamingTiles           = &KNOWNFOLDERID{0x00bcfc5a, 0xed94, 0x4e48, [8]byte{0x96, 0xa1, 0x3f, 0x62, 0x17, 0xf2, 0x19, 0x90}}
	FOLDERID_RoamedTileImages       = &KNOWNFOLDERID{0xaaa8d5a5, 0xf1d6, 0x4259, [8]byte{0xba, 0xa8, 0x78, 0xe7, 0xef, 0x60, 0x83, 0x5e}}
	FOLDERID_Screenshots            = &KNOWNFOLDERID{0xb7bede81, 0xdf94, 0x4682, [8]byte{0xa7, 0xd8, 0x57, 0xa5, 0x26, 0x20, 0xb8, 0x6f}}
	FOLDERID_CameraRoll             = &KNOWNFOLDERID{0xab5fb87b, 0x7ce2, 0x4f83, [8]byte{0x91, 0x5d, 0x55, 0x08, 0x46, 0xc9, 0x53, 0x7b}}
	FOLDERID_SkyDrive               = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}}
	FOLDERID_OneDrive               = &KNOWNFOLDERID{0xa52bba46, 0xe9e1, 0x435f, [8]byte{0xb3, 0xd9, 0x28, 0xda, 0xa6, 0x48, 0xc0, 0xf6}}
	FOLDERID_SkyDriveDocuments      = &KNOWNFOLDERID{0x24d89e24, 0x2f19, 0x4534, [8]byte{0x9d, 0xde, 0x6a, 0x66, 0x71, 0xfb, 0xb8, 0xfe}}
	FOLDERID_SkyDrivePictures       = &KNOWNFOLDERID{0x339719b5, 0x8c47, 0x4894, [8]byte{0x94, 0xc2, 0xd8, 0xf7, 0x7a, 0xdd, 0x44, 0xa6}}
	FOLDERID_SkyDriveMusic          = &KNOWNFOLDERID{0xc3f2459e, 0x80d6, 0x45dc, [8]byte{0xbf, 0xef, 0x1f, 0x76, 0x9f, 0x2b, 0xe7, 0x30}}
	FOLDERID_SkyDriveCameraRoll     = &KNOWNFOLDERID{0x767e6811, 0x49cb, 0x4273, [8]byte{0x87, 0xc2, 0x20, 0xf3, 0x55, 0xe1, 0x08, 0x5b}}
	FOLDERID_SearchHistory          = &KNOWNFOLDERID{0x0d4c3db6, 0x03a3, 0x462f, [8]byte{0xa0, 0xe6, 0x08, 0x92, 0x4c, 0x41, 0xb5, 0xd4}}
	FOLDERID_SearchTemplates        = &KNOWNFOLDERID{0x7e636bfe, 0xdfa9, 0x4d5e, [8]byte{0xb4, 0x56, 0xd7, 0xb3, 0x98, 0x51, 0xd8, 0xa9}}
	FOLDERID_CameraRollLibrary      = &KNOWNFOLDERID{0x2b20df75, 0x1eda, 0x4039, [8]byte{0x80, 0x97, 0x38, 0x79, 0x82, 0x27, 0xd5, 0xb7}}
	FOLDERID_SavedPictures          = &KNOWNFOLDERID{0x3b193882, 0xd3ad, 0x4eab, [8]byte{0x96, 0x5a, 0x69, 0x82, 0x9d, 0x1f, 0xb5, 0x9f}}
	FOLDERID_SavedPicturesLibrary   = &KNOWNFOLDERID{0xe25b5812, 0xbe88, 0x4bd9, [8]byte{0x94, 0xb0, 0x29, 0x23, 0x34, 0x77, 0xb6, 0xc3}}
	FOLDERID_RetailDemo             = &KNOWNFOLDERID{0x12d4c69e, 0x24ad, 0x4923, [8]byte{0xbe, 0x19, 0x31, 0x32, 0x1c, 0x43, 0xa7, 0x67}}
	FOLDERID_Device                 = &KNOWNFOLDERID{0x1c2ac1dc, 0x4358, 0x4b6c, [8]byte{0x97, 0x33, 0xaf, 0x21, 0x15, 0x65, 0x76, 0xf0}}
	FOLDERID_DevelopmentFiles       = &KNOWNFOLDERID{0xdbe8e08e, 0x3053, 0x4bbc, [8]byte{0xb1, 0x83, 0x2a, 0x7b, 0x2b, 0x19, 0x1e, 0x59}}
	FOLDERID_Objects3D              = &KNOWNFOLDERID{0x31c0dd25, 0x9439, 0x4f12, [8]byte{0xbf, 0x41, 0x7f, 0xf4, 0xed, 0xa3, 0x87, 0x22}}
	FOLDERID_AppCaptures            = &KNOWNFOLDERID{0xedc0fe71, 0x98d8, 0x4f4a, [8]byte{0xb9, 0x20, 0xc8, 0xdc, 0x13, 0x3c, 0xb1, 0x65}}
	FOLDERID_LocalDocuments         = &KNOWNFOLDERID{0xf42ee2d3, 0x909f, 0x4907, [8]byte{0x88, 0x71, 0x4c, 0x22, 0xfc, 0x0b, 0xf7, 0x56}}
	FOLDERID_LocalPictures          = &KNOWNFOLDERID{0x0ddd015d, 0xb06c, 0x45d5, [8]byte{0x8c, 0x4c, 0xf5, 0x97, 0x13, 0x85, 0x46, 0x39}}
	FOLDERID_LocalVideos            = &KNOWNFOLDERID{0x35286a68, 0x3c57, 0x41a1, [8]byte{0xbb, 0xb1, 0x0e, 0xae, 0x73, 0xd7, 0x6c, 0x95}}
	FOLDERID_LocalMusic             = &KNOWNFOLDERID{0xa0c69a99, 0x21c8, 0x4671, [8]byte{0x87, 0x03, 0x79, 0x34, 0x16, 0x2f, 0xcf, 0x1d}}
	FOLDERID_LocalDownloads         = &KNOWNFOLDERID{0x7d83ee9b, 0x2244, 0x4e70, [8]byte{0xb1, 0xf5, 0x53, 0x93, 0x04, 0x2a, 0xf1, 0xe4}}
	FOLDERID_RecordedCalls          = &KNOWNFOLDERID{0x2f8b40c2, 0x83ed, 0x48ee, [8]byte{0xb3, 0x83, 0xa1, 0xf1, 0x57, 0xec, 0x6f, 0x9a}}
	FOLDERID_AllAppMods             = &KNOWNFOLDERID{0x7ad67899, 0x66af, 0x43ba, [8]byte{0x91, 0x56, 0x6a, 0xad, 0x42, 0xe6, 0xc5, 0x96}}
	FOLDERID_CurrentAppMods         = &KNOWNFOLDERID{0x3db40b20, 0x2a30, 0x4dbe, [8]byte{0x91, 0x7e, 0x77, 0x1d, 0xd2, 0x1d, 0xd0, 0x99}}
	FOLDERID_AppDataDesktop         = &KNOWNFOLDERID{0xb2c5e279, 0x7add, 0x439f, [8]byte{0xb2, 0x8c, 0xc4, 0x1f, 0xe1, 0xbb, 0xf6, 0x72}}
	FOLDERID_AppDataDocuments       = &KNOWNFOLDERID{0x7be16610, 0x1f7f, 0x44ac, [8]byte{0xbf, 0xf0, 0x83, 0xe1, 0x5f, 0x2f, 0xfc, 0xa1}}
	FOLDERID_AppDataFavorites       = &KNOWNFOLDERID{0x7cfbefbc, 0xde1f, 0x45aa, [8]byte{0xb8, 0x43, 0xa5, 0x42, 0xac, 0x53, 0x6c, 0xc9}}
	FOLDERID_AppDataProgramData     = &KNOWNFOLDERID{0x559d40a3, 0xa036, 0x40fa, [8]byte{0xaf, 0x61, 0x84, 0xcb, 0x43, 0x0a, 0x4d, 0x34}}
)
View Source
var WSAID_CONNECTEX = GUID{
	0x25a207b9,
	0xddf3,
	0x4660,
	[8]byte{0x8e, 0xe9, 0x76, 0xe5, 0x8c, 0x74, 0x06, 0x3e},
}
View Source
var WSAID_WSARECVMSG = GUID{
	0xf689d7c8,
	0x6f1f,
	0x436b,
	[8]byte{0x8a, 0x53, 0xe5, 0x4f, 0xe3, 0x51, 0xc3, 0x22},
}
View Source
var WSAID_WSASENDMSG = GUID{
	0xa441e712,
	0x754f,
	0x43ca,
	[8]byte{0x84, 0xa7, 0x0d, 0xee, 0x44, 0xcf, 0x60, 0x6d},
}

Functions

func AcceptEx

func AcceptEx(ls Handle, as Handle, buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, recvd *uint32, overlapped *Overlapped) (err error)

func AdjustTokenGroups

func AdjustTokenGroups(token Token, resetToDefault bool, newstate *Tokengroups, buflen uint32, prevstate *Tokengroups, returnlen *uint32) (err error)

func AdjustTokenPrivileges

func AdjustTokenPrivileges(token Token, disableAllPrivileges bool, newstate *Tokenprivileges, buflen uint32, prevstate *Tokenprivileges, returnlen *uint32) (err error)

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 **SID) (err error)

func AssignProcessToJobObject

func AssignProcessToJobObject(job Handle, process Handle) (err error)

func BytePtrFromString

func BytePtrFromString(s string) (*byte, error)

BytePtrFromString returns a pointer to a NUL-terminated array of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, syscall.EINVAL).

func BytePtrToString

func BytePtrToString(p *byte) string

BytePtrToString takes a pointer to a sequence of text and returns the corresponding string. If the pointer is nil, it returns the empty string. It assumes that the text sequence is terminated at a zero byte; if the zero byte is not present, the program may crash.

func ByteSliceFromString

func ByteSliceFromString(s string) ([]byte, error)

ByteSliceFromString returns a NUL-terminated slice of bytes containing the text of s. If s contains a NUL byte at any location, it returns (nil, syscall.EINVAL).

func ByteSliceToString

func ByteSliceToString(s []byte) string

ByteSliceToString returns a string form of the text represented by the slice s, with a terminating NUL and any bytes after the NUL removed.

func CancelIo

func CancelIo(s Handle) (err error)

func CancelIoEx

func CancelIoEx(s Handle, o *Overlapped) (err error)

func CertAddCertificateContextToStore

func CertAddCertificateContextToStore(store Handle, certContext *CertContext, addDisposition uint32, storeContext **CertContext) (err error)

func CertCloseStore

func CertCloseStore(store Handle, flags uint32) (err error)

func CertDeleteCertificateFromStore

func CertDeleteCertificateFromStore(certContext *CertContext) (err error)

func CertFreeCertificateChain

func CertFreeCertificateChain(ctx *CertChainContext)

func CertFreeCertificateContext

func CertFreeCertificateContext(ctx *CertContext) (err error)

func CertGetCertificateChain

func CertGetCertificateChain(engine Handle, leaf *CertContext, time *Filetime, additionalStore Handle, para *CertChainPara, flags uint32, reserved uintptr, chainCtx **CertChainContext) (err error)

func CertGetNameString

func CertGetNameString(certContext *CertContext, nameType uint32, flags uint32, typePara unsafe.Pointer, name *uint16, size uint32) (chars uint32)

func CertVerifyCertificateChainPolicy

func CertVerifyCertificateChainPolicy(policyOID uintptr, chain *CertChainContext, para *CertChainPolicyPara, status *CertChainPolicyStatus) (err error)

func ChangeServiceConfig

func ChangeServiceConfig(service 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 Handle, infoLevel uint32, info *byte) (err error)

func Clearenv

func Clearenv()

func CloseHandle

func CloseHandle(handle Handle) (err error)

func CloseServiceHandle

func CloseServiceHandle(handle Handle) (err error)

func Closesocket

func Closesocket(s Handle) (err error)

func CoGetObject

func CoGetObject(name *uint16, bindOpts *BIND_OPTS3, guid *GUID, functionTable **uintptr) (ret error)

func CoInitializeEx

func CoInitializeEx(reserved uintptr, coInit uint32) (ret error)

func CoTaskMemFree

func CoTaskMemFree(address unsafe.Pointer)

func CoUninitialize

func CoUninitialize()

func CommandLineToArgv

func CommandLineToArgv(cmd *uint16, argc *int32) (argv *[8192]*[8192]uint16, err error)

func ConnectNamedPipe

func ConnectNamedPipe(pipe Handle, overlapped *Overlapped) (err error)

func ControlService

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

func ConvertSidToStringSid

func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error)

func ConvertStringSidToSid

func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error)

func CopySid

func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error)

func CreateDirectory

func CreateDirectory(path *uint16, sa *SecurityAttributes) (err error)

func CreateEnvironmentBlock

func CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error)
func CreateHardLink(filename *uint16, existingfilename *uint16, reserved uintptr) (err error)

func CreatePipe

func CreatePipe(readhandle *Handle, writehandle *Handle, sa *SecurityAttributes, size uint32) (err error)

func CreateProcess

func CreateProcess(appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error)

func CreateProcessAsUser

func CreateProcessAsUser(token Token, appName *uint16, commandLine *uint16, procSecurity *SecurityAttributes, threadSecurity *SecurityAttributes, inheritHandles bool, creationFlags uint32, env *uint16, currentDir *uint16, startupInfo *StartupInfo, outProcInfo *ProcessInformation) (err error)
func CreateSymbolicLink(symlinkfilename *uint16, targetfilename *uint16, flags uint32) (err error)

func CryptAcquireCertificatePrivateKey

func CryptAcquireCertificatePrivateKey(cert *CertContext, flags uint32, parameters unsafe.Pointer, cryptProvOrNCryptKey *Handle, keySpec *uint32, callerFreeProvOrNCryptKey *bool) (err error)

func CryptAcquireContext

func CryptAcquireContext(provhandle *Handle, container *uint16, provider *uint16, provtype uint32, flags uint32) (err error)

func CryptDecodeObject

func CryptDecodeObject(encodingType uint32, structType *byte, encodedBytes *byte, lenEncodedBytes uint32, flags uint32, decoded unsafe.Pointer, decodedLen *uint32) (err error)

func CryptGenRandom

func CryptGenRandom(provhandle Handle, buflen uint32, buf *byte) (err error)

func CryptProtectData

func CryptProtectData(dataIn *DataBlob, name *uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error)

func CryptQueryObject

func CryptQueryObject(objectType uint32, object unsafe.Pointer, expectedContentTypeFlags uint32, expectedFormatTypeFlags uint32, flags uint32, msgAndCertEncodingType *uint32, contentType *uint32, formatType *uint32, certStore *Handle, msg *Handle, context *unsafe.Pointer) (err error)

func CryptReleaseContext

func CryptReleaseContext(provhandle Handle, flags uint32) (err error)

func CryptUnprotectData

func CryptUnprotectData(dataIn *DataBlob, name **uint16, optionalEntropy *DataBlob, reserved uintptr, promptStruct *CryptProtectPromptStruct, flags uint32, dataOut *DataBlob) (err error)

func DefineDosDevice

func DefineDosDevice(flags uint32, deviceName *uint16, targetPath *uint16) (err error)

func DeleteFile

func DeleteFile(path *uint16) (err error)

func DeleteService

func DeleteService(service Handle) (err error)

func DeleteVolumeMountPoint

func DeleteVolumeMountPoint(volumeMountPoint *uint16) (err error)

func DeregisterEventSource

func DeregisterEventSource(handle Handle) (err error)

func DestroyEnvironmentBlock

func DestroyEnvironmentBlock(block *uint16) (err error)

func DeviceIoControl

func DeviceIoControl(handle Handle, ioControlCode uint32, inBuffer *byte, inBufferSize uint32, outBuffer *byte, outBufferSize uint32, bytesReturned *uint32, overlapped *Overlapped) (err error)

func DnsNameCompare

func DnsNameCompare(name1 *uint16, name2 *uint16) (same bool)

func DnsQuery

func DnsQuery(name string, qtype uint16, options uint32, extra *byte, qrs **DNSRecord, pr *byte) (status error)

func DnsRecordListFree

func DnsRecordListFree(rl *DNSRecord, freetype uint32)

func DuplicateHandle

func DuplicateHandle(hSourceProcessHandle Handle, hSourceHandle Handle, hTargetProcessHandle Handle, lpTargetHandle *Handle, dwDesiredAccess uint32, bInheritHandle bool, dwOptions uint32) (err error)

func DuplicateTokenEx

func DuplicateTokenEx(existingToken Token, desiredAccess uint32, tokenAttributes *SecurityAttributes, impersonationLevel uint32, tokenType uint32, newToken *Token) (err error)

func DwmGetWindowAttribute

func DwmGetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error)

func DwmSetWindowAttribute

func DwmSetWindowAttribute(hwnd HWND, attribute uint32, value unsafe.Pointer, size uint32) (ret error)

func EnumChildWindows

func EnumChildWindows(hwnd HWND, enumFunc uintptr, param unsafe.Pointer)

func EnumProcessModules

func EnumProcessModules(process Handle, module *Handle, cb uint32, cbNeeded *uint32) (err error)

func EnumProcessModulesEx

func EnumProcessModulesEx(process Handle, module *Handle, cb uint32, cbNeeded *uint32, filterFlag uint32) (err error)

func EnumProcesses

func EnumProcesses(processIds []uint32, bytesReturned *uint32) (err error)

func EnumServicesStatusEx

func EnumServicesStatusEx(mgr Handle, infoLevel uint32, serviceType uint32, serviceState uint32, services *byte, bufSize uint32, bytesNeeded *uint32, servicesReturned *uint32, resumeHandle *uint32, groupName *uint16) (err error)

func EnumWindows

func EnumWindows(enumFunc uintptr, param unsafe.Pointer) (err error)

func Environ

func Environ() []string

func EqualSid

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

func ExitProcess

func ExitProcess(exitcode uint32)

func ExitWindowsEx

func ExitWindowsEx(flags uint32, reason uint32) (err error)

func ExpandEnvironmentStrings

func ExpandEnvironmentStrings(src *uint16, dst *uint16, size uint32) (n uint32, err error)

func FindClose

func FindClose(handle Handle) (err error)

func FindCloseChangeNotification

func FindCloseChangeNotification(handle Handle) (err error)

func FindNextChangeNotification

func FindNextChangeNotification(handle Handle) (err error)

func FindNextVolume

func FindNextVolume(findVolume Handle, volumeName *uint16, bufferLength uint32) (err error)

func FindNextVolumeMountPoint

func FindNextVolumeMountPoint(findVolumeMountPoint Handle, volumeMountPoint *uint16, bufferLength uint32) (err error)

func FindVolumeClose

func FindVolumeClose(findVolume Handle) (err error)

func FindVolumeMountPointClose

func FindVolumeMountPointClose(findVolumeMountPoint Handle) (err error)

func FlushFileBuffers

func FlushFileBuffers(handle Handle) (err error)

func FlushViewOfFile

func FlushViewOfFile(addr uintptr, length uintptr) (err error)

func FormatMessage

func FormatMessage(flags uint32, msgsrc uintptr, msgid uint32, langid uint32, buf []uint16, args *byte) (n uint32, err error)

func FreeAddrInfoW

func FreeAddrInfoW(addrinfo *AddrinfoW)

func FreeEnvironmentStrings

func FreeEnvironmentStrings(envs *uint16) (err error)

func FreeLibrary

func FreeLibrary(handle Handle) (err error)

func FreeSid

func FreeSid(sid *SID) (err error)

func GenerateConsoleCtrlEvent

func GenerateConsoleCtrlEvent(ctrlEvent uint32, processGroupID uint32) (err error)

func GetACP

func GetACP() (acp uint32)

func GetAcceptExSockaddrs

func GetAcceptExSockaddrs(buf *byte, rxdatalen uint32, laddrlen uint32, raddrlen uint32, lrsa **RawSockaddrAny, lrsalen *int32, rrsa **RawSockaddrAny, rrsalen *int32)

func GetActiveProcessorCount

func GetActiveProcessorCount(groupNumber uint16) (ret uint32)

func GetAdaptersAddresses

func GetAdaptersAddresses(family uint32, flags uint32, reserved uintptr, adapterAddresses *IpAdapterAddresses, sizePointer *uint32) (errcode error)

func GetAdaptersInfo

func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error)

func GetAddrInfoW

func GetAddrInfoW(nodename *uint16, servicename *uint16, hints *AddrinfoW, result **AddrinfoW) (sockerr error)

func GetClassName

func GetClassName(hwnd HWND, className *uint16, maxCount int32) (copied int32, err error)

func GetCommTimeouts

func GetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error)

func GetCommandLine

func GetCommandLine() (cmd *uint16)

func GetComputerName

func GetComputerName(buf *uint16, n *uint32) (err error)

func GetComputerNameEx

func GetComputerNameEx(nametype uint32, buf *uint16, n *uint32) (err error)

func GetConsoleMode

func GetConsoleMode(console Handle, mode *uint32) (err error)

func GetConsoleScreenBufferInfo

func GetConsoleScreenBufferInfo(console Handle, info *ConsoleScreenBufferInfo) (err error)

func GetCurrentDirectory

func GetCurrentDirectory(buflen uint32, buf *uint16) (n uint32, err error)

func GetCurrentProcessId

func GetCurrentProcessId() (pid uint32)

func GetCurrentThreadId

func GetCurrentThreadId() (id uint32)

func GetDiskFreeSpaceEx

func GetDiskFreeSpaceEx(directoryName *uint16, freeBytesAvailableToCaller *uint64, totalNumberOfBytes *uint64, totalNumberOfFreeBytes *uint64) (err error)

func GetDriveType

func GetDriveType(rootPathName *uint16) (driveType uint32)

func GetEnvironmentStrings

func GetEnvironmentStrings() (envs *uint16, err error)

func GetEnvironmentVariable

func GetEnvironmentVariable(name *uint16, buffer *uint16, size uint32) (n uint32, err error)

func GetExitCodeProcess

func GetExitCodeProcess(handle Handle, exitcode *uint32) (err error)

func GetFileAttributes

func GetFileAttributes(name *uint16) (attrs uint32, err error)

func GetFileAttributesEx

func GetFileAttributesEx(name *uint16, level uint32, info *byte) (err error)

func GetFileInformationByHandle

func GetFileInformationByHandle(handle Handle, data *ByHandleFileInformation) (err error)

func GetFileInformationByHandleEx

func GetFileInformationByHandleEx(handle Handle, class uint32, outBuffer *byte, outBufferLen uint32) (err error)

func GetFileType

func GetFileType(filehandle Handle) (n uint32, err error)

func GetFileVersionInfo

func GetFileVersionInfo(filename string, handle uint32, bufSize uint32, buffer unsafe.Pointer) (err error)

func GetFileVersionInfoSize

func GetFileVersionInfoSize(filename string, zeroHandle *Handle) (bufSize uint32, err error)

func GetFinalPathNameByHandle

func GetFinalPathNameByHandle(file Handle, filePath *uint16, filePathSize uint32, flags uint32) (n uint32, err error)

func GetFullPathName

func GetFullPathName(path *uint16, buflen uint32, buf *uint16, fname **uint16) (n uint32, err error)

func GetGUIThreadInfo

func GetGUIThreadInfo(thread uint32, info *GUIThreadInfo) (err error)

func GetIfEntry

func GetIfEntry(pIfRow *MibIfRow) (errcode error)

func GetLastError

func GetLastError() (lasterr error)

func GetLengthSid

func GetLengthSid(sid *SID) (len uint32)

func GetLogicalDriveStrings

func GetLogicalDriveStrings(bufferLength uint32, buffer *uint16) (n uint32, err error)

func GetLogicalDrives

func GetLogicalDrives() (drivesBitMask uint32, err error)

func GetLongPathName

func GetLongPathName(path *uint16, buf *uint16, buflen uint32) (n uint32, err error)

func GetMaximumProcessorCount

func GetMaximumProcessorCount(groupNumber uint16) (ret uint32)

func GetModuleBaseName

func GetModuleBaseName(process Handle, module Handle, baseName *uint16, size uint32) (err error)

func GetModuleFileName

func GetModuleFileName(module Handle, filename *uint16, size uint32) (n uint32, err error)

func GetModuleFileNameEx

func GetModuleFileNameEx(process Handle, module Handle, filename *uint16, size uint32) (err error)

func GetModuleHandleEx

func GetModuleHandleEx(flags uint32, moduleName *uint16, module *Handle) (err error)

func GetModuleInformation

func GetModuleInformation(process Handle, module Handle, modinfo *ModuleInfo, cb uint32) (err error)

func GetNamedPipeHandleState

func GetNamedPipeHandleState(pipe Handle, state *uint32, curInstances *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32, userName *uint16, maxUserNameSize uint32) (err error)

func GetNamedPipeInfo

func GetNamedPipeInfo(pipe Handle, flags *uint32, outSize *uint32, inSize *uint32, maxInstances *uint32) (err error)

func GetOverlappedResult

func GetOverlappedResult(handle Handle, overlapped *Overlapped, done *uint32, wait bool) (err error)

func GetPriorityClass

func GetPriorityClass(process Handle) (ret uint32, err error)

func GetProcAddress

func GetProcAddress(module Handle, procname string) (proc uintptr, err error)

func GetProcessId

func GetProcessId(process Handle) (id uint32, err error)

func GetProcessShutdownParameters

func GetProcessShutdownParameters(level *uint32, flags *uint32) (err error)

func GetProcessTimes

func GetProcessTimes(handle Handle, creationTime *Filetime, exitTime *Filetime, kernelTime *Filetime, userTime *Filetime) (err error)

func GetProcessWorkingSetSizeEx

func GetProcessWorkingSetSizeEx(hProcess Handle, lpMinimumWorkingSetSize *uintptr, lpMaximumWorkingSetSize *uintptr, flags *uint32)

func GetQueuedCompletionStatus

func GetQueuedCompletionStatus(cphandle Handle, qty *uint32, key *uintptr, overlapped **Overlapped, timeout uint32) (err error)

func GetShortPathName

func GetShortPathName(longpath *uint16, shortpath *uint16, buflen uint32) (n uint32, err error)

func GetStartupInfo

func GetStartupInfo(startupInfo *StartupInfo) (err error)

func GetSystemDirectory

func GetSystemDirectory() (string, error)

GetSystemDirectory retrieves the path to current location of the system directory, which is typically, though not always, `C:\Windows\System32`.

func GetSystemTimeAsFileTime

func GetSystemTimeAsFileTime(time *Filetime)

func GetSystemTimePreciseAsFileTime

func GetSystemTimePreciseAsFileTime(time *Filetime)

func GetSystemWindowsDirectory

func GetSystemWindowsDirectory() (string, error)

GetSystemWindowsDirectory retrieves the path to current location of the Windows directory, which is typically, though not always, `C:\Windows`.

func GetTempPath

func GetTempPath(buflen uint32, buf *uint16) (n uint32, err error)

func GetTimeZoneInformation

func GetTimeZoneInformation(tzi *Timezoneinformation) (rc uint32, err error)

func GetTokenInformation

func GetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error)

func GetUserNameEx

func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error)

func GetUserProfileDirectory

func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error)

func GetVersion

func GetVersion() (ver uint32, err error)

func GetVolumeInformation

func GetVolumeInformation(rootPathName *uint16, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error)

func GetVolumeInformationByHandle

func GetVolumeInformationByHandle(file Handle, volumeNameBuffer *uint16, volumeNameSize uint32, volumeNameSerialNumber *uint32, maximumComponentLength *uint32, fileSystemFlags *uint32, fileSystemNameBuffer *uint16, fileSystemNameSize uint32) (err error)

func GetVolumeNameForVolumeMountPoint

func GetVolumeNameForVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16, bufferlength uint32) (err error)

func GetVolumePathName

func GetVolumePathName(fileName *uint16, volumePathName *uint16, bufferLength uint32) (err error)

func GetVolumePathNamesForVolumeName

func GetVolumePathNamesForVolumeName(volumeName *uint16, volumePathNames *uint16, bufferLength uint32, returnLength *uint32) (err error)

func GetWindowThreadProcessId

func GetWindowThreadProcessId(hwnd HWND, pid *uint32) (tid uint32, err error)

func GetWindowsDirectory

func GetWindowsDirectory() (string, error)

GetWindowsDirectory retrieves the path to current location of the Windows directory, which is typically, though not always, `C:\Windows`. This may be a private user directory in the case that the application is running under a terminal server.

func Getenv

func Getenv(key string) (value string, found bool)

func Getsockopt

func Getsockopt(s Handle, level int32, optname int32, optval *byte, optlen *int32) (err error)

func ImpersonateSelf

func ImpersonateSelf(impersonationlevel uint32) (err error)

func InitiateSystemShutdownEx

func InitiateSystemShutdownEx(machineName *uint16, message *uint16, timeout uint32, forceAppsClosed bool, rebootAfterShutdown bool, reason uint32) (err error)

func IsWindow

func IsWindow(hwnd HWND) (isWindow bool)

func IsWindowUnicode

func IsWindowUnicode(hwnd HWND) (isUnicode bool)

func IsWindowVisible

func IsWindowVisible(hwnd HWND) (isVisible bool)

func IsWow64Process

func IsWow64Process(handle Handle, isWow64 *bool) (err error)

func IsWow64Process2

func IsWow64Process2(handle Handle, processMachine *uint16, nativeMachine *uint16) (err error)

func LocalAlloc

func LocalAlloc(flags uint32, length uint32) (ptr uintptr, err error)

func LockFileEx

func LockFileEx(file Handle, flags uint32, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error)

func LockResource

func LockResource(resData Handle) (addr uintptr, err error)

func LookupAccountName

func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error)

func LookupAccountSid

func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error)

func LookupPrivilegeValue

func LookupPrivilegeValue(systemname *uint16, name *uint16, luid *LUID) (err error)

func MapViewOfFile

func MapViewOfFile(handle Handle, access uint32, offsetHigh uint32, offsetLow uint32, length uintptr) (addr uintptr, err error)

func MessageBox

func MessageBox(hwnd HWND, text *uint16, caption *uint16, boxtype uint32) (ret int32, err error)

func Module32First

func Module32First(snapshot Handle, moduleEntry *ModuleEntry32) (err error)

func Module32Next

func Module32Next(snapshot Handle, moduleEntry *ModuleEntry32) (err error)

func MoveFile

func MoveFile(from *uint16, to *uint16) (err error)

func MoveFileEx

func MoveFileEx(from *uint16, to *uint16, flags uint32) (err error)

func MultiByteToWideChar

func MultiByteToWideChar(codePage uint32, dwFlags uint32, str *byte, nstr int32, wchar *uint16, nwchar int32) (nwrite int32, err error)

func NetApiBufferFree

func NetApiBufferFree(buf *byte) (neterr error)

func NetGetJoinInformation

func NetGetJoinInformation(server *uint16, name **uint16, bufType *uint32) (neterr error)

func NetUserGetInfo

func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error)

func NotifyServiceStatusChange

func NotifyServiceStatusChange(service Handle, notifyMask uint32, notifier *SERVICE_NOTIFY) (ret error)

func NtCreateFile

func NtCreateFile(handle *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, allocationSize *int64, attributes uint32, share uint32, disposition uint32, options uint32, eabuffer uintptr, ealength uint32) (ntstatus error)

func NtCreateNamedPipeFile

func NtCreateNamedPipeFile(pipe *Handle, access uint32, oa *OBJECT_ATTRIBUTES, iosb *IO_STATUS_BLOCK, share uint32, disposition uint32, options uint32, typ uint32, readMode uint32, completionMode uint32, maxInstances uint32, inboundQuota uint32, outputQuota uint32, timeout *int64) (ntstatus error)

func NtQueryInformationProcess

func NtQueryInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32, retLen *uint32) (ntstatus error)

func NtQuerySystemInformation

func NtQuerySystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32, retLen *uint32) (ntstatus error)

func NtSetInformationFile

func NtSetInformationFile(handle Handle, iosb *IO_STATUS_BLOCK, inBuffer *byte, inBufferLen uint32, class uint32) (ntstatus error)

func NtSetInformationProcess

func NtSetInformationProcess(proc Handle, procInfoClass int32, procInfo unsafe.Pointer, procInfoLen uint32) (ntstatus error)

func NtSetSystemInformation

func NtSetSystemInformation(sysInfoClass int32, sysInfo unsafe.Pointer, sysInfoLen uint32) (ntstatus error)

func Ntohs

func Ntohs(netshort uint16) (u uint16)

func OpenProcessToken

func OpenProcessToken(process Handle, access uint32, token *Token) (err error)

func OpenThreadToken

func OpenThreadToken(thread Handle, access uint32, openAsSelf bool, token *Token) (err error)

func PostQueuedCompletionStatus

func PostQueuedCompletionStatus(cphandle Handle, qty uint32, key uintptr, overlapped *Overlapped) (err error)

func Process32First

func Process32First(snapshot Handle, procEntry *ProcessEntry32) (err error)

func Process32Next

func Process32Next(snapshot Handle, procEntry *ProcessEntry32) (err error)

func ProcessIdToSessionId

func ProcessIdToSessionId(pid uint32, sessionid *uint32) (err error)

func PulseEvent

func PulseEvent(event Handle) (err error)

func QueryDosDevice

func QueryDosDevice(deviceName *uint16, targetPath *uint16, max uint32) (n uint32, err error)

func QueryFullProcessImageName

func QueryFullProcessImageName(proc Handle, flags uint32, exeName *uint16, size *uint32) (err error)

func QueryInformationJobObject

func QueryInformationJobObject(job Handle, JobObjectInformationClass int32, JobObjectInformation uintptr, JobObjectInformationLength uint32, retlen *uint32) (err error)

func QueryServiceConfig

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

func QueryServiceConfig2

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

func QueryServiceDynamicInformation

func QueryServiceDynamicInformation(service Handle, infoLevel uint32, dynamicInfo unsafe.Pointer) (err error)

func QueryServiceLockStatus

func QueryServiceLockStatus(mgr Handle, lockStatus *QUERY_SERVICE_LOCK_STATUS, bufSize uint32, bytesNeeded *uint32) (err error)

func QueryServiceStatus

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

func QueryServiceStatusEx

func QueryServiceStatusEx(service Handle, infoLevel uint32, buff *byte, buffSize uint32, bytesNeeded *uint32) (err error)

func QueryWorkingSetEx

func QueryWorkingSetEx(process Handle, pv uintptr, cb uint32) (err error)

func ReadConsole

func ReadConsole(console Handle, buf *uint16, toread uint32, read *uint32, inputControl *byte) (err error)

func ReadDirectoryChanges

func ReadDirectoryChanges(handle Handle, buf *byte, buflen uint32, watchSubTree bool, mask uint32, retlen *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error)

func ReadProcessMemory

func ReadProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesRead *uintptr) (err error)

func RegCloseKey

func RegCloseKey(key Handle) (regerrno error)

func RegEnumKeyEx

func RegEnumKeyEx(key Handle, index uint32, name *uint16, nameLen *uint32, reserved *uint32, class *uint16, classLen *uint32, lastWriteTime *Filetime) (regerrno error)

func RegNotifyChangeKeyValue

func RegNotifyChangeKeyValue(key Handle, watchSubtree bool, notifyFilter uint32, event Handle, asynchronous bool) (regerrno error)

func RegOpenKeyEx

func RegOpenKeyEx(key Handle, subkey *uint16, options uint32, desiredAccess uint32, result *Handle) (regerrno error)

func RegQueryInfoKey

func RegQueryInfoKey(key Handle, class *uint16, classLen *uint32, reserved *uint32, subkeysLen *uint32, maxSubkeyLen *uint32, maxClassLen *uint32, valuesLen *uint32, maxValueNameLen *uint32, maxValueLen *uint32, saLen *uint32, lastWriteTime *Filetime) (regerrno error)

func RegQueryValueEx

func RegQueryValueEx(key Handle, name *uint16, reserved *uint32, valtype *uint32, buf *byte, buflen *uint32) (regerrno error)

func ReleaseMutex

func ReleaseMutex(mutex Handle) (err error)

func RemoveDirectory

func RemoveDirectory(path *uint16) (err error)

func ReportEvent

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

func ResetEvent

func ResetEvent(event Handle) (err error)

func ResumeThread

func ResumeThread(thread Handle) (ret uint32, err error)

func RevertToSelf

func RevertToSelf() (err error)

func RtlAddFunctionTable

func RtlAddFunctionTable(functionTable *RUNTIME_FUNCTION, entryCount uint32, baseAddress uintptr) (ret bool)

func RtlDefaultNpAcl

func RtlDefaultNpAcl(acl **ACL) (ntstatus error)

func RtlDeleteFunctionTable

func RtlDeleteFunctionTable(functionTable *RUNTIME_FUNCTION) (ret bool)

func RtlDosPathNameToNtPathName

func RtlDosPathNameToNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error)

func RtlDosPathNameToRelativeNtPathName

func RtlDosPathNameToRelativeNtPathName(dosName *uint16, ntName *NTUnicodeString, ntFileNamePart *uint16, relativeName *RTL_RELATIVE_NAME) (ntstatus error)

func RtlInitString

func RtlInitString(destinationString *NTString, sourceString *byte)

func RtlInitUnicodeString

func RtlInitUnicodeString(destinationString *NTUnicodeString, sourceString *uint16)

func SetCommTimeouts

func SetCommTimeouts(handle Handle, timeouts *CommTimeouts) (err error)

func SetConsoleMode

func SetConsoleMode(console Handle, mode uint32) (err error)

func SetCurrentDirectory

func SetCurrentDirectory(path *uint16) (err error)

func SetDefaultDllDirectories

func SetDefaultDllDirectories(directoryFlags uint32) (err error)

func SetDllDirectory

func SetDllDirectory(path string) (err error)

func SetEndOfFile

func SetEndOfFile(handle Handle) (err error)

func SetEnvironmentVariable

func SetEnvironmentVariable(name *uint16, value *uint16) (err error)

func SetErrorMode

func SetErrorMode(mode uint32) (ret uint32)

func SetEvent

func SetEvent(event Handle) (err error)

func SetFileAttributes

func SetFileAttributes(name *uint16, attrs uint32) (err error)

func SetFileCompletionNotificationModes

func SetFileCompletionNotificationModes(handle Handle, flags uint8) (err error)

func SetFileInformationByHandle

func SetFileInformationByHandle(handle Handle, class uint32, inBuffer *byte, inBufferLen uint32) (err error)

func SetFilePointer

func SetFilePointer(handle Handle, lowoffset int32, highoffsetptr *int32, whence uint32) (newlowoffset uint32, err error)

func SetFileTime

func SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)

func SetHandleInformation

func SetHandleInformation(handle Handle, mask uint32, flags uint32) (err error)

func SetInformationJobObject

func SetInformationJobObject(job Handle, JobObjectInformationClass uint32, JobObjectInformation uintptr, JobObjectInformationLength uint32) (ret int, err error)

func SetKernelObjectSecurity

func SetKernelObjectSecurity(handle Handle, securityInformation SECURITY_INFORMATION, securityDescriptor *SECURITY_DESCRIPTOR) (err error)

func SetNamedPipeHandleState

func SetNamedPipeHandleState(pipe Handle, state *uint32, maxCollectionCount *uint32, collectDataTimeout *uint32) (err error)

func SetNamedSecurityInfo

func SetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error)

func SetPriorityClass

func SetPriorityClass(process Handle, priorityClass uint32) (err error)

func SetProcessPriorityBoost

func SetProcessPriorityBoost(process Handle, disable bool) (err error)

func SetProcessShutdownParameters

func SetProcessShutdownParameters(level uint32, flags uint32) (err error)

func SetProcessWorkingSetSizeEx

func SetProcessWorkingSetSizeEx(hProcess Handle, dwMinimumWorkingSetSize uintptr, dwMaximumWorkingSetSize uintptr, flags uint32) (err error)

func SetSecurityInfo

func SetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION, owner *SID, group *SID, dacl *ACL, sacl *ACL) (ret error)

func SetServiceStatus

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

func SetStdHandle

func SetStdHandle(stdhandle uint32, handle Handle) (err error)

func SetThreadToken

func SetThreadToken(thread *Handle, token Token) (err error)

func SetTokenInformation

func SetTokenInformation(token Token, infoClass uint32, info *byte, infoLen uint32) (err error)

func SetVolumeLabel

func SetVolumeLabel(rootPathName *uint16, volumeName *uint16) (err error)

func SetVolumeMountPoint

func SetVolumeMountPoint(volumeMountPoint *uint16, volumeName *uint16) (err error)

func Setenv

func Setenv(key, value string) error

func Setsockopt

func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error)

func SetupDiBuildDriverInfoList

func SetupDiBuildDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error)

func SetupDiCallClassInstaller

func SetupDiCallClassInstaller(installFunction DI_FUNCTION, deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error)

func SetupDiCancelDriverInfoSearch

func SetupDiCancelDriverInfoSearch(deviceInfoSet DevInfo) (err error)

func SetupDiDestroyDeviceInfoList

func SetupDiDestroyDeviceInfoList(deviceInfoSet DevInfo) (err error)

func SetupDiDestroyDriverInfoList

func SetupDiDestroyDriverInfoList(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverType SPDIT) (err error)

func SetupDiGetClassInstallParams

func SetupDiGetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32, requiredSize *uint32) (err error)

func SetupDiSetClassInstallParams

func SetupDiSetClassInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, classInstallParams *ClassInstallHeader, classInstallParamsSize uint32) (err error)

func SetupDiSetDeviceInstallParams

func SetupDiSetDeviceInstallParams(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, deviceInstallParams *DevInstallParams) (err error)

func SetupDiSetSelectedDevice

func SetupDiSetSelectedDevice(deviceInfoSet DevInfo, deviceInfoData *DevInfoData) (err error)

func SetupDiSetSelectedDriver

func SetupDiSetSelectedDriver(deviceInfoSet DevInfo, deviceInfoData *DevInfoData, driverInfoData *DrvInfoData) (err error)

func ShellExecute

func ShellExecute(hwnd Handle, verb *uint16, file *uint16, args *uint16, cwd *uint16, showCmd int32) (err error)

func SizeofResource

func SizeofResource(module Handle, resInfo Handle) (size uint32, err error)

func SleepEx

func SleepEx(milliseconds uint32, alertable bool) (ret uint32)

func StartService

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

func StartServiceCtrlDispatcher

func StartServiceCtrlDispatcher(serviceTable *SERVICE_TABLE_ENTRY) (err error)

func SubscribeServiceChangeNotifications

func SubscribeServiceChangeNotifications(service Handle, eventType uint32, callback uintptr, callbackCtx uintptr, subscription *uintptr) (ret error)

func TerminateJobObject

func TerminateJobObject(job Handle, exitCode uint32) (err error)

func TerminateProcess

func TerminateProcess(handle Handle, exitcode uint32) (err error)

func Thread32First

func Thread32First(snapshot Handle, threadEntry *ThreadEntry32) (err error)

func Thread32Next

func Thread32Next(snapshot Handle, threadEntry *ThreadEntry32) (err error)

func TranslateAccountName

func TranslateAccountName(username string, from, to uint32, initSize int) (string, error)

TranslateAccountName converts a directory service object name from one format to another.

func TranslateName

func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error)

func TransmitFile

func TransmitFile(s Handle, handle Handle, bytesToWrite uint32, bytsPerSend uint32, overlapped *Overlapped, transmitFileBuf *TransmitFileBuffers, flags uint32) (err error)

func UnlockFileEx

func UnlockFileEx(file Handle, reserved uint32, bytesLow uint32, bytesHigh uint32, overlapped *Overlapped) (err error)

func UnmapViewOfFile

func UnmapViewOfFile(addr uintptr) (err error)

func Unsetenv

func Unsetenv(key string) error

func UnsubscribeServiceChangeNotifications

func UnsubscribeServiceChangeNotifications(subscription uintptr) (err error)

func VerQueryValue

func VerQueryValue(block unsafe.Pointer, subBlock string, pointerToBufferPointer unsafe.Pointer, bufSize *uint32) (err error)

func VirtualAlloc

func VirtualAlloc(address uintptr, size uintptr, alloctype uint32, protect uint32) (value uintptr, err error)

func VirtualFree

func VirtualFree(address uintptr, size uintptr, freetype uint32) (err error)

func VirtualLock

func VirtualLock(addr uintptr, length uintptr) (err error)

func VirtualProtect

func VirtualProtect(address uintptr, size uintptr, newprotect uint32, oldprotect *uint32) (err error)

func VirtualProtectEx

func VirtualProtectEx(process Handle, address uintptr, size uintptr, newProtect uint32, oldProtect *uint32) (err error)

func VirtualQuery

func VirtualQuery(address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error)

func VirtualQueryEx

func VirtualQueryEx(process Handle, address uintptr, buffer *MemoryBasicInformation, length uintptr) (err error)

func VirtualUnlock

func VirtualUnlock(addr uintptr, length uintptr) (err error)

func WSACleanup

func WSACleanup() (err error)

func WSAEnumProtocols

func WSAEnumProtocols(protocols *int32, protocolBuffer *WSAProtocolInfo, bufferLength *uint32) (n int32, err error)

func WSAGetOverlappedResult

func WSAGetOverlappedResult(h Handle, o *Overlapped, bytes *uint32, wait bool, flags *uint32) (err error)

func WSAIoctl

func WSAIoctl(s Handle, iocc uint32, inbuf *byte, cbif uint32, outbuf *byte, cbob uint32, cbbr *uint32, overlapped *Overlapped, completionRoutine uintptr) (err error)

func WSARecv

func WSARecv(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, overlapped *Overlapped, croutine *byte) (err error)

func WSARecvFrom

func WSARecvFrom(s Handle, bufs *WSABuf, bufcnt uint32, recvd *uint32, flags *uint32, from *RawSockaddrAny, fromlen *int32, overlapped *Overlapped, croutine *byte) (err error)

func WSASend

func WSASend(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, overlapped *Overlapped, croutine *byte) (err error)

func WSASendTo

func WSASendTo(s Handle, bufs *WSABuf, bufcnt uint32, sent *uint32, flags uint32, to *RawSockaddrAny, tolen int32, overlapped *Overlapped, croutine *byte) (err error)

func WSAStartup

func WSAStartup(verreq uint32, data *WSAData) (sockerr error)

func WTSEnumerateSessions

func WTSEnumerateSessions(handle Handle, reserved uint32, version uint32, sessions **WTS_SESSION_INFO, count *uint32) (err error)

func WTSFreeMemory

func WTSFreeMemory(ptr uintptr)

func WTSGetActiveConsoleSessionId

func WTSGetActiveConsoleSessionId() (sessionID uint32)

func WTSQueryUserToken

func WTSQueryUserToken(session uint32, token *Token) (err error)

func WaitForSingleObject

func WaitForSingleObject(handle Handle, waitMilliseconds uint32) (event uint32, err error)

func WinVerifyTrustEx

func WinVerifyTrustEx(hwnd HWND, actionId *GUID, data *WinTrustData) (ret error)

func WriteConsole

func WriteConsole(console Handle, buf *uint16, towrite uint32, written *uint32, reserved *byte) (err error)

func WriteProcessMemory

func WriteProcessMemory(process Handle, baseAddress uintptr, buffer *byte, size uintptr, numberOfBytesWritten *uintptr) (err error)

Types

type ACCESS_MASK

type ACCESS_MASK uint32

type ACCESS_MODE

type ACCESS_MODE uint32

type ACL

type ACL struct {
	// contains filtered or unexported fields
}

func ACLFromEntries

func ACLFromEntries(explicitEntries []EXPLICIT_ACCESS, mergedACL *ACL) (acl *ACL, err error)

ACLFromEntries returns a new ACL on the Go heap containing a list of explicit entries as well as those of another ACL. Both explicitEntries and mergedACL are optional and can be nil.

type AddrinfoW

type AddrinfoW struct {
	Flags     int32
	Family    int32
	Socktype  int32
	Protocol  int32
	Addrlen   uintptr
	Canonname *uint16
	Addr      uintptr
	Next      *AddrinfoW
}

type BIND_OPTS3

type BIND_OPTS3 struct {
	CbStruct          uint32
	Flags             uint32
	Mode              uint32
	TickCountDeadline uint32
	TrackFlags        uint32
	ClassContext      uint32
	Locale            uint32
	ServerInfo        *COSERVERINFO
	Hwnd              HWND
}

type ByHandleFileInformation

type ByHandleFileInformation struct {
	FileAttributes     uint32
	CreationTime       Filetime
	LastAccessTime     Filetime
	LastWriteTime      Filetime
	VolumeSerialNumber uint32
	FileSizeHigh       uint32
	FileSizeLow        uint32
	NumberOfLinks      uint32
	FileIndexHigh      uint32
	FileIndexLow       uint32
}

type COAUTHIDENTITY

type COAUTHIDENTITY struct {
	User           *uint16
	UserLength     uint32
	Domain         *uint16
	DomainLength   uint32
	Password       *uint16
	PasswordLength uint32
	Flags          uint32
}

type COAUTHINFO

type COAUTHINFO struct {
	AuthnSvc           uint32
	AuthzSvc           uint32
	ServerPrincName    *uint16
	AuthnLevel         uint32
	ImpersonationLevel uint32
	AuthIdentityData   *COAUTHIDENTITY
	Capabilities       uint32
}

type COSERVERINFO

type COSERVERINFO struct {
	Reserved1 uint32
	Aame      *uint16
	AuthInfo  *COAUTHINFO
	Reserved2 uint32
}

type CURDIR

type CURDIR struct {
	DosPath NTUnicodeString
	Handle  Handle
}

type CertBlob

type CertBlob DataBlob

type CertChainContext

type CertChainContext struct {
	Size                       uint32
	TrustStatus                CertTrustStatus
	ChainCount                 uint32
	Chains                     **CertSimpleChain
	LowerQualityChainCount     uint32
	LowerQualityChains         **CertChainContext
	HasRevocationFreshnessTime uint32
	RevocationFreshnessTime    uint32
}

func CertFindChainInStore

func CertFindChainInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevChainContext *CertChainContext) (certchain *CertChainContext, err error)

type CertChainElement

type CertChainElement struct {
	Size              uint32
	CertContext       *CertContext
	TrustStatus       CertTrustStatus
	RevocationInfo    *CertRevocationInfo
	IssuanceUsage     *CertEnhKeyUsage
	ApplicationUsage  *CertEnhKeyUsage
	ExtendedErrorInfo *uint16
}

type CertChainFindByIssuerPara

type CertChainFindByIssuerPara struct {
	Size                   uint32
	UsageIdentifier        *byte
	KeySpec                uint32
	AcquirePrivateKeyFlags uint32
	IssuerCount            uint32
	Issuer                 Pointer
	FindCallback           Pointer
	FindArg                Pointer
	IssuerChainIndex       *uint32
	IssuerElementIndex     *uint32
}

type CertChainPara

type CertChainPara struct {
	Size                         uint32
	RequestedUsage               CertUsageMatch
	RequstedIssuancePolicy       CertUsageMatch
	URLRetrievalTimeout          uint32
	CheckRevocationFreshnessTime uint32
	RevocationFreshnessTime      uint32
	CacheResync                  *Filetime
}

type CertChainPolicyPara

type CertChainPolicyPara struct {
	Size            uint32
	Flags           uint32
	ExtraPolicyPara Pointer
}

type CertChainPolicyStatus

type CertChainPolicyStatus struct {
	Size              uint32
	Error             uint32
	ChainIndex        uint32
	ElementIndex      uint32
	ExtraPolicyStatus Pointer
}

type CertContext

type CertContext struct {
	EncodingType uint32
	EncodedCert  *byte
	Length       uint32
	CertInfo     *CertInfo
	Store        Handle
}

func CertCreateCertificateContext

func CertCreateCertificateContext(certEncodingType uint32, certEncoded *byte, encodedLen uint32) (context *CertContext, err error)

func CertDuplicateCertificateContext

func CertDuplicateCertificateContext(certContext *CertContext) (dupContext *CertContext)

func CertEnumCertificatesInStore

func CertEnumCertificatesInStore(store Handle, prevContext *CertContext) (context *CertContext, err error)

func CertFindCertificateInStore

func CertFindCertificateInStore(store Handle, certEncodingType uint32, findFlags uint32, findType uint32, findPara unsafe.Pointer, prevCertContext *CertContext) (cert *CertContext, err error)

type CertEnhKeyUsage

type CertEnhKeyUsage struct {
	Length           uint32
	UsageIdentifiers **byte
}

type CertExtension

type CertExtension struct {
	ObjId    *byte
	Critical int32
	Value    CryptObjidBlob
}

func CertFindExtension

func CertFindExtension(objId *byte, countExtensions uint32, extensions *CertExtension) (ret *CertExtension)

type CertInfo

type CertInfo struct {
	Version              uint32
	SerialNumber         CryptIntegerBlob
	SignatureAlgorithm   CryptAlgorithmIdentifier
	Issuer               CertNameBlob
	NotBefore            Filetime
	NotAfter             Filetime
	Subject              CertNameBlob
	SubjectPublicKeyInfo CertPublicKeyInfo
	IssuerUniqueId       CryptBitBlob
	SubjectUniqueId      CryptBitBlob
	CountExtensions      uint32
	Extensions           *CertExtension
}

type CertNameBlob

type CertNameBlob DataBlob

type CertPoliciesInfo

type CertPoliciesInfo struct {
	Count       uint32
	PolicyInfos *CertPolicyInfo
}

type CertPolicyInfo

type CertPolicyInfo struct {
	Identifier      *byte
	CountQualifiers uint32
	Qualifiers      *CertPolicyQualifierInfo
}

type CertPolicyQualifierInfo

type CertPolicyQualifierInfo struct {
}

type CertPublicKeyInfo

type CertPublicKeyInfo struct {
	Algorithm CryptAlgorithmIdentifier
	PublicKey CryptBitBlob
}

type CertRdnValueBlob

type CertRdnValueBlob DataBlob

type CertRevocationCrlInfo

type CertRevocationCrlInfo struct {
}

type CertRevocationInfo

type CertRevocationInfo struct {
	Size             uint32
	RevocationResult uint32
	RevocationOid    *byte
	OidSpecificInfo  Pointer
	HasFreshnessTime uint32
	FreshnessTime    uint32
	CrlInfo          *CertRevocationCrlInfo
}

type CertSimpleChain

type CertSimpleChain struct {
	Size                       uint32
	TrustStatus                CertTrustStatus
	NumElements                uint32
	Elements                   **CertChainElement
	TrustListInfo              *CertTrustListInfo
	HasRevocationFreshnessTime uint32
	RevocationFreshnessTime    uint32
}

type CertStrongSignPara

type CertStrongSignPara struct {
	Size                      uint32
	InfoChoice                uint32
	InfoOrSerializedInfoOrOID unsafe.Pointer
}

type CertTrustListInfo

type CertTrustListInfo struct {
}

type CertTrustStatus

type CertTrustStatus struct {
	ErrorStatus uint32
	InfoStatus  uint32
}

type CertUsageMatch

type CertUsageMatch struct {
	Type  uint32
	Usage CertEnhKeyUsage
}

type CommTimeouts

type CommTimeouts struct {
	ReadIntervalTimeout         uint32
	ReadTotalTimeoutMultiplier  uint32
	ReadTotalTimeoutConstant    uint32
	WriteTotalTimeoutMultiplier uint32
	WriteTotalTimeoutConstant   uint32
}

type ConsoleScreenBufferInfo

type ConsoleScreenBufferInfo struct {
	Size              Coord
	CursorPosition    Coord
	Attributes        uint16
	Window            SmallRect
	MaximumWindowSize Coord
}

type Coord

type Coord struct {
	X int16
	Y int16
}

type CrlBlob

type CrlBlob DataBlob

type CryptAlgorithmIdentifier

type CryptAlgorithmIdentifier struct {
	ObjId      *byte
	Parameters CryptObjidBlob
}

type CryptAttrBlob

type CryptAttrBlob DataBlob

type CryptBitBlob

type CryptBitBlob struct {
	Size       uint32
	Data       *byte
	UnusedBits uint32
}

type CryptDataBlob

type CryptDataBlob DataBlob

type CryptDerBlob

type CryptDerBlob DataBlob

type CryptDigestBlob

type CryptDigestBlob DataBlob

type CryptHashBlob

type CryptHashBlob DataBlob

type CryptIntegerBlob

type CryptIntegerBlob DataBlob

type CryptObjidBlob

type CryptObjidBlob DataBlob

type CryptProtectPromptStruct

type CryptProtectPromptStruct struct {
	Size        uint32
	PromptFlags uint32
	App         HWND
	Prompt      *uint16
}

type CryptUintBlob

type CryptUintBlob DataBlob

type DLL

type DLL struct {
	Name   string
	Handle Handle
}

A DLL implements access to a single DLL.

func LoadDLL

func LoadDLL(name string) (dll *DLL, err error)

LoadDLL loads DLL file into memory.

Warning: using LoadDLL without an absolute path name is subject to DLL preloading attacks. To safely load a system DLL, use LazyDLL with System set to true, or use LoadLibraryEx directly.

func MustLoadDLL

func MustLoadDLL(name string) *DLL

MustLoadDLL is like LoadDLL but panics if load operation failes.

func (*DLL) FindProc

func (d *DLL) FindProc(name string) (proc *Proc, err error)

FindProc searches DLL d for procedure named name and returns *Proc if found. It returns an error if search fails.

func (*DLL) FindProcByOrdinal

func (d *DLL) FindProcByOrdinal(ordinal uintptr) (proc *Proc, err error)

FindProcByOrdinal searches DLL d for procedure by ordinal and returns *Proc if found. It returns an error if search fails.

func (*DLL) MustFindProc

func (d *DLL) MustFindProc(name string) *Proc

MustFindProc is like FindProc but panics if search fails.

func (*DLL) MustFindProcByOrdinal

func (d *DLL) MustFindProcByOrdinal(ordinal uintptr) *Proc

MustFindProcByOrdinal is like FindProcByOrdinal but panics if search fails.

func (*DLL) Release

func (d *DLL) Release() (err error)

Release unloads DLL d from memory.

type DLLError

type DLLError struct {
	Err     error
	ObjName string
	Msg     string
}

DLLError describes reasons for DLL load failures.

func (*DLLError) Error

func (e *DLLError) Error() string

func (*DLLError) Unwrap

func (e *DLLError) Unwrap() error

type DNSMXData

type DNSMXData struct {
	NameExchange *uint16
	Preference   uint16
	Pad          uint16
}

type DNSPTRData

type DNSPTRData struct {
	Host *uint16
}

type DNSRecord

type DNSRecord struct {
	Next     *DNSRecord
	Name     *uint16
	Type     uint16
	Length   uint16
	Dw       uint32
	Ttl      uint32
	Reserved uint32
	Data     [40]byte
}

type DNSSRVData

type DNSSRVData struct {
	Target   *uint16
	Priority uint16
	Weight   uint16
	Port     uint16
	Pad      uint16
}

type DNSTXTData

type DNSTXTData struct {
	StringCount uint16
	StringArray [1]*uint16
}

type DataBlob

type DataBlob struct {
	Size uint32
	Data *byte
}

type EXPLICIT_ACCESS

type EXPLICIT_ACCESS struct {
	AccessPermissions ACCESS_MASK
	AccessMode        ACCESS_MODE
	Inheritance       uint32
	Trustee           TRUSTEE
}

type FileNotifyInformation

type FileNotifyInformation struct {
	NextEntryOffset uint32
	Action          uint32
	FileNameLength  uint32
	FileName        uint16
}

type Filetime

type Filetime struct {
	LowDateTime  uint32
	HighDateTime uint32
}

func NsecToFiletime

func NsecToFiletime(nsec int64) (ft Filetime)

func (*Filetime) Nanoseconds

func (ft *Filetime) Nanoseconds() int64

Nanoseconds returns Filetime ft in nanoseconds since Epoch (00:00:00 UTC, January 1, 1970).

type GUID

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

type GUIThreadInfo

type GUIThreadInfo struct {
	Size        uint32
	Flags       uint32
	Active      HWND
	Focus       HWND
	Capture     HWND
	MenuOwner   HWND
	MoveSize    HWND
	CaretHandle HWND
	CaretRect   Rect
}

type Hostent

type Hostent struct {
	Name     *byte
	Aliases  **byte
	AddrType uint16
	Length   uint16
	AddrList **byte
}

func GetHostByName

func GetHostByName(name string) (h *Hostent, err error)

type IO_COUNTERS

type IO_COUNTERS struct {
	ReadOperationCount  uint64
	WriteOperationCount uint64
	OtherOperationCount uint64
	ReadTransferCount   uint64
	WriteTransferCount  uint64
	OtherTransferCount  uint64
}

type IO_STATUS_BLOCK

type IO_STATUS_BLOCK struct {
	Status      NTStatus
	Information uintptr
}

type InterfaceInfo

type InterfaceInfo struct {
	Flags            uint32
	Address          SockaddrGen
	BroadcastAddress SockaddrGen
	Netmask          SockaddrGen
}

type IpAdapterAddresses

type IpAdapterAddresses struct {
	Length                 uint32
	IfIndex                uint32
	Next                   *IpAdapterAddresses
	AdapterName            *byte
	FirstUnicastAddress    *IpAdapterUnicastAddress
	FirstAnycastAddress    *IpAdapterAnycastAddress
	FirstMulticastAddress  *IpAdapterMulticastAddress
	FirstDnsServerAddress  *IpAdapterDnsServerAdapter
	DnsSuffix              *uint16
	Description            *uint16
	FriendlyName           *uint16
	PhysicalAddress        [syscall.MAX_ADAPTER_ADDRESS_LENGTH]byte
	PhysicalAddressLength  uint32
	Flags                  uint32
	Mtu                    uint32
	IfType                 uint32
	OperStatus             uint32
	Ipv6IfIndex            uint32
	ZoneIndices            [16]uint32
	FirstPrefix            *IpAdapterPrefix
	TransmitLinkSpeed      uint64
	ReceiveLinkSpeed       uint64
	FirstWinsServerAddress *IpAdapterWinsServerAddress
	FirstGatewayAddress    *IpAdapterGatewayAddress
	Ipv4Metric             uint32
	Ipv6Metric             uint32
	Luid                   uint64
	Dhcpv4Server           SocketAddress
	CompartmentId          uint32
	NetworkGuid            GUID
	ConnectionType         uint32
	TunnelType             uint32
	Dhcpv6Server           SocketAddress
	Dhcpv6ClientDuid       [MAX_DHCPV6_DUID_LENGTH]byte
	Dhcpv6ClientDuidLength uint32
	Dhcpv6Iaid             uint32
	FirstDnsSuffix         *IpAdapterDNSSuffix
}

type IpAdapterAnycastAddress

type IpAdapterAnycastAddress struct {
	Length  uint32
	Flags   uint32
	Next    *IpAdapterAnycastAddress
	Address SocketAddress
}

type IpAdapterDNSSuffix

type IpAdapterDNSSuffix struct {
	Next   *IpAdapterDNSSuffix
	String [MAX_DNS_SUFFIX_STRING_LENGTH]uint16
}

type IpAdapterDnsServerAdapter

type IpAdapterDnsServerAdapter struct {
	Length   uint32
	Reserved uint32
	Next     *IpAdapterDnsServerAdapter
	Address  SocketAddress
}

type IpAdapterGatewayAddress

type IpAdapterGatewayAddress struct {
	Length   uint32
	Reserved uint32
	Next     *IpAdapterGatewayAddress
	Address  SocketAddress
}

type IpAdapterInfo

type IpAdapterInfo struct {
	Next                *IpAdapterInfo
	ComboIndex          uint32
	AdapterName         [MAX_ADAPTER_NAME_LENGTH + 4]byte
	Description         [MAX_ADAPTER_DESCRIPTION_LENGTH + 4]byte
	AddressLength       uint32
	Address             [MAX_ADAPTER_ADDRESS_LENGTH]byte
	Index               uint32
	Type                uint32
	DhcpEnabled         uint32
	CurrentIpAddress    *IpAddrString
	IpAddressList       IpAddrString
	GatewayList         IpAddrString
	DhcpServer          IpAddrString
	HaveWins            bool
	PrimaryWinsServer   IpAddrString
	SecondaryWinsServer IpAddrString
	LeaseObtained       int64
	LeaseExpires        int64
}

type IpAdapterMulticastAddress

type IpAdapterMulticastAddress struct {
	Length  uint32
	Flags   uint32
	Next    *IpAdapterMulticastAddress
	Address SocketAddress
}

type IpAdapterPrefix

type IpAdapterPrefix struct {
	Length       uint32
	Flags        uint32
	Next         *IpAdapterPrefix
	Address      SocketAddress
	PrefixLength uint32
}

type IpAdapterUnicastAddress

type IpAdapterUnicastAddress struct {
	Length             uint32
	Flags              uint32
	Next               *IpAdapterUnicastAddress
	Address            SocketAddress
	PrefixOrigin       int32
	SuffixOrigin       int32
	DadState           int32
	ValidLifetime      uint32
	PreferredLifetime  uint32
	LeaseLifetime      uint32
	OnLinkPrefixLength uint8
}

type IpAdapterWinsServerAddress

type IpAdapterWinsServerAddress struct {
	Length   uint32
	Reserved uint32
	Next     *IpAdapterWinsServerAddress
	Address  SocketAddress
}

type IpAddrString

type IpAddrString struct {
	Next      *IpAddrString
	IpAddress IpAddressString
	IpMask    IpMaskString
	Context   uint32
}

type IpAddressString

type IpAddressString struct {
	String [16]byte
}

type IpMaskString

type IpMaskString IpAddressString

type JOBOBJECT_BASIC_UI_RESTRICTIONS

type JOBOBJECT_BASIC_UI_RESTRICTIONS struct {
	UIRestrictionsClass uint32
}

type JOBOBJECT_EXTENDED_LIMIT_INFORMATION

type JOBOBJECT_EXTENDED_LIMIT_INFORMATION struct {
	BasicLimitInformation JOBOBJECT_BASIC_LIMIT_INFORMATION
	IoInfo                IO_COUNTERS
	ProcessMemoryLimit    uintptr
	JobMemoryLimit        uintptr
	PeakProcessMemoryUsed uintptr
	PeakJobMemoryUsed     uintptr
}

type KNOWNFOLDERID

type KNOWNFOLDERID GUID

type LDR_DATA_TABLE_ENTRY

type LDR_DATA_TABLE_ENTRY struct {
	InMemoryOrderLinks LIST_ENTRY

	DllBase uintptr

	FullDllName NTUnicodeString

	TimeDateStamp uint32
	// contains filtered or unexported fields
}

type LIST_ENTRY

type LIST_ENTRY struct {
	Flink *LIST_ENTRY
	Blink *LIST_ENTRY
}

type LUID

type LUID struct {
	LowPart  uint32
	HighPart int32
}

type LUIDAndAttributes

type LUIDAndAttributes struct {
	Luid       LUID
	Attributes uint32
}

type LazyDLL

type LazyDLL struct {
	Name string

	// System determines whether the DLL must be loaded from the
	// Windows System directory, bypassing the normal DLL search
	// path.
	System bool
	// contains filtered or unexported fields
}

A LazyDLL implements access to a single DLL. It will delay the load of the DLL until the first call to its Handle method or to one of its LazyProc's Addr method.

func NewLazyDLL

func NewLazyDLL(name string) *LazyDLL

NewLazyDLL creates new LazyDLL associated with DLL file.

func NewLazySystemDLL

func NewLazySystemDLL(name string) *LazyDLL

NewLazySystemDLL is like NewLazyDLL, but will only search Windows System directory for the DLL if name is a base name (like "advapi32.dll").

func (*LazyDLL) Handle

func (d *LazyDLL) Handle() uintptr

Handle returns d's module handle.

func (*LazyDLL) Load

func (d *LazyDLL) Load() error

Load loads DLL file d.Name into memory. It returns an error if fails. Load will not try to load DLL, if it is already loaded into memory.

func (*LazyDLL) NewProc

func (d *LazyDLL) NewProc(name string) *LazyProc

NewProc returns a LazyProc for accessing the named procedure in the DLL d.

type LazyProc

type LazyProc struct {
	Name string
	// contains filtered or unexported fields
}

A LazyProc implements access to a procedure inside a LazyDLL. It delays the lookup until the Addr method is called.

func (*LazyProc) Addr

func (p *LazyProc) Addr() uintptr

Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure. It will panic if the procedure cannot be found.

func (*LazyProc) Call

func (p *LazyProc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error)

Call executes procedure p with arguments a. It will panic, if more than 15 arguments are supplied. It will also panic if the procedure cannot be found.

The returned error is always non-nil, constructed from the result of GetLastError. Callers must inspect the primary return value to decide whether an error occurred (according to the semantics of the specific function being called) before consulting the error. The error will be guaranteed to contain windows.Errno.

func (*LazyProc) Find

func (p *LazyProc) Find() error

Find searches DLL for procedure named p.Name. It returns an error if search fails. Find will not search procedure, if it is already found and loaded into memory.

type MULTIPLE_TRUSTEE_OPERATION

type MULTIPLE_TRUSTEE_OPERATION uint32

type MibIfRow

type MibIfRow struct {
	Name            [MAX_INTERFACE_NAME_LEN]uint16
	Index           uint32
	Type            uint32
	Mtu             uint32
	Speed           uint32
	PhysAddrLen     uint32
	PhysAddr        [MAXLEN_PHYSADDR]byte
	AdminStatus     uint32
	OperStatus      uint32
	LastChange      uint32
	InOctets        uint32
	InUcastPkts     uint32
	InNUcastPkts    uint32
	InDiscards      uint32
	InErrors        uint32
	InUnknownProtos uint32
	OutOctets       uint32
	OutUcastPkts    uint32
	OutNUcastPkts   uint32
	OutDiscards     uint32
	OutErrors       uint32
	OutQLen         uint32
	DescrLen        uint32
	Descr           [MAXLEN_IFDESCR]byte
}

type ModuleEntry32

type ModuleEntry32 struct {
	Size         uint32
	ModuleID     uint32
	ProcessID    uint32
	GlblcntUsage uint32
	ProccntUsage uint32
	ModBaseAddr  uintptr
	ModBaseSize  uint32
	ModuleHandle Handle
	Module       [MAX_MODULE_NAME32 + 1]uint16
	ExePath      [MAX_PATH]uint16
}

type ModuleInfo

type ModuleInfo struct {
	BaseOfDll   uintptr
	SizeOfImage uint32
	EntryPoint  uintptr
}

type NTStatus

type NTStatus uint32

NTStatus corresponds with NTSTATUS, error values returned by ntdll.dll and other native functions.

type NTString

type NTString struct {
	Length        uint16
	MaximumLength uint16
	Buffer        *byte
}

NTString is an ANSI string for NT native APIs, corresponding to STRING.

type NTUnicodeString

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

NTUnicodeString is a UTF-16 string for NT native APIs, corresponding to UNICODE_STRING.

type OBJECTS_AND_NAME

type OBJECTS_AND_NAME struct {
	ObjectsPresent          uint32
	ObjectType              SE_OBJECT_TYPE
	ObjectTypeName          *uint16
	InheritedObjectTypeName *uint16
	Name                    *uint16
}

type OBJECTS_AND_SID

type OBJECTS_AND_SID struct {
	ObjectsPresent          uint32
	ObjectTypeGuid          GUID
	InheritedObjectTypeGuid GUID
	Sid                     *SID
}

type OBJECT_ATTRIBUTES

type OBJECT_ATTRIBUTES struct {
	Length             uint32
	RootDirectory      Handle
	ObjectName         *NTUnicodeString
	Attributes         uint32
	SecurityDescriptor *SECURITY_DESCRIPTOR
	SecurityQoS        *SECURITY_QUALITY_OF_SERVICE
}

type OsVersionInfoEx

type OsVersionInfoEx struct {
	MajorVersion     uint32
	MinorVersion     uint32
	BuildNumber      uint32
	PlatformId       uint32
	CsdVersion       [128]uint16
	ServicePackMajor uint16
	ServicePackMinor uint16
	SuiteMask        uint16
	ProductType      byte
	// contains filtered or unexported fields
}

type Overlapped

type Overlapped struct {
	Internal     uintptr
	InternalHigh uintptr
	Offset       uint32
	OffsetHigh   uint32
	HEvent       Handle
}

type PEB

type PEB struct {
	BeingDebugged byte
	BitField      byte

	ImageBaseAddress  uintptr
	Ldr               *PEB_LDR_DATA
	ProcessParameters *RTL_USER_PROCESS_PARAMETERS

	AtlThunkSListPtr uintptr

	AtlThunkSListPtr32 uint32

	PostProcessInitRoutine uintptr

	SessionId uint32
	// contains filtered or unexported fields
}

func RtlGetCurrentPeb

func RtlGetCurrentPeb() (peb *PEB)

type PEB_LDR_DATA

type PEB_LDR_DATA struct {
	InMemoryOrderModuleList LIST_ENTRY
	// contains filtered or unexported fields
}

type PROCESS_BASIC_INFORMATION

type PROCESS_BASIC_INFORMATION struct {
	ExitStatus                   NTStatus
	PebBaseAddress               *PEB
	AffinityMask                 uintptr
	BasePriority                 int32
	UniqueProcessId              uintptr
	InheritedFromUniqueProcessId uintptr
}

type Pointer

type Pointer *struct{}

Pointer represents a pointer to an arbitrary Windows type.

Pointer-typed fields may point to one of many different types. It's up to the caller to provide a pointer to the appropriate type, cast to Pointer. The caller must obey the unsafe.Pointer rules while doing so.

type Proc

type Proc struct {
	Dll  *DLL
	Name string
	// contains filtered or unexported fields
}

A Proc implements access to a procedure inside a DLL.

func (*Proc) Addr

func (p *Proc) Addr() uintptr

Addr returns the address of the procedure represented by p. The return value can be passed to Syscall to run the procedure.

func (*Proc) Call

func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error)

Call executes procedure p with arguments a. It will panic, if more than 15 arguments are supplied.

The returned error is always non-nil, constructed from the result of GetLastError. Callers must inspect the primary return value to decide whether an error occurred (according to the semantics of the specific function being called) before consulting the error. The error will be guaranteed to contain windows.Errno.

type ProcThreadAttributeList

type ProcThreadAttributeList struct{}

ProcThreadAttributeList is a placeholder type to represent a PROC_THREAD_ATTRIBUTE_LIST.

To create a *ProcThreadAttributeList, use NewProcThreadAttributeList, update it with ProcThreadAttributeListContainer.Update, free its memory using ProcThreadAttributeListContainer.Delete, and access the list itself using ProcThreadAttributeListContainer.List.

type ProcThreadAttributeListContainer

type ProcThreadAttributeListContainer struct {
	// contains filtered or unexported fields
}

type ProcessEntry32

type ProcessEntry32 struct {
	Size            uint32
	Usage           uint32
	ProcessID       uint32
	DefaultHeapID   uintptr
	ModuleID        uint32
	Threads         uint32
	ParentProcessID uint32
	PriClassBase    int32
	Flags           uint32
	ExeFile         [MAX_PATH]uint16
}

type ProcessInformation

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

type Protoent

type Protoent struct {
	Name    *byte
	Aliases **byte
	Proto   uint16
}

func GetProtoByName

func GetProtoByName(name string) (p *Protoent, err error)

type RTLP_CURDIR_REF

type RTLP_CURDIR_REF struct {
	RefCount int32
	Handle   Handle
}

type RTL_DRIVE_LETTER_CURDIR

type RTL_DRIVE_LETTER_CURDIR struct {
	Flags     uint16
	Length    uint16
	TimeStamp uint32
	DosPath   NTString
}

type RTL_PROCESS_MODULES

type RTL_PROCESS_MODULES struct {
	NumberOfModules uint32
	Modules         [1]RTL_PROCESS_MODULE_INFORMATION
}

type RTL_PROCESS_MODULE_INFORMATION

type RTL_PROCESS_MODULE_INFORMATION struct {
	Section          Handle
	MappedBase       uintptr
	ImageBase        uintptr
	ImageSize        uint32
	Flags            uint32
	LoadOrderIndex   uint16
	InitOrderIndex   uint16
	LoadCount        uint16
	OffsetToFileName uint16
	FullPathName     [256]byte
}

type RTL_RELATIVE_NAME

type RTL_RELATIVE_NAME struct {
	RelativeName        NTUnicodeString
	ContainingDirectory Handle
	CurDirRef           *RTLP_CURDIR_REF
}

type RTL_USER_PROCESS_PARAMETERS

type RTL_USER_PROCESS_PARAMETERS struct {
	MaximumLength, Length uint32

	Flags, DebugFlags uint32

	ConsoleHandle                                Handle
	ConsoleFlags                                 uint32
	StandardInput, StandardOutput, StandardError Handle

	CurrentDirectory CURDIR
	DllPath          NTUnicodeString
	ImagePathName    NTUnicodeString
	CommandLine      NTUnicodeString
	Environment      unsafe.Pointer

	StartingX, StartingY, CountX, CountY, CountCharsX, CountCharsY, FillAttribute uint32

	WindowFlags, ShowWindowFlags                     uint32
	WindowTitle, DesktopInfo, ShellInfo, RuntimeData NTUnicodeString
	CurrentDirectories                               [32]RTL_DRIVE_LETTER_CURDIR

	EnvironmentSize, EnvironmentVersion uintptr

	PackageDependencyData unsafe.Pointer
	ProcessGroupId        uint32
	LoaderThreads         uint32

	RedirectionDllName               NTUnicodeString
	HeapPartitionName                NTUnicodeString
	DefaultThreadpoolCpuSetMasks     uintptr
	DefaultThreadpoolCpuSetMaskCount uint32
}

type RUNTIME_FUNCTION

type RUNTIME_FUNCTION struct {
	BeginAddress uint32
	EndAddress   uint32
	UnwindData   uint32
}

type Rect

type Rect struct {
	Left   int32
	Top    int32
	Right  int32
	Bottom int32
}

type ResourceID

type ResourceID uint16

ResourceID represents a 16-bit resource identifier, traditionally created with the MAKEINTRESOURCE macro.

var (
	// Predefined names.
	CREATEPROCESS_MANIFEST_RESOURCE_ID                 ResourceID = 1
	ISOLATIONAWARE_MANIFEST_RESOURCE_ID                ResourceID = 2
	ISOLATIONAWARE_NOSTATICIMPORT_MANIFEST_RESOURCE_ID ResourceID = 3
	ISOLATIONPOLICY_MANIFEST_RESOURCE_ID               ResourceID = 4
	ISOLATIONPOLICY_BROWSER_MANIFEST_RESOURCE_ID       ResourceID = 5
	MINIMUM_RESERVED_MANIFEST_RESOURCE_ID              ResourceID = 1  // inclusive
	MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID              ResourceID = 16 // inclusive

	// Predefined types.
	RT_CURSOR       ResourceID = 1
	RT_BITMAP       ResourceID = 2
	RT_ICON         ResourceID = 3
	RT_MENU         ResourceID = 4
	RT_DIALOG       ResourceID = 5
	RT_STRING       ResourceID = 6
	RT_FONTDIR      ResourceID = 7
	RT_FONT         ResourceID = 8
	RT_ACCELERATOR  ResourceID = 9
	RT_RCDATA       ResourceID = 10
	RT_MESSAGETABLE ResourceID = 11
	RT_GROUP_CURSOR ResourceID = 12
	RT_GROUP_ICON   ResourceID = 14
	RT_VERSION      ResourceID = 16
	RT_DLGINCLUDE   ResourceID = 17
	RT_PLUGPLAY     ResourceID = 19
	RT_VXD          ResourceID = 20
	RT_ANICURSOR    ResourceID = 21
	RT_ANIICON      ResourceID = 22
	RT_HTML         ResourceID = 23
	RT_MANIFEST     ResourceID = 24
)

Predefined resource names and types.

type ResourceIDOrString

type ResourceIDOrString interface{}

ResourceIDOrString must be either a ResourceID, to specify a resource or resource type by ID, or a string, to specify a resource or resource type by name.

type SECURITY_DESCRIPTOR

type SECURITY_DESCRIPTOR struct {
	// contains filtered or unexported fields
}

func BuildSecurityDescriptor

func BuildSecurityDescriptor(owner *TRUSTEE, group *TRUSTEE, accessEntries []EXPLICIT_ACCESS, auditEntries []EXPLICIT_ACCESS, mergedSecurityDescriptor *SECURITY_DESCRIPTOR) (sd *SECURITY_DESCRIPTOR, err error)

BuildSecurityDescriptor makes a new security descriptor using the input trustees, explicit access lists, and prior security descriptor to be merged, any of which can be nil, returning the self-relative security descriptor result on the Go heap.

func GetNamedSecurityInfo

func GetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error)

GetNamedSecurityInfo queries the security information for a given named object and returns the self-relative security descriptor result on the Go heap.

func GetSecurityInfo

func GetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error)

GetSecurityInfo queries the security information for a given handle and returns the self-relative security descriptor result on the Go heap.

func NewSecurityDescriptor

func NewSecurityDescriptor() (absoluteSD *SECURITY_DESCRIPTOR, err error)

NewSecurityDescriptor creates and initializes a new absolute security descriptor.

func SecurityDescriptorFromString

func SecurityDescriptorFromString(sddl string) (sd *SECURITY_DESCRIPTOR, err error)

SecurityDescriptorFromString converts an SDDL string describing a security descriptor into a self-relative security descriptor object allocated on the Go heap.

func (*SECURITY_DESCRIPTOR) Control

func (sd *SECURITY_DESCRIPTOR) Control() (control SECURITY_DESCRIPTOR_CONTROL, revision uint32, err error)

Control returns the security descriptor control bits.

func (*SECURITY_DESCRIPTOR) DACL

func (sd *SECURITY_DESCRIPTOR) DACL() (dacl *ACL, defaulted bool, err error)

DACL returns the security descriptor DACL and whether it was defaulted. The dacl return value may be nil if a DACL exists but is an "empty DACL", meaning fully permissive. If the DACL does not exist, err returns ERROR_OBJECT_NOT_FOUND.

func (*SECURITY_DESCRIPTOR) Group

func (sd *SECURITY_DESCRIPTOR) Group() (group *SID, defaulted bool, err error)

Group returns the security descriptor group and whether it was defaulted.

func (*SECURITY_DESCRIPTOR) IsValid

func (sd *SECURITY_DESCRIPTOR) IsValid() bool

IsValid returns whether the security descriptor is valid.

func (*SECURITY_DESCRIPTOR) Length

func (sd *SECURITY_DESCRIPTOR) Length() uint32

Length returns the length of the security descriptor.

func (*SECURITY_DESCRIPTOR) Owner

func (sd *SECURITY_DESCRIPTOR) Owner() (owner *SID, defaulted bool, err error)

Owner returns the security descriptor owner and whether it was defaulted.

func (*SECURITY_DESCRIPTOR) RMControl

func (sd *SECURITY_DESCRIPTOR) RMControl() (control uint8, err error)

RMControl returns the security descriptor resource manager control bits.

func (*SECURITY_DESCRIPTOR) SACL

func (sd *SECURITY_DESCRIPTOR) SACL() (sacl *ACL, defaulted bool, err error)

SACL returns the security descriptor SACL and whether it was defaulted. The sacl return value may be nil if a SACL exists but is an "empty SACL", meaning fully permissive. If the SACL does not exist, err returns ERROR_OBJECT_NOT_FOUND.

func (*SECURITY_DESCRIPTOR) SetControl

func (sd *SECURITY_DESCRIPTOR) SetControl(controlBitsOfInterest SECURITY_DESCRIPTOR_CONTROL, controlBitsToSet SECURITY_DESCRIPTOR_CONTROL) error

SetControl sets the security descriptor control bits.

func (*SECURITY_DESCRIPTOR) SetDACL

func (absoluteSD *SECURITY_DESCRIPTOR) SetDACL(dacl *ACL, present, defaulted bool) error

SetDACL sets the absolute security descriptor DACL.

func (*SECURITY_DESCRIPTOR) SetGroup

func (absoluteSD *SECURITY_DESCRIPTOR) SetGroup(group *SID, defaulted bool) error

SetGroup sets the absolute security descriptor owner.

func (*SECURITY_DESCRIPTOR) SetOwner

func (absoluteSD *SECURITY_DESCRIPTOR) SetOwner(owner *SID, defaulted bool) error

SetOwner sets the absolute security descriptor owner.

func (*SECURITY_DESCRIPTOR) SetRMControl

func (sd *SECURITY_DESCRIPTOR) SetRMControl(rmControl uint8)

SetRMControl sets the security descriptor resource manager control bits.

func (*SECURITY_DESCRIPTOR) SetSACL

func (absoluteSD *SECURITY_DESCRIPTOR) SetSACL(sacl *ACL, present, defaulted bool) error

SetSACL sets the absolute security descriptor SACL.

func (*SECURITY_DESCRIPTOR) String

func (sd *SECURITY_DESCRIPTOR) String() string

String returns the SDDL form of the security descriptor, with a function signature that can be used with %v formatting directives.

func (*SECURITY_DESCRIPTOR) ToAbsolute

func (selfRelativeSD *SECURITY_DESCRIPTOR) ToAbsolute() (absoluteSD *SECURITY_DESCRIPTOR, err error)

ToAbsolute converts a self-relative security descriptor into an absolute one.

func (*SECURITY_DESCRIPTOR) ToSelfRelative

func (absoluteSD *SECURITY_DESCRIPTOR) ToSelfRelative() (selfRelativeSD *SECURITY_DESCRIPTOR, err error)

ToSelfRelative converts an absolute security descriptor into a self-relative one.

type SECURITY_DESCRIPTOR_CONTROL

type SECURITY_DESCRIPTOR_CONTROL uint16

type SECURITY_INFORMATION

type SECURITY_INFORMATION uint32

type SECURITY_QUALITY_OF_SERVICE

type SECURITY_QUALITY_OF_SERVICE struct {
	Length              uint32
	ImpersonationLevel  uint32
	ContextTrackingMode byte
	EffectiveOnly       byte
}

type SE_OBJECT_TYPE

type SE_OBJECT_TYPE uint32

type SID

type SID struct{}

The security identifier (SID) structure is a variable-length structure used to uniquely identify users or groups.

func CreateWellKnownDomainSid

func CreateWellKnownDomainSid(sidType WELL_KNOWN_SID_TYPE, domainSid *SID) (*SID, error)

Creates a SID for a well-known predefined alias, generally using the constants of the form Win*Sid, for the domain specified by the domainSid parameter.

func CreateWellKnownSid

func CreateWellKnownSid(sidType WELL_KNOWN_SID_TYPE) (*SID, error)

Creates a SID for a well-known predefined alias, generally using the constants of the form Win*Sid, for the local machine.

func LookupSID

func LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error)

LookupSID retrieves a security identifier SID for the account and the name of the domain on which the account was found. System specify target computer to search.

func StringToSid

func StringToSid(s string) (*SID, error)

StringToSid converts a string-format security identifier SID into a valid, functional SID.

func (*SID) Copy

func (sid *SID) Copy() (*SID, error)

Copy creates a duplicate of security identifier SID.

func (*SID) Equals

func (sid *SID) Equals(sid2 *SID) bool

Equals compares two SIDs for equality.

func (*SID) IdentifierAuthority

func (sid *SID) IdentifierAuthority() SidIdentifierAuthority

IdentifierAuthority returns the identifier authority of the SID.

func (*SID) IsValid

func (sid *SID) IsValid() bool

IsValid returns whether the SID has a valid revision and length.

func (*SID) IsWellKnown

func (sid *SID) IsWellKnown(sidType WELL_KNOWN_SID_TYPE) bool

IsWellKnown determines whether the SID matches the well-known sidType.

func (*SID) Len

func (sid *SID) Len() int

Len returns the length, in bytes, of a valid security identifier SID.

func (*SID) LookupAccount

func (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error)

LookupAccount retrieves the name of the account for this SID and the name of the first domain on which this SID is found. System specify target computer to search for.

func (*SID) String

func (sid *SID) String() string

String converts SID to a string format suitable for display, storage, or transmission.

func (*SID) SubAuthority

func (sid *SID) SubAuthority(idx uint32) uint32

SubAuthority returns the sub-authority of the SID as specified by the index, which must be less than sid.SubAuthorityCount().

func (*SID) SubAuthorityCount

func (sid *SID) SubAuthorityCount() uint8

SubAuthorityCount returns the number of sub-authorities in the SID.

type SIDAndAttributes

type SIDAndAttributes struct {
	Sid        *SID
	Attributes uint32
}

type SSLExtraCertChainPolicyPara

type SSLExtraCertChainPolicyPara struct {
	Size       uint32
	AuthType   uint32
	Checks     uint32
	ServerName *uint16
}

type SYSTEM_PROCESS_INFORMATION

type SYSTEM_PROCESS_INFORMATION struct {
	NextEntryOffset              uint32
	NumberOfThreads              uint32
	WorkingSetPrivateSize        int64
	HardFaultCount               uint32
	NumberOfThreadsHighWatermark uint32
	CycleTime                    uint64
	CreateTime                   int64
	UserTime                     int64
	KernelTime                   int64
	ImageName                    NTUnicodeString
	BasePriority                 int32
	UniqueProcessID              uintptr
	InheritedFromUniqueProcessID uintptr
	HandleCount                  uint32
	SessionID                    uint32
	UniqueProcessKey             *uint32
	PeakVirtualSize              uintptr
	VirtualSize                  uintptr
	PageFaultCount               uint32
	PeakWorkingSetSize           uintptr
	WorkingSetSize               uintptr
	QuotaPeakPagedPoolUsage      uintptr
	QuotaPagedPoolUsage          uintptr
	QuotaPeakNonPagedPoolUsage   uintptr
	QuotaNonPagedPoolUsage       uintptr
	PagefileUsage                uintptr
	PeakPagefileUsage            uintptr
	PrivatePageCount             uintptr
	ReadOperationCount           int64
	WriteOperationCount          int64
	OtherOperationCount          int64
	ReadTransferCount            int64
	WriteTransferCount           int64
	OtherTransferCount           int64
}

type SecurityAttributes

type SecurityAttributes struct {
	Length             uint32
	SecurityDescriptor *SECURITY_DESCRIPTOR
	InheritHandle      uint32
}

type SidIdentifierAuthority

type SidIdentifierAuthority struct {
	Value [6]byte
}

type SmallRect

type SmallRect struct {
	Left   int16
	Top    int16
	Right  int16
	Bottom int16
}

type SockaddrGen

type SockaddrGen [24]byte

type SocketAddress

type SocketAddress struct {
	Sockaddr       *syscall.RawSockaddrAny
	SockaddrLength int32
}

func (*SocketAddress) IP

func (addr *SocketAddress) IP() net.IP

IP returns an IPv4 or IPv6 address, or nil if the underlying SocketAddress is neither.

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  Handle
	StdOutput Handle
	StdErr    Handle
	// contains filtered or unexported fields
}

type StartupInfoEx

type StartupInfoEx struct {
	StartupInfo
	ProcThreadAttributeList *ProcThreadAttributeList
}

type Systemtime

type Systemtime struct {
	Year         uint16
	Month        uint16
	DayOfWeek    uint16
	Day          uint16
	Hour         uint16
	Minute       uint16
	Second       uint16
	Milliseconds uint16
}

type TCPKeepalive

type TCPKeepalive struct {
	OnOff    uint32
	Time     uint32
	Interval uint32
}

type TRUSTEE

type TRUSTEE struct {
	MultipleTrustee          *TRUSTEE
	MultipleTrusteeOperation MULTIPLE_TRUSTEE_OPERATION
	TrusteeForm              TRUSTEE_FORM
	TrusteeType              TRUSTEE_TYPE
	TrusteeValue             TrusteeValue
}

type TRUSTEE_FORM

type TRUSTEE_FORM uint32

type TRUSTEE_TYPE

type TRUSTEE_TYPE uint32

type ThreadEntry32

type ThreadEntry32 struct {
	Size           uint32
	Usage          uint32
	ThreadID       uint32
	OwnerProcessID uint32
	BasePri        int32
	DeltaPri       int32
	Flags          uint32
}

type Timeval

type Timeval struct {
	Sec  int32
	Usec int32
}

Invented values to support what package os expects.

func NsecToTimeval

func NsecToTimeval(nsec int64) (tv Timeval)

func (*Timeval) Nano

func (tv *Timeval) Nano() int64

func (*Timeval) Nanoseconds

func (tv *Timeval) Nanoseconds() int64

func (*Timeval) Unix

func (tv *Timeval) Unix() (sec int64, nsec int64)

type Timezoneinformation

type Timezoneinformation struct {
	Bias         int32
	StandardName [32]uint16
	StandardDate Systemtime
	StandardBias int32
	DaylightName [32]uint16
	DaylightDate Systemtime
	DaylightBias int32
}

type Token

type Token Handle

An access token contains the security information for a logon session. The system creates an access token when a user logs on, and every process executed on behalf of the user has a copy of the token. The token identifies the user, the user's groups, and the user's privileges. The system uses the token to control access to securable objects and to control the ability of the user to perform various system-related operations on the local computer.

func GetCurrentProcessToken

func GetCurrentProcessToken() Token

GetCurrentProcessToken returns the access token associated with the current process. It is a pseudo token that does not need to be closed.

func GetCurrentThreadEffectiveToken

func GetCurrentThreadEffectiveToken() Token

GetCurrentThreadEffectiveToken returns the effective access token associated with the current thread. It is a pseudo token that does not need to be closed.

func GetCurrentThreadToken

func GetCurrentThreadToken() Token

GetCurrentThreadToken return the access token associated with the current thread. It is a pseudo token that does not need to be closed.

func OpenCurrentProcessToken deprecated

func OpenCurrentProcessToken() (Token, error)

OpenCurrentProcessToken opens an access token associated with current process with TOKEN_QUERY access. It is a real token that needs to be closed.

Deprecated: Explicitly call OpenProcessToken(CurrentProcess(), ...) with the desired access instead, or use GetCurrentProcessToken for a TOKEN_QUERY token.

func (Token) Close

func (t Token) Close() error

Close releases access to access token.

func (Token) Environ

func (token Token) Environ(inheritExisting bool) (env []string, err error)

Returns a default environment associated with the token, rather than the current process. If inheritExisting is true, then this environment also inherits the environment of the current process.

func (Token) GetLinkedToken

func (token Token) GetLinkedToken() (Token, error)

GetLinkedToken returns the linked token, which may be an elevated UAC token.

func (Token) GetTokenGroups

func (t Token) GetTokenGroups() (*Tokengroups, error)

GetTokenGroups retrieves group accounts associated with access token t.

func (Token) GetTokenPrimaryGroup

func (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error)

GetTokenPrimaryGroup retrieves access token t primary group information. A pointer to a SID structure representing a group that will become the primary group of any objects created by a process using this access token.

func (Token) GetTokenUser

func (t Token) GetTokenUser() (*Tokenuser, error)

GetTokenUser retrieves access token t user account information.

func (Token) GetUserProfileDirectory

func (t Token) GetUserProfileDirectory() (string, error)

GetUserProfileDirectory retrieves path to the root directory of the access token t user's profile.

func (Token) IsElevated

func (token Token) IsElevated() bool

IsElevated returns whether the current token is elevated from a UAC perspective.

func (Token) IsMember

func (t Token) IsMember(sid *SID) (bool, error)

IsMember reports whether the access token t is a member of the provided SID.

func (Token) IsRestricted

func (t Token) IsRestricted() (isRestricted bool, err error)

IsRestricted reports whether the access token t is a restricted token.

type Tokengroups

type Tokengroups struct {
	GroupCount uint32
	Groups     [1]SIDAndAttributes // Use AllGroups() for iterating.
}

func (*Tokengroups) AllGroups

func (g *Tokengroups) AllGroups() []SIDAndAttributes

AllGroups returns a slice that can be used to iterate over the groups in g.

type Tokenmandatorylabel

type Tokenmandatorylabel struct {
	Label SIDAndAttributes
}

func (*Tokenmandatorylabel) Size

func (tml *Tokenmandatorylabel) Size() uint32

type Tokenprimarygroup

type Tokenprimarygroup struct {
	PrimaryGroup *SID
}

type Tokenprivileges

type Tokenprivileges struct {
	PrivilegeCount uint32
	Privileges     [1]LUIDAndAttributes // Use AllPrivileges() for iterating.
}

func (*Tokenprivileges) AllPrivileges

func (p *Tokenprivileges) AllPrivileges() []LUIDAndAttributes

AllPrivileges returns a slice that can be used to iterate over the privileges in p.

type Tokenuser

type Tokenuser struct {
	User SIDAndAttributes
}

type TransmitFileBuffers

type TransmitFileBuffers struct {
	Head       uintptr
	HeadLength uint32
	Tail       uintptr
	TailLength uint32
}

type TrusteeValue

type TrusteeValue uintptr

This type is the union inside of TRUSTEE and must be created using one of the TrusteeValueFrom* functions.

func TrusteeValueFromObjectsAndName

func TrusteeValueFromObjectsAndName(objectsAndName *OBJECTS_AND_NAME) TrusteeValue

func TrusteeValueFromObjectsAndSid

func TrusteeValueFromObjectsAndSid(objectsAndSid *OBJECTS_AND_SID) TrusteeValue

func TrusteeValueFromSID

func TrusteeValueFromSID(sid *SID) TrusteeValue

func TrusteeValueFromString

func TrusteeValueFromString(str string) TrusteeValue

type UserInfo10

type UserInfo10 struct {
	Name       *uint16
	Comment    *uint16
	UsrComment *uint16
	FullName   *uint16
}

type VS_FIXEDFILEINFO

type VS_FIXEDFILEINFO struct {
	Signature        uint32
	StrucVersion     uint32
	FileVersionMS    uint32
	FileVersionLS    uint32
	ProductVersionMS uint32
	ProductVersionLS uint32
	FileFlagsMask    uint32
	FileFlags        uint32
	FileOS           uint32
	FileType         uint32
	FileSubtype      uint32
	FileDateMS       uint32
	FileDateLS       uint32
}

type WELL_KNOWN_SID_TYPE

type WELL_KNOWN_SID_TYPE uint32

Various types of pre-specified SIDs that can be synthesized and compared at runtime.

type WSABuf

type WSABuf struct {
	Len uint32
	Buf *byte
}

type WSAMsg

type WSAMsg struct {
	Name        *syscall.RawSockaddrAny
	Namelen     int32
	Buffers     *WSABuf
	BufferCount uint32
	Control     WSABuf
	Flags       uint32
}

type WSAProtocolChain

type WSAProtocolChain struct {
	ChainLen     int32
	ChainEntries [MAX_PROTOCOL_CHAIN]uint32
}

type WSAProtocolInfo

type WSAProtocolInfo struct {
	ServiceFlags1     uint32
	ServiceFlags2     uint32
	ServiceFlags3     uint32
	ServiceFlags4     uint32
	ProviderFlags     uint32
	ProviderId        GUID
	CatalogEntryId    uint32
	ProtocolChain     WSAProtocolChain
	Version           int32
	AddressFamily     int32
	MaxSockAddr       int32
	MinSockAddr       int32
	SocketType        int32
	Protocol          int32
	ProtocolMaxOffset int32
	NetworkByteOrder  int32
	SecurityScheme    int32
	MessageSize       uint32
	ProviderReserved  uint32
	ProtocolName      [WSAPROTOCOL_LEN + 1]uint16
}

type WTSSESSION_NOTIFICATION

type WTSSESSION_NOTIFICATION struct {
	Size      uint32
	SessionID uint32
}

type WTS_SESSION_INFO

type WTS_SESSION_INFO struct {
	SessionID         uint32
	WindowStationName *uint16
	State             uint32
}

type Win32FileAttributeData

type Win32FileAttributeData struct {
	FileAttributes uint32
	CreationTime   Filetime
	LastAccessTime Filetime
	LastWriteTime  Filetime
	FileSizeHigh   uint32
	FileSizeLow    uint32
}

type Win32finddata

type Win32finddata struct {
	FileAttributes    uint32
	CreationTime      Filetime
	LastAccessTime    Filetime
	LastWriteTime     Filetime
	FileSizeHigh      uint32
	FileSizeLow       uint32
	Reserved0         uint32
	Reserved1         uint32
	FileName          [MAX_PATH - 1]uint16
	AlternateFileName [13]uint16
}

type WinTrustData

type WinTrustData struct {
	Size                            uint32
	PolicyCallbackData              uintptr
	SIPClientData                   uintptr
	UIChoice                        uint32
	RevocationChecks                uint32
	UnionChoice                     uint32
	FileOrCatalogOrBlobOrSgnrOrCert unsafe.Pointer
	StateAction                     uint32
	StateData                       Handle
	URLReference                    *uint16
	ProvFlags                       uint32
	UIContext                       uint32
	SignatureSettings               *WinTrustSignatureSettings
}

type WinTrustFileInfo

type WinTrustFileInfo struct {
	Size         uint32
	FilePath     *uint16
	File         Handle
	KnownSubject *GUID
}

type WinTrustSignatureSettings

type WinTrustSignatureSettings struct {
	Size             uint32
	Index            uint32
	Flags            uint32
	SecondarySigs    uint32
	VerifiedSigIndex uint32
	CryptoPolicy     *CertStrongSignPara
}

Directories

Path Synopsis
Package registry provides access to the Windows registry.
Package registry provides access to the Windows registry.

Jump to

Keyboard shortcuts

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