virtual

package module
v0.0.0-...-fa316c1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2018 License: BSD-3-Clause Imports: 40 Imported by: 13

README

github.com/cznic/virtual has moved to modernc.org/virtual (vcs).

Please update your import paths to modernc.org/virtual.

This repo is now archived.

Documentation

Overview

Package virtual implements a machine that isn't. (Work In Progress)

For supported platforms and architectures please see [0].

Index

Constants

This section is empty.

Variables

View Source
var (
	// Testing amends things for tests.
	Testing bool
)

Functions

func CopyBytes

func CopyBytes(dst uintptr, src []byte, addNull bool)

CopyBytes copies src to dest, optionally adding a zero byte at the end.

func CopyString

func CopyString(dst uintptr, src string, addNull bool)

CopyString copies src to dest, optionally adding a zero byte at the end.

func DumpCode

func DumpCode(w io.Writer, code []Operation, start int, funcs, lines []PCInfo) error

DumpCode outputs code to w, assuming it is located at start.

func DumpCodeStr

func DumpCodeStr(code []Operation, start int, funcs, lines []PCInfo) buffer.Bytes

DumpCodeStr is like DumpCode but it returns a buffer.Bytes instead. Recycle the result using its Close method.

func Exec

func Exec(b *Binary, args []string, stdin io.Reader, stdout, stderr io.Writer, heapSize, stackSize int, tracePath string, opts ...Option) (exitStatus int, err error)

Exec is a convenience wrapper around New. It takes care of calling the Close method of the Machine returned by New.

func GoBytes

func GoBytes(s uintptr) []byte

GoBytes returns a []byte copied from a C char* null terminated string s.

func GoBytesLen

func GoBytesLen(s uintptr, len int) []byte

GoBytesLen returns a []byte copied from a C char* string s having length len bytes.

func GoString

func GoString(s uintptr) string

GoString returns a string from a C char* null terminated string s.

func GoStringLen

func GoStringLen(s uintptr, len int) string

GoStringLen returns a string from a C char* string s having length len bytes.

func IsBuiltin

func IsBuiltin(nm ir.NameID) bool

IsBuiltin reports whether an external function is one of the builtins.

Types

type Binary

type Binary struct {
	BSS        int
	Code       []Operation
	DSRelative []byte // Bit vector of data segment-relative pointers in Data.
	Data       []byte
	Functions  []PCInfo
	Lines      []PCInfo
	TSRelative []byte // Bit vector of text segment-relative pointers in Data.
	Text       []byte
	Sym        map[ir.NameID]int // External function: Code index.
}

Binary represents a loaded program image. It can be run via Exec.

func LoadMain

func LoadMain(objects []ir.Object) (_ *Binary, err error)

LoadMain translates program in objects into a Binary or an error, if any. It's the caller responsibility to ensure the objects were produced for this architecture and platform.

func (*Binary) LookupFunction

func (b *Binary) LookupFunction(f string) (int, bool)

LookupFunction returns the address of an external function and whether it was found.

func (*Binary) ReadFrom

func (b *Binary) ReadFrom(r io.Reader) (n int64, err error)

ReadFrom reads b from r.

func (*Binary) WriteTo

func (b *Binary) WriteTo(w io.Writer) (n int64, err error)

WriteTo writes b to w.

type FFIArgument

type FFIArgument interface {
	// contains filtered or unexported methods
}

FFIArgument is immplemented by all types of FFI arguments.

type FFIResult

type FFIResult interface {
	// contains filtered or unexported methods
}

FFIResult is immplemented by all types of FFI results.

type Float64

type Float64 int64

Float64 is an float64 FFI argument.

type Float64Result

type Float64Result struct{ Value *float64 }

Float64Result is an FFI float64 result.

type Int32

type Int32 int32

Int32 is an int32 FFI argument.

type Int32Result

type Int32Result struct{ Value *int32 }

Int32Result is an FFI int32 result.

type Int64

type Int64 int64

Int64 is an int64 FFI argument.

type Int64Result

type Int64Result struct{ Value *int64 }

Int64Result is an FFI int64 result.

type KillError

type KillError struct{}

KillError is the error returned by the CPU of a killed machine.

