fsformatter

package
v0.14.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for windows/amd64

Index

Constants

View Source
const (

	// This is used to construct the disk path that refsFormatter
	// understands. `harddisk%d` here refers to the disk number
	// associated with the corresponding lun of the attached
	// scsi device.
	VirtualDevObjectPathFormat = "\\device\\harddisk%d\\partition0"
)

This file contains all the supporting structures needed to make an ioctl call to RefsFormatter.

Variables

This section is empty.

Functions

func GetVolumePathBufferOffset

func GetVolumePathBufferOffset() uint32

GetVolumePathBufferOffset gets offset to KernelFormarVolumeFormatOutputBuffer{}.VolumePathBuffer

func InvokeFsFormatter

func InvokeFsFormatter(ctx context.Context, diskPath string) (string, error)

InvokeFsFormatter makes an ioctl call to the fsFormatter driver and returns a path to the mountedVolume

Types

type KernelFormarVolumeFormatOutputBuffer

type KernelFormarVolumeFormatOutputBuffer struct {
	Size     uint32
	Flags    kernelFormatVolumeFormatOutputBufferFlags
	Reserved [4]uint32
	// VolumePathLength holds size of VolumePathBuffer
	// in bytes
	VolumePathLength uint16
	// VolumePathBuffer holds the mounted volume path
	// as returned from refsFormatter. It represents
	// a variable size WCHAR character array
	VolumePathBuffer []uint16
}

func KmFmtCreateFormatOutputBuffer

func KmFmtCreateFormatOutputBuffer() *KernelFormarVolumeFormatOutputBuffer

KmFmtCreateFormatOutputBuffer formats an output buffer as expected by the fsFormatter driver

type KernelFormatVolumeFormatFsParameters

type KernelFormatVolumeFormatFsParameters struct {
	FileSystemType kernelFormatVolumeFilesystemTypes
	// Represents a WCHAR character array
	VolumeLabel [kernelFormatVolumeMaxVolumeLabelLength / uint32(sizeOfWchar)]uint16
	// Length of volume label in bytes
	VolumeLabelLength uint16
	// RefsFormatterParams represents the following union
	/*
	   union {

	       KERNEL_FORMAT_VOLUME_FORMAT_REFS_PARAMETERS RefsParameters;

	       //
	       //  This structure can't grow in size nor change in alignment. 16 ULONGLONGs
	       //  should be more than enough for supporting other filesystems down the
	       //  line. This also serves to enforce 8 byte alignment.
	       //
	       Reserved [16]uint64
	   };
	*/
	RefsFormatterParams [128]byte
}

type KernelFormatVolumeFormatInputBuffer

type KernelFormatVolumeFormatInputBuffer struct {
	Size         uint64
	FsParameters KernelFormatVolumeFormatFsParameters
	Flags        kernelFormatVolumeFormatInputBufferFlags
	Reserved     [4]uint32
	// Size of DiskPathBuffer in bytes
	DiskPathLength uint16
	// DiskPathBuffer holds the disk path. It represents a
	// variable size WCHAR character array
	DiskPathBuffer []uint16
}

func KmFmtCreateFormatInputBuffer

func KmFmtCreateFormatInputBuffer(diskPath string) *KernelFormatVolumeFormatInputBuffer

KmFmtCreateFormatInputBuffer formats an input buffer as expected by the refsFormatter driver. diskPath represents disk path in VirtualDevObjectPathFormat.

type KernelFormatVolumeFormatRefsParameters

type KernelFormatVolumeFormatRefsParameters struct {
	ClusterSize          uint32
	MetadataChecksumType uint16
	UseDataIntegrity     bool
	MajorVersion         uint16
	MinorVersion         uint16
}

Jump to

Keyboard shortcuts

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