The IReplStore::FindFirstItem method returns a new handle to the first object in a given folder, if there is any.
HRESULT FindFirstItem(
HREPLFLD hFolder,
HREPLITEM *phItem,
BOOL * pfExist
);
Header file: | Cesync.h |
Platforms: | H/PC |
Windows CE versions: | 2.0 and later |
The IReplStore::FindFirstItem method works together with FindNextItem and FindItemClose to enumerate all items in a given folder. FindFirstItem and FindNextItem are the only methods in IReplStore that can create HREPLITEM for the items. All HREPLITEM structures passed by the ActiveSync service manager are guaranteed to be originally created from these two methods. It's possible that, before FindItemClose is called, a different thread calls methods like DeleteObject that write to the store. Thus, it's important for the ActiveSync service provider to have some sort of thread synchronization between this method and the methods that write to the store. A typical ActiveSync service provider would use critical section to make sure that, during the time between calls to FindFirstItem and FindItemClose, no write to the store is permitted.
HREPLITEM, IReplStore::FindNextItem, IReplStore::FindItemClose