func (KillError) Error

func (e KillError) Error() string

Error implements error.

type Machine

type Machine struct {
	ProfileFunctions    map[PCInfo]int
	ProfileInstructions map[Opcode]int
	ProfileLines        map[PCInfo]int
	ProfileRate         int       // N: Sample every Nth instruction.
	Threads             []*Thread //TODO Unexport?
	// contains filtered or unexported fields
}

Machine represents the state of the VM memory and threads.

func New

func New(b *Binary, args []string, stdin io.Reader, stdout, stderr io.Writer, heapSize, stackSize int, tracePath string, opts ...Option) (m *Machine, exitStatus int, err error)

New runs the program in b and returns its exit status or an error, if any. It's the caller responsibility to ensure the binary was produced for the correct architecture and platform.

If a stack trace is produced on error, the PCInfo is interpreted relative to tracePath and if a corresponding source file is available the trace is extended with the respective source code lines.

The returned machine is ready, if applicable, for calling individual external functions. Its Close method must be called eventually to free any resources it has acquired from the OS.

func (*Machine) CString

func (m *Machine) CString(s string) uintptr

CString allocates a C string initialized from s.

func (*Machine) Close

func (m *Machine) Close() (err error)

Close frees resources acquired from the OS by m.

func (*Machine) Kill

func (m *Machine) Kill()

Kill sends a kill signal to m.

func (*Machine) NewThread

func (m *Machine) NewThread(stackSize int) (*Thread, error)

NewThread returns a newly created Thread or an error, if any. Its Close method must be called eventually to free any resources it has acquired from the OS.

type Opcode

type Opcode int

Opcode encodes the particular operation.

