IReplObjHandler::GetPacket

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This method is a user-implemented method that serializes an object into one or more packets for transmission between the Windows Embedded CEā€“based device and the desktop computer.

Syntax

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

Parameters

  • lppbData
    [in] Long pointer to a pointer of the outgoing packet.
  • pcbData
    [in] Pointer to a DWORD for the packet size.
  • cbRecommend
    [in] Recommended maximum size of the packet.

Return Value

The following table shows the possible returns values for this method.

Value Description

NOERROR

The operation 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.

RERR_TRY_AGAIN

The operation failed to create an object. The server should try again later to replicate the object.

RERR_VOL_INACTIVE

The volume has become inactive.

RWRN_LAST_PACKET

A packet was created, and it is the last one for the object.

Remarks

During deserialization, the ActiveSync manager calls GetPacket repeatedly 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, packet size is recommended to be less than 8KB.

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.

Requirements

Header cesync.h
Library coredll.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

IReplObjHandler::Reset
IReplObjHandler::SetPacket