When HasLinkTargetIDList is set, this structure follows the header. It holds the target as an item ID list, the shell’s own way of naming a location.
Structure
0IDListSize the size of the IDList that follows22ItemID a two-byte size, then that many bytes less twovaries…more ItemIDsvaries…TerminalID two zero bytes2
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | u16 | IDListSize | The size in bytes of the IDList field. |
| variable | IDList | IDList | Zero or more ItemIDs, then the TerminalID. |
ItemID
| Size | Type | Name | Description |
|---|---|---|---|
| 2 | u16 | ItemIDSize | The size of this ItemID in bytes, these two bytes included. |
| variable | bytes | Data | The contents of the item. MS-SHLLINK treats these as opaque. |
An ItemIDSize of zero is the TerminalID, which ends the list.
What the Data holds depends on the shell folder that made the item, and is not part of MS-SHLLINK. The shell items page describes the common kinds.
Rebuilding the path
The items name the target one step at a time, from the outermost folder inwards, so the
path is the names joined with backslashes. The viewer builds it like this: a root folder
item contributes its shell folder’s name (the Computer folder is dropped when a volume
item follows, as it is implied); a volume item contributes the drive, C:; a
file entry contributes its long name, taken from the 0xBEEF0004 block on
Windows XP and later, or the primary name on earlier systems (where it is the long name
when there is one); a network item contributes its share or server. Names of items that
are not folders on disk, such as the Recycle Bin, are written in angle brackets.
The path from the items and the path in LinkInfo
are separate records and can disagree. The viewer shows the LinkInfo path as the target and the
path from the items on its own row when they differ. Across the 171 distinct real
shortcuts checked, 114 agree exactly (or have no LinkInfo) and 56 differ only in the
earlier components, never in the file name. The differences seen are of three kinds: the
items start below a special folder, such as the Desktop, so the path is relative to it
(E-Flyer research\Development\… against C:\Documents and
Settings\Work\Desktop\E-Flyer research\Development\…); the items keep the folder
names’ real case where LinkInfo has the upper-case form older systems stored
(I:\Text\Info against I:\TEXT\INFO); and a mapped network drive
appears as a drive letter in the items but as a share path in LinkInfo
(Y:\Html against \\CHUHOME\E_L\LK213\HTML).