const (
	Nop Opcode = iota

	AP // N
	AddF32
	AddF64
	AddC64
	AddC128
	AddI32
	AddI64
	AddPtr // N
	AddPtrs
	AddSP // N
	And16
	And32
	And64
	And8
	Argument   // N + ext: size
	Argument16 // N
	Argument32 // N
	Argument64 // N
	Argument8  // N
	Arguments
	ArgumentsFP
	BP          // N
	BitfieldI8  // N  lshift<<8|rshift
	BitfieldI16 // N  lshift<<8|rshift
	BitfieldI32 // N  lshift<<8|rshift
	BitfieldI64 // N  lshift<<8|rshift
	BitfieldU8  // N: lshift<<8|rshift
	BitfieldU16 // N: lshift<<8|rshift
	BitfieldU32 // N: lshift<<8|rshift
	BitfieldU64 // N: lshift<<8|rshift
	BoolC128
	BoolF32
	BoolF64
	BoolI16
	BoolI32
	BoolI64
	BoolI8
	Call // N
	CallFP
	ConvC64C128
	ConvF32C128
	ConvF32C64
	ConvF32F64
	ConvF32I32
	ConvF32I64
	ConvF32U32
	ConvF64C128
	ConvF64F32
	ConvF64I32
	ConvF64I64
	ConvF64I8
	ConvF64U16
	ConvF64U32
	ConvF64U64
	ConvI16I32
	ConvI16I64
	ConvI16U32
	ConvI32C128
	ConvI32C64
	ConvI32F32
	ConvI32F64
	ConvI32I16
	ConvI32I64
	ConvI32I8
	ConvI64 // N
	ConvI64F64
	ConvI64I16
	ConvI64I32
	ConvI64I8
	ConvI64U16
	ConvI8I16
	ConvI8I32
	ConvI8I64
	ConvI8F64
	ConvI8U32
	ConvU16I32
	ConvU16I64
	ConvU16U32
	ConvU16U64
	ConvU32F32
	ConvU32F64
	ConvU32I16
	ConvU32I64
	ConvU32U8
	ConvU8I16
	ConvU8I32
	ConvU8U32
	ConvU8U64
	Copy // N
	Cpl32
	Cpl64
	Cpl8
	DS     // N
	DSC128 // N
	DSI16  // N
	DSI32  // N
	DSI64  // N
	DSI8   // N
	DSN    // N + ext: size
	DivC128
	DivC64
	DivF32
	DivF64
	DivI32
	DivI64
	DivU32
	DivU64
	Dup32
	Dup64
	Dup8
	EqF32
	EqF64
	EqI32
	EqI64
	EqI8
	Ext // N
	FFIReturn
	FP      // N
	Field16 // N + ext: size
	Field64 // N + ext: size
	Field8  // N + ext: size
	Func    // N
	GeqF32
	GeqF64
	GeqI32
	GeqI64
	GeqI8
	GeqU32
	GeqU64
	GtF32
	GtF64
	GtI32
	GtI64
	GtU32
	GtU64
	Index    // N
	IndexI16 // N
	IndexU16 // N
	IndexI32 // N
	IndexI64 // N
	IndexI8  // N
	IndexU32 // N
	IndexU64 // N
	IndexU8  // N
	Jmp      // N
	JmpP
	Jnz   // N
	Jz    // N
	Label // N
	LeqF32
	LeqF64
	LeqI32
	LeqI64
	LeqI8
	LeqU32
	LeqU64
	Load   // N + ext: size
	Load16 // N
	Load32 // N
	Load64 // N
	Load8  // N
	LshI16 // N
	LshI32 // N
	LshI64 // N
	LshI8  // N
	LtF32
	LtF64
	LtI32
	LtI64
	LtU32
	LtU64
	MulC128
	MulC64
	MulF32
	MulF64
	MulI32
	MulI64
	NegF32
	NegF64
	NegI16
	NegI32
	NegI64
	NegI8
	NegIndexI32 // N
	NegIndexI64 // N
	NegIndexU16 // N
	NegIndexU32 // N
	NegIndexU64 // N
	NeqC128
	NeqC64
	NeqF32
	NeqF64
	NeqI32
	NeqI64
	NeqI8
	Not
	Or32
	Or64
	Panic
	PostIncF64     // N
	PostIncI16     // N
	PostIncI32     // N
	PostIncI64     // N
	PostIncI8      // N
	PostIncPtr     // N
	PostIncU32Bits // N + ext: bits<<16 | bitoffset<<8 | bitfieldWidth
	PostIncU64Bits // N + ext: bits<<16 | bitoffset<<8 | bitfieldWidth
	PreIncI16      // N
	PreIncI32      // N
	PreIncI64      // N
	PreIncI8       // N
	PreIncPtr      // N
	PreIncU32Bits  // N + ext: bits<<16 | bitoffset<<8 | bitfieldWidth
	PreIncU64Bits  // N + ext: bits<<16 | bitoffset<<8 | bitfieldWidth
	PtrDiff        // N
	Push16         // N
	Push32         // N
	Push64         // N
	Push8          // N
	PushC128       // N + ext: imag part
	RemI32
	RemI64
	RemU32
	RemU64
	Return
	RshI16 // N
	RshI32 // N
	RshI64 // N
	RshI8  // N
	RshU16 // N
	RshU32 // N
	RshU64 // N
	RshU8  // N
	Store  // N
	Store16
	Store32
	Store64
	Store8
	StoreBits16 // N
	StoreBits32 // N
	StoreBits64 // N
	StoreBits8  // N
	StoreC128
	StrNCopy // N
	SubF32
	SubF64
	SubI32
	SubI64
	SubPtrs
	SwitchI32  // N
	SwitchI64  // N
	Text       // N
	Variable   // N + ext: size
	Variable16 // N
	Variable32 // N
	Variable64 // N
	Variable8  // N
	Xor32
	Xor64
	Zero8
	Zero16
	Zero32
	Zero64

	AreFileApisANSI
	CloseHandle
	CreateFileMappingA
	CreateFileMappingW
	CreateMutexW
	CreateFileA
	CreateFileW
	DeleteCriticalSection
	DeleteFileA
	DeleteFileW
	EnterCriticalSection
	FlushFileBuffers
	FlushViewOfFile
	FormatMessageA
	FormatMessageW
	FreeLibrary
	GetCurrentProcessId
	GetCurrentThreadId
	GetDiskFreeSpaceA
	GetDiskFreeSpaceW
	GetFileAttributesA
	GetFileAttributesW
	GetFileAttributesExW
	GetFileSize
	GetFullPathNameA
	GetFullPathNameW
	GetLastError
	GetProcAddress
	GetProcessHeap
	GetSystemInfo
	GetSystemTime
	GetSystemTimeAsFileTime
	GetTempPathA
	GetTempPathW
	GetTickCount
	GetVersionExA
	GetVersionExW
	HeapAlloc
	HeapCreate
	HeapCompact
	HeapDestroy
	HeapFree
	HeapReAlloc
	HeapSize
	HeapValidate
	InitializeCriticalSection
	InterlockedCompareExchange
	LoadLibraryA
	LoadLibraryW
	LocalFree
	LockFile
	LockFileEx
	LeaveCriticalSection
	MapViewOfFile
	MultiByteToWideChar
	OutputDebugStringA
	OutputDebugStringW
	QueryPerformanceCounter
	ReadFile
	SetEndOfFile
	SetFilePointer
	Sleep
	SystemTimeToFileTime
	UnlockFile
	UnlockFileEx
	UnmapViewOfFile
	WaitForSingleObject
	WaitForSingleObjectEx
	WideCharToMultiByte
	WriteFile
)

