IReplObjHandler::GetPacket

This method is implemented by the ActiveSync service provider to deserialize an object into one or more packets. These packets are sent between the Windows CE–based device and the desktop computer by the ActiveSync service provider.

At a Glance

Header file: Cesync.h
Windows CE versions: 2.0 and later

Syntax

HRESULT GetPacket( LPBYTE *lppbData, DWORD *pcbData,
DWORD cbRecommend );

Parameters

lppbData

Long pointer to a pointer of the outgoing packet.

pcbData

Pointer to a DWORD for the packet size.

cbRecommend

Recommended maximum size of the packet.

Return Values

One of the values described in the following table is returned.

Value Description
NOERROR The operation successfully created one packet.
RERR_BAD_OBJECT The operation failed to create one object. If the receiver does receive some of the earlier packets, they should be discarded.
RWRN_LAST_PACKET A packet was successfully created, and it is the last one for the object.

Remarks

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 the sizes of each packet. For efficiency, a packet size is recommended to be less than 8,000 bytes in size.

Allocation and deallocation of memory for the packet is 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.

See Also

IReplObjHandler::SetPacket