The IAddrBook::CompareEntryIDs method compares two entry identifiers belonging to a particular address book provider to determine if they refer to the same address book object.
HRESULT CompareEntryIDs(
ULONG cbEntryID1,
LPENTRYID lpEntryID1,
ULONG cbEntryID2,
LPENTRYID lpEntryID2,
ULONG ulFlags,
ULONG FAR * lpulResult
);
Client applications and service providers call the IAddrBook::CompareEntryIDs method to compare two entry identifiers belonging to a single address book provider to determine if they refer to the same object. CompareEntryIDs is useful because an object can have more than one valid entry identifier; such a situation can occur, for example, after a new version of an address book provider is installed.
MAPI passes this call on to the address book provider responsible for the entry identifiers, determining the appropriate provider by matching the MAPIUID structure in the entry identifiers with the MAPIUID structure registered by the provider.
If the two entry identifiers refer to the same object, then CompareEntryIDs sets the contents of the lpulResult parameter to TRUE; if they refer to different objects, CompareEntryIDs sets it to FALSE. In either case, CompareEntryIDs returns S_OK. If CompareEntryIDs returns an error, which can occur if no address book provider has registered a MAPIUID structure that matches the one in the entry identifiers, clients and providers should not take any action based on the result of the comparison. They should instead take the most conservative approach to the action being performed.