Values of Opcode.

func (Opcode) String

func (i Opcode) String() string

type Operation

type Operation struct {
	Opcode
	N int
}

Operation is the machine code.

type Option

type Option func(*options) error

Option represents an optional argument of New or Exec.

func ProfileFunctions

func ProfileFunctions() Option

ProfileFunctions turns profiling of functions on.

func ProfileInstructions

func ProfileInstructions() Option

ProfileInstructions turns profiling of instructions on.

func ProfileLines

func ProfileLines() Option

ProfileLines turns profiling of source lines on.

func ProfileRate

func ProfileRate(rate int) Option

ProfileRate set the profilig rate.

type PCInfo

type PCInfo struct {
	PC     int
	Line   int
	Column int
	Name   ir.NameID // File name or func name.
}

PCInfo represents a line/function for a particular program counter location.

func (*PCInfo) Position

func (p *PCInfo) Position() token.Position

Position returns a token.Position from p.

type Ptr

type Ptr uintptr

Ptr is a pointer FFI argument.

type PtrResult

type PtrResult struct{ Value *uintptr }

PtrResult is an FFI pointer result.

type Thread

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

Thread is a thread of VM execution.

func (*Thread) AreFileApisANSI

func (c *Thread) AreFileApisANSI()

//sys:kernel32: BOOL AreFileApisANSI();

func (*Thread) Close

func (t *Thread) Close() error

Close frees resources acquired from the OS by t.

func (*Thread) CloseHandle

func (c *Thread) CloseHandle()

//sys:kernel32: BOOL CloseHandle(HANDLE hObject);

func (*Thread) CreateFileA

func (c *Thread) CreateFileA()

//sys:kernel32: HANDLE CreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);

func (*Thread) CreateFileMappingA

func (c *Thread) CreateFileMappingA()

//sys:kernel32: HANDLE CreateFileMappingA(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCSTR lpName);

func (*Thread) CreateFileMappingW

func (c *Thread) CreateFileMappingW()

//sys:kernel32: HANDLE CreateFileMappingW(HANDLE hFile, LPSECURITY_ATTRIBUTES lpAttributes, DWORD flProtect, DWORD dwMaximumSizeHigh, DWORD dwMaximumSizeLow, LPCWSTR lpName);

func (*Thread) CreateFileW

func (c *Thread) CreateFileW()

//sys:kernel32: HANDLE CreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);

func (*Thread) CreateMutexW

func (c *Thread) CreateMutexW()

//sys:kernel32: HANDLE CreateMutexW(LPSECURITY_ATTRIBUTES lpMutexAttributes, BOOL bInitialOwner, LPCTSTR lpName);

func (*Thread) DeleteCriticalSection

func (c *Thread) DeleteCriticalSection()

//sys:kernel32: void DeleteCriticalSection(LPCRITICAL_SECTION lpCriticalSection);

func (*Thread) DeleteFileA

func (c *Thread) DeleteFileA()

//sys:kernel32: BOOL DeleteFileA(LPCTSTR lpFileName);

func (*Thread) DeleteFileW

func (c *Thread) DeleteFileW()

//sys:kernel32: BOOL DeleteFileW(LPCTSTR lpFileName);

