The ActiveSync service provider implements GetPacket to deserialize an object into one or more packets. These packets are sent between the Windows CE device and the desktop by the ActiveSync service provider.
HRESULT GetPacket(
LPBYTE *lppbData,
DWORD *pcbData,
DWORD cbRecommend
);
Header file: | Cesync.h |
Platforms: | H/PC |
Windows CE versions: | 2.0 and later |
During a deserialization of an object, the ActiveSync service manager calls the IReplObjHandler::GetPacket method continuously until RWRN_LAST_OBJECT or an error value is returned. The ActiveSync service provider determines how many packets are to be sent and what are the sizes of each packet. As a guideline for efficiency, a packet size is recommended to be less than 8000 bytes in size.
Allocation and deallocation of memory for the packet is totally the responsibility of the ActiveSync service provider. An ActiveSync service provider sets lppbData to that pointer and sets pcbData with the packet size. Typically, an ActiveSync service provider allocates a piece of memory of a known size in IReplObjHandler::Setup and frees it in IReplObjHandler::Reset.