Tallan Blog

Tallan’s Experts Share Their Knowledge on Technology, Trends and Solutions to Business Challenges

SharePoint 2010 Crawled Property Variant Type Codes


Ever have to deal with Crawled Properties in PowerShell, or look through FAST Search FFDumper logs and try to figure out what the type numbers mean?  I have found a couple of random blog posts that cover some, but not all of them, and I’ve tried to find a definitive list.

I finally came across a TechNet page for the New-FASTSearchMetadataCrawledProperty FAST PowerShell command, which lists this page as the source of the Variant Type codes:


From that page (for posterity’s sake):

Propvariant type Code Propvariant member Value representation
VT_EMPTY 0 None A property with a type indicator of VT_EMPTY has no data associated with it; that is, the size of the value is zero.
VT_NULL 1 None This is like a pointer to NULL.
VT_I1 16 cVal 1-byte signed integer.
VT_UI1 17 bVal 1-byte unsigned integer.
VT_I2 2 iVal Two bytes representing a 2-byte signed integer value.
VT_UI2 18 uiVal 2-byte unsigned integer.
VT_I4 3 lVal 4-byte signed integer value.
VT_UI4 19 ulVal 4-byte unsigned integer.
VT_INT 22 intVal 4-byte signed integer value (equivalent to VT_I4).
VT_UINT 23 uintVal 4-byte unsigned integer (equivalent to VT_UI4).
VT_I8 20 hVal 8-byte signed integer.
VT_UI8 21 uhVal 8-byte unsigned integer.
VT_R4 4 fltVal 32-bit IEEE floating point value.
VT_R8 5 dblVal 64-bit IEEE floating point value.
VT_BOOL 11 boolVal (bool in earlier designs) Boolean value, a WORD that contains 0 (FALSE) or -1 (TRUE).
VT_ERROR 10 scode A DWORD that contains a status code.
VT_CY 6 cyVal 8-byte two’s complement integer (scaled by 10,000). This type is commonly used for currency amounts.
VT_DATE 7 date A 64-bit floating point number representing the number of days (not seconds) since December 31, 1899. For example, January 1, 1900, is 2.0, January 2, 1900, is 3.0, and so on). This is stored in the same representation as VT_R8.
VT_FILETIME 64 filetime 64-bit FILETIME structure as defined by Win32. It is recommended that all times be stored in Universal Coordinate Time (UTC).
VT_CLSID 72 puuid Pointer to a class identifier (CLSID) (or other globally unique identifier (GUID)).
VT_CF 71 pclipdata Pointer to a CLIPDATA structure, described above.
VT_BSTR 8 bstrVal Pointer to a null-terminated Unicode string. The string is immediately preceded by a DWORD representing the byte count, but bstrVal points past this DWORD to the first character of the string. BSTRs must be allocated and freed using the Automation SysAllocString and SysFreeString calls.
VT_BSTR_BLOB 0xfff bstrblobVal For system use only.
VT_BLOB 65 blob DWORD count of bytes, followed by that many bytes of data. The byte count does not include the four bytes for the length of the count itself; an empty blob member would have a count of zero, followed by zero bytes. This is similar to the value VT_BSTR, but does not guarantee a null byte at the end of the data.
VT_BLOBOBJECT 70 blob A blob member that contains a serialized object in the same representation that would appear in VT_STREAMED_OBJECT. That is, a DWORD byte count (where the byte count does not include the size of itself) which is in the format of a class identifier followed by initialization data for that class.The only significant difference between VT_BLOB_OBJECT and VT_STREAMED_OBJECT is that the former does not have the system-level storage overhead that the latter would have, and is therefore more suitable for scenarios involving numbers of small objects.
VT_LPSTR 30 pszVal A pointer to a null-terminated ANSI string in the system default code page.
VT_LPWSTR 31 pwszVal A pointer to a null-terminated Unicode string in the user default locale.
VT_UNKNOWN 13 punkVal New.
VT_DISPATCH 9 pdispVal New.
VT_STREAM 66 pStream A pointer to an IStream interface that represents a stream which is a sibling to the “Contents” stream.
VT_STREAMED_OBJECT 68 pStream As in VT_STREAM, but indicates that the stream contains a serialized object, which is a CLSID followed by initialization data for the class. The stream is a sibling to the “Contents” stream that contains the property set.
VT_STORAGE 67 pStorage A pointer to an IStorage interface, representing a storage object that is a sibling to the “Contents” stream.
VT_STORED_OBJECT 69 pStorage As in VT_STORAGE, but indicates that the designated IStorage contains a loadable object.
VT_VERSIONED_STREAM 73 pVersionedStream A stream with a GUID version.
VT_DECIMAL 14 decVal A DECIMAL structure.
VT_VECTOR 0x1000 ca* If the type indicator is combined with VT_VECTOR by using an OR operator, the value is one of the counted array values. This creates a DWORD count of elements, followed by a pointer to the specified repetitions of the value.For example, a type indicator of VT_LPSTR|VT_VECTOR has a DWORD element count, followed by a pointer to an array of LPSTR elements.VT_VECTOR can be combined by an OR operator with the following types: VT_I1, VT_UI1, VT_I2, VT_UI2, VT_BOOL, VT_I4, VT_UI4, VT_R4, VT_R8, VT_ERROR, VT_I8, VT_UI8, VT_CY, VT_DATE, VT_FILETIME, VT_CLSID, VT_CF, VT_BSTR, VT_LPSTR, VT_LPWSTR, and VT_VARIANT. VT_VECTOR can also be combined by an OR operation with VT_BSTR_BLOB, however it is for system use only.
VT_ARRAY 0x2000 Parray If the type indicator is combined with VT_ARRAY by an OR operator, the value is a pointer to a SAFEARRAY. VT_ARRAY can use the OR with the following data types: VT_I1, VT_UI1, VT_I2, VT_UI2, VT_I4, VT_UI4, VT_INT, VT_UINT, VT_R4, VT_R8, VT_BOOL, VT_DECIMAL, VT_ERROR, VT_CY, VT_DATE, VT_BSTR, VT_DISPATCH, VT_UNKNOWN, and VT_VARIANT. VT_ARRAY cannot use OR with VT_VECTOR.
VT_BYREF 0x4000 p* If the type indicator is combined with VT_BYREF by an OR operator, the value is a reference. Reference types are interpreted as a reference to data, similar to the reference type in C++ (for example, “int&”).VT_BYREF can use OR with the following types: VT_I1, VT_UI1, VT_I2, VT_UI2, VT_I4, VT_UI4, VT_INT, VT_UINT, VT_R4, VT_R8, VT_BOOL, VT_DECIMAL, VT_ERROR, VT_CY, VT_DATE, VT_BSTR, VT_UNKNOWN, VT_DISPATCH, VT_ARRAY, and VT_VARIANT.
VT_VARIANT 12 capropvar A DWORD type indicator followed by the corresponding value. VT_VARIANT can be used only with VT_VECTOR or VT_BYREF.
VT_TYPEMASK 0xFFF Â Used as a mask for VT_VECTOR and other modifiers to extract the raw VT value.


Share this post:

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>