func (*Thread) EnterCriticalSection

func (c *Thread) EnterCriticalSection()

//sys:kernel32: void EnterCriticalSection(LPCRITICAL_SECTION lpCriticalSection);

func (*Thread) FFI

func (t *Thread) FFI(fn int, out []FFIResult, in ...FFIArgument) (int, error)

FFI executes function fn using 'in' as arguments. The number and types of 'out' and 'in' items must match the number and types of the function results and arguments. Variadic functions are supported.

func (*Thread) FFI0

func (t *Thread) FFI0(fn int, in ...FFIArgument) (int, error)

FFI0 executes a void function fn using 'in' as arguments. The number and types of arguments must match the number and types of the function arguments. Variadic functions are supported.

func (*Thread) FFI1

func (t *Thread) FFI1(fn int, out FFIResult, in ...FFIArgument) (int, error)

FFI1 executes function fn, having one result, using 'in' as arguments. The number and types of 'in' items must match the number and types of the function arguments. Variadic functions are supported.

func (*Thread) FlushFileBuffers

func (c *Thread) FlushFileBuffers()

//sys:kernel32: BOOL FlushFileBuffers(HANDLE hFile);

func (*Thread) FlushViewOfFile

func (c *Thread) FlushViewOfFile()

//sys:kernel32: BOOL FlushViewOfFile(LPCVOID lpBaseAddress, SIZE_T dwNumberOfBytesToFlush);

func (*Thread) FormatMessageA

func (c *Thread) FormatMessageA()

//sys:kernel32: DWORD FormatMessageA(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments);

func (*Thread) FormatMessageW

func (c *Thread) FormatMessageW()

//sys:kernel32: DWORD FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPTSTR lpBuffer, DWORD nSize, va_list* Arguments);

func (*Thread) FreeLibrary

func (c *Thread) FreeLibrary()

//sys:kernel32: BOOL FreeLibrary(HMODULE hModule);

func (*Thread) GetCurrentProcessId

func (c *Thread) GetCurrentProcessId()

//sys:kernel32: DWORD GetCurrentProcessId();

func (*Thread) GetCurrentThreadId

func (c *Thread) GetCurrentThreadId()

func (*Thread) GetDiskFreeSpaceA

func (c *Thread) GetDiskFreeSpaceA()

//sys:kernel32: BOOL GetDiskFreeSpaceA(LPCTSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);

func (*Thread) GetDiskFreeSpaceW

func (c *Thread) GetDiskFreeSpaceW()

//sys:kernel32: BOOL GetDiskFreeSpaceW(LPCTSTR lpRootPathName, LPDWORD lpSectorsPerCluster, LPDWORD lpBytesPerSector, LPDWORD lpNumberOfFreeClusters, LPDWORD lpTotalNumberOfClusters);

func (*Thread) GetFileAttributesA

func (c *Thread) GetFileAttributesA()

//sys:kernel32: DWORD GetFileAttributesA(LPCTSTR lpFileName);

func (*Thread) GetFileAttributesExW

func (c *Thread) GetFileAttributesExW()

//sys:kernel32: BOOL GetFileAttributesExW(LPCTSTR lpFileName, GET_FILEEX_INFO_LEVELS fInfoLevelId, LPVOID lpFileInformation);

func (*Thread) GetFileAttributesW

func (c *Thread) GetFileAttributesW()

//sys:kernel32: DWORD GetFileAttributesW(LPCTSTR lpFileName);

func (*Thread) GetFileSize

func (c *Thread) GetFileSize()

//sys:kernel32: DWORD GetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh);

func (*Thread) GetFullPathNameA

func (c *Thread) GetFullPathNameA()

//sys:kernel32: DWORD GetFullPathNameA( LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart);

func (*Thread) GetFullPathNameW

func (c *Thread) GetFullPathNameW()

//sys:kernel32: DWORD GetFullPathNameW( LPCTSTR lpFileName, DWORD nBufferLength, LPTSTR lpBuffer, LPTSTR* lpFilePart);

func (*Thread) GetLastError

func (c *Thread) GetLastError()

func (*Thread) GetProcAddress

func (c *Thread) GetProcAddress()

