winapi

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RtIcon Hardware-dependent icon resource.
	// MAKEINTRESOURCE((ULONG_PTR)(RT_ICON) + 11)
	// https://docs.microsoft.com/en-us/windows/win32/menurc/resource-types
	RtIcon = 3
	// RtGroupIcon Hardware-independent icon resource.
	// MAKEINTRESOURCE((ULONG_PTR)(RT_ICON) + 11)
	// https://docs.microsoft.com/en-us/windows/win32/menurc/resource-types
	RtGroupIcon = RtIcon + 11

	// LoadLibraryAsImageResource 0x00000020
	// If this value is used, the system maps the file into the process's virtual address space as an image file.
	// However, the loader does not load the static imports or perform the other usual initialization steps.
	// Use this flag when you want to load a DLL only to extract messages or resources from it.
	// Unless the application depends on the file having the in-memory layout of an image, this value should be used
	// with either LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE or LOAD_LIBRARY_AS_DATAFILE.
	// For more information, see the Remarks section.
	//
	// Windows Server 2003 and Windows XP:  This value is not supported until Windows Vista.
	// https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa
	LoadLibraryAsImageResource = 0x00000020

	// LoadLibraryAsDatafile 0x00000002
	// If this value is used, the system maps the file into the calling process's virtual address space
	// as if it were a data file. Nothing is done to execute or prepare to execute the mapped file.
	// Therefore, you cannot call functions like GetModuleFileName, GetModuleHandle or GetProcAddress with
	// this DLL. Using this value causes writes to read-only memory to raise an access violation. Use this
	// flag when you want to load a DLL only to extract messages or resources from it.
	//
	// This value can be used with LOAD_LIBRARY_AS_IMAGE_RESOURCE. For more information, see Remarks.
	// https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-loadlibraryexa
	LoadLibraryAsDatafile = 0x00000002
)

Variables

This section is empty.

Functions

func EnumResourceNamesA

func EnumResourceNamesA(hModule windows.Handle, lpcStr uintptr, lpEnumFunc EnumResNameProcA, lParam *int32) error

EnumResourceNamesA enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable Executable (LN file), and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that contain localizable language resources. It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources.

func FindResourceA

func FindResourceA(hModule windows.Handle, lpName, lpType uintptr) (rInfo uintptr, err error)

FindResourceA etermines the location of a resource with the specified type and name in the specified module.

func LoadLibraryEx

func LoadLibraryEx(name string, flags uint32) (windows.Handle, error)

LoadLibraryEx maps a specified executable module into the address space of the calling process. The executable module can be a .dll or an .exe file. The specified module may cause other modules to be mapped into the address space.

func LoadResource

func LoadResource(hModule windows.Handle, hResInfo uintptr) (windows.Handle, error)

LoadResource retrieves a handle that can be used to obtain a pointer to the first byte of the specified resource in memory.

func LockResource

func LockResource(hResData windows.Handle) (windows.Handle, error)

LockResource retrieves a pointer to the specified resource in memory.

func MakeIntResource

func MakeIntResource(i int) uintptr

MakeIntResource converts an integer value to a resource type compatible with the resource-management functions. This macro is used in place of a string containing the name of the resource.

func QueryFullProcessImageNameW

func QueryFullProcessImageNameW(pid uint32, flags uint32) (s string, err error)

QueryFullProcessImageNameW retrieves the full name of the executable image for the specified process.

func SizeofResource

func SizeofResource(hModule windows.Handle, hResInfo uintptr) (uint32, error)

SizeofResource retrieves the size, in bytes, of the specified resource.

Types

type EnumResNameProcA

type EnumResNameProcA func(hModule windows.Handle, lpType, lpName, lParam uintptr) uintptr

EnumResNameProcA is an application-defined callback function used with the EnumResourceNames and EnumResourceNamesEx functions. It receives the type and name of a resource. The ENUMRESNAMEPROC type defines a pointer to this callback function. EnumResNameProc is a placeholder for the application-defined function name.

Jump to

Keyboard shortcuts

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