IAssociationArray

IID_IAssociationArray {3B877E3C-67DE-4F9A-B29B-17D0A1521C6A} original
{19ADBAFD-1C5F-4FC7-94EE-846702DFB58B} revised

The original IAssociationArray methods are (as ordered in the virtual function table after the IUnknown methods):

Offset Method
0x0C EnumElements
0x10 QueryString
0x14 QueryDword
0x18 QueryExists
0x1C QueryDirect
0x20 QueryObject

with prototypes;

HRESULT EnumElements (ULONG, IEnumAssociationElements **);
HRESULT QueryString (ULONG, ASSOCQUERY, PCWSTR, PWSTR *);
HRESULT QueryDword (ULONG, ASSOCQUERY, PCWSTR, DWORD *);
HRESULT QueryExists (ULONG, ASSOCQUERY, PCWSTR);
HRESULT QueryDirect (ULONG, ASSOCQUERY, PCWSTR, FLAGGED_BYTE_BLOB **);
HRESULT QueryObject (ULONG, ASSOCQUERY, PCWSTR, REFIID, PVOID *);

in which IEnumAssociationElements is an undocumented interface and ASSOCQUERY is invented as a typedef for an undocumented enumeration:

typedef enum tagASSOCQUERY ASSOCQUERY; 

The revision deletes one method, inserts another, and removes the first argument from each of the remaining methods.

Offset Method
0x0C QueryString
0x10 QueryDword
0x14 QueryGuid
0x18 QueryExists
0x1C QueryDirect
0x20 QueryObject

with prototypes:

HRESULT QueryString (ASSOCQUERY, PCWSTR, PWSTR *);
HRESULT QueryDword (ASSOCQUERY, PCWSTR, DWORD *);
HRESULT QueryGuid (ASSOCQUERY, PCWSTR, GUID *);
HRESULT QueryExists (ASSOCQUERY, PCWSTR);
HRESULT QueryDirect (ASSOCQUERY, PCWSTR, FLAGGED_BYTE_BLOB **);
HRESULT QueryObject (ASSOCQUERY, PCWSTR, REFIID, PVOID *);

Note that the revision leaves IAssociationArray having exactly the same methods as the (revised) IAssociationElement interface which was simultaneously brought to SHELL32 from SHLWAPI. This is much the better design since it models well that to query the association array is just to query multiple elements as if to have queried whichever one element happens to provide the answer.

Availability

The IAssociationArray interface is implemented in SHELL32.DLL version 6.00 and higher. The revision begins with the version 6.00 from Windows Vista.

Though this interface dates from 2001, it was still not documented by Microsoft as late as the January 2007 edition of the Windows Vista Software Development Kit (SDK).