//sys:kernel32: FARPROC GetProcAddress(HMODULE hModule, LPCSTR lpProcName);

func (*Thread) GetProcessHeap

func (c *Thread) GetProcessHeap()

//sys:kernel32: HANDLE GetProcessHeap();

func (*Thread) GetSystemInfo

func (c *Thread) GetSystemInfo()

//sys:kernel32: void GetSystemInfo(LPSYSTEM_INFO lpSystemInfo);

func (*Thread) GetSystemTime

func (c *Thread) GetSystemTime()

//sys:kernel32: void GetSystemTime(LPSYSTEMTIME lpSystemTime);

func (*Thread) GetSystemTimeAsFileTime

func (c *Thread) GetSystemTimeAsFileTime()

//sys:kernel32: void GetSystemTimeAsFileTime(LPFILETIME lpSystemTimeAsFileTime);

func (*Thread) GetTempPathA

func (c *Thread) GetTempPathA()

//sys:kernel32: DWORD GetTempPathA(DWORD nBufferLength, LPTSTR lpBuffer);

func (*Thread) GetTempPathW

func (c *Thread) GetTempPathW()

//sys:kernel32: DWORD GetTempPathW(DWORD nBufferLength, LPTSTR lpBuffer);

func (*Thread) GetTickCount

func (c *Thread) GetTickCount()

//sys:kernel32: DWORD GetTickCount();

func (*Thread) GetVersionExA

func (c *Thread) GetVersionExA()

//sys:kernel32: BOOL GetVersionExA(LPOSVERSIONINFO lpVersionInfo);

func (*Thread) GetVersionExW

func (c *Thread) GetVersionExW()

//sys:kernel32: BOOL GetVersionExW(LPOSVERSIONINFO lpVersionInfo);

func (*Thread) HeapAlloc

func (c *Thread) HeapAlloc()

//sys:kernel32: LPVOID HeapAlloc(HANDLE hHeap, DWORD dwFlags, SIZE_T dwBytes);

func (*Thread) HeapCompact

func (c *Thread) HeapCompact()

//sys:kernel32: SIZE_T HeapCompact(HANDLE hHeap, DWORD dwFlags);

func (*Thread) HeapCreate

func (c *Thread) HeapCreate()

//sys:kernel32: HANDLE HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize);

func (*Thread) HeapDestroy

func (c *Thread) HeapDestroy()

//sys:kernel32: BOOL HeapDestroy(HANDLE hHeap);

func (*Thread) HeapFree

func (c *Thread) HeapFree()

//sys:kernel32: BOOL HeapFree(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);

func (*Thread) HeapReAlloc

func (c *Thread) HeapReAlloc()

//sys:kernel32: LPVOID HeapReAlloc(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem, SIZE_T dwBytes);

func (*Thread) HeapSize

func (c *Thread) HeapSize()

//sys:kernel32: SIZE_T HeapSize(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);

func (*Thread) HeapValidate

func (c *Thread) HeapValidate()

//sys:kernel32: BOOL HeapValidate(HANDLE hHeap, DWORD dwFlags, LPCVOID lpMem);

func (*Thread) InitializeCriticalSection

func (c *Thread) InitializeCriticalSection()

//sys:kernel32: void InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection);

func (*Thread) InterlockedCompareExchange

func (c *Thread) InterlockedCompareExchange()

func (*Thread) LeaveCriticalSection

func (c *Thread) LeaveCriticalSection()

//sys:kernel32: void LeaveCriticalSection(LPCRITICAL_SECTION lpCriticalSection);

func (*Thread) LoadLibraryA

func (c *Thread) LoadLibraryA()

//sys:kernel32: HMODULE LoadLibraryA(LPCTSTR lpFileName);

func (*Thread) LoadLibraryW

func (c *Thread) LoadLibraryW()

//sys:kernel32: HMODULE LoadLibraryW(LPCTSTR lpFileName);

func (*Thread) LocalFree

func (c *Thread) LocalFree()

//sys:kernel32: HLOCAL LocalFree(HLOCAL hMem);

func (*Thread) LockFile

func (c *Thread) LockFile()

//sys:kernel32: BOOL LockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh);

func (*Thread) LockFileEx

