Documentation
¶
Index ¶
- Constants
- Variables
- func ReadFile(filename string, out *LnkFile) error
- type ConsoleDataBlock
- type ConsoleFEDataBlock
- type Decoder
- type DriveType
- type Encoder
- type Encoding
- type EnvironmentVariableDataBlock
- type ExtraDataBlock
- type ExtraDataBlockHead
- type ExtraDataSection
- type ExtraDataSignature
- type FileAttrs
- type FileHeader
- type IDList
- type IconEnvironmentDataBlock
- type ItemID
- type LinkFlags
- func (i LinkFlags) ActiveFlags() []string
- func (i LinkFlags) AllowLinkToLink() bool
- func (i LinkFlags) ClearAllowLinkToLink() LinkFlags
- func (i LinkFlags) ClearDisableKnownFolderAlias() LinkFlags
- func (i LinkFlags) ClearDisableKnownFolderTracking() LinkFlags
- func (i LinkFlags) ClearDisableLinkPathTracking() LinkFlags
- func (i LinkFlags) ClearEnableTargetMetadata() LinkFlags
- func (i LinkFlags) ClearForceNoLinkInfo() LinkFlags
- func (i LinkFlags) ClearForceNoLinkTrack() LinkFlags
- func (i LinkFlags) ClearHasArguments() LinkFlags
- func (i LinkFlags) ClearHasDarwinID() LinkFlags
- func (i LinkFlags) ClearHasExpIconLocation() LinkFlags
- func (i LinkFlags) ClearHasExpString() LinkFlags
- func (i LinkFlags) ClearHasIconLocation() LinkFlags
- func (i LinkFlags) ClearHasLinkInfo() LinkFlags
- func (i LinkFlags) ClearHasLinkTargetIDList() LinkFlags
- func (i LinkFlags) ClearHasName() LinkFlags
- func (i LinkFlags) ClearHasRelativePath() LinkFlags
- func (i LinkFlags) ClearHasWorkingDir() LinkFlags
- func (i LinkFlags) ClearIsUnicode() LinkFlags
- func (i LinkFlags) ClearKeepLocalIDListForUNCTarget() LinkFlags
- func (i LinkFlags) ClearNoPIDLAlias() LinkFlags
- func (i LinkFlags) ClearPreferEnvironmentPath() LinkFlags
- func (i LinkFlags) ClearRunAsUser() LinkFlags
- func (i LinkFlags) ClearRunInSeparateProcess() LinkFlags
- func (i LinkFlags) ClearRunWithShimLayer() LinkFlags
- func (i LinkFlags) ClearUnaliasOnSave() LinkFlags
- func (i LinkFlags) DisableKnownFolderAlias() bool
- func (i LinkFlags) DisableKnownFolderTracking() bool
- func (i LinkFlags) DisableLinkPathTracking() bool
- func (i LinkFlags) EnableTargetMetadata() bool
- func (i LinkFlags) ForceNoLinkInfo() bool
- func (i LinkFlags) ForceNoLinkTrack() bool
- func (i LinkFlags) HasArguments() bool
- func (i LinkFlags) HasDarwinID() bool
- func (i LinkFlags) HasExpIconLocation() bool
- func (i LinkFlags) HasExpString() bool
- func (i LinkFlags) HasIconLocation() bool
- func (i LinkFlags) HasLinkInfo() bool
- func (i LinkFlags) HasLinkTargetIDList() bool
- func (i LinkFlags) HasName() bool
- func (i LinkFlags) HasRelativePath() bool
- func (i LinkFlags) HasWorkingDir() bool
- func (i LinkFlags) IsUnicode() bool
- func (i LinkFlags) KeepLocalIDListForUNCTarget() bool
- func (i LinkFlags) NoPIDLAlias() bool
- func (i LinkFlags) PreferEnvironmentPath() bool
- func (i LinkFlags) RunAsUser() bool
- func (i LinkFlags) RunInSeparateProcess() bool
- func (i LinkFlags) RunWithShimLayer() bool
- func (i LinkFlags) SetAllowLinkToLink() LinkFlags
- func (i LinkFlags) SetDisableKnownFolderAlias() LinkFlags
- func (i LinkFlags) SetDisableKnownFolderTracking() LinkFlags
- func (i LinkFlags) SetDisableLinkPathTracking() LinkFlags
- func (i LinkFlags) SetEnableTargetMetadata() LinkFlags
- func (i LinkFlags) SetForceNoLinkInfo() LinkFlags
- func (i LinkFlags) SetForceNoLinkTrack() LinkFlags
- func (i LinkFlags) SetHasArguments() LinkFlags
- func (i LinkFlags) SetHasDarwinID() LinkFlags
- func (i LinkFlags) SetHasExpIconLocation() LinkFlags
- func (i LinkFlags) SetHasExpString() LinkFlags
- func (i LinkFlags) SetHasIconLocation() LinkFlags
- func (i LinkFlags) SetHasLinkInfo() LinkFlags
- func (i LinkFlags) SetHasLinkTargetIDList() LinkFlags
- func (i LinkFlags) SetHasName() LinkFlags
- func (i LinkFlags) SetHasRelativePath() LinkFlags
- func (i LinkFlags) SetHasWorkingDir() LinkFlags
- func (i LinkFlags) SetIsUnicode() LinkFlags
- func (i LinkFlags) SetKeepLocalIDListForUNCTarget() LinkFlags
- func (i LinkFlags) SetNoPIDLAlias() LinkFlags
- func (i LinkFlags) SetPreferEnvironmentPath() LinkFlags
- func (i LinkFlags) SetRunAsUser() LinkFlags
- func (i LinkFlags) SetRunInSeparateProcess() LinkFlags
- func (i LinkFlags) SetRunWithShimLayer() LinkFlags
- func (i LinkFlags) SetUnaliasOnSave() LinkFlags
- func (i LinkFlags) String() string
- func (i LinkFlags) UnaliasOnSave() bool
- type LinkInfoFlags
- type LinkInfoHeader
- type LinkInfoSection
- type LinkTargetIDListSection
- type LnkFile
- type NetworkLocationFlags
- type NetworkLocationHeader
- type NetworkLocationSection
- type NetworkProviderType
- type PlatformGUID
- type PlatformString
- type PlatformTime
- type ShowCommand
- type TextFontFamily
- type TextFontPitch
- type TrackerDataBlock
- type UTF8Encoding
- type UnknownBlock
- type VolumeIDHeader
- type VolumeIDSection
Constants ¶
const ( TrackerDataBlockV1 = 0x00000000 TrackerDataBlockV1Length = 0x00000058 )
const ( LinkInfoHeaderSize = 0x1c LinkInfoHeaderExtendedSize = 0x24 )
const (
MaxSectionSize = 0x7ffff
)
Variables ¶
var ( ErrNoExtraDataBlock = errors.New("no extra data block found") ErrTooBig = errors.New("data block is too big") )
var ( LinkCLSID = PlatformGUID{ Data1: 0x00021401, Data2: 0x0000, Data3: 0x0000, Data4: [8]byte{0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}, } )
Functions ¶
Types ¶
type ConsoleDataBlock ¶
type ConsoleDataBlock struct {
Header ExtraDataBlockHead
FillAttributes uint16
PopupFillAttributes uint16
ScreenBufferSizeX uint16
ScreenBufferSizeY uint16
WindowSizeX uint16
WindowSizeY uint16
WindowOriginX uint16
WindowOriginY uint16
Unused1 uint32
Unused2 uint32
FontSize uint32
FontFamily TextFontFamily
FontWeight uint32
FaceName PlatformString
CursorSize uint32
FullScreen uint32
QuickEdit uint32
InsertMode uint32
AutoPosition uint32
HistoryBufferSize uint32
NumberOfHistoryBuffers uint32
HistoryNoDup uint32
ColorTable [16]uint32
}
ConsoleDataBlock represents a console data block in the LNK file.
type ConsoleFEDataBlock ¶
type ConsoleFEDataBlock struct {
Header ExtraDataBlockHead
CodePage uint32
}
ConsoleFEDataBlock represents a console fe data block in the LNK file.
type DriveType ¶
type DriveType uint32
DriveType specifies the type of drive the link target is stored on.
type EnvironmentVariableDataBlock ¶
type EnvironmentVariableDataBlock struct {
Encoding Encoding
Header ExtraDataBlockHead
Target PlatformString
}
func (*EnvironmentVariableDataBlock) ReadFrom ¶
func (blk *EnvironmentVariableDataBlock) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom implements the io.ReaderFrom interface.
type ExtraDataBlock ¶
type ExtraDataBlock interface {
// contains filtered or unexported methods
}
ExtraDataBlock represents an extra data block in the LNK file.
type ExtraDataBlockHead ¶
type ExtraDataBlockHead struct {
// Size of the extra data block in bytes.
Size uint32
// Signature of the extra data block.
Signature ExtraDataSignature
}
ExtraDataBlockHead represents the header of an extra data block in the LNK file.
func (*ExtraDataBlockHead) ReadFrom ¶
func (e *ExtraDataBlockHead) ReadFrom(r io.Reader) (n int64, err error)
ReadFrom implements the io.ReaderFrom interface.
type ExtraDataSection ¶
type ExtraDataSection struct {
Encoding Encoding
// Blocks hold the extra data blocks.
Blocks []ExtraDataBlock
}
func (*ExtraDataSection) ReadFrom ¶
func (s *ExtraDataSection) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom implements the io.ReaderFrom interface.
type ExtraDataSignature ¶
type ExtraDataSignature uint32
const ( Console ExtraDataSignature = 0xA0000002 ConsoleFE ExtraDataSignature = 0xA0000004 Darwin ExtraDataSignature = 0xA0000006 EnvVar ExtraDataSignature = 0xA0000001 IconEnv ExtraDataSignature = 0xA0000007 KnownFolder ExtraDataSignature = 0xA000000B PropertyStore ExtraDataSignature = 0xA0000009 ShimSignature ExtraDataSignature = 0xA0000008 SpecialFolder ExtraDataSignature = 0xA0000005 Tracker ExtraDataSignature = 0xA0000003 VistaIDList ExtraDataSignature = 0xA000000C )
func (ExtraDataSignature) String ¶
func (i ExtraDataSignature) String() string
type FileAttrs ¶
type FileAttrs uint32
FileAttrs represents the file attributes in the lnk header.
const ( FileAttrReadOnly FileAttrs = 0x00000001 FileAttrHidden FileAttrs = 0x00000002 FileAttrSystem FileAttrs = 0x00000004 FileAttrDirectory FileAttrs = 0x00000010 FileAttrArchive FileAttrs = 0x00000020 FileAttrNormal FileAttrs = 0x00000080 FileAttrTemporary FileAttrs = 0x00000100 FileAttrSparseFile FileAttrs = 0x00000200 FileAttrReparsePoint FileAttrs = 0x00000400 FileAttrCompressed FileAttrs = 0x00000800 FileAttrOffline FileAttrs = 0x00001000 FileAttrNotContentIndexed FileAttrs = 0x00002000 FileAttrEncrypted FileAttrs = 0x00004000 )
func (FileAttrs) ActiveFlags ¶
type FileHeader ¶
type FileHeader struct {
// HeaderSize is the size of the header in bytes.
HeaderSize uint32
// CLSID is the CLSID identifying the file as a shell link, must be 00021401-0000-0000-C000-000000000046.
CLSID PlatformGUID
// Flags is the flags in the lnk header.
Flags LinkFlags
// FileAttributes is the file attributes of the link target.
FileAttributes FileAttrs
// CreationTime is the time the link target was created.
CreationTime PlatformTime
// AccessTime is the time the link target was last accessed.
AccessTime PlatformTime
// WriteTime is the time the link target was last written to.
WriteTime PlatformTime
// FileSize is the size of the link target file. If larger than capacity, it will have the LSB 32-bits of size.
FileSize uint32
// IconIndex is the index of the icon in the icon location.
IconIndex int32
// ShowCommand is the expected window state of the target after execution.
ShowCommand ShowCommand
// HotKey is the hotkey to open the target.
HotKey uint16
}
FileHeader represents the lnk header.
type IDList ¶
type IDList struct {
// ItemIDList contains the IDLists.
ItemIDList []ItemID
}
IDList represents a persisted item ID list.
type IconEnvironmentDataBlock ¶
type IconEnvironmentDataBlock struct {
Encoding Encoding
Header ExtraDataBlockHead
// Target the link target using environment variable substitution.
Target PlatformString
}
func (*IconEnvironmentDataBlock) ReadFrom ¶
func (blk *IconEnvironmentDataBlock) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom implements the io.ReaderFrom interface.
type ItemID ¶
type ItemID struct {
// Size describes the length of the ItemID structure in bytes including the size field.
Size uint16
// Data is the source-defined data that specifies an item.
Data []byte
}
ItemID is an element in IDList.
type LinkFlags ¶
type LinkFlags uint32
LinkFlags represents the flags in the lnk header.
const ( LinkFlagHasLinkTargetIDList LinkFlags = 0x00000001 LinkFlagHasLinkInfo LinkFlags = 0x00000002 LinkFlagHasName LinkFlags = 0x00000004 LinkFlagHasRelativePath LinkFlags = 0x00000008 LinkFlagHasWorkingDir LinkFlags = 0x00000010 LinkFlagHasArguments LinkFlags = 0x00000020 LinkFlagHasIconLocation LinkFlags = 0x00000040 LinkFlagIsUnicode LinkFlags = 0x00000080 LinkFlagForceNoLinkInfo LinkFlags = 0x00000100 LinkFlagHasExpString LinkFlags = 0x00000200 LinkFlagRunInSeparateProcess LinkFlags = 0x00000400 LinkFlagHasDarwinID LinkFlags = 0x00001000 LinkFlagRunAsUser LinkFlags = 0x00002000 LinkFlagHasExpIconLocation LinkFlags = 0x00004000 LinkFlagNoPIDLAlias LinkFlags = 0x00008000 LinkFlagRunWithShimLayer LinkFlags = 0x00020000 LinkFlagForceNoLinkTrack LinkFlags = 0x00040000 LinkFlagEnableTargetMetadata LinkFlags = 0x00080000 LinkFlagDisableLinkPathTracking LinkFlags = 0x00100000 LinkFlagDisableKnownFolderTracking LinkFlags = 0x00200000 LinkFlagDisableKnownFolderAlias LinkFlags = 0x00400000 LinkFlagAllowLinkToLink LinkFlags = 0x00800000 LinkFlagUnaliasOnSave LinkFlags = 0x01000000 LinkFlagPreferEnvironmentPath LinkFlags = 0x02000000 LinkFlagKeepLocalIDListForUNCTarget LinkFlags = 0x04000000 )
func (LinkFlags) ActiveFlags ¶
func (LinkFlags) AllowLinkToLink ¶
func (LinkFlags) ClearAllowLinkToLink ¶
func (LinkFlags) ClearDisableKnownFolderAlias ¶
func (LinkFlags) ClearDisableKnownFolderTracking ¶
func (LinkFlags) ClearDisableLinkPathTracking ¶
func (LinkFlags) ClearEnableTargetMetadata ¶
func (LinkFlags) ClearForceNoLinkInfo ¶
func (LinkFlags) ClearForceNoLinkTrack ¶
func (LinkFlags) ClearHasArguments ¶
func (LinkFlags) ClearHasDarwinID ¶
func (LinkFlags) ClearHasExpIconLocation ¶
func (LinkFlags) ClearHasExpString ¶
func (LinkFlags) ClearHasIconLocation ¶
func (LinkFlags) ClearHasLinkInfo ¶
func (LinkFlags) ClearHasLinkTargetIDList ¶
func (LinkFlags) ClearHasName ¶
func (LinkFlags) ClearHasRelativePath ¶
func (LinkFlags) ClearHasWorkingDir ¶
func (LinkFlags) ClearIsUnicode ¶
func (LinkFlags) ClearKeepLocalIDListForUNCTarget ¶
func (LinkFlags) ClearNoPIDLAlias ¶
func (LinkFlags) ClearPreferEnvironmentPath ¶
func (LinkFlags) ClearRunAsUser ¶
func (LinkFlags) ClearRunInSeparateProcess ¶
func (LinkFlags) ClearRunWithShimLayer ¶
func (LinkFlags) ClearUnaliasOnSave ¶
func (LinkFlags) DisableKnownFolderAlias ¶
func (LinkFlags) DisableKnownFolderTracking ¶
func (LinkFlags) DisableLinkPathTracking ¶
func (LinkFlags) EnableTargetMetadata ¶
func (LinkFlags) ForceNoLinkInfo ¶
func (LinkFlags) ForceNoLinkTrack ¶
func (LinkFlags) HasArguments ¶
func (LinkFlags) HasDarwinID ¶
func (LinkFlags) HasExpIconLocation ¶
func (LinkFlags) HasExpString ¶
func (LinkFlags) HasIconLocation ¶
func (LinkFlags) HasLinkInfo ¶
func (LinkFlags) HasLinkTargetIDList ¶
func (LinkFlags) HasRelativePath ¶
func (LinkFlags) HasWorkingDir ¶
func (LinkFlags) KeepLocalIDListForUNCTarget ¶
func (LinkFlags) NoPIDLAlias ¶
func (LinkFlags) PreferEnvironmentPath ¶
func (LinkFlags) RunInSeparateProcess ¶
func (LinkFlags) RunWithShimLayer ¶
func (LinkFlags) SetAllowLinkToLink ¶
func (LinkFlags) SetDisableKnownFolderAlias ¶
func (LinkFlags) SetDisableKnownFolderTracking ¶
func (LinkFlags) SetDisableLinkPathTracking ¶
func (LinkFlags) SetEnableTargetMetadata ¶
func (LinkFlags) SetForceNoLinkInfo ¶
func (LinkFlags) SetForceNoLinkTrack ¶
func (LinkFlags) SetHasArguments ¶
func (LinkFlags) SetHasDarwinID ¶
func (LinkFlags) SetHasExpIconLocation ¶
func (LinkFlags) SetHasExpString ¶
func (LinkFlags) SetHasIconLocation ¶
func (LinkFlags) SetHasLinkInfo ¶
func (LinkFlags) SetHasLinkTargetIDList ¶
func (LinkFlags) SetHasName ¶
func (LinkFlags) SetHasRelativePath ¶
func (LinkFlags) SetHasWorkingDir ¶
func (LinkFlags) SetIsUnicode ¶
func (LinkFlags) SetKeepLocalIDListForUNCTarget ¶
func (LinkFlags) SetNoPIDLAlias ¶
func (LinkFlags) SetPreferEnvironmentPath ¶
func (LinkFlags) SetRunAsUser ¶
func (LinkFlags) SetRunInSeparateProcess ¶
func (LinkFlags) SetRunWithShimLayer ¶
func (LinkFlags) SetUnaliasOnSave ¶
func (LinkFlags) UnaliasOnSave ¶
type LinkInfoFlags ¶
type LinkInfoFlags uint32
LinkInfoFlags represents the flags in the LinkInfo section.
const ( LinkInfoFlagVolumeIDAndLocalBasePath LinkInfoFlags = 0x00000001 LinkInfoFlagCommonNetworkRelativeLink LinkInfoFlags = 0x00000002 )
func (LinkInfoFlags) ActiveFlags ¶
func (i LinkInfoFlags) ActiveFlags() []string
func (LinkInfoFlags) String ¶
func (i LinkInfoFlags) String() string
type LinkInfoHeader ¶
type LinkInfoHeader struct {
// SectionSize specifies the length of the LinkInfo field in bytes,
// including the size field.
SectionSize uint32
// HeaderSize specifies the length of the LinkInfo header in bytes.
HeaderSize uint32
// Flags specify the flags in the LinkInfo section.
Flags LinkInfoFlags
// VolumeIDOffset specifies the offset of the VolumeID field
// in bytes from the start of the LinkInfo section.
VolumeIDOffset uint32
// LocalBasePathOffset specifies the offset of the
// LocalBasePath field in bytes from the start of the
// LinkInfoSection structure.
LocalBasePathOffset uint32
// CommonNetworkRelativeLinkOffset specifies the offset of the
// CommonNetworkRelativeLink field in bytes from the start of
// the LinkInfo section.
CommonNetworkRelativeLinkOffset uint32
// CommonPathSuffixOffset specifies the offset of the
// CommonPathSuffix field in bytes from the start of the
// LinkInfo section.
CommonPathSuffixOffset uint32
// LocalBasePathOffsetUnicode specifies the location of the
// LocalBasePathUnicode field. If the
// LinkInfoFlagVolumeIDAndLocalBasePath flag is set, this value
// is an offset, in bytes, from the start of the
// LinkInfoSection structure; otherwise, this value MUST be
// zero.
//
// This field is present only if the value of the
// HeaderSize field is greater than or equal to 0x00000024.
LocalBasePathOffsetUnicode *uint32
// CommonPathSuffixOffsetUnicode specifies the location of the
// CommonPathSuffixUnicode field. This value is an offset, in
// bytes, from the start of the LinkInfoSection structure.
//
// This field is present only if the value of the
// HeaderSize field is greater than or equal to 0x00000024.
CommonPathSuffixOffsetUnicode *uint32
}
type LinkInfoSection ¶
type LinkInfoSection struct {
// Encoding specifies the character encoding used within
// the LinkInfoSection structure.
Encoding Encoding
Header LinkInfoHeader
// VolumeID specifies an optional VolumeIDSection structure that
// specifies information about the volume that the link target
// was on when the link was created.
//
// This field is present if the
// LinkInfoFlagVolumeIDAndLocalBasePath flag is set.
VolumeID *VolumeIDSection
// LocalBasePath specifies an optional string, defined by the
// system default code page, which is used to construct the
// full path to the link item or link target by appending the
// string in the CommonPathSuffix field.
//
// This field is present if the
// LinkInfoFlagVolumeIDAndLocalBasePath flag is set.
LocalBasePath *PlatformString
// CommonNetworkRelativeLink specifies an optional
// NetworkLocationSection structure that specifies
// information about the network location where the link
// target is stored.
CommonNetworkRelativeLink *NetworkLocationSection
// CommonPathSuffix is used to construct the full path to the
// link item or link target by being appended to the string in
// the LocalBasePath field.
CommonPathSuffix *PlatformString
}
type LinkTargetIDListSection ¶
type LnkFile ¶
type LnkFile struct {
// Encoding specifies the character encoding used within the LnkFile, enabling encoding and decoding operations.
Encoding Encoding
// Header represents the FileHeader containing metadata and configuration for the shortcut file.
Header FileHeader
// TargetIDList specifies the TargetIDList section.
TargetIDList *LinkTargetIDListSection
// LinkInfo specifies the LinkInfo section.
LinkInfo *LinkInfoSection
Name *PlatformString
RelativePath *PlatformString
WorkingDir *PlatformString
Arguments *PlatformString
IconLocation *PlatformString
ExtraData ExtraDataSection
}
LnkFile represents one lnk file.
type NetworkLocationFlags ¶
type NetworkLocationFlags uint32
const ( NetworkLocationFlagValidDevice NetworkLocationFlags = 0x00000001 NetworkLocationFlagValidNetType NetworkLocationFlags = 0x00000002 )
type NetworkLocationHeader ¶
type NetworkLocationHeader struct {
// SectionSize specifies the size, in bytes, of the
// [NetworkLocationSection] structure. This value
// MUST be greater than or equal to 0x00000014. All offsets
// specified in this structure MUST be less than this value,
// and all strings contained in this structure MUST fit within
// the extent defined by this size.
SectionSize uint32
// Flags specify the contents of the
// DeviceNameOffset and NetProviderType fields.
Flags NetworkLocationFlags
// NetNameOffset specifies the location of the NetName
// field. This value is an offset, in bytes, from the start of
// the [NetworkLocationSection] structure.
NetNameOffset uint32
// DeviceNameOffset specifies the location of the DeviceName
// field. If the ValidDevice flag is set, this value is an
// offset, in bytes, from the start of the
// [NetworkLocationSection] structure; otherwise,
// this value MUST be zero.
DeviceNameOffset uint32
// NetworkProviderType specifies the type of network provider.
// If the ValidNetType flag is set, this value MUST be one of
// [NetworkProviderType]; otherwise, this value MUST be ignored.
NetworkProviderType NetworkProviderType
// NetNameOffsetUnicode specifies the location of the
// NetNameUnicode field. This value is an offset, in bytes,
// from the start of the [NetworkLocationSection]
// structure.
//
// This field MUST be present if the value of the
// NetNameOffset field is greater than 0x00000014; otherwise,
// this field MUST NOT be present.
NetNameOffsetUnicode *uint32
// DeviceNameOffsetUnicode specifies the location of
// the DeviceNameUnicode field. This value is an offset, in bytes,
// from the start of the CommonNetworkRelativeLink structure.
//
// This field MUST be present if the value of the
// NetNameOffset field is greater than 0x00000014; otherwise,
// this field MUST NOT be present.
DeviceNameOffsetUnicode *uint32
}
NetworkLocationHeader represents a header describing network-relative link data.
type NetworkLocationSection ¶
type NetworkLocationSection struct {
Encoding Encoding
// Header specifies the NetworkLocationHeader structure describing properties of network-relative link data.
Header NetworkLocationHeader
// NetName a NULL–terminated string, as defined by the system
// default code page, which specifies a server share path; for
// example, "\\server\share".
NetName *PlatformString
// DeviceName a NULL–terminated string, as defined by the system
// default code page, which specifies a device; for example, the
// drive letter "D:".
DeviceName *PlatformString
}
type NetworkProviderType ¶
type NetworkProviderType uint32
const ( NetworkProviderTypeAVID NetworkProviderType = 0x001A0000 NetworkProviderTypeDOCUSPACE NetworkProviderType = 0x001B0000 NetworkProviderTypeMANGOSOFT NetworkProviderType = 0x001C0000 NetworkProviderTypeSERNET NetworkProviderType = 0x001D0000 NetworkProviderTypeRIVERFRONT1 NetworkProviderType = 0x001E0000 NetworkProviderTypeRIVERFRONT2 NetworkProviderType = 0x001F0000 NetworkProviderTypeDECORB NetworkProviderType = 0x00200000 NetworkProviderTypePROTSTOR NetworkProviderType = 0x00210000 NetworkProviderTypeFJREDIR NetworkProviderType = 0x00220000 NetworkProviderTypeDISTINCT NetworkProviderType = 0x00230000 NetworkProviderTypeTWINS NetworkProviderType = 0x00240000 NetworkProviderTypeRDR2SAMPLE NetworkProviderType = 0x00250000 NetworkProviderTypeCSCSAMPLE NetworkProviderType = 0x00260000 NetworkProviderType3IN1 NetworkProviderType = 0x00270000 NetworkProviderTypeEXTENDNET NetworkProviderType = 0x00290000 NetworkProviderTypeSTACNET NetworkProviderType = 0x002A0000 NetworkProviderTypeFOXBAT NetworkProviderType = 0x002B0000 NetworkProviderTypeYAHOO NetworkProviderType = 0x002C0000 NetworkProviderTypeEXIFST NetworkProviderType = 0x002D0000 NetworkProviderTypeDAV NetworkProviderType = 0x002E0000 NetworkProviderTypeKNOWARE NetworkProviderType = 0x002F0000 NetworkProviderTypeOBJECTDIRE NetworkProviderType = 0x00300000 NetworkProviderTypeMASFAX NetworkProviderType = 0x00310000 NetworkProviderTypeHOBNFS NetworkProviderType = 0x00320000 NetworkProviderTypeSHIVA NetworkProviderType = 0x00330000 NetworkProviderTypeIBMAL NetworkProviderType = 0x00340000 NetworkProviderTypeLOCKNET NetworkProviderType = 0x00350000 NetworkProviderTypeTERMSRV NetworkProviderType = 0x00360000 NetworkProviderTypeSRT NetworkProviderType = 0x00370000 NetworkProviderTypeQUINCY NetworkProviderType = 0x00380000 NetworkProviderTypeOPENAFS NetworkProviderType = 0x00390000 NetworkProviderTypeAVID1 NetworkProviderType = 0x003A0000 NetworkProviderTypeDFS NetworkProviderType = 0x003B0000 NetworkProviderTypeKWNP NetworkProviderType = 0x003C0000 NetworkProviderTypeZENWORKS NetworkProviderType = 0x003D0000 NetworkProviderTypeDRIVEONWEB NetworkProviderType = 0x003E0000 NetworkProviderTypeVMWARE NetworkProviderType = 0x003F0000 NetworkProviderTypeRSFX NetworkProviderType = 0x00400000 NetworkProviderTypeMFILES NetworkProviderType = 0x00410000 NetworkProviderTypeMSNFS NetworkProviderType = 0x00420000 NetworkProviderTypeGOOGLE NetworkProviderType = 0x00430000 )
type PlatformGUID ¶
PlatformGUID represents a Windows compatible GUID structure.
func (*PlatformGUID) MarshalText ¶
func (g *PlatformGUID) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*PlatformGUID) ReadFrom ¶
func (g *PlatformGUID) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom reads a PlatformGUID from the given io.Reader.
func (*PlatformGUID) String ¶
func (g *PlatformGUID) String() string
type PlatformString ¶
type PlatformString struct {
// contains filtered or unexported fields
}
func (*PlatformString) HasNarrow ¶
func (ps *PlatformString) HasNarrow() bool
func (*PlatformString) HasWideCharacter ¶
func (ps *PlatformString) HasWideCharacter() bool
func (*PlatformString) IsNull ¶
func (ps *PlatformString) IsNull() bool
func (*PlatformString) MarshalText ¶
func (ps *PlatformString) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*PlatformString) String ¶
func (ps *PlatformString) String() string
String implements the fmt.Stringer interface.
func (*PlatformString) Value ¶
func (ps *PlatformString) Value() (string, error)
Value returns the string value.
type PlatformTime ¶
type PlatformTime struct {
// contains filtered or unexported fields
}
PlatformTime represents a Windows FILETIME structure.
func (*PlatformTime) MarshalText ¶
func (pt *PlatformTime) MarshalText() ([]byte, error)
MarshalText implements the encoding.TextMarshaler interface.
func (*PlatformTime) ReadFrom ¶
func (pt *PlatformTime) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom reads a FILETIME structure from the given io.Reader.
func (*PlatformTime) String ¶
func (pt *PlatformTime) String() []byte
func (*PlatformTime) Time ¶
func (pt *PlatformTime) Time() (t time.Time)
Time converts the PlatformTime to a time.Time object.
type ShowCommand ¶
type ShowCommand uint32
ShowCommand represents the show command in the lnk header.
const ( ShowCommandHide ShowCommand = 0x00000000 ShowCommandShowNormal ShowCommand = 0x00000001 ShowCommandShowMinimized ShowCommand = 0x00000002 ShowCommandShowMaximized ShowCommand = 0x00000003 ShowCommandShowNoActivate ShowCommand = 0x00000004 ShowCommandShow ShowCommand = 0x00000005 ShowCommandShowMinimize ShowCommand = 0x00000006 ShowCommandShowMinNoActive ShowCommand = 0x00000007 ShowCommandShowNA ShowCommand = 0x00000008 ShowCommandRestore ShowCommand = 0x00000009 ShowCommandShowDefault ShowCommand = 0x0000000A ShowCommandShowForceMinimize ShowCommand = 0x0000000B )
func (ShowCommand) String ¶
func (i ShowCommand) String() string
type TextFontFamily ¶
type TextFontFamily uint32
const ( FontFamilyDontCare TextFontFamily = 0x0000 FontFamilyRoman TextFontFamily = 0x0010 FontFamilySwiss TextFontFamily = 0x0020 FontFamilyModern TextFontFamily = 0x0030 FontFamilyScript TextFontFamily = 0x0040 FontFamilyDecorative TextFontFamily = 0x0050 )
type TextFontPitch ¶
type TextFontPitch uint32
const ( PitchNone TextFontPitch = 0x00 PitchFixed TextFontPitch = 0x01 PitchVector TextFontPitch = 0x02 PitchTrueType TextFontPitch = 0x04 PitchDevice TextFontPitch = 0x08 )
type TrackerDataBlock ¶
type TrackerDataBlock struct {
Encoding Encoding
Header ExtraDataBlockHead
Length uint32
Version uint32
MachineID PlatformString
VolumeDroid PlatformGUID
FileDroid PlatformGUID
VolumeDroidBirth PlatformGUID
FileDroidBirth PlatformGUID
}
func (*TrackerDataBlock) ReadFrom ¶
func (blk *TrackerDataBlock) ReadFrom(rd io.Reader) (n int64, err error)
ReadFrom implements the io.ReaderFrom interface.
type UTF8Encoding ¶
type UTF8Encoding struct{}
func (UTF8Encoding) NewDecoder ¶
func (enc UTF8Encoding) NewDecoder() Decoder
func (UTF8Encoding) NewEncoder ¶
func (enc UTF8Encoding) NewEncoder() Encoder
type UnknownBlock ¶
type UnknownBlock struct {
Header ExtraDataBlockHead
Raw []byte
}
UnknownBlock represents an unknown extra data block in the LNK file.
type VolumeIDHeader ¶
type VolumeIDHeader struct {
// SectionSize specifies the size, in bytes, of this section. This
// value MUST be greater than 0x00000010. All offsets specified
// in this structure MUST be less than this value, and all
// strings contained in this structure MUST fit within the
// extent defined by this size.
SectionSize uint32
// DriveType specifies the type of drive the link target is
// stored on.
DriveType DriveType
// DriveSerialNumber specifies the drive serial number of
// the volume the link target is stored on.
DriveSerialNumber uint32
// VolumeLabelOffset specifies the location of a string that
// contains the volume label of the drive that the link target
// is stored on. This value is an offset, in bytes, from the
// start of the VolumeIDSection structure to a NULL-terminated
// string of characters, defined by the system's default
// code page. The volume label string is located in the Data
// field of this structure.
//
// If the value of this field is 0x14, it MUST be ignored,
// and the value of the VolumeLabelOffsetUnicode field MUST be
// used to locate the volume label string.
VolumeLabelOffset uint32
// VolumeLabelOffsetUnicode specifies the location of a string
// that contains the volume label of the drive that the
// link target is stored on. This value is an offset, in bytes,
// from the start of the [VolumeIDSection] structure to a
// NULL-terminated string of Unicode characters. The volume
// label string is located in the Data field of this structure.
//
// If the value of the VolumeLabelOffset field is not 0x00000014,
// this field MUST NOT be present; instead, the value of the
// VolumeLabelOffset field MUST be used to locate the volume
// label string.
VolumeLabelOffsetUnicode *uint32
}
type VolumeIDSection ¶
type VolumeIDSection struct {
// Encoding specifies the character encoding used within
// the LinkInfoSection structure.
Encoding Encoding
// Header represents the VolumeIDHeader structure describing the section.
Header VolumeIDHeader
// VolumeLabel contains the volume label of the drive as a
// string defined by the system default code page.
VolumeLabel *PlatformString
}
VolumeIDSection specifies information about the volume that a link target was on when the link was created. This information is useful for resolving the link if the file is not found in its original location.
Source Files
¶
- const.go
- default-encodings.go
- encoding.go
- errors.go
- extradataBlocks.go
- extradataBlocks_strings.go
- extradataConsole.go
- extradataConsoleFE.go
- extradataEnvVar.go
- extradataIconEnv.go
- extradataSection.go
- extradataTracker.go
- extradataUnknown.go
- file.go
- fileheader.go
- fileheader_strings.go
- io.go
- linkinfo.go
- linkinfo_strings.go
- network.go
- platformguid.go
- platformstring.go
- platformstring_strings.go
- platformtime.go
- targetIDList.go
- volumeid.go
- volumeid_strings.go