bindfilter

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (
	BINDFLT_FLAG_READ_ONLY_MAPPING uint32 = 0x00000001
	// Tells bindflt to fail mapping with STATUS_INVALID_PARAMETER if a mapping produces
	// multiple targets.
	BINDFLT_FLAG_NO_MULTIPLE_TARGETS uint32 = 0x00000040
)

BfSetupFilter flags. See: https://github.com/microsoft/BuildXL/blob/a6dce509f0d4f774255e5fbfb75fa6d5290ed163/Public/Src/Utilities/Native/Processes/Windows/NativeContainerUtilities.cs#L193-L240

View Source
const (
	BINDFLT_GET_MAPPINGS_FLAG_VOLUME uint32 = 0x00000001
	BINDFLT_GET_MAPPINGS_FLAG_SILO   uint32 = 0x00000002
	BINDFLT_GET_MAPPINGS_FLAG_USER   uint32 = 0x00000004
)

Variables

This section is empty.

Functions

func ApplyFileBinding

func ApplyFileBinding(root, source string, readOnly bool) error

ApplyFileBinding creates a global mount of the source in root, with an optional read only flag. The bind filter allows us to create mounts of directories and volumes. By default it allows us to mount multiple sources inside a single root, acting as an overlay. Files from the second source will superscede the first source that was mounted. This function disables this behavior and sets the BINDFLT_FLAG_NO_MULTIPLE_TARGETS flag on the mount.

func RemoveFileBinding

func RemoveFileBinding(root string) error

RemoveFileBinding removes a mount from the root path.

Types

type BindMapping

type BindMapping struct {
	MountPoint string
	Flags      uint32
	Targets    []string
}

func GetBindMappings

func GetBindMappings(volumePath string) ([]BindMapping, error)

GetBindMappings returns a list of bind mappings that have their root on a particular volume. The volumePath parameter can be any path that exists on a volume. For example, if a number of mappings are created in C:\ProgramData\test, to get a list of those mappings, the volumePath parameter would have to be set to C:\ or the VOLUME_NAME_GUID notation of C:\ (\\?\Volume{GUID}\), or any child path that exists.

Jump to

Keyboard shortcuts

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