func (c *Thread) LockFileEx()

//sys:kernel32: BOOL LockFileEx(HANDLE hFile, DWORD dwFlags, DWORD dwReserved, DWORD nNumberOfBytesToLockLow, DWORD nNumberOfBytesToLockHigh, LPOVERLAPPED lpOverlapped);

func (*Thread) MapViewOfFile

func (c *Thread) MapViewOfFile()

//sys:kernel32: LPVOID MapViewOfFile(HANDLE hFileMappingObject, DWORD dwDesiredAccess, DWORD dwFileOffsetHigh, DWORD dwFileOffsetLow, SIZE_T dwNumberOfBytesToMap);

func (*Thread) MultiByteToWideChar

func (c *Thread) MultiByteToWideChar()

//sys:kernel32: int MultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);

func (*Thread) OutputDebugStringA

func (c *Thread) OutputDebugStringA()

//sys:kernel32: void OutputDebugStringA(LPCTSTR lpOutputString);

func (*Thread) OutputDebugStringW

func (c *Thread) OutputDebugStringW()

//sys:kernel32: void OutputDebugStringW(LPCTSTR lpOutputString);

func (*Thread) QueryPerformanceCounter

func (c *Thread) QueryPerformanceCounter()

//sys:kernel32: BOOL QueryPerformanceCounter(LARGE_INTEGER* lpPerformanceCount);

func (*Thread) ReadFile

func (c *Thread) ReadFile()

//sys:kernel32: BOOL ReadFile(HANDLE hFile, LPVOID lpBuffer, DWORD nNumberOfBytesToRead, LPDWORD lpNumberOfBytesRead, LPOVERLAPPED lpOverlapped);

func (*Thread) SetEndOfFile

func (c *Thread) SetEndOfFile()

//sys:kernel32: BOOL SetEndOfFile(HANDLE hFile);

func (*Thread) SetFilePointer

func (c *Thread) SetFilePointer()

//sys:kernel32: DWORD SetFilePointer(HANDLE hFile, LONG lDistanceToMove, PLONG lpDistanceToMoveHigh, DWORD dwMoveMethod);

func (*Thread) Sleep

func (c *Thread) Sleep()

//sys:kernel32: void Sleep(DWORD dwMilliseconds);

func (*Thread) SystemTimeToFileTime

func (c *Thread) SystemTimeToFileTime()

//sys:kernel32: BOOL SystemTimeToFileTime(SYSTEMTIME* lpSystemTime, LPFILETIME lpFileTime);

func (*Thread) UnlockFile

func (c *Thread) UnlockFile()

//sys:kernel32: BOOL UnlockFile(HANDLE hFile, DWORD dwFileOffsetLow, DWORD dwFileOffsetHigh, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh);

func (*Thread) UnlockFileEx

func (c *Thread) UnlockFileEx()

//sys:kernel32: BOOL UnlockFileEx(HANDLE hFile, DWORD dwReserved, DWORD nNumberOfBytesToUnlockLow, DWORD nNumberOfBytesToUnlockHigh, LPOVERLAPPED lpOverlapped);

func (*Thread) UnmapViewOfFile

func (c *Thread) UnmapViewOfFile()

//sys:kernel32: BOOL UnmapViewOfFile(LPCVOID lpBaseAddress);

func (*Thread) WaitForSingleObject

func (c *Thread) WaitForSingleObject()

//sys:kernel32: DWORD WaitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);

func (*Thread) WaitForSingleObjectEx

func (c *Thread) WaitForSingleObjectEx()

//sys:kernel32: DWORD WaitForSingleObjectEx(HANDLE hHandle, DWORD dwMilliseconds, BOOL bAlertable);

func (*Thread) WideCharToMultiByte

func (c *Thread) WideCharToMultiByte()

//sys:kernel32: int WideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWSTR lpWideCharStr, int cchWideChar, LPSTR lpMultiByteStr, int cbMultiByte, LPCSTR lpDefaultChar, LPBOOL lpUsedDefaultChar);

func (*Thread) WriteFile

func (c *Thread) WriteFile()

//sys:kernel32: BOOL WriteFile(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);

Jump to

Keyboard shortcuts

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