Most noticeable change: replacement of SPropValue with PropertyValue_r, SRowSet with PropertyRowSet_r
Custom handling of ExtendedException
New properties added
Improvement of provisioning code
# mapiproxy servers
####################
provision-install: python-install
+ $(INSTALL) -d $(DESTDIR)$(sbindir)
+ $(INSTALL) -m 0755 setup/openchange_provision $(DESTDIR)$(sbindir)/
+ $(INSTALL) -m 0755 setup/openchange_newuser $(DESTDIR)$(sbindir)/
$(INSTALL) -d $(DESTDIR)$(datadir)/setup/AD
$(INSTALL) -m 0644 setup/AD/oc_provision* $(DESTDIR)$(datadir)/setup/AD/
$(INSTALL) -m 0644 setup/AD/prefixMap.txt $(DESTDIR)$(datadir)/setup/AD/
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
+sbindir=@sbindir@
libdir=@libdir@
modulesdir=@modulesdir@
datarootdir=@datarootdir@
[size_is(cValues)] uint32 *lpl;
} LongArray_r;
- typedef struct {
- [range(0,100000)] uint32 cValues;
- [size_is(cValues)] dlong *lpi8;
- } I8Array_r;
-
typedef struct {
[range(0,100000)] uint32 cValues;
[size_is(cValues)] Binary_r *lpbin;
typedef [switch_type(uint32)] union {
[case(PT_I2)] uint16 i;
[case(PT_LONG)] uint32 l;
- [case(PT_DOUBLE)] dlong dbl;
[case(PT_BOOLEAN)] uint8 b;
- [case(PT_I8)] dlong d;
[case(PT_STRING8)][unique][string,charset(DOS)] uint8 *lpszA;
+ [case(PT_UNICODE)][string,charset(UTF16)] uint16 *lpszW;
[case(PT_BINARY)] Binary_r bin;
[case(PT_SVREID)] Binary_r bin;
- [case(PT_UNICODE)][string,charset(UTF16)] uint16 *lpszW;
[case(PT_CLSID)] FlatUID_r *lpguid;
[case(PT_SYSTIME)] FILETIME ft;
[case(PT_ERROR)] MAPISTATUS err;
[case(PT_MV_I2)] ShortArray_r MVi;
[case(PT_MV_LONG)] LongArray_r MVl;
- [case(PT_MV_I8)] I8Array_r MVi8;
[case(PT_MV_STRING8)] StringArray_r MVszA;
[case(PT_MV_BINARY)] BinaryArray_r MVbin;
[case(PT_MV_CLSID)] FlatUIDArray_r MVguid;
[case(PT_MV_UNICODE)] StringArrayW_r MVszW;
[case(PT_MV_SYSTIME)] DateTimeArray_r MVft;
[case(PT_NULL)] uint32 null;
- [case(PT_OBJECT)] uint32 object;
- } SPropValue_CTR;
+ } PROP_VAL_UNION;
typedef [public]struct {
MAPITAGS ulPropTag;
uint32 dwAlignPad;
- [switch_is(ulPropTag & 0xFFFF)] SPropValue_CTR value;
- } SPropValue;
+ [switch_is(ulPropTag & 0xFFFF)] PROP_VAL_UNION value;
+ } PropertyValue_r;
typedef struct {
- uint32 ulAdrEntryPad;
- [range(0,100000)] uint32 cValues;
- [size_is(cValues)]SPropValue *lpProps;
- } SRow;
-
+ uint32 Reserved;
+ [range(0,100000)] uint32 cValues;
+ [size_is(cValues)] PropertyValue_r *lpProps;
+ } PropertyRow_r;
typedef [public] struct {
[range(0,100000)] uint32 cRows;
- [size_is(cRows)] SRow aRow[];
- } SRowSet;
+ [size_is(cRows)] PropertyRow_r aRow[];
+ } PropertyRowSet_r;
typedef struct {
[range(0,100000)] uint32 cRes;
typedef struct {
uint32 ulFuzzyLevel;
MAPITAGS ulPropTag;
- SPropValue *lpProp;
+ PropertyValue_r *lpProp;
} ContentRestriction_r;
typedef struct {
uint32 relop;
MAPITAGS ulPropTag;
- SPropValue *lpProp;
+ PropertyValue_r *lpProp;
} PropertyRestriction_r;
typedef struct {
[switch_is(rt)] RestrictionUnion_r res;
} Restriction_r;
+
+ /* Note:
+ Those structs are used only internally by libmapi, the server code
+ and the backend code, in order to provide 32 bits lengths to
+ certain members (contrarily to mapi_SPropValue) and enable
+ type-independence between different operations.
+ They are derived from the PropertyValue_r/Row_r/RowSet_r structs
+ and enhance them with certain types that are absent from NSPI and
+ would otherwise break the data alignment on wire operations.
+ However, they must be defined here as they make use of the same array types. */
+
+ typedef [nopush,nopull,noprint] struct {
+ [range(0,100000)] uint32 cValues;
+ [size_is(cValues)] dlong *lpi8;
+ } I8Array_r;
+
+ typedef [switch_type(uint32),nopush,nopull,noprint] union {
+ [case(PT_I2)] uint16 i;
+ [case(PT_LONG)] uint32 l;
+ [case(PT_DOUBLE)] double dbl;
+ [case(PT_BOOLEAN)] uint8 b;
+ [case(PT_I8)] dlong d;
+ [case(PT_STRING8)][unique][string,charset(DOS)] uint8 *lpszA;
+ [case(PT_BINARY)] Binary_r bin;
+ [case(PT_SVREID)] Binary_r bin;
+ [case(PT_UNICODE)][string,charset(UTF16)] uint16 *lpszW;
+ [case(PT_CLSID)] FlatUID_r *lpguid;
+ [case(PT_SYSTIME)] FILETIME ft;
+ [case(PT_ERROR)] MAPISTATUS err;
+ [case(PT_MV_I2)] ShortArray_r MVi;
+ [case(PT_MV_LONG)] LongArray_r MVl;
+ [case(PT_MV_I8)] I8Array_r MVi8;
+ [case(PT_MV_STRING8)] StringArray_r MVszA;
+ [case(PT_MV_BINARY)] BinaryArray_r MVbin;
+ [case(PT_MV_CLSID)] FlatUIDArray_r MVguid;
+ [case(PT_MV_UNICODE)] StringArrayW_r MVszW;
+ [case(PT_MV_SYSTIME)] DateTimeArray_r MVft;
+ [case(PT_NULL)] uint32 null;
+ [case(PT_OBJECT)] uint32 object;
+ } SPropValue_CTR;
+
+ typedef [public,noprint,nopush,nopull] struct {
+ MAPITAGS ulPropTag;
+ uint32 dwAlignPad;
+ [switch_is(ulPropTag & 0xFFFF)] SPropValue_CTR value;
+ } SPropValue;
+
+ typedef [public,noprint,nopush,nopull] struct {
+ uint32 ulAdrEntryPad;
+ [range(0,100000)] uint32 cValues;
+ [size_is(cValues)]SPropValue *lpProps;
+ } SRow;
+
+ typedef [public,noprint,nopush,nopull] struct {
+ [range(0,100000)] uint32 cRows;
+ [size_is(cRows)] SRow aRow[];
+ } SRowSet;
+ /* /internal types */
+
/*****************/
/* Function 0x00 */
typedef [bitmap32bit] bitmap {
[in,unique,size_is(dwETableCount)] uint32 *lpETable,
[in] uint32 Count,
[in,unique] SPropTagArray *pPropTags,
- [out] SRowSet **ppRows
+ [out] PropertyRowSet_r **ppRows
);
/*****************/
[in] policy_handle *handle,
[in] uint32 Reserved,
[in,out] STAT *pStat,
- [in] SPropValue *pTarget,
+ [in] PropertyValue_r *pTarget,
[in,unique] PropertyTagArray_r *lpETable,
[in,unique] SPropTagArray *pPropTags,
- [out] SRowSet **pRows
+ [out] PropertyRowSet_r **pRows
);
/*****************/
[in] uint32 ulRequested,
[out] PropertyTagArray_r **ppOutMIds,
[in][unique] SPropTagArray *pPropTags,
- [out] SRowSet **ppRows
+ [out] PropertyRowSet_r **ppRows
);
/*****************/
[in] uint32 dwFlags,
[in] STAT *pStat,
[in,unique] SPropTagArray *pPropTags,
- [out] SRow **ppRows
+ [out] PropertyRow_r **ppRows
);
/*****************/
[in] uint32 Reserved,
[in] STAT *pStat,
[in,unique] SPropTagArray *pPropTags,
- [in] SRow *pRow
+ [in] PropertyRow_r *pRow
);
/*****************/
[in] NspiGetSpecialTable_dwFlags dwFlags,
[in] STAT *pStat,
[in,out] uint32 *lpVersion,
- [out] SRowSet **ppRows
+ [out] PropertyRowSet_r **ppRows
);
/*******************/
[in,unique,string,charset(DOS)] uint8 *pDN,
[in] uint32 dwCodePage,
[in] uint32 dwLocaleID,
- [out] SRow **ppData
+ [out] PropertyRow_r **ppData
);
/*******************/
[in,unique] SPropTagArray *pPropTags,
[in] StringsArray_r *paStr,
[out] PropertyTagArray_r **ppMIds,
- [out] SRowSet **ppRows
+ [out] PropertyRowSet_r **ppRows
);
/*****************/
[in,unique] SPropTagArray *pPropTags,
[in] StringsArrayW_r *paWStr,
[out] PropertyTagArray_r **ppMIds,
- [out] SRowSet **ppRows
+ [out] PropertyRowSet_r **ppRows
);
}
{
void unknown_dummy();
}
-
_PUBLIC_ enum MAPISTATUS ResolveNames(struct mapi_session *session,
const char **usernames,
struct SPropTagArray *props,
- struct SRowSet **rowset,
+ struct PropertyRowSet_r **rowset,
struct PropertyTagArray_r **flaglist,
uint32_t flags)
{
*/
_PUBLIC_ enum MAPISTATUS GetGALTable(struct mapi_session *session,
struct SPropTagArray *SPropTagArray,
- struct SRowSet **SRowSet,
+ struct PropertyRowSet_r **rowsetp,
uint32_t count,
uint8_t ulFlags)
{
TALLOC_CTX *mem_ctx;
struct nspi_context *nspi;
- struct SRowSet *srowset;
+ struct PropertyRowSet_r *rowset;
enum MAPISTATUS retval;
/* Sanity checks */
OPENCHANGE_RETVAL_IF(!session, MAPI_E_SESSION_LIMIT, NULL);
OPENCHANGE_RETVAL_IF(!session->nspi, MAPI_E_SESSION_LIMIT, NULL);
OPENCHANGE_RETVAL_IF(!session->nspi->ctx, MAPI_E_SESSION_LIMIT, NULL);
- OPENCHANGE_RETVAL_IF(!SRowSet, MAPI_E_INVALID_PARAMETER, NULL);
+ OPENCHANGE_RETVAL_IF(!rowsetp, MAPI_E_INVALID_PARAMETER, NULL);
OPENCHANGE_RETVAL_IF(!SPropTagArray, MAPI_E_INVALID_PARAMETER, NULL);
mem_ctx = talloc_named(session, 0, "GetGALTable");
nspi->pStat->TotalRecs = 0xffffffff;
}
- srowset = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi, mem_ctx, SPropTagArray, NULL, count, &srowset);
- srowset = talloc_steal(session, srowset);
- *SRowSet = srowset;
+ rowset = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi, mem_ctx, SPropTagArray, NULL, count, &rowset);
+ rowset = talloc_steal(session, rowset);
+ *rowsetp = rowset;
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
talloc_free(mem_ctx);
TALLOC_CTX *mem_ctx;
struct nspi_context *nspi;
enum MAPISTATUS retval;
- struct SRowSet *srowset;
+ struct PropertyRowSet_r *rowset;
/* Sanity Checks */
OPENCHANGE_RETVAL_IF(!session, MAPI_E_SESSION_LIMIT, NULL);
nspi->pStat->NumPos = 0;
nspi->pStat->TotalRecs = 0xffffffff;
- srowset = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi, mem_ctx, NULL, NULL, 0, &srowset);
+ rowset = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi, mem_ctx, NULL, NULL, 0, &rowset);
*totalRecs = nspi->pStat->TotalRecs;
_PUBLIC_ enum MAPISTATUS GetABRecipientInfo(struct mapi_session *session,
const char *username,
struct SPropTagArray *pPropTags,
- struct SRowSet **ppRowSet)
+ struct PropertyRowSet_r **ppRowSet)
{
enum MAPISTATUS retval;
TALLOC_CTX *mem_ctx;
struct nspi_context *nspi_ctx;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct SPropTagArray *SPropTagArray = NULL;
struct PropertyTagArray_r *pMId = NULL;
struct PropertyTagArray_r *flaglist = NULL;
usernames[0] = username;
usernames[1] = NULL;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
SPropTagArray = set_SPropTagArray(mem_ctx, 0xc,
PR_ENTRYID,
PR_DISPLAY_NAME_UNICODE,
PR_TRANSMITTABLE_DISPLAY_NAME_UNICODE,
PR_7BIT_DISPLAY_NAME_UNICODE,
PR_SMTP_ADDRESS_UNICODE);
- retval = ResolveNames(session, usernames, SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
+ retval = ResolveNames(session, usernames, SPropTagArray, &RowSet, &flaglist, MAPI_UNICODE);
MAPIFreeBuffer(SPropTagArray);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
OPENCHANGE_RETVAL_IF((flaglist->aulPropTag[0] != MAPI_RESOLVED), MAPI_E_NOT_FOUND, mem_ctx);
- username = (const char *) get_SPropValue_SRowSet_data(SRowSet, PR_7BIT_DISPLAY_NAME_UNICODE);
- email = talloc_strdup(mem_ctx, (const char *) get_SPropValue_SRowSet_data(SRowSet, PR_EMAIL_ADDRESS_UNICODE));
- MAPIFreeBuffer(SRowSet);
+ username = (const char *) get_PropertyValue_PropertyRowSet_data(RowSet, PR_7BIT_DISPLAY_NAME_UNICODE);
+ email = talloc_strdup(mem_ctx, (const char *) get_PropertyValue_PropertyRowSet_data(RowSet, PR_EMAIL_ADDRESS_UNICODE));
+ MAPIFreeBuffer(RowSet);
/* Step 2. Map recipient DN to MId */
pNames.Count = 0x1;
SPropTagArray = pPropTags;
}
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_GetProps(nspi_ctx, SRowSet, SPropTagArray, pMId, &SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetProps(nspi_ctx, RowSet, SPropTagArray, pMId, &RowSet);
if (allocated == true) {
MAPIFreeBuffer(SPropTagArray);
}
MAPIFreeBuffer(pMId);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
- SRowSet = talloc_steal((TALLOC_CTX *)session, SRowSet);
- *ppRowSet = SRowSet;
+ RowSet = talloc_steal((TALLOC_CTX *)session, RowSet);
+ *ppRowSet = RowSet;
talloc_free(mem_ctx);
enum MAPISTATUS retval;
struct nspi_context *nspi;
struct StringsArray_r pNames;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *PropertyRowSet;
struct SPropTagArray *SPropTagArray = NULL;
struct PropertyTagArray_r *MId_array;
struct StringArray_r *MVszA = NULL;
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
/* Step 2. Retrieve the Server DN associated to this MId */
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_EMS_AB_HOME_MDB);
- retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_array, &SRowSet);
+ retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_array, &PropertyRowSet);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(MId_array);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
- HomeMDB = (char *)find_SPropValue_data(&(SRowSet->aRow[0]), PR_EMS_AB_HOME_MDB);
+ HomeMDB = (char *)find_PropertyValue_data(&(PropertyRowSet->aRow[0]), PR_EMS_AB_HOME_MDB);
OPENCHANGE_RETVAL_IF(!HomeMDB, MAPI_E_NOT_FOUND, mem_ctx);
server_dn = x500_truncate_dn_last_elements(mem_ctx, HomeMDB, 1);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
} else {
server_dn = talloc_strdup(mem_ctx, legacyDN);
}
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
/* Step 4. Retrieve the binding strings associated to this DN */
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_EMS_AB_NETWORK_ADDRESS);
- retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_array, &SRowSet);
+ retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_array, &PropertyRowSet);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(MId_array);
MAPIFreeBuffer(server_dn);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
/* Step 5. Extract host from ncacn_ip_tcp binding string */
- MVszA = (struct StringArray_r *) find_SPropValue_data(&(SRowSet->aRow[0]), PR_EMS_AB_NETWORK_ADDRESS);
+ MVszA = (struct StringArray_r *) find_PropertyValue_data(&(PropertyRowSet->aRow[0]), PR_EMS_AB_NETWORK_ADDRESS);
OPENCHANGE_RETVAL_IF(!MVszA, MAPI_E_NOT_FOUND, mem_ctx);
for (i = 0; i != MVszA->cValues; i++) {
if (!strncasecmp(MVszA->lppszA[i], "ncacn_ip_tcp:", 13)) {
break;
}
}
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
OPENCHANGE_RETVAL_IF(!binding, MAPI_E_NOT_FOUND, mem_ctx);
/* Step 6. Close the existing session and initiates it again */
static bool set_profile_attribute(struct mapi_context *mapi_ctx,
const char *profname,
- struct SRowSet rowset,
+ struct PropertyRowSet_r rowset,
uint32_t index,
uint32_t property,
const char *attr);
enum MAPISTATUS retval;
struct nspi_context *nspi;
struct SPropTagArray *SPropTagArray = NULL;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *PropertyRowSet;
struct Restriction_r Filter;
- struct SPropValue *lpProp = NULL;
+ struct PropertyValue_r *lpProp = NULL;
struct PropertyTagArray_r *MIds = NULL;
uint32_t index = 0;
char *password;
nspi = (struct nspi_context *) session->nspi->ctx;
index = 0;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_GetSpecialTable(nspi, mem_ctx, 0x0, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetSpecialTable(nspi, mem_ctx, 0x0, &PropertyRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1,
}
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ANR_UNICODE;
lpProp->dwAlignPad = 0;
lpProp->value.lpszW = username;
Filter.res.resProperty.ulPropTag = PR_ANR_UNICODE;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi, mem_ctx, SPropTagArray, &Filter, 5000, &PropertyRowSet, &MIds);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(lpProp);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
talloc_free(mem_ctx);
return retval;
}
/* if there's no match */
- OPENCHANGE_RETVAL_IF(!SRowSet, MAPI_E_NOT_FOUND, mem_ctx);
- OPENCHANGE_RETVAL_IF(!SRowSet->cRows, MAPI_E_NOT_FOUND, mem_ctx);
+ OPENCHANGE_RETVAL_IF(!PropertyRowSet, MAPI_E_NOT_FOUND, mem_ctx);
+ OPENCHANGE_RETVAL_IF(!PropertyRowSet->cRows, MAPI_E_NOT_FOUND, mem_ctx);
OPENCHANGE_RETVAL_IF(!MIds, MAPI_E_NOT_FOUND, mem_ctx);
MAPIFreeBuffer(MIds);
- set_profile_attribute(mapi_ctx, profile_dst, *SRowSet, index, PR_EMAIL_ADDRESS, "EmailAddress");
+ set_profile_attribute(mapi_ctx, profile_dst, *PropertyRowSet, index, PR_EMAIL_ADDRESS, "EmailAddress");
mapi_profile_delete_string_attr(mapi_ctx, profile_dst, "EmailAddress", oldEmailAddress);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
+ DLIST_REMOVE(mapi_ctx->session, session);
+ MAPIFreeBuffer(session);
DLIST_REMOVE(mapi_ctx->session, session);
MAPIFreeBuffer(session);
}
static bool set_profile_attribute(struct mapi_context *mapi_ctx,
const char *profname,
- struct SRowSet rowset,
+ struct PropertyRowSet_r rowset,
uint32_t index,
uint32_t property,
const char *attr)
{
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
enum MAPISTATUS ret;
- lpProp = get_SPropValue_SRow(&(rowset.aRow[index]), property);
+ lpProp = get_PropertyValue_PropertyRow(&(rowset.aRow[index]), property);
if (!lpProp) {
DEBUG(3, ("MAPI Property %s not set\n", attr));
static bool set_profile_mvstr_attribute(struct mapi_context *mapi_ctx,
const char *profname,
- struct SRowSet rowset,
+ struct PropertyRowSet_r rowset,
uint32_t index,
uint32_t property,
const char *attr)
{
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
enum MAPISTATUS ret;
uint32_t i;
- lpProp = get_SPropValue_SRow(&(rowset.aRow[index]), property);
+ lpProp = get_PropertyValue_PropertyRow(&(rowset.aRow[index]), property);
if (!lpProp) {
DEBUG(3, ("MAPI Property %s not set\n", attr));
struct nspi_context *nspi;
struct SPropTagArray *SPropTagArray = NULL;
struct Restriction_r Filter;
- struct SRowSet *SRowSet;
- struct SPropValue *lpProp = NULL;
+ struct PropertyRowSet_r *PropertyRowSet;
+ struct PropertyValue_r *lpProp = NULL;
struct PropertyTagArray_r *MIds = NULL;
struct PropertyTagArray_r MIds2;
struct PropertyTagArray_r *MId_server = NULL;
profname = session->profile->profname;
index = 0;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_GetSpecialTable(nspi, mem_ctx, 0x0, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetSpecialTable(nspi, mem_ctx, 0x0, &PropertyRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
SPropTagArray = set_SPropTagArray(mem_ctx, 0xc,
}
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ANR_UNICODE;
lpProp->dwAlignPad = 0;
lpProp->value.lpszW = username;
Filter.res.resProperty.ulPropTag = PR_ANR_UNICODE;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi, mem_ctx, SPropTagArray, &Filter, 5000, &PropertyRowSet, &MIds);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(lpProp);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
talloc_free(mem_ctx);
return retval;
}
/* if there's no match */
- OPENCHANGE_RETVAL_IF(!SRowSet, MAPI_E_NOT_FOUND, mem_ctx);
- OPENCHANGE_RETVAL_IF(!SRowSet->cRows, MAPI_E_NOT_FOUND, mem_ctx);
+ OPENCHANGE_RETVAL_IF(!PropertyRowSet, MAPI_E_NOT_FOUND, mem_ctx);
+ OPENCHANGE_RETVAL_IF(!PropertyRowSet->cRows, MAPI_E_NOT_FOUND, mem_ctx);
OPENCHANGE_RETVAL_IF(!MIds, MAPI_E_NOT_FOUND, mem_ctx);
- /* if SRowSet count is superior than 1 an callback is specified, call it */
- if (SRowSet->cRows > 1 && callback) {
- index = callback(SRowSet, private_data);
- OPENCHANGE_RETVAL_IF((index >= SRowSet->cRows), MAPI_E_USER_CANCEL, mem_ctx);
+ /* if PropertyRowSet count is superior than 1 an callback is specified, call it */
+ if (PropertyRowSet->cRows > 1 && callback) {
+ index = callback(PropertyRowSet, private_data);
+ OPENCHANGE_RETVAL_IF((index >= PropertyRowSet->cRows), MAPI_E_USER_CANCEL, mem_ctx);
instance_key = MIds->aulPropTag[index];
} else {
instance_key = MIds->aulPropTag[0];
MIds2.cValues = 0x1;
MIds2.aulPropTag = &instance_key;
- set_profile_attribute(mapi_ctx, profname, *SRowSet, index, PR_EMAIL_ADDRESS, "EmailAddress");
- set_profile_attribute(mapi_ctx, profname, *SRowSet, index, PR_DISPLAY_NAME, "DisplayName");
- set_profile_attribute(mapi_ctx, profname, *SRowSet, index, PR_ACCOUNT, "Account");
- set_profile_attribute(mapi_ctx, profname, *SRowSet, index, PR_ADDRTYPE, "AddrType");
+ set_profile_attribute(mapi_ctx, profname, *PropertyRowSet, index, PR_EMAIL_ADDRESS, "EmailAddress");
+ set_profile_attribute(mapi_ctx, profname, *PropertyRowSet, index, PR_DISPLAY_NAME, "DisplayName");
+ set_profile_attribute(mapi_ctx, profname, *PropertyRowSet, index, PR_ACCOUNT, "Account");
+ set_profile_attribute(mapi_ctx, profname, *PropertyRowSet, index, PR_ADDRTYPE, "AddrType");
SPropTagArray = set_SPropTagArray(mem_ctx, 0x7,
PR_DISPLAY_NAME,
nspi->pStat->NumPos = 0x0;
nspi->pStat->TotalRecs = 0x1;
- MAPIFreeBuffer(SRowSet);
- SRowSet = talloc(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi, mem_ctx, SPropTagArray, &MIds2, 1, &SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
+ PropertyRowSet = talloc(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi, mem_ctx, SPropTagArray, &MIds2, 1, &PropertyRowSet);
MAPIFreeBuffer(SPropTagArray);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
- lpProp = get_SPropValue_SRowSet(SRowSet, PR_EMS_AB_HOME_MDB);
+ lpProp = get_PropertyValue_PropertyRowSet(PropertyRowSet, PR_EMS_AB_HOME_MDB);
OPENCHANGE_RETVAL_IF(!lpProp, MAPI_E_NOT_FOUND, mem_ctx);
nspi->org = x500_get_dn_element(mem_ctx, lpProp->value.lpszA, ORG);
nspi->servername = x500_get_servername(lpProp->value.lpszA);
mapi_profile_add_string_attr(mapi_ctx, profname, "ServerName", nspi->servername);
- set_profile_attribute(mapi_ctx, profname, *SRowSet, 0, PR_EMS_AB_HOME_MDB, "HomeMDB");
- set_profile_mvstr_attribute(mapi_ctx, profname, *SRowSet, 0, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
+ set_profile_attribute(mapi_ctx, profname, *PropertyRowSet, 0, PR_EMS_AB_HOME_MDB, "HomeMDB");
+ set_profile_mvstr_attribute(mapi_ctx, profname, *PropertyRowSet, 0, PR_EMS_AB_PROXY_ADDRESSES, "ProxyAddress");
pNames.Count = 0x1;
pNames.Strings = (const char **) talloc_array(mem_ctx, char **, 1);
MAPIFreeBuffer((char **)pNames.Strings);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
- MAPIFreeBuffer(SRowSet);
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ MAPIFreeBuffer(PropertyRowSet);
+ PropertyRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_EMS_AB_NETWORK_ADDRESS);
- retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_server, &SRowSet);
+ retval = nspi_GetProps(nspi, mem_ctx, SPropTagArray, MId_server, &PropertyRowSet);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(MId_server);
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
- set_profile_mvstr_attribute(mapi_ctx, profname, *SRowSet, 0, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
- MAPIFreeBuffer(SRowSet);
+ set_profile_mvstr_attribute(mapi_ctx, profname, *PropertyRowSet, 0, PR_EMS_AB_NETWORK_ADDRESS, "NetworkAddress");
+ MAPIFreeBuffer(PropertyRowSet);
talloc_free(mem_ctx);
return MAPI_E_SUCCESS;
mapi_object_t obj_message;
mapi_object_t obj_htable;
mapi_object_t obj_ctable;
- struct SRowSet *pRowSet;
+ struct PropertyRowSet_r *pRowSet;
struct SRowSet SRowSet;
struct SPropValue *lpProps;
struct mapi_SRestriction res;
mem_ctx = (TALLOC_CTX *) session;
/* Step 0. Retrieve the user Email Address and build FreeBusy strings */
- pRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ pRowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
retval = GetABRecipientInfo(session, recipient, NULL, &pRowSet);
OPENCHANGE_RETVAL_IF(retval, retval, pRowSet);
- email = (const char *) get_SPropValue_SRowSet_data(pRowSet, PR_EMAIL_ADDRESS_UNICODE);
+ email = (const char *) get_PropertyValue_PropertyRowSet_data(pRowSet, PR_EMAIL_ADDRESS_UNICODE);
o = x500_get_dn_element(mem_ctx, email, ORG);
ou = x500_get_dn_element(mem_ctx, email, ORG_UNIT);
username = x500_get_dn_element(mem_ctx, email, "/cn=Recipients/cn=");
struct nspi_context *nspi_bind(TALLOC_CTX *, struct dcerpc_pipe *, struct cli_credentials *, uint32_t, uint32_t, uint32_t);
enum MAPISTATUS nspi_unbind(struct nspi_context *);
enum MAPISTATUS nspi_UpdateStat(struct nspi_context *, TALLOC_CTX *, uint32_t *);
-enum MAPISTATUS nspi_QueryRows(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MIds, uint32_t, struct SRowSet **);
-enum MAPISTATUS nspi_SeekEntries(struct nspi_context *, TALLOC_CTX *, enum TableSortOrders, struct SPropValue *, struct SPropTagArray *, struct PropertyTagArray_r *pMIds, struct SRowSet **);
-enum MAPISTATUS nspi_GetMatches(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct Restriction_r *, uint32_t ulRequested, struct SRowSet **, struct PropertyTagArray_r **ppOutMIds);
+enum MAPISTATUS nspi_QueryRows(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MIds, uint32_t, struct PropertyRowSet_r **);
+enum MAPISTATUS nspi_SeekEntries(struct nspi_context *, TALLOC_CTX *, enum TableSortOrders, struct PropertyValue_r *, struct SPropTagArray *, struct PropertyTagArray_r *pMIds, struct PropertyRowSet_r **);
+enum MAPISTATUS nspi_GetMatches(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct Restriction_r *, uint32_t ulRequested, struct PropertyRowSet_r **, struct PropertyTagArray_r **ppOutMIds);
enum MAPISTATUS nspi_ResortRestriction(struct nspi_context *, TALLOC_CTX *, enum TableSortOrders, struct PropertyTagArray_r *pInMIds, struct PropertyTagArray_r **ppMIds);
enum MAPISTATUS nspi_DNToMId(struct nspi_context *, TALLOC_CTX *, struct StringsArray_r *, struct PropertyTagArray_r **ppMIds);
enum MAPISTATUS nspi_GetPropList(struct nspi_context *, TALLOC_CTX *, bool, uint32_t, struct SPropTagArray **);
-enum MAPISTATUS nspi_GetProps(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MId, struct SRowSet **);
+enum MAPISTATUS nspi_GetProps(struct nspi_context *, TALLOC_CTX *, struct SPropTagArray *, struct PropertyTagArray_r *MId, struct PropertyRowSet_r **);
enum MAPISTATUS nspi_CompareMIds(struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, uint32_t *);
-enum MAPISTATUS nspi_ModProps(struct nspi_context *, TALLOC_CTX *, uint32_t, struct SPropTagArray *, struct SRow *);
-enum MAPISTATUS nspi_GetSpecialTable(struct nspi_context *, TALLOC_CTX *, uint32_t, struct SRowSet **);
-enum MAPISTATUS nspi_GetTemplateInfo(struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, char *, struct SRow **);
+enum MAPISTATUS nspi_ModProps(struct nspi_context *, TALLOC_CTX *, uint32_t, struct SPropTagArray *, struct PropertyRow_r *);
+enum MAPISTATUS nspi_GetSpecialTable(struct nspi_context *, TALLOC_CTX *, uint32_t, struct PropertyRowSet_r **);
+enum MAPISTATUS nspi_GetTemplateInfo(struct nspi_context *, TALLOC_CTX *, uint32_t, uint32_t, char *, struct PropertyRow_r **);
enum MAPISTATUS nspi_ModLinkAtt(struct nspi_context *, bool, uint32_t, uint32_t, struct BinaryArray_r *);
enum MAPISTATUS nspi_QueryColumns(struct nspi_context *, TALLOC_CTX *, bool, struct SPropTagArray **);
enum MAPISTATUS nspi_GetNamesFromIDs(struct nspi_context *, TALLOC_CTX *, struct FlatUID_r *, struct SPropTagArray *, struct SPropTagArray **, struct PropertyNameSet_r **);
enum MAPISTATUS nspi_GetIDsFromNames(struct nspi_context *, TALLOC_CTX *, bool, uint32_t, struct PropertyName_r *, struct SPropTagArray **);
-enum MAPISTATUS nspi_ResolveNames(struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct SRowSet ***, struct PropertyTagArray_r ***);
-enum MAPISTATUS nspi_ResolveNamesW(struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct SRowSet ***, struct PropertyTagArray_r ***);
+enum MAPISTATUS nspi_ResolveNames(struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct PropertyRowSet_r ***, struct PropertyTagArray_r ***);
+enum MAPISTATUS nspi_ResolveNamesW(struct nspi_context *, TALLOC_CTX *, const char **, struct SPropTagArray *, struct PropertyRowSet_r ***, struct PropertyTagArray_r ***);
/* The following public definitions come from libmapi/emsmdb.c */
NTSTATUS emsmdb_transaction_null(struct emsmdb_context *, struct mapi_response **);
void mapidump_SPropTagArray(struct SPropTagArray *);
void mapidump_SRowSet(struct SRowSet *, const char *);
void mapidump_SRow(struct SRow *, const char *);
-void mapidump_PAB_entry(struct SRow *);
+void mapidump_PAB_entry(struct PropertyRow_r *);
void mapidump_Recipients(const char **, struct SRowSet *, struct PropertyTagArray_r *flaglist);
void mapidump_date(struct mapi_SPropValue_array *, uint32_t, const char *);
void mapidump_date_SPropValue(struct SPropValue, const char *, const char *);
bool set_mapi_SPropValue(TALLOC_CTX *, struct mapi_SPropValue *, const void *);
bool set_mapi_SPropValue_proptag(TALLOC_CTX *, struct mapi_SPropValue *, uint32_t, const void *);
+struct PropertyValue_r *get_PropertyValue_PropertyRow(struct PropertyRow_r *, enum MAPITAGS);
+struct PropertyValue_r *get_PropertyValue_PropertyRowSet(struct PropertyRowSet_r *, enum MAPITAGS);
+const void *get_PropertyValue_PropertyRowSet_data(struct PropertyRowSet_r *, uint32_t);
+bool set_PropertyValue(struct PropertyValue_r *, const void *);
+const void *get_PropertyValue(struct PropertyValue_r *, enum MAPITAGS);
+const void *get_PropertyValue_data(struct PropertyValue_r *);
+enum MAPISTATUS PropertyRow_addprop(struct PropertyRow_r *, struct PropertyValue_r);
+const void *find_PropertyValue_data(struct PropertyRow_r *, uint32_t);
+uint32_t PropertyRowSet_propcpy(TALLOC_CTX *, struct PropertyRowSet_r *, struct PropertyValue_r);
+void cast_PropertyValue_to_SPropValue(struct PropertyValue_r *, struct SPropValue *);
+void cast_PropertyRow_to_SRow(TALLOC_CTX *, struct PropertyRow_r *, struct SRow *);
+void cast_PropertyRowSet_to_SRowSet(TALLOC_CTX *, struct PropertyRowSet_r *, struct SRowSet *);
+
/* The following public definitions come from libmapi/IABContainer.c */
-enum MAPISTATUS ResolveNames(struct mapi_session *, const char **, struct SPropTagArray *, struct SRowSet **, struct PropertyTagArray_r **, uint32_t);
-enum MAPISTATUS GetGALTable(struct mapi_session *, struct SPropTagArray *, struct SRowSet **, uint32_t, uint8_t);
+enum MAPISTATUS ResolveNames(struct mapi_session *, const char **, struct SPropTagArray *, struct PropertyRowSet_r **, struct PropertyTagArray_r **, uint32_t);
+enum MAPISTATUS GetGALTable(struct mapi_session *, struct SPropTagArray *, struct PropertyRowSet_r **, uint32_t, uint8_t);
enum MAPISTATUS GetGALTableCount(struct mapi_session *, uint32_t *);
-enum MAPISTATUS GetABRecipientInfo(struct mapi_session *, const char *, struct SPropTagArray *, struct SRowSet **);
+enum MAPISTATUS GetABRecipientInfo(struct mapi_session *, const char *, struct SPropTagArray *, struct PropertyRowSet_r **);
/* The following public definitions come from libmapi/IProfAdmin.c */
enum MAPISTATUS mapi_profile_add_string_attr(struct mapi_context *, const char *, const char *, const char *);
void obfuscate_data(uint8_t *, uint32_t, uint8_t);
enum ndr_err_code ndr_pull_lzxpress_decompress(struct ndr_pull *, struct ndr_pull **, ssize_t);
enum ndr_err_code ndr_push_lzxpress_compress(struct ndr_push *, struct ndr_push *);
+enum ndr_err_code ndr_push_ExtendedException(struct ndr_push *, int, uint16_t, const struct ExceptionInfo *, const struct ExtendedException *);
+enum ndr_err_code ndr_pull_ExtendedException(struct ndr_pull *, int, uint16_t, const struct ExceptionInfo *, struct ExtendedException *);
+enum ndr_err_code ndr_push_AppointmentRecurrencePattern(struct ndr_push *, int, const struct AppointmentRecurrencePattern *);
+enum ndr_err_code ndr_pull_AppointmentRecurrencePattern(struct ndr_pull *, int, struct AppointmentRecurrencePattern *);
/* The following private definitions come from libmapi/nspi.c */
int nspi_disconnect_dtor(void *);
const char *kerberos;
};
-typedef int (*mapi_profile_callback_t)(struct SRowSet *, const void *);
+typedef int (*mapi_profile_callback_t)(struct PropertyRowSet_r *, const void *);
#define OC_PROFILE_NOPASSWORD 1
The SRow is assumed to contain entries for PR_ADDRTYPE_UNICODE, PR_DISPLAY_NAME_UNICODE,
PR_EMAIL_ADDRESS_UNICODE and PR_ACCOUNT_UNICODE.
*/
-_PUBLIC_ void mapidump_PAB_entry(struct SRow *aRow)
+_PUBLIC_ void mapidump_PAB_entry(struct PropertyRow_r *aRow)
{
const char *addrtype;
const char *name;
const char *email;
const char *account;
- addrtype = (const char *)find_SPropValue_data(aRow, PR_ADDRTYPE_UNICODE);
- name = (const char *)find_SPropValue_data(aRow, PR_DISPLAY_NAME_UNICODE);
- email = (const char *)find_SPropValue_data(aRow, PR_EMAIL_ADDRESS_UNICODE);
- account = (const char *)find_SPropValue_data(aRow, PR_ACCOUNT_UNICODE);
+ addrtype = (const char *)find_PropertyValue_data(aRow, PR_ADDRTYPE_UNICODE);
+ name = (const char *)find_PropertyValue_data(aRow, PR_DISPLAY_NAME_UNICODE);
+ email = (const char *)find_PropertyValue_data(aRow, PR_EMAIL_ADDRESS_UNICODE);
+ account = (const char *)find_PropertyValue_data(aRow, PR_ACCOUNT_UNICODE);
printf("[%s] %s:\n\tName: %-25s\n\tEmail: %-25s\n",
addrtype, account, name, email);
struct SPropTagArray *pPropTags,
struct PropertyTagArray_r *MIds,
uint32_t count,
- struct SRowSet **ppRows)
+ struct PropertyRowSet_r **ppRows)
{
struct NspiQueryRows r;
NTSTATUS status;
\param nspi_ctx pointer to the NSPI connection context
\param mem_ctx pointer to the memory context
\param SortType the table sort order to use
- \param pTarget SPropValue struct holding the value being sought
+ \param pTarget PropertyValue_r struct holding the value being sought
\param pPropTags pointer to an array of property tags of columns
that the client wants to be returned for each row returned.
\param pMIds pointer to a list of Mid that comprise a restricted
_PUBLIC_ enum MAPISTATUS nspi_SeekEntries(struct nspi_context *nspi_ctx,
TALLOC_CTX *mem_ctx,
enum TableSortOrders SortType,
- struct SPropValue *pTarget,
+ struct PropertyValue_r *pTarget,
struct SPropTagArray *pPropTags,
struct PropertyTagArray_r *pMIds,
- struct SRowSet **pRows)
+ struct PropertyRowSet_r **pRows)
{
struct NspiSeekEntries r;
NTSTATUS status;
struct SPropTagArray *pPropTags,
struct Restriction_r *Filter,
uint32_t ulRequested,
- struct SRowSet **ppRows,
+ struct PropertyRowSet_r **ppRows,
struct PropertyTagArray_r **ppOutMIds)
{
struct NspiGetMatches r;
TALLOC_CTX *mem_ctx,
struct SPropTagArray *pPropTags,
struct PropertyTagArray_r *MId,
- struct SRowSet **SRowSet)
+ struct PropertyRowSet_r **SRowSet)
{
struct NspiGetProps r;
NTSTATUS status;
enum MAPISTATUS retval;
- struct SRow *ppRows;
+ struct PropertyRow_r *ppRows;
/* Sanity checks */
OPENCHANGE_RETVAL_IF(!nspi_ctx, MAPI_E_NOT_INITIALIZED, NULL);
r.in.pPropTags = pPropTags;
- ppRows = talloc(mem_ctx, struct SRow);
+ ppRows = talloc(mem_ctx, struct PropertyRow_r);
r.out.ppRows = &ppRows;
status = dcerpc_NspiGetProps_r(nspi_ctx->rpc_connection->binding_handle, mem_ctx, &r);
OPENCHANGE_RETVAL_IF(retval, retval, NULL)
SRowSet[0]->cRows = 1;
- SRowSet[0]->aRow = talloc(mem_ctx, struct SRow);
- SRowSet[0]->aRow->ulAdrEntryPad = ppRows->ulAdrEntryPad;
+ SRowSet[0]->aRow = talloc(mem_ctx, struct PropertyRow_r);
+ SRowSet[0]->aRow->Reserved = ppRows->Reserved;
SRowSet[0]->aRow->cValues = ppRows->cValues;
SRowSet[0]->aRow->lpProps = ppRows->lpProps;
TALLOC_CTX *mem_ctx,
uint32_t MId,
struct SPropTagArray *pPropTags,
- struct SRow *pRow)
+ struct PropertyRow_r *pRow)
{
struct NspiModProps r;
NTSTATUS status;
_PUBLIC_ enum MAPISTATUS nspi_GetSpecialTable(struct nspi_context *nspi_ctx,
TALLOC_CTX *mem_ctx,
uint32_t Type,
- struct SRowSet **ppRows)
+ struct PropertyRowSet_r **ppRows)
{
struct NspiGetSpecialTable r;
NTSTATUS status;
uint32_t dwFlags,
uint32_t ulType,
char *pDN,
- struct SRow **ppData)
+ struct PropertyRow_r **ppData)
{
struct NspiGetTemplateInfo r;
NTSTATUS status;
TALLOC_CTX *mem_ctx,
const char **usernames,
struct SPropTagArray *pPropTags,
- struct SRowSet ***pppRows,
+ struct PropertyRowSet_r ***pppRows,
struct PropertyTagArray_r ***pppMIds)
{
struct NspiResolveNames r;
TALLOC_CTX *mem_ctx,
const char **usernames,
struct SPropTagArray *pPropTags,
- struct SRowSet ***pppRows,
+ struct PropertyRowSet_r ***pppRows,
struct PropertyTagArray_r ***pppMIds)
{
struct NspiResolveNamesW r;
lpProps->value.l = *((const uint32_t *)data);
break;
case PT_DOUBLE:
- memcpy(&lpProps->value.dbl, (uint8_t *)data, 8);
+ lpProps->value.dbl = *((const double *)data);
break;
case PT_I8:
lpProps->value.d = *((const uint64_t *)data);
lpProps->value.l = *((const uint32_t *)data);
break;
case PT_DOUBLE:
- memcpy(&lpProps->value.dbl, (uint8_t *)data, 8);
+ lpProps->value.dbl = *((const double *)data);
break;
case PT_I8:
lpProps->value.d = *((const uint64_t *)data);
mapi_sprop->value.l = sprop->value.l;
return sizeof(uint32_t);
case PT_DOUBLE:
- memcpy(&mapi_sprop->value.dbl, (uint8_t *)&sprop->value.dbl, 8);
+ mapi_sprop->value.dbl = sprop->value.dbl;
return sizeof(double);
case PT_I8:
mapi_sprop->value.d = sprop->value.d;
return (max_out - out_left);
}
+
+struct PropertyValue_r* get_PropertyValue_PropertyRow(struct PropertyRow_r *aRow, enum MAPITAGS ulPropTag)
+{
+ uint32_t i;
+
+ if (!aRow) {
+ return NULL;
+ }
+
+ for (i = 0; i < aRow->cValues; i++) {
+ if (ulPropTag == aRow->lpProps[i].ulPropTag) {
+ return (&aRow->lpProps[i]);
+ }
+ }
+
+ return NULL;
+}
+
+_PUBLIC_ struct PropertyValue_r *get_PropertyValue_PropertyRowSet(struct PropertyRowSet_r *RowSet,
+ enum MAPITAGS ulPropTag)
+{
+ uint32_t i;
+ uint32_t j;
+
+ /* Sanity Checks */
+ if (!RowSet) return NULL;
+
+ for (i = 0; i != RowSet->cRows; i++) {
+ for (j = 0; j < RowSet->aRow[i].cValues; j++) {
+ if (ulPropTag == RowSet->aRow[i].lpProps[j].ulPropTag) {
+ return (&RowSet->aRow[i].lpProps[j]);
+ }
+ }
+ }
+
+ return NULL;
+}
+
+_PUBLIC_ const void *get_PropertyValue_PropertyRowSet_data(struct PropertyRowSet_r *RowSet,
+ uint32_t ulPropTag)
+{
+ struct PropertyValue_r *lpProp;
+
+ lpProp = get_PropertyValue_PropertyRowSet(RowSet, ulPropTag);
+ return get_PropertyValue(lpProp, ulPropTag);
+}
+
+_PUBLIC_ bool set_PropertyValue(struct PropertyValue_r *lpProp, const void *data)
+{
+ if (data == NULL) {
+ lpProp->ulPropTag = (lpProp->ulPropTag & 0xffff0000) | PT_ERROR;
+ lpProp->value.err = MAPI_E_NOT_FOUND;
+ return false;
+ }
+ switch (lpProp->ulPropTag & 0xFFFF) {
+ case PT_SHORT:
+ lpProp->value.i = *((const uint16_t *)data);
+ break;
+ case PT_BOOLEAN:
+ lpProp->value.b = *((const uint8_t *)data);
+ break;
+ case PT_LONG:
+ lpProp->value.l = *((const uint32_t *)data);
+ break;
+ case PT_STRING8:
+ lpProp->value.lpszA = (const char *) data;
+ break;
+ case PT_BINARY:
+ case PT_SVREID:
+ lpProp->value.bin = *((const struct Binary_r *)data);
+ break;
+ case PT_UNICODE:
+ lpProp->value.lpszW = (const char *) data;
+ break;
+ case PT_CLSID:
+ lpProp->value.lpguid = (struct FlatUID_r *) data;
+ break;
+ case PT_SYSTIME:
+ lpProp->value.ft = *((const struct FILETIME *) data);
+ break;
+ case PT_ERROR:
+ lpProp->value.err = *((enum MAPISTATUS *)data);
+ break;
+ case PT_MV_SHORT:
+ lpProp->value.MVi = *((const struct ShortArray_r *)data);
+ break;
+ case PT_MV_LONG:
+ lpProp->value.MVl = *((const struct LongArray_r *)data);
+ break;
+ case PT_MV_STRING8:
+ lpProp->value.MVszA = *((const struct StringArray_r *)data);
+ break;
+ case PT_MV_BINARY:
+ lpProp->value.MVbin = *((const struct BinaryArray_r *)data);
+ break;
+ case PT_MV_CLSID:
+ lpProp->value.MVguid = *((const struct FlatUIDArray_r *)data);
+ break;
+ case PT_MV_UNICODE:
+ lpProp->value.MVszW = *((const struct StringArrayW_r *)data);
+ break;
+ case PT_MV_SYSTIME:
+ lpProp->value.MVft = *((const struct DateTimeArray_r *)data);
+ break;
+ case PT_NULL:
+ lpProp->value.null = *((const uint32_t *)data);
+ break;
+ default:
+ lpProp->ulPropTag = (lpProp->ulPropTag & 0xffff0000) | PT_ERROR;
+ lpProp->value.err = MAPI_E_NOT_FOUND;
+
+ return false;
+ }
+
+ return true;
+}
+
+_PUBLIC_ const void *get_PropertyValue(struct PropertyValue_r *lpProps, enum MAPITAGS ulPropTag)
+{
+ uint32_t i;
+
+ /* Sanity checks */
+ if (!lpProps) return NULL;
+
+ for (i = 0; lpProps[i].ulPropTag; i++) {
+ if (ulPropTag == lpProps[i].ulPropTag) {
+ return get_PropertyValue_data(&lpProps[i]);
+ }
+ }
+ return NULL;
+}
+
+_PUBLIC_ const void *get_PropertyValue_data(struct PropertyValue_r *lpProps)
+{
+ if (lpProps->ulPropTag == 0) {
+ return NULL;
+ }
+
+ switch(lpProps->ulPropTag & 0xFFFF) {
+ case PT_SHORT:
+ return (const void *)&lpProps->value.i;
+ case PT_BOOLEAN:
+ return (const void *)&lpProps->value.b;
+ case PT_STRING8:
+ return (const void *)lpProps->value.lpszA;
+ case PT_UNICODE:
+ return (const void *)lpProps->value.lpszW;
+ case PT_SYSTIME:
+ return (const void *)(struct FILETIME *)&lpProps->value.ft;
+ case PT_ERROR:
+ return (const void *)&lpProps->value.err;
+ case PT_LONG:
+ return (const void *)&lpProps->value.l;
+ case PT_CLSID:
+ return (const void *)lpProps->value.lpguid;
+ case PT_BINARY:
+ case PT_SVREID:
+ return (const void *)&lpProps->value.bin;
+ case PT_MV_SHORT:
+ return (const void *)(struct ShortArray_r *)&lpProps->value.MVi;
+ case PT_MV_LONG:
+ return (const void *)(struct LongArray_r *)&lpProps->value.MVl;
+ case PT_MV_STRING8:
+ return (const void *)(struct StringArray_r *)&lpProps->value.MVszA;
+ case PT_MV_UNICODE:
+ return (const void *)(struct StringArrayW_r *)&lpProps->value.MVszW;
+ case PT_MV_BINARY:
+ return (const void *)(struct BinaryArray_r *)&lpProps->value.MVbin;
+ case PT_MV_SYSTIME:
+ return (const void *)(struct DateTimeArray_r *)&lpProps->value.MVft;
+ case PT_NULL:
+ return (const void *)&lpProps->value.null;
+ default:
+ return NULL;
+ }
+}
+
+/**
+ \details add a PropertyValue_r structure to a PropertyRow_r array
+
+ \param aRow pointer to the PropertyRow_r array where propValue should be appended
+ \param propValue the PropertyValue_r structure to add to aRow
+
+ \return MAPI_E_SUCCESS on success, otherwise MAPI_E_INVALID_PARAMETER.
+ */
+_PUBLIC_ enum MAPISTATUS PropertyRow_addprop(struct PropertyRow_r *aRow, struct PropertyValue_r propValue)
+{
+ TALLOC_CTX *mem_ctx;
+ uint32_t cValues;
+ struct PropertyValue_r lpProp;
+ uint32_t i;
+
+ /* Sanity checks */
+ OPENCHANGE_RETVAL_IF(!aRow, MAPI_E_INVALID_PARAMETER, NULL);
+
+ mem_ctx = (TALLOC_CTX *) aRow;
+
+ /* If the property tag already exist, overwrite its value */
+ for (i = 0; i < aRow->cValues; i++) {
+ if (aRow->lpProps[i].ulPropTag == propValue.ulPropTag) {
+ aRow->lpProps[i] = propValue;
+ return MAPI_E_SUCCESS;
+ }
+ }
+
+ cValues = aRow->cValues + 1;
+ aRow->lpProps = talloc_realloc(mem_ctx, aRow->lpProps, struct PropertyValue_r, cValues);
+ lpProp = aRow->lpProps[cValues-1];
+ lpProp.ulPropTag = propValue.ulPropTag;
+ lpProp.dwAlignPad = 0;
+ set_PropertyValue(&(lpProp), get_PropertyValue_data(&propValue));
+ aRow->cValues = cValues;
+ aRow->lpProps[cValues - 1] = lpProp;
+
+ return MAPI_E_SUCCESS;
+}
+
+_PUBLIC_ const void *find_PropertyValue_data(struct PropertyRow_r *aRow, uint32_t mapitag)
+{
+ uint32_t i;
+
+ if (!aRow) {
+ return NULL;
+ }
+
+ for (i = 0; i < aRow->cValues; i++) {
+ if (aRow->lpProps[i].ulPropTag == mapitag) {
+ return get_PropertyValue_data(&(aRow->lpProps[i]));
+ }
+ }
+ return NULL;
+}
+
+/**
+ \details Append a PropertyValue_r structure to given PropertyRowSet_r
+
+ \param mem_ctx pointer to the memory context
+ \param RowSet pointer to the PropertyRowSet_r array to update
+ \param value the PropertyValue_r to append within SRowSet
+
+ \return 0 on success, otherwise 1
+ */
+_PUBLIC_ uint32_t PropertyRowSet_propcpy(TALLOC_CTX *mem_ctx, struct PropertyRowSet_r *RowSet, struct PropertyValue_r value)
+{
+ uint32_t rows;
+ uint32_t cValues;
+ struct PropertyValue_r lpProp;
+
+ /* Sanity checks */
+ if (!RowSet) return 1;
+
+ for (rows = 0; rows < RowSet->cRows; rows++) {
+ cValues = RowSet->aRow[rows].cValues + 1;
+ RowSet->aRow[rows].lpProps = talloc_realloc(mem_ctx, RowSet->aRow[rows].lpProps, struct PropertyValue_r, cValues);
+ lpProp = RowSet->aRow[rows].lpProps[cValues-1];
+ lpProp.ulPropTag = value.ulPropTag;
+ lpProp.dwAlignPad = 0;
+ set_PropertyValue(&(lpProp), (void *)&value.value);
+ RowSet->aRow[rows].cValues = cValues;
+ RowSet->aRow[rows].lpProps[cValues - 1] = lpProp;
+ }
+ return 0;
+}
+
+/**
+ \details Convenience function to convert a PropertyValue_r structure into a SPropValue structure.
+
+ \param propvalue pointer to the PropertyValue_r structure to copy data to
+ \param spropvalue pointer to the SPropValue structure to copy data from
+ */
+_PUBLIC_ void cast_PropertyValue_to_SPropValue(struct PropertyValue_r *propvalue, struct SPropValue *spropvalue)
+{
+ spropvalue->ulPropTag = propvalue->ulPropTag;
+
+ switch (propvalue->ulPropTag & 0xFFFF) {
+ case PT_BOOLEAN:
+ spropvalue->value.b = propvalue->value.b;
+ break;
+ case PT_I2:
+ spropvalue->value.i = propvalue->value.i;
+ break;
+ case PT_LONG:
+ spropvalue->value.l = propvalue->value.l;
+ break;
+ case PT_STRING8:
+ spropvalue->value.lpszA = propvalue->value.lpszA;
+ break;
+ case PT_UNICODE:
+ spropvalue->value.lpszW = propvalue->value.lpszW;
+ break;
+ case PT_SYSTIME:
+ propvalue->value.ft = propvalue->value.ft;
+ break;
+ case PT_CLSID:
+ spropvalue->value.lpguid = propvalue->value.lpguid;
+ break;
+ case PT_SVREID:
+ case PT_BINARY:
+ spropvalue->value.bin = propvalue->value.bin;
+ break;
+ case PT_ERROR:
+ spropvalue->value.err = propvalue->value.err;
+ break;
+ case PT_MV_LONG:
+ spropvalue->value.MVl = propvalue->value.MVl;
+ break;
+ case PT_MV_STRING8:
+ spropvalue->value.MVszA = propvalue->value.MVszA;
+ break;
+ case PT_MV_UNICODE:
+ spropvalue->value.MVszW = propvalue->value.MVszW;
+ break;
+ case PT_MV_CLSID:
+ spropvalue->value.MVguid = propvalue->value.MVguid;
+ break;
+ case PT_MV_BINARY:
+ spropvalue->value.MVbin = propvalue->value.MVbin;
+ break;
+ default:
+ printf("unhandled conversion case in cast_PropvalueValue(): 0x%x\n", (propvalue->ulPropTag & 0xFFFF));
+ OPENCHANGE_ASSERT();
+ }
+}
+
+/**
+ \details Convenience function to convert a PropertyRow_r structure into a SRow structure.
+
+ \param mem_ctx pointer to the allocation context for structure members
+ \param proprow pointer to the PropertyRow_r structure to copy data to
+ \param srow pointer to the SRow structure to copy data from
+ */
+_PUBLIC_ void cast_PropertyRow_to_SRow(TALLOC_CTX *mem_ctx, struct PropertyRow_r *proprow, struct SRow *srow)
+{
+ uint32_t i;
+
+ srow->cValues = proprow->cValues;
+ srow->lpProps = talloc_array(mem_ctx, struct SPropValue, srow->cValues);
+ for (i = 0; i < srow->cValues; i++) {
+ cast_PropertyValue_to_SPropValue(proprow->lpProps + i, srow->lpProps + i);
+ }
+}
+
+/**
+ \details Convenience function to convert a PropertyRowSet_r structure into a SRowSet structure.
+
+ \param mem_ctx pointer to the allocation context for structure members
+ \param prowset pointer to the PropertyRowSet_r structure to copy data to
+ \param setrowset pointer to the SRowSet structure to copy data from
+ */
+_PUBLIC_ void cast_PropertyRowSet_to_SRowSet(TALLOC_CTX *mem_ctx, struct PropertyRowSet_r *prowset, struct SRowSet *srowset)
+{
+ uint32_t i;
+
+ srowset->cRows = prowset->cRows;
+ srowset->aRow = talloc_array(mem_ctx, struct SRow, srowset->cRows);
+ for (i = 0; i < srowset->cRows; i++) {
+ cast_PropertyRow_to_SRow(mem_ctx, prowset->aRow + i, srowset->aRow + i);
+ }
+}
TALLOC_CTX *mem_ctx;
struct SPropTagArray *SPropTagArray;
const char *names[2];
- struct SRowSet *rows = NULL;
+ struct PropertyRowSet_r *rows = NULL;
struct PropertyTagArray_r *flaglist = NULL;
struct mapi_PermissionsData rowList;
rowList.PermissionsData[0].PermissionDataFlags = ROW_ADD;
rowList.PermissionsData[0].lpProps.cValues = 2;
rowList.PermissionsData[0].lpProps.lpProps = talloc_array(mem_ctx, struct mapi_SPropValue, 2);
- cast_mapi_SPropValue((TALLOC_CTX *)rowList.PermissionsData[0].lpProps.lpProps,
- &rowList.PermissionsData[0].lpProps.lpProps[0], &rows->aRow[0].lpProps[0]);
+ set_mapi_SPropValue(NULL, &rowList.PermissionsData[0].lpProps.lpProps[0], get_PropertyValue_data(&rows->aRow[0].lpProps[0]));
rowList.PermissionsData[0].lpProps.lpProps[1].ulPropTag = PR_MEMBER_RIGHTS;
rowList.PermissionsData[0].lpProps.lpProps[1].value.l = role;
struct SPropTagArray *SPropTagArray;
const char *names[2];
const char *user = NULL;
- struct SRowSet *rows = NULL;
+ struct PropertyRowSet_r *rows = NULL;
struct SRowSet rowset;
struct PropertyTagArray_r *flaglist = NULL;
struct mapi_PermissionsData rowList;
OPENCHANGE_RETVAL_IF(retval, retval, mem_ctx);
if (flaglist->aulPropTag[0] == MAPI_RESOLVED) {
- user = (const char *) find_SPropValue_data(&(rows->aRow[0]), PR_DISPLAY_NAME);
+ user = (const char *) find_PropertyValue_data(&(rows->aRow[0]), PR_DISPLAY_NAME);
} else {
/* Special case: Not a AD user account but Default or
* Anonymous. Since names are language specific, we
struct SPropTagArray *SPropTagArray;
const char *names[2];
const char *user = NULL;
- struct SRowSet *rows = NULL;
+ struct PropertyRowSet_r *rows = NULL;
struct SRowSet rowset;
struct PropertyTagArray_r *flaglist = NULL;
struct mapi_PermissionsData rowList;
/* Check if the username was found */
OPENCHANGE_RETVAL_IF((flaglist->aulPropTag[0] != MAPI_RESOLVED), MAPI_E_NOT_FOUND, mem_ctx);
- user = (const char *)find_SPropValue_data(&(rows->aRow[0]), PR_DISPLAY_NAME);
+ user = (const char *)find_PropertyValue_data(&(rows->aRow[0]), PR_DISPLAY_NAME);
mapi_object_init(&obj_table);
retval = GetPermissionsTable(obj_folder, 0x00, &obj_table);
struct SPropValue SPropValue;
struct SPropValue *lpProps;
struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct PropertyTagArray_r *flaglist = NULL;
char **usernames = NULL;
int *recipClass = NULL;
usernames[i] = NULL;
retval = ResolveNames(mapi_object_get_session(obj_message), (const char **)usernames,
- SPropTagArray, &SRowSet, &flaglist, 0);
+ SPropTagArray, &RowSet, &flaglist, 0);
MAPIFreeBuffer(SPropTagArray);
MAPI_RETVAL_IF(retval, retval, usernames);
/* Step2. Associate resolved recipients to their respective recipClass */
- if (!SRowSet) {
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ if (RowSet) {
+ cast_PropertyRowSet_to_SRowSet(mem_ctx, RowSet, SRowSet);
}
counter = 0;
uint32_t i;
uint32_t propID = -1;
struct SPropTagArray *SPropTagArray = NULL;
- struct SRow *SRow;
+ struct PropertyRow_r *Row;
struct StringArray_r *slpstr;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
/* Sanity checks */
if (!r->out.ppRows) return false;
if (propID == -1) return false;
/* Step 2. Retrieve the SLPSTRArray */
- SRow = *r->out.ppRows;
- lpProp = &SRow->lpProps[propID];
+ Row = *r->out.ppRows;
+ lpProp = &Row->lpProps[propID];
if (!lpProp) return false;
if (lpProp->ulPropTag != PR_EMS_AB_NETWORK_ADDRESS) return false;
uint32_t i;
uint32_t propID = -1;
struct SPropTagArray *SPropTagArray = NULL;
- struct SRowSet *SRowSet;
- struct SPropValue *lpProp;
+ struct PropertyRowSet_r *RowSet;
+ struct PropertyValue_r *lpProp;
char *lpszA;
char *exchname;
if (propID == -1) return false;
/* Retrieve the lpszA */
- SRowSet = *r->out.ppRows;
- lpProp = &(SRowSet->aRow->lpProps[propID]);
+ RowSet = *r->out.ppRows;
+ lpProp = &(RowSet->aRow->lpProps[propID]);
if (!lpProp) return false;
if (lpProp->ulPropTag != PR_EMS_AB_HOME_MDB) return false;
{ PidTagAssistant, "PidTagAssistant" },
{ PidTagAssistantTelephoneNumber, "PidTagAssistantTelephoneNumber" },
{ PidTagAssociated, "PidTagAssociated" },
+ { PidTagAssociatedContentCount, "PidTagAssociatedContentCount" },
{ PidTagAttachAdditionalInformation, "PidTagAttachAdditionalInformation" },
{ PidTagAttachContentBase, "PidTagAttachContentBase" },
{ PidTagAttachContentId, "PidTagAttachContentId" },
uint16_t mapistore_namedprops_next_unused_id(struct ldb_context *);
enum mapistore_error mapistore_namedprops_create_id(struct ldb_context *, struct MAPINAMEID, uint16_t);
enum mapistore_error mapistore_namedprops_get_nameid(struct ldb_context *, uint16_t, struct MAPINAMEID **);
+enum mapistore_error mapistore_namedprops_get_nameid_type(struct ldb_context *, uint16_t, uint16_t *);
/* definitions from mapistore_mgmt.c */
enum mapistore_error mapistore_mgmt_backend_register_user(struct mapistore_connection_info *, const char *, const char *);
return rc;
}
+
+/**
+ \details return the type matching the mapped property ID passed in parameter.
+
+ \param ldb_ctx pointer to the namedprops ldb context
+ \param propID the property ID to lookup
+ \param propTypeP pointer to the uint16_t that will receive the property type
+
+ \return MAPISTORE_SUCCESS on success, otherwise MAPISTORE_ERROR
+ */
+_PUBLIC_ enum mapistore_error mapistore_namedprops_get_nameid_type(struct ldb_context *ldb_ctx, uint16_t propID, uint16_t *propTypeP)
+{
+ TALLOC_CTX *mem_ctx;
+ struct ldb_result *res = NULL;
+ const char * const attrs[] = { "propType", NULL };
+ int ret, type;
+ int rc = MAPISTORE_SUCCESS;
+
+ /* Sanity checks */
+ MAPISTORE_RETVAL_IF(!ldb_ctx, MAPISTORE_ERROR, NULL);
+ MAPISTORE_RETVAL_IF(!propTypeP, MAPISTORE_ERROR, NULL);
+ MAPISTORE_RETVAL_IF(propID < 0x8000, MAPISTORE_ERROR, NULL);
+
+ mem_ctx = talloc_zero(NULL, TALLOC_CTX);
+
+ ret = ldb_search(ldb_ctx, mem_ctx, &res, ldb_get_default_basedn(ldb_ctx),
+ LDB_SCOPE_SUBTREE, attrs, "(mappedId=%d)", propID);
+ MAPISTORE_RETVAL_IF(ret != LDB_SUCCESS || !res->count, MAPISTORE_ERROR, mem_ctx);
+
+ type = ldb_msg_find_attr_as_int(res->msgs[0], "propType", 0);
+ MAPISTORE_RETVAL_IF(!type, MAPISTORE_ERROR, mem_ctx);
+
+ *propTypeP = type;
+
+ talloc_free(mem_ctx);
+
+ return rc;
+}
switch (table_object->object.table->ulType) {
case MAPISTORE_FOLDER_TABLE:
ret = emsmdbp_object_open_folder(odb_ctx, table_object->parent_object->emsmdbp_ctx, table_object->parent_object, *(uint64_t *)rowFMId, &rowobject);
- mapistore_folder = emsmdbp_is_mapistore(rowobject);
- if (mapistore_folder) {
- contextID = emsmdbp_get_contextID(rowobject);
+ if (ret == MAPISTORE_SUCCESS) {
+ mapistore_folder = emsmdbp_is_mapistore(rowobject);
+ if (mapistore_folder) {
+ contextID = emsmdbp_get_contextID(rowobject);
+ }
}
break;
case MAPISTORE_MESSAGE_TABLE:
else { /* keyword: folderChange */
SPropTagArray_add(synccontext, &synccontext->properties, PidTagParentFolderId); /* PidTagParentSourceKey */
SPropTagArray_add(synccontext, &synccontext->properties, PidTagFolderId); /* PidTagSourceKey */
+ properties_exclusion[PidTagMessageClass >> 16] = false;
}
SPropTagArray_add(synccontext, &synccontext->properties, PidTagChangeNumber);
SPropTagArray_add(synccontext, &synccontext->properties, PidTagChangeKey);
struct GetProps_req *request;
struct GetProps_repl *response;
uint32_t handle;
+ uint16_t property_id, property_type;
struct mapi_handles *rec = NULL;
void *private_data = NULL;
struct emsmdbp_object *object;
for (i = 0; i < request->prop_count; i++) {
properties->aulPropTag[i] = request->properties[i];
if ((request->properties[i] & 0xffff) == 0) {
- properties->aulPropTag[i] |= get_property_type(request->properties[i] >> 16);
- untyped_status[i] = true;
+ property_id = request->properties[i] >> 16;
+ if (property_id < 0x8000) {
+ property_type = get_property_type(property_id);
+ }
+ else {
+ property_type = 0;
+ mapistore_namedprops_get_nameid_type(emsmdbp_ctx->mstore_ctx->nprops_ctx, property_id, &property_type);
+ }
+ if (property_type) {
+ properties->aulPropTag[i] |= property_type;
+ untyped_status[i] = true;
+ }
+ else {
+ properties->aulPropTag[i] |= PT_ERROR; /* fail with a MAPI_E_NOT_FOUND */
+ untyped_status[i] = false;
+ }
}
else {
untyped_status[i] = false;
enum MAPISTATUS retval = MAPI_E_SUCCESS;
struct emsabp_context *emsabp_ctx = NULL;
struct SPropTagArray *pPropTags;
- struct SRowSet *pRows;
- uint32_t i, j;
+ struct PropertyRowSet_r *pRows;
+ uint32_t i, j, count;
DEBUG(3, ("exchange_nsp: NspiQueryRows (0x3)\n"));
}
/* Allocate RowSet to be filled in */
- pRows = talloc_zero(mem_ctx, struct SRowSet);
+ pRows = talloc_zero(mem_ctx, struct PropertyRowSet_r);
/* Step 2. Fill ppRows */
if (r->in.lpETable == NULL) {
goto failure;
}
- if (ldb_res->count) {
- pRows->cRows = ldb_res->count - r->in.pStat->NumPos;
- pRows->aRow = talloc_array(mem_ctx, struct SRow, pRows->cRows);
+ count = ldb_res->count - r->in.pStat->NumPos;
+ if (r->in.Count < count) {
+ count = r->in.Count;
+ }
+ if (count) {
+ pRows->cRows = count;
+ pRows->aRow = talloc_array(mem_ctx, struct PropertyRow_r, count);
}
/* fetch required attributes for every entry found */
- for (i = r->in.pStat->NumPos; i < ldb_res->count; i++) {
- retval = emsabp_fetch_attrs_from_msg(mem_ctx, emsabp_ctx, &(pRows->aRow[i-r->in.pStat->NumPos]),
- ldb_res->msgs[i], 0, r->in.dwFlags, pPropTags);
+ for (i = 0; i < count; i++) {
+ retval = emsabp_fetch_attrs_from_msg(mem_ctx, emsabp_ctx, pRows->aRow + i,
+ ldb_res->msgs[i+r->in.pStat->NumPos], 0, r->in.dwFlags, pPropTags);
if (!MAPI_STATUS_IS_OK(retval)) {
goto failure;
}
j = 0;
if (r->in.pStat->NumPos < r->in.dwETableCount) {
pRows->cRows = r->in.dwETableCount - r->in.pStat->NumPos;
- pRows->aRow = talloc_array(mem_ctx, struct SRow, pRows->cRows);
+ pRows->aRow = talloc_array(mem_ctx, struct PropertyRow_r, pRows->cRows);
for (i = r->in.pStat->NumPos; i < r->in.dwETableCount; i++) {
retval = emsabp_fetch_attrs(mem_ctx, emsabp_ctx, &(pRows->aRow[j]), r->in.lpETable[i], r->in.dwFlags, pPropTags);
if (retval != MAPI_E_SUCCESS) {
goto end;
}
- r->out.pRows = talloc_zero(mem_ctx, struct SRowSet *);
- r->out.pRows[0] = talloc_zero(mem_ctx, struct SRowSet);
+ r->out.pRows = talloc_zero(mem_ctx, struct PropertyRowSet_r *);
+ r->out.pRows[0] = talloc_zero(mem_ctx, struct PropertyRowSet_r);
r->out.pRows[0]->cRows = mids->cValues;
- r->out.pRows[0]->aRow = talloc_array(mem_ctx, struct SRow, mids->cValues);
+ r->out.pRows[0]->aRow = talloc_array(mem_ctx, struct PropertyRow_r, mids->cValues);
for (row = 0; row < mids->cValues; row++) {
ret = emsabp_fetch_attrs(mem_ctx, emsabp_ctx, &(r->out.pRows[0]->aRow[row]),
mids->aulPropTag[row], fEphID, r->in.pPropTags);
failure:
r->out.pStat = r->in.pStat;
*r->out.ppOutMIds = ppOutMIds;
- r->out.ppRows = talloc(mem_ctx, struct SRowSet *);
+ r->out.ppRows = talloc(mem_ctx, struct PropertyRowSet_r *);
r->out.ppRows[0] = NULL;
DCESRV_NSP_RETURN(r, retval, NULL);
}
*r->out.ppOutMIds = ppOutMIds;
/* Step 2. Retrieve requested properties for these MIds */
- r->out.ppRows = talloc_zero(mem_ctx, struct SRowSet *);
- r->out.ppRows[0] = talloc_zero(mem_ctx, struct SRowSet);
+ r->out.ppRows = talloc_zero(mem_ctx, struct PropertyRowSet_r *);
+ r->out.ppRows[0] = talloc_zero(mem_ctx, struct PropertyRowSet_r);
r->out.ppRows[0]->cRows = ppOutMIds->cValues;
- r->out.ppRows[0]->aRow = talloc_array(mem_ctx, struct SRow, ppOutMIds->cValues);
+ r->out.ppRows[0]->aRow = talloc_array(mem_ctx, struct PropertyRow_r, ppOutMIds->cValues);
for (i = 0; i < ppOutMIds->cValues; i++) {
retval = emsabp_fetch_attrs(mem_ctx, emsabp_ctx, &(r->out.ppRows[0]->aRow[i]),
}
/* Step 2. Fetch properties */
- r->out.ppRows = talloc_array(mem_ctx, struct SRow *, 2);
- r->out.ppRows[0] = talloc_zero(r->out.ppRows, struct SRow);
- r->out.ppRows[0]->ulAdrEntryPad = 0;
+ r->out.ppRows = talloc_array(mem_ctx, struct PropertyRow_r *, 2);
+ r->out.ppRows[0] = talloc_zero(r->out.ppRows, struct PropertyRow_r);
pPropTags = r->in.pPropTags;
if (!pPropTags) {
/* Is MId is not found, proceed as if no attributes were found */
if (retval == MAPI_E_INVALID_BOOKMARK) {
uint32_t ulPropTag;
- struct SRow *aRow;
+ struct PropertyRow_r *aRow;
aRow = r->out.ppRows[0];
- aRow->ulAdrEntryPad = 0x0;
+ aRow->Reserved = 0x0;
aRow->cValues = r->in.pPropTags->cValues;
- aRow->lpProps = talloc_array(mem_ctx, struct SPropValue, aRow->cValues);
+ aRow->lpProps = talloc_array(mem_ctx, struct PropertyValue_r, aRow->cValues);
for (i = 0; i < aRow->cValues; i++) {
ulPropTag = r->in.pPropTags->aulPropTag[i];
ulPropTag = (ulPropTag & 0xFFFF0000) | PT_ERROR;
aRow->lpProps[i].ulPropTag = (enum MAPITAGS) ulPropTag;
aRow->lpProps[i].dwAlignPad = 0x0;
- set_SPropValue(&(aRow->lpProps[i]), NULL);
+ set_PropertyValue(&(aRow->lpProps[i]), NULL);
}
retval = MAPI_W_ERRORS_RETURNED;
} else {
*r->out.lpVersion = 0x1;
/* Step 2. Allocate output SRowSet and call associated emsabp function */
- r->out.ppRows = talloc_zero(mem_ctx, struct SRowSet *);
+ r->out.ppRows = talloc_zero(mem_ctx, struct PropertyRowSet_r *);
if (!r->out.ppRows) {
DCESRV_NSP_RETURN(r, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);
}
- r->out.ppRows[0] = talloc_zero(mem_ctx, struct SRowSet);
+ r->out.ppRows[0] = talloc_zero(mem_ctx, struct PropertyRowSet_r);
if (!r->out.ppRows[0]) {
DCESRV_NSP_RETURN(r, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);
}
struct SPropTagArray *pPropTags;
const char *purportedSearch;
struct PropertyTagArray_r *pMIds = NULL;
- struct SRowSet *pRows = NULL;
+ struct PropertyRowSet_r *pRows = NULL;
struct StringsArray_r *paStr;
uint32_t i;
int ret;
pMIds = talloc(mem_ctx, struct PropertyTagArray_r);
pMIds->cValues = paStr->Count;
pMIds->aulPropTag = (uint32_t *) talloc_array(mem_ctx, uint32_t, pMIds->cValues);
- pRows = talloc(mem_ctx, struct SRowSet);
+ pRows = talloc(mem_ctx, struct PropertyRowSet_r);
pRows->cRows = 0;
- pRows->aRow = talloc_array(mem_ctx, struct SRow, pMIds->cValues);
+ pRows->aRow = talloc_array(mem_ctx, struct PropertyRow_r, pMIds->cValues);
/* Step 2. Fetch AB container records */
for (i = 0; i < paStr->Count; i++) {
struct SPropTagArray *pPropTags;
const char *purportedSearch;
struct PropertyTagArray_r *pMIds = NULL;
- struct SRowSet *pRows = NULL;
+ struct PropertyRowSet_r *pRows = NULL;
struct StringsArrayW_r *paWStr;
uint32_t i;
int ret;
pMIds = talloc(mem_ctx, struct PropertyTagArray_r);
pMIds->cValues = paWStr->Count;
pMIds->aulPropTag = talloc_array(mem_ctx, uint32_t, pMIds->cValues);
- pRows = talloc(mem_ctx, struct SRowSet);
+ pRows = talloc(mem_ctx, struct PropertyRowSet_r);
pRows->cRows = 0;
- pRows->aRow = talloc_array(mem_ctx, struct SRow, pMIds->cValues);
+ pRows->aRow = talloc_array(mem_ctx, struct PropertyRow_r, pMIds->cValues);
/* Step 2. Fetch AB container records */
for (i = 0; i < paWStr->Count; i++) {
enum MAPISTATUS emsabp_set_PermanentEntryID(struct emsabp_context *, uint32_t, struct ldb_message *, struct PermanentEntryID *);
enum MAPISTATUS emsabp_EphemeralEntryID_to_Binary_r(TALLOC_CTX *, struct EphemeralEntryID *, struct Binary_r *);
enum MAPISTATUS emsabp_PermanentEntryID_to_Binary_r(TALLOC_CTX *, struct PermanentEntryID *, struct Binary_r *);
-enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *, struct emsabp_context *, uint32_t, struct SRowSet **);
-enum MAPISTATUS emsabp_get_CreationTemplatesTable(TALLOC_CTX *, struct emsabp_context *, uint32_t, struct SRowSet **);
+enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *, struct emsabp_context *, uint32_t, struct PropertyRowSet_r **);
+enum MAPISTATUS emsabp_get_CreationTemplatesTable(TALLOC_CTX *, struct emsabp_context *, uint32_t, struct PropertyRowSet_r **);
void *emsabp_query(TALLOC_CTX *, struct emsabp_context *, struct ldb_message *, uint32_t, uint32_t, uint32_t);
-enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *, struct emsabp_context *, struct SRow *, struct ldb_message *, uint32_t, uint32_t, struct SPropTagArray *);
-enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *, struct emsabp_context *, struct SRow *, uint32_t, uint32_t, struct SPropTagArray *);
-enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *, struct emsabp_context *, struct SRow *, uint32_t, struct PermanentEntryID *,
+enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *, struct emsabp_context *, struct PropertyRow_r *, struct ldb_message *, uint32_t, uint32_t, struct SPropTagArray *);
+enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *, struct emsabp_context *, struct PropertyRow_r *, uint32_t, uint32_t, struct SPropTagArray *);
+enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *, struct emsabp_context *, struct PropertyRow_r *, uint32_t, struct PermanentEntryID *,
struct PermanentEntryID *, struct ldb_message *, bool);
enum MAPISTATUS emsabp_search(TALLOC_CTX *, struct emsabp_context *, struct PropertyTagArray_r *, struct Restriction_r *, struct STAT *, uint32_t);
enum MAPISTATUS emsabp_search_dn(struct emsabp_context *, const char *, struct ldb_message **);
case PR_ADDRTYPE_UNICODE:
data = (void *) talloc_strdup(mem_ctx, EMSABP_ADDRTYPE /* "SMTP" */);
return data;
- case PR_SMTP_ADDRESS:
- case PR_SMTP_ADDRESS_UNICODE:
- data = NULL;
- ldb_element = ldb_msg_find_element(msg, emsabp_property_get_attribute(PR_EMS_AB_PROXY_ADDRESSES_UNICODE));
- if (ldb_element) {
- for (i = 0; !data && i < ldb_element->num_values; i++) {
- ldb_string = (const char *) ldb_element->values[i].data;
- if (!strncmp(ldb_string, "SMTP:", 5)) {
- data = (void *) talloc_strdup(mem_ctx, ldb_string + 5);
- }
- }
- }
-
- return data;
case PR_OBJECT_TYPE:
data = talloc_zero(mem_ctx, uint32_t);
*((uint32_t *)data) = MAPI_MAILUSER;
*/
_PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *mem_ctx,
struct emsabp_context *emsabp_ctx,
- struct SRow *aRow,
+ struct PropertyRow_r *aRow,
struct ldb_message *ldb_msg,
uint32_t MId, uint32_t dwFlags,
struct SPropTagArray *pPropTags)
}
/* Step 1. Retrieve property values and build aRow */
- aRow->ulAdrEntryPad = 0x0;
+ aRow->Reserved = 0x0;
aRow->cValues = pPropTags->cValues;
- aRow->lpProps = talloc_array(mem_ctx, struct SPropValue, aRow->cValues);
+ aRow->lpProps = talloc_array(mem_ctx, struct PropertyValue_r, aRow->cValues);
for (i = 0; i < aRow->cValues; i++) {
ulPropTag = pPropTags->aulPropTag[i];
aRow->lpProps[i].ulPropTag = (enum MAPITAGS) ulPropTag;
aRow->lpProps[i].dwAlignPad = 0x0;
- set_SPropValue(&(aRow->lpProps[i]), data);
+ set_PropertyValue(&(aRow->lpProps[i]), data);
}
return MAPI_E_SUCCESS;
\return MAPI_E_SUCCESS on success, otherwise MAPI error
*/
_PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx,
- struct SRow *aRow, uint32_t MId, uint32_t dwFlags,
+ struct PropertyRow_r *aRow, uint32_t MId, uint32_t dwFlags,
struct SPropTagArray *pPropTags)
{
enum MAPISTATUS retval;
OPENCHANGE_RETVAL_IF(ret != LDB_SUCCESS || !res->count || res->count != 1, MAPI_E_CORRUPT_STORE, NULL);
/* Step 2. Retrieve property values and build aRow */
- aRow->ulAdrEntryPad = 0x0;
+ aRow->Reserved = 0x0;
aRow->cValues = pPropTags->cValues;
- aRow->lpProps = talloc_array(mem_ctx, struct SPropValue, aRow->cValues);
+ aRow->lpProps = talloc_array(mem_ctx, struct PropertyValue_r, aRow->cValues);
for (i = 0; i < aRow->cValues; i++) {
ulPropTag = pPropTags->aulPropTag[i];
aRow->lpProps[i].ulPropTag = (enum MAPITAGS) ulPropTag;
aRow->lpProps[i].dwAlignPad = 0x0;
- set_SPropValue(&(aRow->lpProps[i]), data);
+ set_PropertyValue(&(aRow->lpProps[i]), data);
}
\return MAPI_E_SUCCESS on success, otherwise MAPI error
*/
_PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx,
- struct SRow *aRow, uint32_t dwFlags,
+ struct PropertyRow_r *aRow, uint32_t dwFlags,
struct PermanentEntryID *permEntryID,
struct PermanentEntryID *parentPermEntryID,
struct ldb_message *msg, bool child)
{
enum MAPISTATUS retval;
struct SPropTagArray *SPropTagArray;
- struct SPropValue lpProps;
+ struct PropertyValue_r lpProps;
int proptag;
uint32_t i;
uint32_t containerID = 0;
}
/* Step 2. Allocate SPropValue array and update SRow cValues field */
- aRow->ulAdrEntryPad = 0x0;
+ aRow->Reserved = 0x0;
aRow->cValues = 0x0;
- aRow->lpProps = talloc_zero(mem_ctx, struct SPropValue);
+ aRow->lpProps = talloc_zero(mem_ctx, struct PropertyValue_r);
/* Step 3. Global Address List or real container */
if (!msg) {
default:
break;
}
- SRow_addprop(aRow, lpProps);
- /* SRow_addprop internals overwrite with MAPI_E_NOT_FOUND when data is NULL */
+ PropertyRow_addprop(aRow, lpProps);
+ /* PropertyRow_addprop internals overwrite with MAPI_E_NOT_FOUND when data is NULL */
if (SPropTagArray->aulPropTag[i] == PR_DISPLAY_NAME ||
SPropTagArray->aulPropTag[i] == PR_DISPLAY_NAME_UNICODE) {
aRow->lpProps[aRow->cValues - 1].value.lpszA = NULL;
default:
break;
}
- SRow_addprop(aRow, lpProps);
+ PropertyRow_addprop(aRow, lpProps);
}
}
\return MAPI_E_SUCCESS on success, otherwise MAPI_E_CORRUPT_STORE
*/
_PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx,
- uint32_t dwFlags, struct SRowSet **SRowSet)
+ uint32_t dwFlags, struct PropertyRowSet_r **SRowSet)
{
enum MAPISTATUS retval;
- struct SRow *aRow;
+ struct PropertyRow_r *aRow;
struct PermanentEntryID gal;
struct PermanentEntryID parentPermEntryID;
struct PermanentEntryID permEntryID;
uint32_t i;
/* Step 1. Build the 'Global Address List' object using PermanentEntryID */
- aRow = talloc_zero(mem_ctx, struct SRow);
+ aRow = talloc_zero(mem_ctx, struct PropertyRow_r);
OPENCHANGE_RETVAL_IF(!aRow, MAPI_E_NOT_ENOUGH_RESOURCES, NULL);
aRow_idx = 0;
scope, recipient_attrs, NULL);
OPENCHANGE_RETVAL_IF(ret != LDB_SUCCESS || !res->count || res->count != 1, MAPI_E_CORRUPT_STORE, aRow);
- aRow = talloc_realloc(mem_ctx, aRow, struct SRow, aRow_idx + 1);
+ aRow = talloc_realloc(mem_ctx, aRow, struct PropertyRow_r, aRow_idx + 1);
retval = emsabp_set_PermanentEntryID(emsabp_ctx, DT_CONTAINER, res->msgs[0], &parentPermEntryID);
emsabp_table_fetch_attrs(mem_ctx, emsabp_ctx, &aRow[aRow_idx], dwFlags, &parentPermEntryID, NULL, res->msgs[0], false);
aRow_idx++;
OPENCHANGE_RETVAL_IF(1, MAPI_E_CORRUPT_STORE, aRow);
}
- aRow = talloc_realloc(mem_ctx, aRow, struct SRow, aRow_idx + res->count + 1);
+ aRow = talloc_realloc(mem_ctx, aRow, struct PropertyRow_r, aRow_idx + res->count + 1);
for (i = 0; res->msgs[i]; i++) {
retval = emsabp_set_PermanentEntryID(emsabp_ctx, DT_CONTAINER, res->msgs[i], &permEntryID);
\return MAPI_E_SUCCESS on success, otherwise MAPI_E_CORRUPT_STORE
*/
_PUBLIC_ enum MAPISTATUS emsabp_get_CreationTemplatesTable(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_ctx,
- uint32_t dwFlags, struct SRowSet **SRowSet)
+ uint32_t dwFlags, struct PropertyRowSet_r **SRowSet)
{
return MAPI_E_SUCCESS;
}
return MAPI_E_NO_SUPPORT;
}
- attr = (char *)get_SPropValue_data(res_prop->lpProp);
+ attr = (char *)get_PropertyValue_data(res_prop->lpProp);
if (attr == NULL) {
return MAPI_E_NO_SUPPORT;
}
if ((res_prop->ulPropTag & 0xFFFF) == 0x101e) {
- struct StringArray_r *attr_ml = (struct StringArray_r *) get_SPropValue_data(res_prop->lpProp);
+ struct StringArray_r *attr_ml = (struct StringArray_r *) get_PropertyValue_data(res_prop->lpProp);
attr = (char *)attr_ml->lppszA[0];
} else {
- attr = (char *)get_SPropValue_data(res_prop->lpProp);
+ attr = (char *)get_PropertyValue_data(res_prop->lpProp);
}
if (attr == NULL) {
return MAPI_E_NO_SUPPORT;
_PUBLIC_ enum MAPISTATUS emsabp_ab_container_enum(TALLOC_CTX *mem_ctx,
struct emsabp_context *emsabp_ctx,
uint32_t ContainerID,
- struct ldb_result **ldb_res)
+ struct ldb_result **ldb_resp)
{
- enum MAPISTATUS retval;
- int ldb_ret;
- struct ldb_message *ldb_msg_ab;
- const char *purportedSearch;
- const char * const recipient_attrs[] = { "*", NULL };
+ enum MAPISTATUS retval;
+ int ldb_ret;
+ struct ldb_request *ldb_req;
+ struct ldb_result *ldb_res;
+ struct ldb_message *ldb_msg_ab;
+ const char *purportedSearch;
+ char *expression;
+ const char * const recipient_attrs[] = { "*", NULL };
+ struct ldb_server_sort_control **ldb_sort_controls;
/* Fetch AB container record */
retval = emsabp_ab_container_by_id(mem_ctx, emsabp_ctx, ContainerID, &ldb_msg_ab);
purportedSearch = ldb_msg_find_attr_as_string(ldb_msg_ab, "purportedSearch", NULL);
if (!purportedSearch) {
- *ldb_res = talloc_zero(mem_ctx, struct ldb_result);
+ *ldb_resp = talloc_zero(mem_ctx, struct ldb_result);
return MAPI_E_SUCCESS;
}
OPENCHANGE_RETVAL_IF(!purportedSearch, MAPI_E_INVALID_BOOKMARK, NULL);
/* Search AD with purportedSearch filter */
- ldb_ret = ldb_search(emsabp_ctx->samdb_ctx, mem_ctx, ldb_res,
- ldb_get_default_basedn(emsabp_ctx->samdb_ctx),
- LDB_SCOPE_SUBTREE, recipient_attrs,
- "%s", purportedSearch);
+
+ ldb_res = talloc_zero(mem_ctx, struct ldb_result);
+ if (!ldb_res) {
+ *ldb_resp = NULL;
+ return MAPI_E_NOT_FOUND;
+ }
+
+ expression = talloc_asprintf(mem_ctx, "%s", purportedSearch);
+ if (!expression) {
+ talloc_free(ldb_res);
+ return MAPI_E_NOT_FOUND;
+ }
+
+ ldb_req = NULL;
+ ldb_ret = ldb_build_search_req(&ldb_req, emsabp_ctx->samdb_ctx, mem_ctx,
+ ldb_get_default_basedn(emsabp_ctx->samdb_ctx),
+ LDB_SCOPE_SUBTREE,
+ expression,
+ recipient_attrs,
+ NULL,
+ ldb_res,
+ ldb_search_default_callback,
+ NULL);
+ if (ldb_ret != LDB_SUCCESS) goto done;
+
+ ldb_sort_controls = talloc_array(expression, struct ldb_server_sort_control *, 2);
+ ldb_sort_controls[0] = talloc(ldb_sort_controls, struct ldb_server_sort_control);
+ ldb_sort_controls[0]->attributeName = talloc_strdup(ldb_sort_controls, "displayName");
+ ldb_sort_controls[0]->orderingRule = NULL;
+ ldb_sort_controls[0]->reverse = 0;
+ ldb_sort_controls[1] = NULL;
+ ldb_request_add_control(ldb_req, LDB_CONTROL_SERVER_SORT_OID, false, ldb_sort_controls);
+
+ ldb_ret = ldb_request(emsabp_ctx->samdb_ctx, ldb_req);
+
+ if (ldb_ret == LDB_SUCCESS) {
+ ldb_ret = ldb_wait(ldb_req->handle, LDB_WAIT_ALL);
+ }
+
+done:
+ talloc_free(expression);
+ if (ldb_req) {
+ talloc_free(ldb_req);
+ }
+
+ if (ldb_ret != LDB_SUCCESS) {
+ talloc_free(ldb_res);
+ ldb_res = NULL;
+ }
+
+ *ldb_resp = ldb_res;
return (ldb_ret != LDB_SUCCESS) ? MAPI_E_NOT_FOUND : MAPI_E_SUCCESS;
}
{ PidTagGivenName, "givenName", false, NULL },
{ PidTagSurname, "sn", false, NULL },
{ PidTagTransmittableDisplayName, "displayName", false, NULL },
+ { PidTagPrimarySmtpAddress, "mail", false, NULL },
{ PidTag7BitDisplayName, "displayName", false, NULL },
{ PR_EMS_AB_HOME_MTA, "homeMTA", true, "legacyExchangeDN" },
{ PR_EMS_AB_ASSOC_NT_ACCOUNT, "assocNTAccount", false, NULL },
#include "libmapi/libmapi_private.h"
#include <ndr.h>
#include "gen_ndr/ndr_exchange.h"
+#include "gen_ndr/ndr_property.h"
#define MIN(a,b) ((a)<(b)?(a):(b))
{
return NDR_ERR_SUCCESS;
}
+
+/* property.idl */
+
+_PUBLIC_ enum ndr_err_code ndr_push_ExtendedException(struct ndr_push *ndr, int ndr_flags, uint16_t WriterVersion2, const struct ExceptionInfo *ExceptionInfo, const struct ExtendedException *r)
+{
+ bool subjectIsSet, locationIsSet;
+ uint32_t cntr_WideCharSubject_0;
+ uint32_t cntr_WideCharLocation_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+
+
+ subjectIsSet = (ExceptionInfo->OverrideFlags & ARO_SUBJECT) == ARO_SUBJECT;
+ locationIsSet = (ExceptionInfo->OverrideFlags & ARO_LOCATION) == ARO_LOCATION;
+
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ if (WriterVersion2 > 0x3008) {
+ NDR_CHECK(ndr_push_ChangeHighlight(ndr, NDR_SCALARS, &r->ChangeHighlight));
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlockEE1Size));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ReservedBlockEE1, r->ReservedBlockEE1Size));
+ if (subjectIsSet || locationIsSet) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->StartDateTime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->EndDateTime));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->OriginalStartDate));
+ }
+ if (subjectIsSet) {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->WideCharSubjectLength));
+ for (cntr_WideCharSubject_0 = 0; cntr_WideCharSubject_0 < r->WideCharSubjectLength; cntr_WideCharSubject_0++) {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->WideCharSubject[cntr_WideCharSubject_0]));
+ }
+ }
+ if (locationIsSet) {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->WideCharLocationLength));
+ for (cntr_WideCharLocation_0 = 0; cntr_WideCharLocation_0 < r->WideCharLocationLength; cntr_WideCharLocation_0++) {
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->WideCharLocation[cntr_WideCharLocation_0]));
+ }
+ }
+ if (subjectIsSet || locationIsSet) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlockEE2Size));
+ NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, r->ReservedBlockEE2, r->ReservedBlockEE2Size));
+ }
+ NDR_CHECK(ndr_push_trailer_align(ndr, 4));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_ExtendedException(struct ndr_pull *ndr, int ndr_flags, uint16_t WriterVersion2, const struct ExceptionInfo *ExceptionInfo, struct ExtendedException *r)
+{
+ bool subjectIsSet, locationIsSet;
+ uint32_t cntr_WideCharSubject_0;
+ TALLOC_CTX *_mem_save_WideCharSubject_0;
+ uint32_t cntr_WideCharLocation_0;
+ TALLOC_CTX *_mem_save_WideCharLocation_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+
+ subjectIsSet = (ExceptionInfo->OverrideFlags & ARO_SUBJECT) == ARO_SUBJECT;
+ locationIsSet = (ExceptionInfo->OverrideFlags & ARO_LOCATION) == ARO_LOCATION;
+
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ if (WriterVersion2 > 0x3008) {
+ NDR_CHECK(ndr_pull_ChangeHighlight(ndr, NDR_SCALARS, &r->ChangeHighlight));
+ }
+ else {
+ memset(&r->ChangeHighlight, 0, sizeof(struct ChangeHighlight));
+ }
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlockEE1Size));
+ NDR_PULL_ALLOC_N(ndr, r->ReservedBlockEE1, r->ReservedBlockEE1Size);
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ReservedBlockEE1, r->ReservedBlockEE1Size));
+ if (subjectIsSet || locationIsSet) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->StartDateTime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->EndDateTime));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->OriginalStartDate));
+ }
+ if (subjectIsSet) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WideCharSubjectLength));
+ NDR_PULL_ALLOC_N(ndr, r->WideCharSubject, r->WideCharSubjectLength);
+ _mem_save_WideCharSubject_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->WideCharSubject, 0);
+ for (cntr_WideCharSubject_0 = 0; cntr_WideCharSubject_0 < r->WideCharSubjectLength; cntr_WideCharSubject_0++) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WideCharSubject[cntr_WideCharSubject_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_WideCharSubject_0, 0);
+ }
+ if (locationIsSet) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WideCharLocationLength));
+ NDR_PULL_ALLOC_N(ndr, r->WideCharLocation, r->WideCharLocationLength);
+ _mem_save_WideCharLocation_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->WideCharLocation, 0);
+ for (cntr_WideCharLocation_0 = 0; cntr_WideCharLocation_0 < r->WideCharLocationLength; cntr_WideCharLocation_0++) {
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->WideCharLocation[cntr_WideCharLocation_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_WideCharLocation_0, 0);
+ }
+ if (subjectIsSet || locationIsSet) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlockEE2Size));
+ NDR_PULL_ALLOC_N(ndr, r->ReservedBlockEE2, r->ReservedBlockEE2Size);
+ NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, r->ReservedBlockEE2, r->ReservedBlockEE2Size));
+ }
+ NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_push_AppointmentRecurrencePattern(struct ndr_push *ndr, int ndr_flags, const struct AppointmentRecurrencePattern *r)
+{
+ uint32_t cntr_ExceptionInfo_0;
+ uint32_t cntr_ReservedBlock1_0;
+ uint32_t cntr_ExtendedException_0;
+ uint32_t cntr_ReservedBlock2_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ NDR_PUSH_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_push_align(ndr, 4));
+ NDR_CHECK(ndr_push_RecurrencePattern(ndr, NDR_SCALARS, &r->RecurrencePattern));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReaderVersion2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->WriterVersion2));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->StartTimeOffset));
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->EndTimeOffset));
+ NDR_CHECK(ndr_push_uint16(ndr, NDR_SCALARS, r->ExceptionCount));
+ for (cntr_ExceptionInfo_0 = 0; cntr_ExceptionInfo_0 < r->ExceptionCount; cntr_ExceptionInfo_0++) {
+ NDR_CHECK(ndr_push_ExceptionInfo(ndr, NDR_SCALARS, &r->ExceptionInfo[cntr_ExceptionInfo_0]));
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlock1Size));
+ for (cntr_ReservedBlock1_0 = 0; cntr_ReservedBlock1_0 < r->ReservedBlock1Size; cntr_ReservedBlock1_0++) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlock1[cntr_ReservedBlock1_0]));
+ }
+ for (cntr_ExtendedException_0 = 0; cntr_ExtendedException_0 < r->ExceptionCount; cntr_ExtendedException_0++) {
+ NDR_CHECK(ndr_push_ExtendedException(ndr, NDR_SCALARS, r->WriterVersion2, r->ExceptionInfo + cntr_ExtendedException_0, &r->ExtendedException[cntr_ExtendedException_0]));
+ }
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlock2Size));
+ for (cntr_ReservedBlock2_0 = 0; cntr_ReservedBlock2_0 < r->ReservedBlock2Size; cntr_ReservedBlock2_0++) {
+ NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, r->ReservedBlock2[cntr_ReservedBlock2_0]));
+ }
+ NDR_CHECK(ndr_push_trailer_align(ndr, 4));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_push_RecurrencePattern(ndr, NDR_BUFFERS, &r->RecurrencePattern));
+ for (cntr_ExceptionInfo_0 = 0; cntr_ExceptionInfo_0 < r->ExceptionCount; cntr_ExceptionInfo_0++) {
+ NDR_CHECK(ndr_push_ExceptionInfo(ndr, NDR_BUFFERS, &r->ExceptionInfo[cntr_ExceptionInfo_0]));
+ }
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
+
+_PUBLIC_ enum ndr_err_code ndr_pull_AppointmentRecurrencePattern(struct ndr_pull *ndr, int ndr_flags, struct AppointmentRecurrencePattern *r)
+{
+ uint32_t cntr_ExceptionInfo_0;
+ TALLOC_CTX *_mem_save_ExceptionInfo_0;
+ uint32_t cntr_ReservedBlock1_0;
+ TALLOC_CTX *_mem_save_ReservedBlock1_0;
+ uint32_t cntr_ExtendedException_0;
+ TALLOC_CTX *_mem_save_ExtendedException_0;
+ uint32_t cntr_ReservedBlock2_0;
+ TALLOC_CTX *_mem_save_ReservedBlock2_0;
+ {
+ uint32_t _flags_save_STRUCT = ndr->flags;
+ ndr_set_flags(&ndr->flags, LIBNDR_FLAG_NOALIGN);
+ NDR_PULL_CHECK_FLAGS(ndr, ndr_flags);
+ if (ndr_flags & NDR_SCALARS) {
+ NDR_CHECK(ndr_pull_align(ndr, 4));
+ NDR_CHECK(ndr_pull_RecurrencePattern(ndr, NDR_SCALARS, &r->RecurrencePattern));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReaderVersion2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->WriterVersion2));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->StartTimeOffset));
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->EndTimeOffset));
+ NDR_CHECK(ndr_pull_uint16(ndr, NDR_SCALARS, &r->ExceptionCount));
+ NDR_PULL_ALLOC_N(ndr, r->ExceptionInfo, r->ExceptionCount);
+ _mem_save_ExceptionInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ExceptionInfo, 0);
+ for (cntr_ExceptionInfo_0 = 0; cntr_ExceptionInfo_0 < r->ExceptionCount; cntr_ExceptionInfo_0++) {
+ NDR_CHECK(ndr_pull_ExceptionInfo(ndr, NDR_SCALARS, &r->ExceptionInfo[cntr_ExceptionInfo_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ExceptionInfo_0, 0);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlock1Size));
+ NDR_PULL_ALLOC_N(ndr, r->ReservedBlock1, r->ReservedBlock1Size);
+ _mem_save_ReservedBlock1_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ReservedBlock1, 0);
+ for (cntr_ReservedBlock1_0 = 0; cntr_ReservedBlock1_0 < r->ReservedBlock1Size; cntr_ReservedBlock1_0++) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlock1[cntr_ReservedBlock1_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ReservedBlock1_0, 0);
+ NDR_PULL_ALLOC_N(ndr, r->ExtendedException, r->ExceptionCount);
+ _mem_save_ExtendedException_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ExtendedException, 0);
+ for (cntr_ExtendedException_0 = 0; cntr_ExtendedException_0 < r->ExceptionCount; cntr_ExtendedException_0++) {
+ NDR_CHECK(ndr_pull_ExtendedException(ndr, NDR_SCALARS, r->WriterVersion2, r->ExceptionInfo + cntr_ExtendedException_0, &r->ExtendedException[cntr_ExtendedException_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ExtendedException_0, 0);
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlock2Size));
+ NDR_PULL_ALLOC_N(ndr, r->ReservedBlock2, r->ReservedBlock2Size);
+ _mem_save_ReservedBlock2_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ReservedBlock2, 0);
+ for (cntr_ReservedBlock2_0 = 0; cntr_ReservedBlock2_0 < r->ReservedBlock2Size; cntr_ReservedBlock2_0++) {
+ NDR_CHECK(ndr_pull_uint32(ndr, NDR_SCALARS, &r->ReservedBlock2[cntr_ReservedBlock2_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ReservedBlock2_0, 0);
+ NDR_CHECK(ndr_pull_trailer_align(ndr, 4));
+ }
+ if (ndr_flags & NDR_BUFFERS) {
+ NDR_CHECK(ndr_pull_RecurrencePattern(ndr, NDR_BUFFERS, &r->RecurrencePattern));
+ _mem_save_ExceptionInfo_0 = NDR_PULL_GET_MEM_CTX(ndr);
+ NDR_PULL_SET_MEM_CTX(ndr, r->ExceptionInfo, 0);
+ for (cntr_ExceptionInfo_0 = 0; cntr_ExceptionInfo_0 < r->ExceptionCount; cntr_ExceptionInfo_0++) {
+ NDR_CHECK(ndr_pull_ExceptionInfo(ndr, NDR_BUFFERS, &r->ExceptionInfo[cntr_ExceptionInfo_0]));
+ }
+ NDR_PULL_SET_MEM_CTX(ndr, _mem_save_ExceptionInfo_0, 0);
+ }
+ ndr->flags = _flags_save_STRUCT;
+ }
+ return NDR_ERR_SUCCESS;
+}
uint32 EndDate;
} RecurrencePattern;
- typedef [public,flag(NDR_NOALIGN)] struct {
- uint32 ReservedBlockEE1Size;
- [size_is(ReservedBlockEE1Size)] uint8 ReservedBlockEE1[];
- uint32 StartDateTime;
- uint32 EndDateTime;
- uint32 OriginalStartDate;
- uint16 WideCharSubjectLength;
- [size_is(WideCharSubjectLength+1)] uint16 WideCharSubject[];
- uint16 WideCharLocationLength;
- [size_is(WideCharLocationLength+1)] uint16 WideCharLocation[];
- uint32 ReservedBlockEE2Size;
- [size_is(ReservedBlockEE2Size)] uint8 ReservedBlockEE2[];
- } OldExtendedException;
-
- typedef [public,flag(NDR_NOALIGN)] struct {
- uint32 ChangeHighlightSize;
- uint32 ChangeHighlightValue;
- uint32 Reserved;
- } ChangeHighlight;
-
- typedef [public,flag(NDR_NOALIGN)] struct {
- ChangeHighlight ChangeHighlight;
- uint32 ReservedBlockEE1Size;
- [size_is(ReservedBlockEE1Size)] uint8 ReservedBlockEE1[];
- uint32 StartDateTime;
- uint32 EndDateTime;
- uint32 OriginalStartDate;
- uint16 WideCharSubjectLength;
- [size_is(WideCharSubjectLength+1)] uint16 WideCharSubject[];
- uint16 WideCharLocationLength;
- [size_is(WideCharLocationLength+1)] uint16 WideCharLocation[];
- uint32 ReservedBlockEE2Size;
- [size_is(ReservedBlockEE2Size)] uint8 ReservedBlockEE2[];
- } ExtendedException;
-
typedef [public,flag(NDR_NOALIGN)] struct {
uint16 msgLength;
uint16 msgLength2;
- [size_is(msgLength)] uint8 msg[];
+ uint8 msg[msgLength2];
} Exception_Msg;
typedef [nodiscriminant, flag(NDR_NOALIGN)] union {
} Exception_Value;
typedef [public,flag(NDR_NOALIGN)] struct {
- uint32 StartDateTime;
- uint32 EndDateTime;
- uint32 OriginalStartDate;
- OverrideFlags OverrideFlags;
- [switch_is(OverrideFlags & 0x0001)] Exception_Value Subject;
- [switch_is(OverrideFlags & 0x0002)] Exception_Value MeetingType;
- [switch_is(OverrideFlags & 0x0004)] Exception_Value ReminderDelta;
- [switch_is(OverrideFlags & 0x0008)] Exception_Value ReminderSet;
- [switch_is(OverrideFlags & 0x0010)] Exception_Value Location;
- [switch_is(OverrideFlags & 0x0020)] Exception_Value BusyStatus;
- [switch_is(OverrideFlags & 0x0040)] Exception_Value Attachment;
- [switch_is(OverrideFlags & 0x0080)] Exception_Value SubType;
- [switch_is(OverrideFlags & 0x0100)] Exception_Value AppointmentColor;
+ uint32 StartDateTime;
+ uint32 EndDateTime;
+ uint32 OriginalStartDate;
+ OverrideFlags OverrideFlags;
+ [switch_is(OverrideFlags & 0x0001)] Exception_Value Subject;
+ [switch_is(OverrideFlags & 0x0002)] Exception_Value MeetingType;
+ [switch_is(OverrideFlags & 0x0004)] Exception_Value ReminderDelta;
+ [switch_is(OverrideFlags & 0x0008)] Exception_Value ReminderSet;
+ [switch_is(OverrideFlags & 0x0010)] Exception_Value Location;
+ [switch_is(OverrideFlags & 0x0020)] Exception_Value BusyStatus;
+ [switch_is(OverrideFlags & 0x0040)] Exception_Value Attachment;
+ [switch_is(OverrideFlags & 0x0080)] Exception_Value SubType;
+ [switch_is(OverrideFlags & 0x0100)] Exception_Value AppointmentColor;
} ExceptionInfo;
- typedef [nodiscriminant,flag(NDR_NOALIGN)] union {
- [case(0x3008)] OldExtendedException OldExtendedException;
- [default] ExtendedException ExtendedException;
- } ExtendedExceptionData;
-
typedef [public,flag(NDR_NOALIGN)] struct {
+ uint32 ChangeHighlightSize;
+ uint32 ChangeHighlightValue;
+ uint8 Reserved[ChangeHighlightSize-4];
+ } ChangeHighlight;
+
+ typedef [nopull,nopush,flag(NDR_NOALIGN)] struct {
+ ChangeHighlight ChangeHighlight;
+ uint32 ReservedBlockEE1Size;
+ uint8 ReservedBlockEE1[ReservedBlockEE1Size];
+ uint32 StartDateTime;
+ uint32 EndDateTime;
+ uint32 OriginalStartDate;
+ uint16 WideCharSubjectLength;
+ uint16 WideCharSubject[WideCharSubjectLength];
+ uint16 WideCharLocationLength;
+ uint16 WideCharLocation[WideCharLocationLength];
+ uint32 ReservedBlockEE2Size;
+ uint8 ReservedBlockEE2[ReservedBlockEE2Size];
+ } ExtendedException;
+
+ typedef [nopull,nopush,flag(NDR_NOALIGN)] struct {
RecurrencePattern RecurrencePattern;
uint32 ReaderVersion2;
uint32 WriterVersion2;
ExceptionInfo ExceptionInfo[ExceptionCount];
uint32 ReservedBlock1Size;
uint32 ReservedBlock1[ReservedBlock1Size];
- // // ExtendedException ExtendedException;
- [switch_is(WriterVersion2)] ExtendedExceptionData ExtendedExceptionData[ExceptionCount];
+ ExtendedException ExtendedException[ExceptionCount];
uint32 ReservedBlock2Size;
uint32 ReservedBlock2[ReservedBlock2Size];
} AppointmentRecurrencePattern;
extended_user = """
dn: %s
changetype: modify
-add: displayName
-displayName: %s
add: auxiliaryClass
auxiliaryClass: msExchBaseClass
add: mailNickName
proxyAddresses: SMTP:%s@%s
replace: msExchUserAccountControl
msExchUserAccountControl: 0
-""" % (user_dn, username, username, names.netbiosname, names.netbiosname, names.firstorg, names.domaindn, names.netbiosname, names.netbiosname, names.firstorg, names.domaindn, names.firstorg, username, names.firstorg, username, names.dnsdomain, username, username, names.dnsdomain)
+""" % (user_dn, username, names.netbiosname, names.netbiosname, names.firstorg, names.domaindn, names.netbiosname, names.netbiosname, names.firstorg, names.domaindn, names.firstorg, username, names.firstorg, username, names.dnsdomain, username, username, names.dnsdomain)
db.modify_ldif(extended_user)
+ res = db.search(base=user_dn, scope=SCOPE_BASE, attrs=["*"])
+ if len(res) == 1:
+ record = res[0]
+ else:
+ raise Exception, \
+ "this should never happen as we just modified the record..."
+ record_keys = map(lambda x: x.lower(), record.keys())
+
+ if "displayname" not in record_keys:
+ extended_user = "dn: %s\nadd: displayName\ndisplayName: %s\n" % (user_dn, username)
+ db.modify_ldif(extended_user)
+
+ if "mail" not in record_keys:
+ extended_user = "dn: %s\nadd: mail\nmail: %s@%s\n" % (user_dn, username, names.dnsdomain)
+ db.modify_ldif(extended_user)
+
print "[+] User %s extended and enabled" % username
{
enum MAPISTATUS retval;
struct SPropTagArray *SPropTagArray;
+ struct PropertyRowSet_r *RowSet = NULL;
struct SRowSet *SRowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
- struct SPropValue SPropValue;
+ struct PropertyValue_r value;
struct SPropValue lpProps[4];
const char *username[2];
const char *body;
username[0] = (char *)mt->profile->mailbox;
username[1] = NULL;
- SRowSet = talloc_zero(mt->mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mt->mem_ctx, struct PropertyRowSet_r);
flaglist = talloc_zero(mt->mem_ctx, struct PropertyTagArray_r);
retval = ResolveNames(mapi_object_get_session(obj_message), username, SPropTagArray,
- &SRowSet, &flaglist, MAPI_UNICODE);
+ &RowSet, &flaglist, MAPI_UNICODE);
MAPIFreeBuffer(SPropTagArray);
if (retval != MAPI_E_SUCCESS) {
mapitest_print_retval(mt, "(Common) ResolveNames");
- talloc_free(SRowSet);
+ talloc_free(RowSet);
talloc_free(flaglist);
return false;
}
- SPropValue.ulPropTag = PR_SEND_INTERNET_ENCODING;
- SPropValue.value.l = 0;
- ret = SRowSet_propcpy(mt->mem_ctx, SRowSet, SPropValue);
+ value.ulPropTag = PR_SEND_INTERNET_ENCODING;
+ value.value.l = 0;
+ ret = PropertyRowSet_propcpy(mt->mem_ctx, RowSet, value);
if (ret) return false;
+ SRowSet = talloc_zero(RowSet, struct SRowSet);
+ cast_PropertyRowSet_to_SRowSet(SRowSet, RowSet, SRowSet);
+
/* Set Recipients */
SetRecipientType(&(SRowSet->aRow[0]), MAPI_TO);
retval = ModifyRecipients(obj_message, SRowSet);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
if (retval != MAPI_E_SUCCESS) {
mapitest_print_retval(mt, "(Common) ModifyRecipients");
\note this is a simple wrapper for mapidump_PAB_entry(), only for use in mapitest.
*/
-_PUBLIC_ void mapitest_print_PAB_entry(struct mapitest *mt, struct SRow *aRow)
+_PUBLIC_ void mapitest_print_PAB_entry(struct mapitest *mt, struct PropertyRow_r *aRow)
{
if (mt->subunit_output) {
return;
*/
_PUBLIC_ bool mapitest_mapidump_pabentry(struct mapitest *mt)
{
- struct SRow pabentry;
- struct SPropValue SPropValue;
+ struct PropertyRow_r pabentry;
+ struct PropertyValue_r value;
pabentry.cValues = 0;
- pabentry.lpProps = talloc_zero(mt->mem_ctx, struct SPropValue);
+ pabentry.lpProps = talloc_zero(mt->mem_ctx, struct PropertyValue_r);
- SPropValue.ulPropTag = PR_ADDRTYPE_UNICODE;
- SPropValue.value.lpszA = "dummy addrtype";
- SRow_addprop(&(pabentry), SPropValue);
+ value.ulPropTag = PR_ADDRTYPE_UNICODE;
+ value.value.lpszA = "dummy addrtype";
+ PropertyRow_addprop(&(pabentry), value);
- SPropValue.ulPropTag = PR_DISPLAY_NAME_UNICODE;
- SPropValue.value.lpszA = "dummy display name";
- SRow_addprop(&(pabentry), SPropValue);
+ value.ulPropTag = PR_DISPLAY_NAME_UNICODE;
+ value.value.lpszA = "dummy display name";
+ PropertyRow_addprop(&(pabentry), value);
- SPropValue.ulPropTag = PR_EMAIL_ADDRESS_UNICODE;
- SPropValue.value.lpszA = "dummy@example.com";
- SRow_addprop(&(pabentry), SPropValue);
+ value.ulPropTag = PR_EMAIL_ADDRESS_UNICODE;
+ value.value.lpszA = "dummy@example.com";
+ PropertyRow_addprop(&(pabentry), value);
- SPropValue.ulPropTag = PR_ACCOUNT_UNICODE;
- SPropValue.value.lpszA = "dummy account";
- SRow_addprop(&(pabentry), SPropValue);
+ value.ulPropTag = PR_ACCOUNT_UNICODE;
+ value.value.lpszA = "dummy account";
+ PropertyRow_addprop(&(pabentry), value);
mapidump_PAB_entry(&pabentry);
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
uint32_t plDelta = 1;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_UpdateStat");
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x2, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x2, &RowSet);
+ MAPIFreeBuffer(RowSet);
if (retval != MAPI_E_SUCCESS) {
talloc_free(mem_ctx);
return false;
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
struct PropertyTagArray_r *MIds;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct SPropTagArray *SPropTagArray;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
struct Restriction_r Filter;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_QueryRows");
PR_DISPLAY_TYPE);
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ACCOUNT;
lpProp->dwAlignPad = 0;
lpProp->value.lpszA = mt->mapi_ctx->session->profile->username;
Filter.res.resProperty.ulPropTag = PR_ACCOUNT;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(lpProp);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(SPropTagArray);
mapitest_print_retval_clean(mt, "NspiGetMatches", retval);
if (retval != MAPI_E_SUCCESS) {
}
/* Query the rows */
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &RowSet);
+ MAPIFreeBuffer(RowSet);
mapitest_print_retval_clean(mt, "NspiQueryRows", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
TALLOC_CTX *mem_ctx;
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
- struct SPropValue pTarget;
+ struct PropertyValue_r pTarget;
struct SPropTagArray *pPropTags;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct emsmdb_context *emsmdb;
bool ret = true;
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
emsmdb = (struct emsmdb_context *) mt->session->emsmdb->ctx;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
pTarget.ulPropTag = PR_DISPLAY_NAME;
pTarget.dwAlignPad = 0x0;
pTarget.value.lpszA = emsmdb->info.szDisplayName;
pPropTags = set_SPropTagArray(mem_ctx, 0x1, PR_ACCOUNT);
- retval = nspi_SeekEntries(nspi_ctx, mem_ctx, SortTypeDisplayName, &pTarget, pPropTags, NULL, &SRowSet);
+ retval = nspi_SeekEntries(nspi_ctx, mem_ctx, SortTypeDisplayName, &pTarget, pPropTags, NULL, &RowSet);
if (retval != MAPI_E_SUCCESS) {
ret = false;
}
mapitest_print_retval_clean(mt, "NspiSeekEntries", retval);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(pPropTags);
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
pTarget.ulPropTag = PR_DISPLAY_NAME_UNICODE;
pTarget.dwAlignPad = 0x0;
pTarget.value.lpszA = emsmdb->info.szDisplayName;
pPropTags = set_SPropTagArray(mem_ctx, 0x1, PR_ACCOUNT);
- retval = nspi_SeekEntries(nspi_ctx, mem_ctx, SortTypeDisplayName, &pTarget, pPropTags, NULL, &SRowSet);
+ retval = nspi_SeekEntries(nspi_ctx, mem_ctx, SortTypeDisplayName, &pTarget, pPropTags, NULL, &RowSet);
if (retval != MAPI_E_SUCCESS) {
ret = false;
}
mapitest_print_retval_clean(mt, "NspiSeekEntries", retval);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(pPropTags);
talloc_free(mem_ctx);
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
struct PropertyTagArray_r *MIds;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct SPropTagArray *SPropTagArray;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
struct Restriction_r Filter;
bool ret = true;
PR_DISPLAY_TYPE);
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ACCOUNT;
lpProp->dwAlignPad = 0;
lpProp->value.lpszA = mt->mapi_ctx->session->profile->username;
Filter.res.resProperty.ulPropTag = PR_ACCOUNT;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(lpProp);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(MIds);
mapitest_print_retval_clean(mt, "NspiGetMatches", retval);
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
struct Restriction_r Filter;
- struct SRowSet *SRowSet = NULL;
+ struct PropertyRowSet_r *RowSet = NULL;
struct SPropTagArray *SPropTagArray = NULL;
- struct SPropValue *lpProp = NULL;
+ struct PropertyValue_r *lpProp = NULL;
struct PropertyTagArray_r *MIds = NULL;
struct PropertyTagArray_r *ppMIds = NULL;
bool ret = true;
);
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_OBJECT_TYPE;
lpProp->dwAlignPad = 0;
lpProp->value.l = 6;
Filter.res.resProperty.ulPropTag = PR_OBJECT_TYPE;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(lpProp);
MAPIFreeBuffer(SPropTagArray);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
mapitest_print_retval_clean(mt, "NspiGetMatches", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
struct nspi_context *nspi_ctx;
struct SPropTagArray *pPropTags = 0;
struct PropertyTagArray_r *MIds;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
struct Restriction_r Filter;
struct SPropTagArray *SPropTagArray;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_GetPropList");
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
/* Step 1. Query for current profile username */
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_DISPLAY_NAME);
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ANR_UNICODE;
lpProp->dwAlignPad = 0;
lpProp->value.lpszW = mt->mapi_ctx->session->profile->username;
Filter.res.resProperty.ulPropTag = PR_ANR_UNICODE;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(lpProp);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
talloc_free(mem_ctx);
struct StringsArray_r pNames;
struct PropertyTagArray_r *MId;
struct SPropTagArray *SPropTagArray;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_GetProps");
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
return false;
}
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_EMS_AB_NETWORK_ADDRESS);
- retval = nspi_GetProps(nspi_ctx, mem_ctx, SPropTagArray, MId, &SRowSet);
+ retval = nspi_GetProps(nspi_ctx, mem_ctx, SPropTagArray, MId, &RowSet);
mapitest_print_retval_clean(mt, "NspiGetProps", retval);
MAPIFreeBuffer(SPropTagArray);
MAPIFreeBuffer(MId);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
talloc_free(mem_ctx);
struct nspi_context *nspi_ctx;
uint32_t plResult;
struct PropertyTagArray_r *MIds;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct SPropTagArray *SPropTagArray;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
struct Restriction_r Filter;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_CompareMIds");
SPropTagArray = set_SPropTagArray(mem_ctx, 0x1, PR_DISPLAY_NAME);
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_OBJECT_TYPE;
lpProp->dwAlignPad = 0;
lpProp->value.l = 6;
Filter.res.resProperty.ulPropTag = PR_OBJECT_TYPE;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(lpProp);
MAPIFreeBuffer(SPropTagArray);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
mapitest_print_retval_clean(mt, "NspiGetMatches", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
TALLOC_CTX *mem_ctx;
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
- struct SRow *pRow;
+ struct PropertyRow_r *pRow;
struct SPropTagArray *pPropTags;
- struct SPropValue modProp;
+ struct PropertyValue_r modProp;
struct PropertyTagArray_r *MIds;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
struct SPropTagArray *SPropTagArray;
- struct SPropValue *lpProp;
+ struct PropertyValue_r *lpProp;
struct Restriction_r Filter;
const char *original_office_location;
bool ret = true;
PR_DISPLAY_TYPE);
/* Build the restriction we want for NspiGetMatches */
- lpProp = talloc_zero(mem_ctx, struct SPropValue);
+ lpProp = talloc_zero(mem_ctx, struct PropertyValue_r);
lpProp->ulPropTag = PR_ACCOUNT;
lpProp->dwAlignPad = 0;
lpProp->value.lpszA = mt->mapi_ctx->session->profile->username;
Filter.res.resProperty.ulPropTag = PR_ACCOUNT;
Filter.res.resProperty.lpProp = lpProp;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
MIds = talloc_zero(mem_ctx, struct PropertyTagArray_r);
- retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &SRowSet, &MIds);
+ retval = nspi_GetMatches(nspi_ctx, mem_ctx, SPropTagArray, &Filter, 5000, &RowSet, &MIds);
MAPIFreeBuffer(lpProp);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(SPropTagArray);
mapitest_print_retval_clean(mt, "nspi_GetMatches", retval);
if (retval != MAPI_E_SUCCESS) {
}
/* Query the rows */
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &RowSet);
mapitest_print_retval_clean(mt, "nspi_QueryRows", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
talloc_free(mem_ctx);
return false;
}
- if (SRowSet->cRows != 1) {
- mapitest_print(mem_ctx, "unexpected number of rows: %i\n", SRowSet->cRows);
+ if (RowSet->cRows != 1) {
+ mapitest_print(mem_ctx, "unexpected number of rows: %i\n", RowSet->cRows);
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
talloc_free(mem_ctx);
return false;
}
- original_office_location = (const char *)find_SPropValue_data(&(SRowSet->aRow[0]), PR_OFFICE_LOCATION);
+ original_office_location = (const char *)find_PropertyValue_data(&(RowSet->aRow[0]), PR_OFFICE_LOCATION);
mapitest_print(mt, "original PR_OFFICE_LOCATION value: %s\n", original_office_location);
/* Build the SRow and SPropTagArray for NspiModProps */
- pRow = talloc_zero(mem_ctx, struct SRow);
+ pRow = talloc_zero(mem_ctx, struct PropertyRow_r);
modProp.ulPropTag = PR_OFFICE_LOCATION;
modProp.value.lpszA = "MT office location";
- SRow_addprop(pRow, modProp);
+ PropertyRow_addprop(pRow, modProp);
pPropTags = set_SPropTagArray(mem_ctx, 0x1, PR_OFFICE_LOCATION);
retval = nspi_ModProps(nspi_ctx, mem_ctx, MIds->aulPropTag[0], pPropTags, pRow);
}
/* Check that the property was set correctly */
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_QueryRows(nspi_ctx, mem_ctx, NULL, MIds, 1, &RowSet);
mapitest_print_retval_clean(mt, "nspi_QueryRows", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
talloc_free(mem_ctx);
return false;
}
- if (SRowSet->cRows != 1) {
- mapitest_print(mem_ctx, "unexpected number of rows: %i\n", SRowSet->cRows);
+ if (RowSet->cRows != 1) {
+ mapitest_print(mem_ctx, "unexpected number of rows: %i\n", RowSet->cRows);
MAPIFreeBuffer(MIds);
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
talloc_free(mem_ctx);
return false;
}
- if (strcmp((const char *)find_SPropValue_data(&(SRowSet->aRow[0]), PR_OFFICE_LOCATION), "MT office location") != 0) {
- mapitest_print(mt, "PR_OFFICE_LOCATION string value mismatch: %s", (const char *)find_SPropValue_data(&(SRowSet->aRow[0]), PR_OFFICE_LOCATION));
+ if (strcmp((const char *)find_PropertyValue_data(&(RowSet->aRow[0]), PR_OFFICE_LOCATION), "MT office location") != 0) {
+ mapitest_print(mt, "PR_OFFICE_LOCATION string value mismatch: %s", (const char *)find_PropertyValue_data(&(RowSet->aRow[0]), PR_OFFICE_LOCATION));
ret = false;
} else {
mapitest_print(mt, "correctly set PR_OFFICE_LOCATION\n");
}
/* try to reset the office location back to the original value */
- pRow = talloc_zero(mem_ctx, struct SRow);
+ pRow = talloc_zero(mem_ctx, struct PropertyRow_r);
modProp.ulPropTag = PR_OFFICE_LOCATION;
modProp.value.lpszA = original_office_location;
- SRow_addprop(pRow, modProp);
+ PropertyRow_addprop(pRow, modProp);
retval = nspi_ModProps(nspi_ctx, mem_ctx, MIds->aulPropTag[0], pPropTags, pRow);
mapitest_print_retval_clean(mt, "nspi_ModProps (reset original value)", retval);
TALLOC_CTX *mem_ctx;
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_GetSpecialTable");
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
- retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x0, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ RowSet = talloc_zero(mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x0, &RowSet);
+ MAPIFreeBuffer(RowSet);
mapitest_print_retval_clean(mt, "NspiGetSpecialTable (Hierarchy Table)", retval);
if (retval != MAPI_E_SUCCESS) {
return false;
}
- SRowSet = talloc_zero(mt->mem_ctx, struct SRowSet);
- retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x2, &SRowSet);
- MAPIFreeBuffer(SRowSet);
+ RowSet = talloc_zero(mt->mem_ctx, struct PropertyRowSet_r);
+ retval = nspi_GetSpecialTable(nspi_ctx, mem_ctx, 0x2, &RowSet);
+ MAPIFreeBuffer(RowSet);
mapitest_print_retval_clean(mt, "NspiGetSpecialTable (Address Creation Template)", retval);
talloc_free(mem_ctx);
TALLOC_CTX *mem_ctx;
enum MAPISTATUS retval;
struct nspi_context *nspi_ctx;
- struct SRow *ppData = NULL;
+ struct PropertyRow_r *ppData = NULL;
mem_ctx = talloc_named(NULL, 0, "mapitest_nspi_GetTemplateInfo");
nspi_ctx = (struct nspi_context *) mt->session->nspi->ctx;
- ppData = talloc_zero(mem_ctx, struct SRow);
+ ppData = talloc_zero(mem_ctx, struct PropertyRow_r);
retval = nspi_GetTemplateInfo(nspi_ctx, mem_ctx,
TI_TEMPLATE|TI_SCRIPT|TI_EMT|TI_HELPFILE_NAME|TI_HELPFILE_CONTENTS,
0, NULL, &ppData);
{
enum MAPISTATUS retval;
struct SPropTagArray *SPropTagArray = NULL;
- struct SRowSet *SRowSet = NULL;
+ struct PropertyRowSet_r *RowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
const char *username[2];
const char *username_err[2];
/* Test with existing username */
/* NspiResolveNames (0x13) */
- retval = ResolveNames(mt->session, (const char **)username, SPropTagArray, &SRowSet, &flaglist, 0);
+ retval = ResolveNames(mt->session, (const char **)username, SPropTagArray, &RowSet, &flaglist, 0);
mapitest_print_retval_clean(mt, "NspiResolveNames - existing", retval);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(SPropTagArray);
mapitest_print(mt, "\tGot expected resolution flag\n");
}
talloc_free(flaglist);
- talloc_free(SRowSet);
+ talloc_free(RowSet);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(SPropTagArray);
return false;
}
/* NspiResolveNamesW (0x14) */
- retval = ResolveNames(mt->session, (const char **)username, SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
+ retval = ResolveNames(mt->session, (const char **)username, SPropTagArray, &RowSet, &flaglist, MAPI_UNICODE);
mapitest_print_retval_clean(mt, "NspiResolveNamesW - existing", retval);
if (flaglist->aulPropTag[0] != MAPI_RESOLVED) {
mapitest_print(mt, "Expected 2 (MAPI_RESOLVED), but NspiResolveNamesW returned: %i\n", flaglist->aulPropTag[0]);
mapitest_print(mt, "\tGot expected resolution flag\n");
}
talloc_free(flaglist);
- talloc_free(SRowSet);
+ talloc_free(RowSet);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(SPropTagArray);
return false;
/* Test with non-existant username */
/* NspiResolveNames (0x13) */
- retval = ResolveNames(mt->session, (const char **)username_err, SPropTagArray, &SRowSet, &flaglist, 0);
+ retval = ResolveNames(mt->session, (const char **)username_err, SPropTagArray, &RowSet, &flaglist, 0);
mapitest_print_retval_clean(mt, "NspiResolveNames - non existant user name", retval);
if (flaglist->aulPropTag[0] != MAPI_UNRESOLVED) {
mapitest_print(mt, "Expected 0 (MAPI_UNRESOLVED), but NspiResolveNames returned: %i\n", flaglist->aulPropTag[0]);
mapitest_print(mt, "\tGot expected resolution flag\n");
}
talloc_free(flaglist);
- talloc_free(SRowSet);
+ talloc_free(RowSet);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(SPropTagArray);
return false;
}
/* NspiResolveNamesW (0x14) */
- retval = ResolveNames(mt->session, (const char **)username_err, SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
+ retval = ResolveNames(mt->session, (const char **)username_err, SPropTagArray, &RowSet, &flaglist, MAPI_UNICODE);
mapitest_print_retval_clean(mt, "NspiResolveNamesW - non existant user name", retval);
if (flaglist->aulPropTag[0] != MAPI_UNRESOLVED) {
mapitest_print(mt, "Expected 0 (MAPI_UNRESOLVED), but NspiResolveNamesW returned: %i\n", flaglist->aulPropTag[0]);
mapitest_print(mt, "\tGot expected resolution flag\n");
}
talloc_free(flaglist);
- talloc_free(SRowSet);
+ talloc_free(RowSet);
if (retval != MAPI_E_SUCCESS) {
MAPIFreeBuffer(SPropTagArray);
return false;
_PUBLIC_ bool mapitest_nspi_GetGALTable(struct mapitest *mt)
{
struct SPropTagArray *SPropTagArray;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
enum MAPISTATUS retval;
uint32_t i;
uint32_t count;
count = 0x20;
ulFlags = TABLE_START;
do {
- retval = GetGALTable(mt->session, SPropTagArray, &SRowSet, count, ulFlags);
+ retval = GetGALTable(mt->session, SPropTagArray, &RowSet, count, ulFlags);
mapitest_print_retval_clean(mt, "GetGALTable", retval);
- if ((!SRowSet) || (!(SRowSet->aRow))) {
+ if ((!RowSet) || (!(RowSet->aRow))) {
ret = false;
goto cleanup;
}
- rowsFetched = SRowSet->cRows;
+ rowsFetched = RowSet->cRows;
totalRowsFetched += rowsFetched;
if (rowsFetched) {
for (i = 0; i < rowsFetched; i++) {
- mapitest_print_PAB_entry(mt, &SRowSet->aRow[i]);
+ mapitest_print_PAB_entry(mt, &RowSet->aRow[i]);
}
}
ulFlags = TABLE_CUR;
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
} while (rowsFetched == count);
if (totalRowsFetched < 1) {
mapi_id_t id_folder;
char **username = NULL;
struct SPropTagArray *SPropTagArray = NULL;
- struct SPropValue SPropValue;
+ struct PropertyValue_r value;
+ struct PropertyRowSet_r *RowSet = NULL;
struct SRowSet *SRowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
mapi_id_t id_msgs[1];
retval = ResolveNames(mapi_object_get_session(&obj_message),
(const char **)username, SPropTagArray,
- &SRowSet, &flaglist, MAPI_UNICODE);
+ &RowSet, &flaglist, MAPI_UNICODE);
mapitest_print_retval_clean(mt, "ResolveNames", retval);
if (retval != MAPI_E_SUCCESS) {
return false;
}
- if (!SRowSet) {
- mapitest_print(mt, "Null SRowSet\n");
+ if (!RowSet) {
+ mapitest_print(mt, "Null RowSet\n");
return false;
}
- if (!SRowSet->cRows) {
- mapitest_print(mt, "No values in SRowSet\n");
- MAPIFreeBuffer(SRowSet);
+ if (!RowSet->cRows) {
+ mapitest_print(mt, "No values in RowSet\n");
+ MAPIFreeBuffer(RowSet);
return false;
}
- SPropValue.ulPropTag = PR_SEND_INTERNET_ENCODING;
- SPropValue.value.l = 0;
- SRowSet_propcpy(mt->mem_ctx, SRowSet, SPropValue);
+ value.ulPropTag = PR_SEND_INTERNET_ENCODING;
+ value.value.l = 0;
+ PropertyRowSet_propcpy(mt->mem_ctx, RowSet, value);
+
+ SRowSet = talloc_zero(RowSet, struct SRowSet);
+ cast_PropertyRowSet_to_SRowSet(SRowSet, RowSet, SRowSet);
SetRecipientType(&(SRowSet->aRow[0]), MAPI_TO);
mapitest_print_retval(mt, "SetRecipientType");
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_TO");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_CC");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_BCC");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = DeleteMessage(&obj_folder, id_msgs, 1);
mapitest_print_retval(mt, "DeleteMessage");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
/* Release */
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
mapi_object_release(&obj_message);
mapi_object_release(&obj_folder);
mapi_id_t id_folder;
char **username = NULL;
struct SPropTagArray *SPropTagArray = NULL;
- struct SPropValue SPropValue;
+ struct PropertyValue_r value;
+ struct PropertyRowSet_r *RowSet = NULL;
struct SRowSet *SRowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
mapi_id_t id_msgs[1];
retval = ResolveNames(mapi_object_get_session(&obj_message),
(const char **)username, SPropTagArray,
- &SRowSet, &flaglist, MAPI_UNICODE);
+ &RowSet, &flaglist, MAPI_UNICODE);
mapitest_print_retval_clean(mt, "ResolveNames", retval);
if (retval != MAPI_E_SUCCESS) {
return false;
}
- if (!SRowSet) {
- mapitest_print(mt, "Null SRowSet\n");
+ if (!RowSet) {
+ mapitest_print(mt, "Null RowSet\n");
return false;
}
- if (!SRowSet->cRows) {
- mapitest_print(mt, "No values in SRowSet\n");
- MAPIFreeBuffer(SRowSet);
+ if (!RowSet->cRows) {
+ mapitest_print(mt, "No values in RowSet\n");
+ MAPIFreeBuffer(RowSet);
return false;
}
- SPropValue.ulPropTag = PR_SEND_INTERNET_ENCODING;
- SPropValue.value.l = 0;
- SRowSet_propcpy(mt->mem_ctx, SRowSet, SPropValue);
+ value.ulPropTag = PR_SEND_INTERNET_ENCODING;
+ value.value.l = 0;
+ PropertyRowSet_propcpy(mt->mem_ctx, RowSet, value);
+
+ SRowSet = talloc_zero(RowSet, struct SRowSet);
+ cast_PropertyRowSet_to_SRowSet(SRowSet, RowSet, SRowSet);
SetRecipientType(&(SRowSet->aRow[0]), MAPI_TO);
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_TO");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_CC");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_BCC");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = RemoveAllRecipients(&obj_message);
mapitest_print_retval(mt, "RemoveAllRecipients");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
ret = false;
}
retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadOnly);
mapitest_print_retval(mt, "SaveChangesMessage");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = DeleteMessage(&obj_folder, id_msgs, 1);
mapitest_print_retval(mt, "DeleteMessage");
if (GetLastError() != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
ret = false;
}
/* Release */
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
mapi_object_release(&obj_message);
mapi_object_release(&obj_folder);
mapi_id_t id_folder;
char **username = NULL;
struct SPropTagArray *SPropTagArray = NULL;
- struct SPropValue SPropValue;
+ struct PropertyValue_r value;
+ struct PropertyRowSet_r *RowSet = NULL;
struct SRowSet *SRowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
struct ReadRecipientRow *RecipientRows;
retval = ResolveNames(mapi_object_get_session(&obj_message),
(const char **)username, SPropTagArray,
- &SRowSet, &flaglist, MAPI_UNICODE);
+ &RowSet, &flaglist, MAPI_UNICODE);
mapitest_print_retval_clean(mt, "ResolveNames", retval);
if (retval != MAPI_E_SUCCESS) {
return false;
}
- if (!SRowSet) {
- mapitest_print(mt, "Null SRowSet\n");
+ if (!RowSet) {
+ mapitest_print(mt, "Null RowSet\n");
return false;
}
- if (!SRowSet->cRows) {
- mapitest_print(mt, "No values in SRowSet\n");
- MAPIFreeBuffer(SRowSet);
+ if (!RowSet->cRows) {
+ mapitest_print(mt, "No values in RowSet\n");
+ MAPIFreeBuffer(RowSet);
return false;
}
- SPropValue.ulPropTag = PR_SEND_INTERNET_ENCODING;
- SPropValue.value.l = 0;
- SRowSet_propcpy(mt->mem_ctx, SRowSet, SPropValue);
+ value.ulPropTag = PR_SEND_INTERNET_ENCODING;
+ value.value.l = 0;
+ PropertyRowSet_propcpy(mt->mem_ctx, RowSet, value);
+
+ SRowSet = talloc_zero(RowSet, struct SRowSet);
+ cast_PropertyRowSet_to_SRowSet(SRowSet, RowSet, SRowSet);
retval = SetRecipientType(&(SRowSet->aRow[0]), MAPI_TO);
mapitest_print_retval_clean(mt, "SetRecipientType", retval);
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_TO");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_CC");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
-
SetRecipientType(&(SRowSet->aRow[0]), MAPI_BCC);
mapitest_print_retval(mt, "SetRecipientType");
retval = ModifyRecipients(&obj_message, SRowSet);
mapitest_print_retval_fmt(mt, "ModifyRecipients", "(%s)", "MAPI_BCC");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = SaveChangesMessage(&obj_folder, &obj_message, KeepOpenReadOnly);
mapitest_print_retval(mt, "SaveChangesMessage");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
mapitest_print_retval(mt, "ReadRecipients");
MAPIFreeBuffer(RecipientRows);
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
retval = DeleteMessage(&obj_folder, id_msgs, 1);
mapitest_print_retval(mt, "DeleteMessage");
if (retval != MAPI_E_SUCCESS) {
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
return false;
}
/* Release */
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
MAPIFreeBuffer(flaglist);
mapi_object_release(&obj_message);
mapi_object_release(&obj_folder);
struct SPropTagArray *SPropTagArray;
struct SPropValue SPropValue;
struct SRowSet *SRowSet = NULL;
+ struct PropertyRowSet_r *RowSet = NULL;
struct PropertyTagArray_r *flaglist = NULL;
mapi_id_t id_outbox;
mapi_object_t obj_outbox;
/* ResolveNames */
retval = ResolveNames(mapi_object_get_session(&obj_message), (const char **)oclient->usernames,
- SPropTagArray, &SRowSet, &flaglist, MAPI_UNICODE);
+ SPropTagArray, &RowSet, &flaglist, MAPI_UNICODE);
MAPIFreeBuffer(SPropTagArray);
if (retval != MAPI_E_SUCCESS) return retval;
- if (!SRowSet) {
- SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ SRowSet = talloc_zero(mem_ctx, struct SRowSet);
+ if (!RowSet) {
+ cast_PropertyRowSet_to_SRowSet(mem_ctx, RowSet, SRowSet);
}
set_usernames_RecipientType(mem_ctx, &index, SRowSet, oclient->mapi_to, flaglist, MAPI_TO);
struct mapi_session *session)
{
struct SPropTagArray *SPropTagArray;
- struct SRowSet *SRowSet;
+ struct PropertyRowSet_r *RowSet;
uint32_t i;
uint32_t count;
uint8_t ulFlags;
ulFlags = TABLE_START;
do {
count += 0x2;
- GetGALTable(session, SPropTagArray, &SRowSet, count, ulFlags);
- if ((!SRowSet) || (!(SRowSet->aRow))) {
+ GetGALTable(session, SPropTagArray, &RowSet, count, ulFlags);
+ if ((!RowSet) || (!(RowSet->aRow))) {
return false;
}
- rowsFetched = SRowSet->cRows;
+ rowsFetched = RowSet->cRows;
if (rowsFetched) {
for (i = 0; i < rowsFetched; i++) {
- mapidump_PAB_entry(&SRowSet->aRow[i]);
+ mapidump_PAB_entry(&RowSet->aRow[i]);
}
}
ulFlags = TABLE_CUR;
- MAPIFreeBuffer(SRowSet);
+ MAPIFreeBuffer(RowSet);
} while (rowsFetched == count);
mapi_errstr("GetPABTable", GetLastError());