Partager via


ScRelocProps

This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Adjusts the pointers in an SPropValue array after the array and its data have been copied or moved to a new location.

Header file:

Mapidefs.h

Implemented by:

MAPI

Called by:

Client applications and service providers

SCODE ScRelocProps(
  int cprop,
  LPSPropValue rgprop,
  LPVOID pvBaseOld,
  LPVOID pvBaseNew,
  ULONG FAR * pcb
);

Parameters

  • cprop
    [in] Count of properties in the array pointed to by the rgprop parameter.

  • rgprop
    [in] Pointer to an array of SPropValue structures for which pointers are to be adjusted.

  • pvBaseOld
    [in] Pointer to the original base address of the array pointed to by the rgprop parameter.

  • pvBaseNew
    [in] Pointer to the new base address of the array pointed to by the rgprop parameter.

  • pcb
    [in, out] Optional pointer to the size, in bytes, of the array indicated by the pvBaseNew parameter. If not NULL, the pcb parameter is set to the number of bytes stored in the pvD parameter.

Return Value

  • S_OK
    Pointers were adjusted successfully.

  • MAPI_E_INVALID_PARAMETER
    One or both parameters were invalid, or an unknown property type was encountered.

Remarks

The ScRelocProps function operates on the assumption that the property value array for which pointers are adjusted was originally allocated in a single call similar to a call to the ScCopyProps function. If a client application or service provider is working with a property value that is built from disjointed blocks of memory, it should use ScCopyProps to copy properties instead.

ScRelocProps is used to maintain the validity of pointers in an SPropValue array. To maintain pointers' validity when writing such an array to and reading it from a disk, perform the following operations:

  1. Before writing the array and data to a disk, call ScRelocProps on the array with the pvBaseNew parameter pointing to some standard value zero, for instance.

  2. After reading the array and data from a disk, call ScRelocProps on the array with the pvBaseOld parameter equal to the same standard value used in Step 1. The array and data must be read into a buffer created with a single allocation.

  3. The pcb parameter to ScRelocProps is optional.

See Also

Reference

MAPIAllocateBuffer

ScCountProps

ScDupPropset

ScRelocNotifications