3.2.2 Property Name to Property ID
If a property name is specified, the data inside the named property mapping storage is used to determine the property ID of the property. The method differs slightly for string named properties and numerical named properties.
If the property name specified is the following:
GUID = {0x00062003, 0x0000, 0x0000, {0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46}}
Name identifier = 0x811C
Kind = 0
First the GUID is examined to compute the GUID index, as described in section 2.2.3.2.1.
In this example, the GUID was found in the second position in the GUID stream, so its GUID index will be 0x04.
Then, the stream ID is calculated using the stream ID equation for numerical named properties:
0x1000 + (name identifier XOR (GUID index << 1)) MOD 0x1F
= 0x1000 + (0x811C XOR (0x04 << 1)) MOD 0x1F
= 0x1000 + (0x811C XOR 0x08) MOD 0x1F
= 0x1000 + 0x8114 MOD 0x1F
= 0x1000 + 0x1D
= 0x101D
Then, the hexadecimal identifier is generated as follows:
stream ID << 16 | 0x00000102
= 0x101D << 16 | 0x00000102
= 0x101D0102
The stream name is generated by concatenating "__substg1.0_" and the hexadecimal identifier. Therefore, the stream name is "__substg1.0_101D0102".
The data inside the stream is an array of 8-byte entries, each with the structure described in section 2.2.3.2.4. One of those entries maps to the named property in question and can be found by comparing the name identifier of the named property with that fetched from the stream. In this example, the stream "__substg1.0_101D0102" has the following contents:
1C 81 00 00 08 00 05 00 15 85 00 00 06 00 40 00 34 85 00 00 06 00 4A 00 A8 85 00 00 06 00 70 00
The structure described in section 2.2.3.2.4 is applied to these bytes to obtain the following entries.
|
Serial # |
Name identifier |
Property index |
GUID index |
Property Kind |
|
1 |
0x811C |
0x05 |
0x04 |
0 |
|
2 |
0x8515 |
0x40 |
0x03 |
0 |
|
3 |
0x8534 |
0x4A |
0x03 |
0 |
|
4 |
0x85A8 |
0x70 |
0x03 |
0 |
The entry corresponding to the named property in question is number 1 because the name identifier from the stream is equal to the property's name identifier.
The property ID is then computed as follows:
0x8000 + property index
= 0x8000 + 0x05
= 0x8005