Documentation ¶
Overview ¶
Package winapi contains various low-level bindings to Windows APIs. It can be thought of as an extension to golang.org/x/sys/windows.
Index ¶
- Constants
- func BfSetupFilter(jobHandle windows.Handle, flags uint32, virtRootPath *uint16, ...) (hr error)
- func CMGetDevNodeProperty(dnDevInst uint32, propertyKey *DevPropKey, propertyType *uint32, ...) (hr error)
- func CMGetDeviceIDList(pszFilter *byte, buffer *byte, bufferLen uint32, uFlags uint32) (hr error)
- func CMGetDeviceIDListSize(pulLen *uint32, pszFilter *byte, uFlags uint32) (hr error)
- func CMLocateDevNode(pdnDevInst *uint32, pDeviceID string, uFlags uint32) (hr error)
- func CimCloseImage(cimFSHandle FsHandle) (hr error)
- func CimCloseStream(cimStreamHandle StreamHandle) (hr error)
- func CimCommitImage(cimFSHandle FsHandle) (hr error)
- func CimCreateAlternateStream(cimFSHandle FsHandle, path string, size uint64, cimStreamHandle *StreamHandle) (hr error)
- func CimCreateFile(cimFSHandle FsHandle, path string, file *CimFsFileMetadata, ...) (hr error)
- func CimCreateHardLink(cimFSHandle FsHandle, newPath string, oldPath string) (hr error)
- func CimCreateImage(imagePath string, oldFSName *uint16, newFSName *uint16, cimFSHandle *FsHandle) (hr error)
- func CimDeletePath(cimFSHandle FsHandle, path string) (hr error)
- func CimDismountImage(volumeID *g) (hr error)
- func CimMountImage(imagePath string, fsName string, flags uint32, volumeID *g) (hr error)
- func CimWriteStream(cimStreamHandle StreamHandle, buffer uintptr, bufferSize uint32) (hr error)
- func ClosePseudoConsole(hpc windows.Handle)
- func ConvertStringSetToSlice(buf []byte) ([]string, error)
- func CopyFileW(existingFileName *uint16, newFileName *uint16, failIfExists int32) (err error)
- func CreatePseudoConsole(size windows.Coord, hInput windows.Handle, hOutput windows.Handle, ...) error
- func CreateRemoteThread(process windows.Handle, sa *windows.SecurityAttributes, stackSize uint32, ...) (handle windows.Handle, err error)
- func GetActiveProcessorCount(groupNumber uint16) (amount uint32)
- func IsElevated() bool
- func IsProcessInJob(procHandle windows.Handle, jobHandle windows.Handle, result *int32) (err error)
- func LocalAlloc(flags uint32, size int) (ptr uintptr)
- func LocalFree(ptr uintptr)
- func LogonUser(username *uint16, domain *uint16, password *uint16, logonType uint32, ...) (err error)
- func NTSuccess(status uint32) bool
- func NetLocalGroupAddMembers(serverName, groupName string, level uint32, buf *byte, totalEntries uint32) (err error)
- func NetLocalGroupGetInfo(serverName, groupName string, level uint32, bufPtr **byte) (err error)
- func NetUserAdd(serverName string, level uint32, buf *byte, parm_err *uint32) (err error)
- func NetUserDel(serverName, userName string) (err error)
- func NtCreateFile(handle *uintptr, accessMask uint32, oa *ObjectAttributes, iosb *IOStatusBlock, ...) (status uint32)
- func NtCreateJobObject(jobHandle *windows.Handle, desiredAccess uint32, ...) (status uint32)
- func NtOpenDirectoryObject(handle *uintptr, accessMask uint32, oa *ObjectAttributes) (status uint32)
- func NtOpenJobObject(jobHandle *windows.Handle, desiredAccess uint32, ...) (status uint32)
- func NtQueryDirectoryObject(handle uintptr, buffer *byte, length uint32, singleEntry bool, ...) (status uint32)
- func NtQueryInformationProcess(processHandle windows.Handle, processInfoClass uint32, ...) (status uint32)
- func NtQuerySystemInformation(systemInfoClass int, systemInformation unsafe.Pointer, systemInfoLength uint32, ...) (status uint32)
- func NtSetInformationFile(handle uintptr, iosb *IOStatusBlock, information uintptr, length uint32, ...) (status uint32)
- func ORCloseHive(key syscall.Handle) (regerrno error)
- func ORCreateHive(key *syscall.Handle) (regerrno error)
- func ORSaveHive(key syscall.Handle, file string, OsMajorVersion uint32, OsMinorVersion uint32) (regerrno error)
- func OpenJobObject(desiredAccess uint32, inheritHandle int32, lpName *uint16) (handle windows.Handle, err error)
- func ParseUtf16LE(b []byte) string
- func QueryInformationJobObject(jobHandle windows.Handle, infoClass uint32, jobObjectInfo unsafe.Pointer, ...) (err error)
- func QueryIoRateControlInformationJobObject(jobHandle windows.Handle, volumeName *uint16, ...) (ret uint32, err error)
- func ResizePseudoConsole(hpcon windows.Handle, size windows.Coord) error
- func RtlNtStatusToDosError(status uint32) (winerr error)
- func SearchPath(lpPath *uint16, lpFileName *uint16, lpExtension *uint16, nBufferLength uint32, ...) (size uint32, err error)
- func SetIoRateControlInformationJobObject(jobHandle windows.Handle, ...) (ret uint32, err error)
- func SetJobCompartmentId(handle windows.Handle, compartmentId uint32) (win32Err error)
- func Uint16BufferToSlice(buffer *uint16, bufferLength int) (result []uint16)
- type CimFsFileMetadata
- type DevPropKey
- type FILE_ID_INFO
- type FileDispositionInformationEx
- type FileLinkInformation
- type FsHandle
- type IOStatusBlock
- type JOBOBJECT_ASSOCIATE_COMPLETION_PORT
- type JOBOBJECT_BASIC_ACCOUNTING_INFORMATION
- type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION
- type JOBOBJECT_BASIC_LIMIT_INFORMATION
- type JOBOBJECT_BASIC_PROCESS_ID_LIST
- type JOBOBJECT_CPU_RATE_CONTROL_INFORMATION
- type JOBOBJECT_IO_ATTRIBUTION_INFORMATION
- type JOBOBJECT_IO_ATTRIBUTION_STATS
- type JOBOBJECT_IO_RATE_CONTROL_INFORMATION
- type JOBOBJECT_MEMORY_USAGE_INFORMATION
- type LocalGroupInfo1
- type LocalGroupMembersInfo0
- type ObjectAttributes
- type ObjectDirectoryInformation
- type SYSTEM_PROCESS_INFORMATION
- type StreamHandle
- type UnicodeString
- type UserInfo1
- type VM_COUNTERS_EX
- type VM_COUNTERS_EX2
Constants ¶
const ( BINDFLT_FLAG_READ_ONLY_MAPPING uint32 = 0x00000001 BINDFLT_FLAG_MERGED_BIND_MAPPING uint32 = 0x00000002 BINDFLT_FLAG_USE_CURRENT_SILO_MAPPING uint32 = 0x00000004 )
const ( STATUS_REPARSE_POINT_ENCOUNTERED = 0xC000050B ERROR_NO_MORE_ITEMS = 0x103 ERROR_MORE_DATA syscall.Errno = 234 )
const ( FileLinkInformationClass = 11 FileDispositionInformationExClass = 64 FILE_READ_ATTRIBUTES = 0x0080 FILE_WRITE_ATTRIBUTES = 0x0100 DELETE = 0x10000 FILE_OPEN = 1 FILE_CREATE = 2 FILE_LIST_DIRECTORY = 0x00000001 FILE_DIRECTORY_FILE = 0x00000001 FILE_SYNCHRONOUS_IO_NONALERT = 0x00000020 FILE_OPEN_FOR_BACKUP_INTENT = 0x00004000 FILE_OPEN_REPARSE_POINT = 0x00200000 FILE_DISPOSITION_DELETE = 0x00000001 OBJ_DONT_REPARSE = 0x1000 STATUS_MORE_ENTRIES = 0x105 STATUS_NO_MORE_ENTRIES = 0x8000001a )
const ( JOB_OBJECT_MSG_END_OF_JOB_TIME uint32 = 1 JOB_OBJECT_MSG_END_OF_PROCESS_TIME uint32 = 2 JOB_OBJECT_MSG_ACTIVE_PROCESS_LIMIT uint32 = 3 JOB_OBJECT_MSG_ACTIVE_PROCESS_ZERO uint32 = 4 JOB_OBJECT_MSG_NEW_PROCESS uint32 = 6 JOB_OBJECT_MSG_EXIT_PROCESS uint32 = 7 JOB_OBJECT_MSG_ABNORMAL_EXIT_PROCESS uint32 = 8 JOB_OBJECT_MSG_PROCESS_MEMORY_LIMIT uint32 = 9 JOB_OBJECT_MSG_JOB_MEMORY_LIMIT uint32 = 10 JOB_OBJECT_MSG_NOTIFICATION_LIMIT uint32 = 11 )
Messages that can be received from an assigned io completion port. https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-jobobject_associate_completion_port
const ( JOB_OBJECT_QUERY = 0x0004 JOB_OBJECT_ALL_ACCESS = 0x1F001F )
Access rights for creating or opening job objects.
https://docs.microsoft.com/en-us/windows/win32/procthread/job-object-security-and-access-rights
const ( JOB_OBJECT_CPU_RATE_CONTROL_ENABLE uint32 = 1 << iota JOB_OBJECT_CPU_RATE_CONTROL_WEIGHT_BASED JOB_OBJECT_CPU_RATE_CONTROL_HARD_CAP JOB_OBJECT_CPU_RATE_CONTROL_NOTIFY JOB_OBJECT_CPU_RATE_CONTROL_MIN_MAX_RATE )
const ( JobObjectBasicAccountingInformation uint32 = 1 JobObjectBasicProcessIdList uint32 = 3 JobObjectBasicAndIoAccountingInformation uint32 = 8 JobObjectLimitViolationInformation uint32 = 13 JobObjectMemoryUsageInformation uint32 = 28 JobObjectNotificationLimitInformation2 uint32 = 33 JobObjectCreateSilo uint32 = 35 JobObjectSiloBasicInformation uint32 = 36 JobObjectIoAttribution uint32 = 42 )
JobObjectInformationClass values. Used for a call to QueryInformationJobObject
https://docs.microsoft.com/en-us/windows/win32/api/jobapi2/nf-jobapi2-queryinformationjobobject
const ( LOGON32_LOGON_INTERACTIVE uint32 = 2 LOGON32_LOGON_NETWORK uint32 = 3 LOGON32_LOGON_BATCH uint32 = 4 LOGON32_LOGON_SERVICE uint32 = 5 LOGON32_LOGON_UNLOCK uint32 = 7 LOGON32_LOGON_NETWORK_CLEARTEXT uint32 = 8 LOGON32_LOGON_NEW_CREDENTIALS uint32 = 9 )
Logon types
const ( LOGON32_PROVIDER_DEFAULT uint32 = 0 LOGON32_PROVIDER_WINNT40 uint32 = 2 LOGON32_PROVIDER_WINNT50 uint32 = 3 )
Logon providers
const ( PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE = 0x20016 PROC_THREAD_ATTRIBUTE_JOB_LIST = 0x2000D )
const ( USER_PRIV_GUEST uint32 = iota USER_PRIV_USER USER_PRIV_ADMIN )
const ( UF_NORMAL_ACCOUNT = 0x00200 UF_DONT_EXPIRE_PASSWD = 0x10000 )
const ALL_PROCESSOR_GROUPS = 0xFFFF
Get count from all processor groups. https://docs.microsoft.com/en-us/windows/win32/procthread/processor-groups
const (
FileIdInfo = 18
)
Select entries from FILE_INFO_BY_HANDLE_CLASS.
C declaration:
typedef enum _FILE_INFO_BY_HANDLE_CLASS { FileBasicInfo, FileStandardInfo, FileNameInfo, FileRenameInfo, FileDispositionInfo, FileAllocationInfo, FileEndOfFileInfo, FileStreamInfo, FileCompressionInfo, FileAttributeTagInfo, FileIdBothDirectoryInfo, FileIdBothDirectoryRestartInfo, FileIoPriorityHintInfo, FileRemoteProtocolInfo, FileFullDirectoryInfo, FileFullDirectoryRestartInfo, FileStorageInfo, FileAlignmentInfo, FileIdInfo, FileIdExtdDirectoryInfo, FileIdExtdDirectoryRestartInfo, FileDispositionInfoEx, FileRenameInfoEx, FileCaseSensitiveInfo, FileNormalizedNameInfo, MaximumFileInfoByHandleClass } FILE_INFO_BY_HANDLE_CLASS, *PFILE_INFO_BY_HANDLE_CLASS;
Documentation: https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ne-minwinbase-file_info_by_handle_class
const JOBOBJECT_IO_ATTRIBUTION_CONTROL_ENABLE uint32 = 0x1
const JOB_OBJECT_IO_RATE_CONTROL_ENABLE = 0x1
IO limit flags
const NERR_UserNotFound = syscall.Errno(0x8AD)
const NTSTRSAFE_UNICODE_STRING_MAX_CCH = 32767
NTSTRSAFE_UNICODE_STRING_MAX_CCH is a constant defined in ntstrsafe.h. This value denotes the maximum number of wide chars a path can have.
const PROCESS_ALL_ACCESS uint32 = 2097151
const PSEUDOCONSOLE_INHERIT_CURSOR = 0x1
const ProcessVmCounters = 3
ProcessVmCounters corresponds to the _VM_COUNTERS_EX and _VM_COUNTERS_EX2 structures.
const STATUS_INFO_LENGTH_MISMATCH = 0xC0000004
const SystemProcessInformation = 5
const UserNameCharLimit = 20
Variables ¶
This section is empty.
Functions ¶
func BfSetupFilter ¶ added in v0.10.0
func CMGetDevNodeProperty ¶
func CMGetDeviceIDList ¶
func CMGetDeviceIDListSize ¶
func CMLocateDevNode ¶
func CimCloseImage ¶ added in v0.10.0
func CimCloseStream ¶ added in v0.10.0
func CimCloseStream(cimStreamHandle StreamHandle) (hr error)
func CimCommitImage ¶ added in v0.10.0
func CimCreateAlternateStream ¶ added in v0.10.0
func CimCreateAlternateStream(cimFSHandle FsHandle, path string, size uint64, cimStreamHandle *StreamHandle) (hr error)
func CimCreateFile ¶ added in v0.10.0
func CimCreateFile(cimFSHandle FsHandle, path string, file *CimFsFileMetadata, cimStreamHandle *StreamHandle) (hr error)
func CimCreateHardLink ¶ added in v0.10.0
func CimCreateImage ¶ added in v0.10.0
func CimDeletePath ¶ added in v0.10.0
func CimDismountImage ¶ added in v0.10.0
func CimDismountImage(volumeID *g) (hr error)
func CimMountImage ¶ added in v0.10.0
func CimWriteStream ¶ added in v0.10.0
func CimWriteStream(cimStreamHandle StreamHandle, buffer uintptr, bufferSize uint32) (hr error)
func ClosePseudoConsole ¶ added in v0.9.2
func ConvertStringSetToSlice ¶
ConvertStringSetToSlice is a helper function used to convert the contents of `buf` into a string slice. `buf` contains a set of null terminated strings with an additional null at the end to indicate the end of the set.
func CreatePseudoConsole ¶ added in v0.9.2
func CreatePseudoConsole(size windows.Coord, hInput windows.Handle, hOutput windows.Handle, dwFlags uint32, hpcon *windows.Handle) error
CreatePseudoConsole creates a windows pseudo console.
func CreateRemoteThread ¶ added in v0.8.16
func GetActiveProcessorCount ¶
func IsElevated ¶ added in v0.10.0
func IsElevated() bool
func IsProcessInJob ¶
func LocalAlloc ¶
func NetLocalGroupAddMembers ¶ added in v0.10.0
func NetLocalGroupAddMembers(serverName, groupName string, level uint32, buf *byte, totalEntries uint32) (err error)
NetLocalGroupAddMembers is a slightly go friendlier wrapper around the NetLocalGroupAddMembers function. Instead of taking in *uint16's, it takes in go strings and does the conversion internally.
func NetLocalGroupGetInfo ¶ added in v0.10.0
NetLocalGroupGetInfo is a slightly go friendlier wrapper around the NetLocalGroupGetInfo function. Instead of taking in *uint16's, it takes in go strings and does the conversion internally.
func NetUserAdd ¶ added in v0.10.0
NetUserAdd is a slightly go friendlier wrapper around the NetUserAdd function. Instead of taking in *uint16's, it takes in go strings and does the conversion internally.
func NetUserDel ¶ added in v0.10.0
NetUserDel is a slightly go friendlier wrapper around the NetUserDel function. Instead of taking in *uint16's, it takes in go strings and does the conversion internally.
func NtCreateFile ¶
func NtCreateJobObject ¶ added in v0.8.15
func NtCreateJobObject(jobHandle *windows.Handle, desiredAccess uint32, objAttributes *ObjectAttributes) (status uint32)
func NtOpenDirectoryObject ¶
func NtOpenDirectoryObject(handle *uintptr, accessMask uint32, oa *ObjectAttributes) (status uint32)
func NtOpenJobObject ¶ added in v0.8.15
func NtOpenJobObject(jobHandle *windows.Handle, desiredAccess uint32, objAttributes *ObjectAttributes) (status uint32)
func NtQueryDirectoryObject ¶
func NtQueryInformationProcess ¶ added in v0.9.3
func NtQuerySystemInformation ¶ added in v0.8.16
func NtSetInformationFile ¶
func ORCloseHive ¶ added in v0.10.0
func ORCreateHive ¶ added in v0.10.0
func ORSaveHive ¶ added in v0.10.0
func OpenJobObject ¶
func ParseUtf16LE ¶ added in v0.10.0
ParseUtf16LE parses a UTF-16LE byte array into a string (without passing through a uint16 or rune array).
func QueryIoRateControlInformationJobObject ¶ added in v0.8.15
func ResizePseudoConsole ¶ added in v0.9.2
ResizePseudoConsole resizes the internal buffers of the pseudo console to the width and height specified in `size`.
func RtlNtStatusToDosError ¶
func SearchPath ¶
func SetIoRateControlInformationJobObject ¶
func SetIoRateControlInformationJobObject(jobHandle windows.Handle, ioRateControlInfo *JOBOBJECT_IO_RATE_CONTROL_INFORMATION) (ret uint32, err error)
func SetJobCompartmentId ¶ added in v0.8.11
func Uint16BufferToSlice ¶ added in v0.8.15
Uint16BufferToSlice wraps a uint16 pointer-and-length into a slice for easier interop with Go APIs
Types ¶
type CimFsFileMetadata ¶ added in v0.10.0
type CimFsFileMetadata struct { Attributes uint32 FileSize int64 CreationTime windows.Filetime LastWriteTime windows.Filetime ChangeTime windows.Filetime LastAccessTime windows.Filetime SecurityDescriptorBuffer unsafe.Pointer SecurityDescriptorSize uint32 ReparseDataBuffer unsafe.Pointer ReparseDataSize uint32 ExtendedAttributes unsafe.Pointer EACount uint32 }
type DevPropKey ¶
type FILE_ID_INFO ¶ added in v0.8.11
C declaration:
typedef struct _FILE_ID_INFO { ULONGLONG VolumeSerialNumber; FILE_ID_128 FileId; } FILE_ID_INFO, *PFILE_ID_INFO;
Documentation: https://docs.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-file_id_info
type FileDispositionInformationEx ¶
type FileDispositionInformationEx struct {
Flags uintptr
}
type FileLinkInformation ¶
type IOStatusBlock ¶
type IOStatusBlock struct {
Status, Information uintptr
}
type JOBOBJECT_ASSOCIATE_COMPLETION_PORT ¶
type JOBOBJECT_BASIC_ACCOUNTING_INFORMATION ¶ added in v0.8.11
type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION ¶ added in v0.8.11
type JOBOBJECT_BASIC_AND_IO_ACCOUNTING_INFORMATION struct { BasicInfo JOBOBJECT_BASIC_ACCOUNTING_INFORMATION IoInfo windows.IO_COUNTERS }
type JOBOBJECT_BASIC_LIMIT_INFORMATION ¶
type JOBOBJECT_BASIC_LIMIT_INFORMATION struct { PerProcessUserTimeLimit int64 PerJobUserTimeLimit int64 LimitFlags uint32 MinimumWorkingSetSize uintptr MaximumWorkingSetSize uintptr ActiveProcessLimit uint32 Affinity uintptr PriorityClass uint32 SchedulingClass uint32 }
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-jobobject_basic_limit_information
type JOBOBJECT_BASIC_PROCESS_ID_LIST ¶
type JOBOBJECT_BASIC_PROCESS_ID_LIST struct { NumberOfAssignedProcesses uint32 NumberOfProcessIdsInList uint32 ProcessIdList [1]uintptr }
https://docs.microsoft.com/en-us/windows/win32/api/winnt/ns-winnt-jobobject_basic_process_id_list
func (*JOBOBJECT_BASIC_PROCESS_ID_LIST) AllPids ¶ added in v0.8.11
func (p *JOBOBJECT_BASIC_PROCESS_ID_LIST) AllPids() []uintptr
AllPids returns all the process Ids in the job object.
type JOBOBJECT_IO_ATTRIBUTION_INFORMATION ¶ added in v0.8.11
type JOBOBJECT_IO_ATTRIBUTION_INFORMATION struct { ControlFlags uint32 ReadStats JOBOBJECT_IO_ATTRIBUTION_STATS WriteStats JOBOBJECT_IO_ATTRIBUTION_STATS }
typedef struct _JOBOBJECT_IO_ATTRIBUTION_INFORMATION { ULONG ControlFlags; JOBOBJECT_IO_ATTRIBUTION_STATS ReadStats; JOBOBJECT_IO_ATTRIBUTION_STATS WriteStats; } JOBOBJECT_IO_ATTRIBUTION_INFORMATION, *PJOBOBJECT_IO_ATTRIBUTION_INFORMATION;
type JOBOBJECT_IO_ATTRIBUTION_STATS ¶ added in v0.8.11
type JOBOBJECT_IO_ATTRIBUTION_STATS struct { IoCount uintptr TotalNonOverlappedQueueTime uint64 TotalNonOverlappedServiceTime uint64 TotalSize uint64 }
typedef struct _JOBOBJECT_IO_ATTRIBUTION_STATS { ULONG_PTR IoCount; ULONGLONG TotalNonOverlappedQueueTime; ULONGLONG TotalNonOverlappedServiceTime; ULONGLONG TotalSize; } JOBOBJECT_IO_ATTRIBUTION_STATS, *PJOBOBJECT_IO_ATTRIBUTION_STATS;
type JOBOBJECT_IO_RATE_CONTROL_INFORMATION ¶
type JOBOBJECT_MEMORY_USAGE_INFORMATION ¶ added in v0.8.11
typedef struct _JOBOBJECT_MEMORY_USAGE_INFORMATION { ULONG64 JobMemory; ULONG64 PeakJobMemoryUsed; } JOBOBJECT_MEMORY_USAGE_INFORMATION, *PJOBOBJECT_MEMORY_USAGE_INFORMATION;
type LocalGroupInfo1 ¶ added in v0.10.0
typedef struct _LOCALGROUP_INFO_1 { LPWSTR lgrpi1_name; LPWSTR lgrpi1_comment; } LOCALGROUP_INFO_1, *PLOCALGROUP_INFO_1, *LPLOCALGROUP_INFO_1;
type LocalGroupMembersInfo0 ¶ added in v0.10.0
typedef struct _LOCALGROUP_MEMBERS_INFO_0 { PSID lgrmi0_sid; } LOCALGROUP_MEMBERS_INFO_0, *PLOCALGROUP_MEMBERS_INFO_0, *LPLOCALGROUP_MEMBERS_INFO_0;
type ObjectAttributes ¶
type ObjectDirectoryInformation ¶
type ObjectDirectoryInformation struct { Name UnicodeString TypeName UnicodeString }
type SYSTEM_PROCESS_INFORMATION ¶ added in v0.8.16
type SYSTEM_PROCESS_INFORMATION struct { NextEntryOffset uint32 // ULONG NumberOfThreads uint32 // ULONG WorkingSetPrivateSize int64 // LARGE_INTEGER HardFaultCount uint32 // ULONG NumberOfThreadsHighWatermark uint32 // ULONG CycleTime uint64 // ULONGLONG CreateTime int64 // LARGE_INTEGER UserTime int64 // LARGE_INTEGER KernelTime int64 // LARGE_INTEGER ImageName UnicodeString // UNICODE_STRING BasePriority int32 // KPRIORITY UniqueProcessID windows.Handle // HANDLE InheritedFromUniqueProcessID windows.Handle // HANDLE HandleCount uint32 // ULONG SessionID uint32 // ULONG UniqueProcessKey *uint32 // ULONG_PTR PeakVirtualSize uintptr // SIZE_T VirtualSize uintptr // SIZE_T PageFaultCount uint32 // ULONG PeakWorkingSetSize uintptr // SIZE_T WorkingSetSize uintptr // SIZE_T QuotaPeakPagedPoolUsage uintptr // SIZE_T QuotaPagedPoolUsage uintptr // SIZE_T QuotaPeakNonPagedPoolUsage uintptr // SIZE_T QuotaNonPagedPoolUsage uintptr // SIZE_T PagefileUsage uintptr // SIZE_T PeakPagefileUsage uintptr // SIZE_T PrivatePageCount uintptr // SIZE_T ReadOperationCount int64 // LARGE_INTEGER WriteOperationCount int64 // LARGE_INTEGER OtherOperationCount int64 // LARGE_INTEGER ReadTransferCount int64 // LARGE_INTEGER WriteTransferCount int64 // LARGE_INTEGER OtherTransferCount int64 // LARGE_INTEGER }
type StreamHandle ¶ added in v0.10.0
type StreamHandle uintptr
type UnicodeString ¶
UnicodeString corresponds to UNICODE_STRING win32 struct defined here https://docs.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_unicode_string
func NewUnicodeString ¶
func NewUnicodeString(s string) (*UnicodeString, error)
NewUnicodeString allocates a new UnicodeString and copies `s` into the buffer of the new UnicodeString.
func (UnicodeString) String ¶
func (uni UnicodeString) String() string
String converts a UnicodeString to a golang string
type UserInfo1 ¶ added in v0.10.0
type UserInfo1 struct { Name *uint16 Password *uint16 PasswordAge uint32 Priv uint32 HomeDir *uint16 Comment *uint16 Flags uint32 ScriptPath *uint16 }
typedef struct _USER_INFO_1 { LPWSTR usri1_name; LPWSTR usri1_password; DWORD usri1_password_age; DWORD usri1_priv; LPWSTR usri1_home_dir; LPWSTR usri1_comment; DWORD usri1_flags; LPWSTR usri1_script_path; } USER_INFO_1, *PUSER_INFO_1, *LPUSER_INFO_1;
type VM_COUNTERS_EX ¶ added in v0.9.3
type VM_COUNTERS_EX struct { PeakVirtualSize uintptr VirtualSize uintptr PageFaultCount uint32 PeakWorkingSetSize uintptr WorkingSetSize uintptr QuotaPeakPagedPoolUsage uintptr QuotaPagedPoolUsage uintptr QuotaPeakNonPagedPoolUsage uintptr QuotaNonPagedPoolUsage uintptr PagefileUsage uintptr PeakPagefileUsage uintptr PrivateUsage uintptr }
typedef struct _VM_COUNTERS_EX { SIZE_T PeakVirtualSize; SIZE_T VirtualSize; ULONG PageFaultCount; SIZE_T PeakWorkingSetSize; SIZE_T WorkingSetSize; SIZE_T QuotaPeakPagedPoolUsage; SIZE_T QuotaPagedPoolUsage; SIZE_T QuotaPeakNonPagedPoolUsage; SIZE_T QuotaNonPagedPoolUsage; SIZE_T PagefileUsage; SIZE_T PeakPagefileUsage; SIZE_T PrivateUsage; } VM_COUNTERS_EX, *PVM_COUNTERS_EX;
type VM_COUNTERS_EX2 ¶ added in v0.9.3
type VM_COUNTERS_EX2 struct { CountersEx VM_COUNTERS_EX PrivateWorkingSetSize uintptr }
typedef struct _VM_COUNTERS_EX2 { VM_COUNTERS_EX CountersEx; SIZE_T PrivateWorkingSetSize; SIZE_T SharedCommitUsage; } VM_COUNTERS_EX2, *PVM_COUNTERS_EX2;