Sample Dictionary

The stock market data transfer example (see  Transferring Data Contained in Property Sets,  in the Storage chapter of this Guide) might include a displayable name of  Stock Quote  for the entire set, and  Ticker Symbol  for PID_SYMBOL. If a property set contained just a symbol and the dictionary, the property set section would have a byte stream that looked like the following:

Offset     Bytes

; Start of section

0000    5C 01 00 00    ; DWORD size of section

0004    04 00 00 00    ; DWORD number of properties in section

 

; Start of PropID/Offset pairs

0008    01 00 00 00    ; DWORD Property ID (1 == code page)

000C    28 00 00 00    ; DWORD offset to property ID

0010    00 00 00 80    ; DWORD Property ID (0x80000000 == locale

                                                  ID)

0014    30 00 00 00    ; DWORD offset to property ID

0018    00 00 00 00    ; DWORD Property ID (0 == dictionary)

001C    38 00 00 00    ; DWORD offset to property ID

0020    07 00 00 00    ; DWORD Property ID (3 == PID_SYMBOL)

0024    5C 01 00 00    ; DWORD offset to property ID

 

; Start of Property 1 (code page)

0028    01 00 00 00    ; DWORD type indicator (VT_12)

002C    B0 04          ; USHORT codepage (0x04b0 == 1200 ==

                                                unicode)

002E    00 00          ; Pad to 32-bit boundary

 

; Start of Property 0x80000000 (Local ID)

0030    13 00 00 00    ; DWORD type indicator (VT_U14)

0034    09 04 00 00    ; ULONG locale ID (0x0409 == American

                                               English)

 

; Start of Property 0 (the dictionary)

0038    08 00 00 00    ; DWORD number of entries in dictionary

                            (Note:  No type indicator)

003C    00 00 00 00    ; DWORD propid == 0 (the dictionary)

0040    0C 00 00 00    ; DWORD cch == wcslen(L Stock Quote ) +

                              sizeof(L \0 ) == 12

0044    L Stock Quote  ; wchar_t wsz(12)

005C    05 00 00 00    ; DWORD propid == 5 (PID_HIGH)

0060    0B 00 00 00    ; DWORD cch == wcslen(L High Price ) +

                              sizeof(L \0 ) == 11

0064    L High Price\0 ; wchar_t wsz(11)

007A    00 00          ; padding for 32-bit alignment (necessary

                           because the codepage is unicode)

007C    07 00 00 00    ; DWORD propid == 7 (PID_SYMBOL)

0080    0E 00 00 00    ; DWORD cch - wcslen(L Ticker Symbol\0 )

                           == 14

0084    L Ticker Symbol\0  ; wchar_t wsz(14)

 

//The dictionary would continue, but may not contain entries

   //for every possible property, and may contain entries for

   //properties that are not present. Also, entries need not be in

   //order.