Merge r3881,3893,3894,3895,3907,3908,3910,3911,3912,3913,3915,3916,3917,3919,3920...
authorJulien Kerihuel <j.kerihuel@openchange.org>
Mon, 16 Apr 2012 12:01:23 +0000 (12:01 +0000)
committerJulien Kerihuel <j.kerihuel@openchange.org>
Mon, 16 Apr 2012 12:01:23 +0000 (12:01 +0000)
Most noticeable change: replacement of SPropValue with PropertyValue_r, SRowSet with PropertyRowSet_r
Custom handling of ExtendedException
New properties added
Improvement of provisioning code

35 files changed:
Makefile
config.mk.in
exchange.idl
libmapi/IABContainer.c
libmapi/IMAPISession.c
libmapi/IProfAdmin.c
libmapi/freebusy.c
libmapi/libmapi.h
libmapi/libmapi_private.h
libmapi/mapi_profile.h
libmapi/mapidump.c
libmapi/nspi.c
libmapi/property.c
libmapi/simple_mapi.c
libocpf/ocpf_public.c
mapiproxy/dcesrv_mapiproxy_nspi.c
mapiproxy/libmapiproxy/openchangedb_property.c
mapiproxy/libmapistore/mapistore.h
mapiproxy/libmapistore/mapistore_namedprops.c
mapiproxy/servers/default/emsmdb/emsmdbp_object.c
mapiproxy/servers/default/emsmdb/oxcfxics.c
mapiproxy/servers/default/emsmdb/oxcprpt.c
mapiproxy/servers/default/nspi/dcesrv_exchange_nsp.c
mapiproxy/servers/default/nspi/dcesrv_exchange_nsp.h
mapiproxy/servers/default/nspi/emsabp.c
mapiproxy/servers/default/nspi/emsabp_property.c
ndr_mapi.c
property.idl
python/openchange/provision.py
utils/mapitest/mapitest_common.c
utils/mapitest/mapitest_print.c
utils/mapitest/modules/module_mapidump.c
utils/mapitest/modules/module_nspi.c
utils/mapitest/modules/module_oxcmsg.c
utils/openchangeclient.c

index f9c22badca85291a28fc1b3c394f2dbf87ef35bb..dbf399fb00303dbc70c3a24465f19c82575a1b5a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -995,6 +995,9 @@ mapiproxy/modules/mpm_dummy.$(SHLIBEXT): mapiproxy/modules/mpm_dummy.po
 # 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/
index 6b25fe055d4e45ffcf00da533a0ddc3175d91a27..3d32f47d1ae81bee429b5a92e367d47f13baaea6 100644 (file)
@@ -19,6 +19,7 @@ PYTHON_LIBS=@PYTHON_LIBS@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 bindir=@bindir@
+sbindir=@sbindir@
 libdir=@libdir@
 modulesdir=@modulesdir@
 datarootdir=@datarootdir@
index ee37eddc15117f3c0861b9ada1669bc09cd6a6f1..05c7a1876ab4b7db4a3aeba904524e5b3ce3a6ba 100644 (file)
@@ -313,11 +313,6 @@ System Attendant Private Interface
                [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;
@@ -336,45 +331,40 @@ System Attendant Private Interface
        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;
@@ -393,13 +383,13 @@ System Attendant Private Interface
        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 {
@@ -463,6 +453,65 @@ System Attendant Private Interface
                [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 {
@@ -507,7 +556,7 @@ System Attendant Private Interface
                [in,unique,size_is(dwETableCount)]      uint32                          *lpETable,
                [in]                                    uint32                          Count,
                [in,unique]                             SPropTagArray                   *pPropTags,
-               [out]                                   SRowSet                         **ppRows
+               [out]                                   PropertyRowSet_r                **ppRows
                );
 
        /*****************/
@@ -516,10 +565,10 @@ System Attendant Private Interface
                [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
                );
 
        /*****************/
@@ -535,7 +584,7 @@ System Attendant Private Interface
                [in]            uint32                  ulRequested,
                [out]           PropertyTagArray_r      **ppOutMIds,
                [in][unique]    SPropTagArray           *pPropTags,
-               [out]           SRowSet                 **ppRows
+               [out]           PropertyRowSet_r        **ppRows
                );
 
        /*****************/
@@ -574,7 +623,7 @@ System Attendant Private Interface
                [in]    uint32                          dwFlags,
                [in]    STAT                            *pStat,
                [in,unique] SPropTagArray               *pPropTags,
-               [out]   SRow                            **ppRows
+               [out]   PropertyRow_r                   **ppRows
                );
 
        /*****************/
@@ -595,7 +644,7 @@ System Attendant Private Interface
                [in] uint32                     Reserved,
                [in] STAT                       *pStat,
                [in,unique] SPropTagArray       *pPropTags,
-               [in] SRow                       *pRow
+               [in] PropertyRow_r              *pRow
                );
 
        /*****************/
@@ -610,7 +659,7 @@ System Attendant Private Interface
                [in] NspiGetSpecialTable_dwFlags        dwFlags,
                [in] STAT                               *pStat,
                [in,out] uint32                         *lpVersion,
-               [out] SRowSet                           **ppRows
+               [out] PropertyRowSet_r                  **ppRows
                );
 
        /*******************/
@@ -630,7 +679,7 @@ System Attendant Private Interface
                [in,unique,string,charset(DOS)] uint8   *pDN,
                [in] uint32                             dwCodePage,
                [in] uint32                             dwLocaleID,
-               [out] SRow                              **ppData
+               [out] PropertyRow_r                     **ppData
                );
 
        /*******************/
@@ -696,7 +745,7 @@ System Attendant Private Interface
                [in,unique] SPropTagArray       *pPropTags,
                [in] StringsArray_r             *paStr,
                [out] PropertyTagArray_r        **ppMIds,
-               [out] SRowSet                   **ppRows
+               [out] PropertyRowSet_r          **ppRows
        );
 
        /*****************/
@@ -708,7 +757,7 @@ System Attendant Private Interface
                [in,unique] SPropTagArray       *pPropTags,
                [in] StringsArrayW_r            *paWStr,
                [out] PropertyTagArray_r        **ppMIds,
-               [out] SRowSet                   **ppRows
+               [out] PropertyRowSet_r          **ppRows
                );
 }
 
@@ -4644,4 +4693,3 @@ System Attendant Private Interface
 {
        void unknown_dummy();
 }
-
index 7505706af329f768bd95788e9d383276c7752a83..4983a1c65905291189c097bcc24862e0347e8b22 100644 (file)
@@ -66,7 +66,7 @@
 _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)
 {
@@ -150,20 +150,20 @@ _PUBLIC_ enum MAPISTATUS ResolveNames(struct mapi_session *session,
  */
 _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");
@@ -176,10 +176,10 @@ _PUBLIC_ enum MAPISTATUS GetGALTable(struct mapi_session *session,
                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);
@@ -217,7 +217,7 @@ _PUBLIC_ enum MAPISTATUS GetGALTableCount(struct mapi_session *session,
        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);
@@ -232,8 +232,8 @@ _PUBLIC_ enum MAPISTATUS GetGALTableCount(struct mapi_session *session,
        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;
        
@@ -273,12 +273,12 @@ _PUBLIC_ enum MAPISTATUS GetGALTableCount(struct mapi_session *session,
 _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;
@@ -302,7 +302,7 @@ _PUBLIC_ enum MAPISTATUS GetABRecipientInfo(struct mapi_session *session,
        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,
@@ -316,15 +316,15 @@ _PUBLIC_ enum MAPISTATUS GetABRecipientInfo(struct mapi_session *session,
                                          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;
@@ -348,16 +348,16 @@ _PUBLIC_ enum MAPISTATUS GetABRecipientInfo(struct mapi_session *session,
                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);
 
index 0be793e3a27ff24a0371c7fd6c59ace46c20242f..4657fec73eec43842ee4b8acc9ee69dbede7c350 100644 (file)
@@ -36,7 +36,7 @@ static enum MAPISTATUS FindGoodServer(struct mapi_session *session,
        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;
@@ -65,17 +65,17 @@ static enum MAPISTATUS FindGoodServer(struct mapi_session *session,
                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);
        }
@@ -90,16 +90,16 @@ static enum MAPISTATUS FindGoodServer(struct mapi_session *session,
        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)) {
@@ -107,7 +107,7 @@ static enum MAPISTATUS FindGoodServer(struct mapi_session *session,
                        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 */
index 4a3ee66036e19811c39ad2c1045efe8ba8fa207b..f45c59d0a63783fd5d341d630c8af68bd7a39297 100644 (file)
@@ -1001,7 +1001,7 @@ _PUBLIC_ enum MAPISTATUS CopyProfile(struct mapi_context *mapi_ctx,
 
 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);
@@ -1077,9 +1077,9 @@ _PUBLIC_ enum MAPISTATUS DuplicateProfile(struct mapi_context *mapi_ctx,
                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;
@@ -1105,9 +1105,9 @@ _PUBLIC_ enum MAPISTATUS DuplicateProfile(struct mapi_context *mapi_ctx,
                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,
@@ -1121,7 +1121,7 @@ _PUBLIC_ enum MAPISTATUS DuplicateProfile(struct mapi_context *mapi_ctx,
                }
 
                /* 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;
@@ -1131,27 +1131,29 @@ _PUBLIC_ enum MAPISTATUS DuplicateProfile(struct mapi_context *mapi_ctx,
                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);
        }
@@ -1556,15 +1558,15 @@ _PUBLIC_ enum MAPISTATUS FindProfileAttr(struct mapi_profile *profile,
 
 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));
@@ -1582,16 +1584,16 @@ static bool set_profile_attribute(struct mapi_context *mapi_ctx,
 
 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));
@@ -1659,8 +1661,8 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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;
@@ -1680,9 +1682,9 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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,
@@ -1707,7 +1709,7 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        }
 
        /* 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;
@@ -1717,27 +1719,27 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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];
@@ -1747,10 +1749,10 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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,
@@ -1767,13 +1769,13 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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);
@@ -1787,8 +1789,8 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
 
        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);
@@ -1801,16 +1803,16 @@ _PUBLIC_ enum MAPISTATUS ProcessNetworkProfile(struct mapi_session *session,
        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;
index 7f0117b3d2290de7d38f173f502bcbba8b5b4dab..aaf9825d1958e5f6bfd9e9a0d753599c78f7890b 100644 (file)
@@ -67,7 +67,7 @@ _PUBLIC_ enum MAPISTATUS GetUserFreeBusyData(mapi_object_t *obj_store,
        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;
@@ -95,11 +95,11 @@ _PUBLIC_ enum MAPISTATUS GetUserFreeBusyData(mapi_object_t *obj_store,
        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=");
index 451152127b2d9dbf7400f27a20205444a853f355..cec803859e99e2ba02104dcd33af4ce2a288a807 100644 (file)
@@ -94,23 +94,23 @@ __BEGIN_DECLS
 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 **);
@@ -167,7 +167,7 @@ void                        mapidump_SPropValue(struct SPropValue, const char *);
 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 *);
@@ -289,11 +289,24 @@ const char                *get_TypedString(struct TypedString *);
 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 *);
index 3898285a8ecbe7130396ee1f9f9592c0f5fc1bdb..e39902bb38e36b38c91f6bd506d6bfca6583ed11 100644 (file)
@@ -60,6 +60,10 @@ __BEGIN_DECLS
 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 *);
index 86e0c05cba7976a1d4479bc9f2a466af42041080..1fea0c43cc802cb863274271b113d4d2208f0124 100644 (file)
@@ -56,7 +56,7 @@ struct mapi_profile
        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
 
index 6fc07fae0094339933c0e21a60e147746768dcda..8e8f73ce9fbb4f36aa0ff7a677d8c6712943c340 100644 (file)
@@ -219,17 +219,17 @@ _PUBLIC_ void mapidump_SRow(struct SRow *aRow, const char *sep)
   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);
index d9b63ae352844f5c293638ce0a77ddff025be6ea..05cc83a6878c4191c6539d0752f5b7169884c6c4 100644 (file)
@@ -242,7 +242,7 @@ _PUBLIC_ enum MAPISTATUS nspi_QueryRows(struct nspi_context *nspi_ctx,
                                        struct SPropTagArray *pPropTags,
                                        struct PropertyTagArray_r *MIds, 
                                        uint32_t count,
-                                       struct SRowSet **ppRows)
+                                       struct PropertyRowSet_r **ppRows)
 {
        struct NspiQueryRows            r;
        NTSTATUS                        status;
@@ -299,7 +299,7 @@ _PUBLIC_ enum MAPISTATUS nspi_QueryRows(struct nspi_context *nspi_ctx,
    \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
@@ -324,10 +324,10 @@ _PUBLIC_ enum MAPISTATUS nspi_QueryRows(struct nspi_context *nspi_ctx,
 _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;
@@ -411,7 +411,7 @@ _PUBLIC_ enum MAPISTATUS nspi_GetMatches(struct nspi_context *nspi_ctx,
                                         struct SPropTagArray *pPropTags,
                                         struct Restriction_r *Filter,
                                         uint32_t ulRequested,
-                                        struct SRowSet **ppRows,
+                                        struct PropertyRowSet_r **ppRows,
                                         struct PropertyTagArray_r **ppOutMIds)
 {
        struct NspiGetMatches           r;
@@ -621,13 +621,13 @@ _PUBLIC_ enum MAPISTATUS nspi_GetProps(struct nspi_context *nspi_ctx,
                                       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);
@@ -646,7 +646,7 @@ _PUBLIC_ enum MAPISTATUS nspi_GetProps(struct nspi_context *nspi_ctx,
 
        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);
@@ -655,8 +655,8 @@ _PUBLIC_ enum MAPISTATUS nspi_GetProps(struct nspi_context *nspi_ctx,
        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;
        
@@ -723,7 +723,7 @@ _PUBLIC_ enum MAPISTATUS nspi_ModProps(struct nspi_context *nspi_ctx,
                                       TALLOC_CTX *mem_ctx,
                                       uint32_t MId,
                                       struct SPropTagArray *pPropTags,
-                                      struct SRow *pRow)
+                                      struct PropertyRow_r *pRow)
 {
        struct NspiModProps     r;
        NTSTATUS                status;
@@ -780,7 +780,7 @@ _PUBLIC_ enum MAPISTATUS nspi_ModProps(struct nspi_context *nspi_ctx,
 _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;
@@ -837,7 +837,7 @@ _PUBLIC_ enum MAPISTATUS nspi_GetTemplateInfo(struct nspi_context *nspi_ctx,
                                              uint32_t dwFlags,
                                              uint32_t ulType,
                                              char *pDN,
-                                             struct SRow **ppData)
+                                             struct PropertyRow_r **ppData)
 {
        struct NspiGetTemplateInfo      r;
        NTSTATUS                        status;
@@ -1083,7 +1083,7 @@ _PUBLIC_ enum MAPISTATUS nspi_ResolveNames(struct nspi_context *nspi_ctx,
                                           TALLOC_CTX *mem_ctx,
                                           const char **usernames, 
                                           struct SPropTagArray *pPropTags, 
-                                          struct SRowSet ***pppRows,
+                                          struct PropertyRowSet_r ***pppRows,
                                           struct PropertyTagArray_r ***pppMIds)
 {
        struct NspiResolveNames r;
@@ -1146,7 +1146,7 @@ _PUBLIC_ enum MAPISTATUS nspi_ResolveNamesW(struct nspi_context *nspi_ctx,
                                            TALLOC_CTX *mem_ctx,
                                            const char **usernames, 
                                            struct SPropTagArray *pPropTags, 
-                                           struct SRowSet ***pppRows,
+                                           struct PropertyRowSet_r ***pppRows,
                                            struct PropertyTagArray_r ***pppMIds)
 {
        struct NspiResolveNamesW        r;
index 4380dd002ace35358919a5aaea32a4301ea29ee6..745b40619f51393266ec36d568e264f88891b1fd 100644 (file)
@@ -472,7 +472,7 @@ _PUBLIC_ bool set_mapi_SPropValue(TALLOC_CTX *mem_ctx, struct mapi_SPropValue *l
                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);
@@ -561,7 +561,7 @@ _PUBLIC_ bool set_SPropValue(struct SPropValue *lpProps, const void *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);
@@ -719,7 +719,7 @@ _PUBLIC_ uint32_t cast_mapi_SPropValue(TALLOC_CTX *mem_ctx,
                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;
@@ -1803,3 +1803,362 @@ size_t get_utf8_utf16_conv_length(const char *inbuf)
 
        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);
+       }
+}
index 33bae82cb866bbd0ce484d9172f34c0e11cb6af6..3d6d41049463c536d1a4f41cc1dc940dca0d33af 100644 (file)
@@ -494,7 +494,7 @@ _PUBLIC_ enum MAPISTATUS AddUserPermission(mapi_object_t *obj_folder, const char
        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;
 
@@ -527,8 +527,7 @@ _PUBLIC_ enum MAPISTATUS AddUserPermission(mapi_object_t *obj_folder, const char
        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;
 
@@ -569,7 +568,7 @@ _PUBLIC_ enum MAPISTATUS ModifyUserPermission(mapi_object_t *obj_folder,
        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;
@@ -596,7 +595,7 @@ _PUBLIC_ enum MAPISTATUS ModifyUserPermission(mapi_object_t *obj_folder,
        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
@@ -687,7 +686,7 @@ _PUBLIC_ enum MAPISTATUS RemoveUserPermission(mapi_object_t *obj_folder,
        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;
@@ -714,7 +713,7 @@ _PUBLIC_ enum MAPISTATUS RemoveUserPermission(mapi_object_t *obj_folder,
        /* 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);
index 9fb05b4c512eecb38b4bbc07d817968ace704ac7..c9db17656a697b9ea160d956ca2a95961bc3e17b 100644 (file)
@@ -600,6 +600,7 @@ _PUBLIC_ enum MAPISTATUS ocpf_set_Recipients(TALLOC_CTX *mem_ctx,
        struct SPropValue               SPropValue;
        struct SPropValue               *lpProps;
        struct SRowSet                  *SRowSet;
+       struct PropertyRowSet_r         *RowSet;
        struct PropertyTagArray_r       *flaglist = NULL;
        char                            **usernames = NULL;
        int                             *recipClass = NULL;
@@ -641,13 +642,14 @@ _PUBLIC_ enum MAPISTATUS ocpf_set_Recipients(TALLOC_CTX *mem_ctx,
        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;
index f1046fcd8a3f45be9e58abe46d95a81d1be9d0a8..3cc660beb3dac6728cb127390b281c1ecf6b1b10 100644 (file)
@@ -71,9 +71,9 @@ bool mapiproxy_NspiGetProps(struct dcesrv_call_state *dce_call, struct NspiGetPr
        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;
@@ -91,8 +91,8 @@ bool mapiproxy_NspiGetProps(struct dcesrv_call_state *dce_call, struct NspiGetPr
        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;
@@ -127,8 +127,8 @@ bool mapiproxy_NspiQueryRows(struct dcesrv_call_state *dce_call, struct NspiQuer
        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;
 
@@ -151,8 +151,8 @@ bool mapiproxy_NspiQueryRows(struct dcesrv_call_state *dce_call, struct NspiQuer
        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;
index 15f667ef8d9ff04e21839588efc4f8b2dac5ab0d..02dd89441c4ec3527dfc7adbe3fd07b6df49c6a4 100644 (file)
@@ -77,6 +77,7 @@ static struct pidtags pidtags[] = {
        { PidTagAssistant,                                                    "PidTagAssistant" },
        { PidTagAssistantTelephoneNumber,                                     "PidTagAssistantTelephoneNumber" },
        { PidTagAssociated,                                                   "PidTagAssociated" },
+       { PidTagAssociatedContentCount,                                       "PidTagAssociatedContentCount" },
        { PidTagAttachAdditionalInformation,                                  "PidTagAttachAdditionalInformation" },
        { PidTagAttachContentBase,                                            "PidTagAttachContentBase" },
        { PidTagAttachContentId,                                              "PidTagAttachContentId" },
index c5402980ea84fd54674a78828a028516bc02383c..e6db8af0587db828d0d5196ec78d339d6afec78a 100644 (file)
@@ -352,6 +352,7 @@ enum mapistore_error mapistore_namedprops_get_mapped_id(struct ldb_context *ldb_
 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 *);
index fe88dbf95215ad11c9da4caf94073e07a06e8a5a..9bcf51c91089bb3f185287394001d8b3895544c9 100644 (file)
@@ -334,3 +334,41 @@ _PUBLIC_ enum mapistore_error mapistore_namedprops_get_nameid(struct ldb_context
 
        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;
+}
index 789eec6358abcb3249febc43ba32a27ece2f82dd..702060fdaf0b5f51dfca11128b0bb85a4e349769 100644 (file)
@@ -1581,9 +1581,11 @@ _PUBLIC_ void **emsmdbp_object_table_get_row_props(TALLOC_CTX *mem_ctx, struct e
                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:
index 0af2235550143b814ad6a3cba76c5c2799759721..df91678761b0811d500dc407b637182f7b47ca6d 100644 (file)
@@ -1498,6 +1498,7 @@ _PUBLIC_ enum MAPISTATUS EcDoRpc_RopSyncConfigure(TALLOC_CTX *mem_ctx,
        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);
index f608263b19ad9a6689d8221eee6c4c0cb57bc79f..04888c6348db1e2ef41f4f7603a5e05ae9d73ed8 100644 (file)
@@ -60,6 +60,7 @@ _PUBLIC_ enum MAPISTATUS EcDoRpc_RopGetPropertiesSpecific(TALLOC_CTX *mem_ctx,
        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;
@@ -125,8 +126,22 @@ _PUBLIC_ enum MAPISTATUS EcDoRpc_RopGetPropertiesSpecific(TALLOC_CTX *mem_ctx,
         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;
index d45270cbf32a855e1f5a58df7cd4f7a2e0dd768b..dedb60ba5160a617a14a186ddab663e7228681d1 100644 (file)
@@ -342,8 +342,8 @@ static void dcesrv_NspiQueryRows(struct dcesrv_call_state *dce_call,
        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"));
 
@@ -378,7 +378,7 @@ static void dcesrv_NspiQueryRows(struct dcesrv_call_state *dce_call,
        }
 
        /* 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) {
@@ -391,15 +391,19 @@ static void dcesrv_NspiQueryRows(struct dcesrv_call_state *dce_call,
                        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;
                        }
@@ -413,7 +417,7 @@ static void dcesrv_NspiQueryRows(struct dcesrv_call_state *dce_call,
                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) {
@@ -515,10 +519,10 @@ static void dcesrv_NspiSeekEntries(struct dcesrv_call_state *dce_call,
                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);
@@ -577,7 +581,7 @@ static void dcesrv_NspiGetMatches(struct dcesrv_call_state *dce_call,
        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);
        }
@@ -585,10 +589,10 @@ static void dcesrv_NspiGetMatches(struct dcesrv_call_state *dce_call,
        *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]), 
@@ -742,9 +746,8 @@ static void dcesrv_NspiGetProps(struct dcesrv_call_state *dce_call,
        }
 
        /* 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) {
@@ -769,19 +772,19 @@ static void dcesrv_NspiGetProps(struct dcesrv_call_state *dce_call,
                /* 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 {
@@ -880,11 +883,11 @@ static void dcesrv_NspiGetSpecialTable(struct dcesrv_call_state *dce_call,
        *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);
        }
@@ -1042,7 +1045,7 @@ static void dcesrv_NspiResolveNames(struct dcesrv_call_state *dce_call,
        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;
@@ -1092,9 +1095,9 @@ static void dcesrv_NspiResolveNames(struct dcesrv_call_state *dce_call,
        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++) {
@@ -1157,7 +1160,7 @@ static void dcesrv_NspiResolveNamesW(struct dcesrv_call_state *dce_call,
        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;
@@ -1208,9 +1211,9 @@ static void dcesrv_NspiResolveNamesW(struct dcesrv_call_state *dce_call,
        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++) {
index 8de4e7d3e2f86a241d7b07deefced0d2b01d2066..caadc3ad137bafb5f9e0dd3e4cd166a28981039a 100644 (file)
@@ -125,12 +125,12 @@ enum MAPISTATUS           emsabp_set_EphemeralEntryID(struct emsabp_context *, uint32_t,
 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 **);
index 375192968091b5ef83a2f0c8697fe8144e8b436b..c27c8bf90d751f0b822dba8be3246c53fa261743 100644 (file)
@@ -452,20 +452,6 @@ _PUBLIC_ void *emsabp_query(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_c
        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;
@@ -595,7 +581,7 @@ _PUBLIC_ void *emsabp_query(TALLOC_CTX *mem_ctx, struct emsabp_context *emsabp_c
  */
 _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)
@@ -623,9 +609,9 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *mem_ctx,
        }
 
        /* 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];
@@ -636,7 +622,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *mem_ctx,
                
                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;
@@ -665,7 +651,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs_from_msg(TALLOC_CTX *mem_ctx,
    \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;
@@ -695,9 +681,9 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_c
        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];
@@ -709,7 +695,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_c
 
                aRow->lpProps[i].ulPropTag = (enum MAPITAGS) ulPropTag;
                aRow->lpProps[i].dwAlignPad = 0x0;
-               set_SPropValue(&(aRow->lpProps[i]), data);
+               set_PropertyValue(&(aRow->lpProps[i]), data);
        }
 
 
@@ -738,14 +724,14 @@ _PUBLIC_ enum MAPISTATUS emsabp_fetch_attrs(TALLOC_CTX *mem_ctx, struct emsabp_c
    \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;
@@ -772,9 +758,9 @@ _PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *mem_ctx, struct em
        }
 
        /* 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) {
@@ -805,8 +791,8 @@ _PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *mem_ctx, struct em
                        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;
@@ -880,7 +866,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *mem_ctx, struct em
                        default:
                                break;
                        }
-                       SRow_addprop(aRow, lpProps);
+                       PropertyRow_addprop(aRow, lpProps);
                }
        }
 
@@ -901,10 +887,10 @@ _PUBLIC_ enum MAPISTATUS emsabp_table_fetch_attrs(TALLOC_CTX *mem_ctx, struct em
    \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;
@@ -921,7 +907,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *mem_ctx, struct e
        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;
 
@@ -949,7 +935,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *mem_ctx, struct e
                         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++;
@@ -980,7 +966,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *mem_ctx, struct e
                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);
@@ -1013,7 +999,7 @@ _PUBLIC_ enum MAPISTATUS emsabp_get_HierarchyTable(TALLOC_CTX *mem_ctx, struct e
    \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;
 }
@@ -1079,16 +1065,16 @@ _PUBLIC_ enum MAPISTATUS emsabp_search(TALLOC_CTX *mem_ctx, struct emsabp_contex
                        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;
@@ -1287,13 +1273,17 @@ _PUBLIC_ enum MAPISTATUS emsabp_ab_container_by_id(TALLOC_CTX *mem_ctx,
 _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);
@@ -1301,16 +1291,63 @@ _PUBLIC_ enum MAPISTATUS emsabp_ab_container_enum(TALLOC_CTX *mem_ctx,
 
        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;
 }
index 3ef491f7bbf7c0e92ec9f05b638675c1ba36bac2..cec037cb83e1267504ed513fbce8fbf3a6f75ce0 100644 (file)
@@ -41,6 +41,7 @@ static const struct emsabp_property emsabp_property[] = {
        { 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                    },
index d1e661d1ba6b8ff93754eb0a36ba08459a70660a..7f314f6584c52ea6093c45eb9700d590b1beec89 100644 (file)
@@ -23,6 +23,7 @@
 #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))
 
@@ -2121,3 +2122,234 @@ enum ndr_err_code ndr_pull_BufferTooSmall_repl(struct ndr_pull *ndr, int ndr_fla
 {
        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;
+}
index 3c764a38f89c607a7f2630d39cb63e56cfb362f3..37fa6dc5cfac5f0f0d836ec802f1c6d6b1ecbd7a 100644 (file)
@@ -154,45 +154,10 @@ interface property
                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 {
@@ -210,27 +175,43 @@ interface property
        } 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;
@@ -240,8 +221,7 @@ interface property
                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;
index 57c8aee968a51375e4ab0fac44e00035d45f9689..ce550386e899e9bdbb12725e6e60f3240bd92952 100644 (file)
@@ -270,8 +270,6 @@ def newuser(lp, creds, username=None):
     extended_user = """
 dn: %s
 changetype: modify
-add: displayName
-displayName: %s
 add: auxiliaryClass
 auxiliaryClass: msExchBaseClass
 add: mailNickName
@@ -289,9 +287,25 @@ proxyAddresses: X400:c=US;a= ;p=First Organizati;o=Exchange;s=%s
 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
 
 
index 4c43105f8789071ee90b05932a36c24072589810..677b30b0d26db04d642aa64b020a8739b12e7f54 100644 (file)
@@ -224,9 +224,10 @@ _PUBLIC_ bool mapitest_common_message_fill(struct mapitest *mt,
 {
        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;
@@ -253,28 +254,31 @@ _PUBLIC_ bool mapitest_common_message_fill(struct mapitest *mt,
        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");
index e1959b5465f8f85612c78765a34d1458ba025dea..a7dd3dfa328d62be98d18a87d036bec667544538 100644 (file)
@@ -674,7 +674,7 @@ _PUBLIC_ void mapitest_print_SPropValue(struct mapitest *mt, struct SPropValue l
   
   \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;
index edfd83b48402c41a1f9376cc08e2cc70d6defc91..e9c599fa1f3227ce9fc39d2d6dd8938dcd3a80c5 100644 (file)
@@ -224,27 +224,27 @@ _PUBLIC_ bool mapitest_mapidump_srowset(struct mapitest *mt)
 */ 
 _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);
 
index 30e5838f793e6caf094fe5fff622bdb1d4182fb5..918fdb5f3f0ff5423c71d80e7da63ac989e900c3 100644 (file)
@@ -42,14 +42,14 @@ _PUBLIC_ bool mapitest_nspi_UpdateStat(struct mapitest *mt)
        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;
@@ -81,9 +81,9 @@ _PUBLIC_ bool mapitest_nspi_QueryRows(struct mapitest *mt)
        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");
@@ -94,7 +94,7 @@ _PUBLIC_ bool mapitest_nspi_QueryRows(struct mapitest *mt)
                                          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;
@@ -104,11 +104,11 @@ _PUBLIC_ bool mapitest_nspi_QueryRows(struct mapitest *mt)
        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) {
@@ -118,9 +118,9 @@ _PUBLIC_ bool mapitest_nspi_QueryRows(struct mapitest *mt)
        }
 
        /* 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);
@@ -146,9 +146,9 @@ _PUBLIC_ bool mapitest_nspi_SeekEntries(struct mapitest *mt)
        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;
 
@@ -156,36 +156,36 @@ _PUBLIC_ bool mapitest_nspi_SeekEntries(struct mapitest *mt)
        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);
@@ -207,9 +207,9 @@ _PUBLIC_ bool mapitest_nspi_GetMatches(struct mapitest *mt)
        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;
 
@@ -221,7 +221,7 @@ _PUBLIC_ bool mapitest_nspi_GetMatches(struct mapitest *mt)
                                          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;
@@ -231,11 +231,11 @@ _PUBLIC_ bool mapitest_nspi_GetMatches(struct mapitest *mt)
        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);
@@ -261,9 +261,9 @@ _PUBLIC_ bool mapitest_nspi_ResortRestriction(struct mapitest *mt)
        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;
@@ -287,7 +287,7 @@ _PUBLIC_ bool mapitest_nspi_ResortRestriction(struct mapitest *mt)
                                          );
 
        /* 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;
@@ -297,12 +297,12 @@ _PUBLIC_ bool mapitest_nspi_ResortRestriction(struct mapitest *mt)
        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);
@@ -378,17 +378,17 @@ _PUBLIC_ bool mapitest_nspi_GetPropList(struct mapitest *mt)
        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;
@@ -398,12 +398,12 @@ _PUBLIC_ bool mapitest_nspi_GetPropList(struct mapitest *mt)
        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);
@@ -448,7 +448,7 @@ _PUBLIC_ bool mapitest_nspi_GetProps(struct mapitest *mt)
        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;
@@ -469,13 +469,13 @@ _PUBLIC_ bool mapitest_nspi_GetProps(struct mapitest *mt)
                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);
 
@@ -501,9 +501,9 @@ _PUBLIC_ bool mapitest_nspi_CompareMIds(struct mapitest *mt)
        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");
@@ -513,7 +513,7 @@ _PUBLIC_ bool mapitest_nspi_CompareMIds(struct mapitest *mt)
        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;
@@ -523,12 +523,12 @@ _PUBLIC_ bool mapitest_nspi_CompareMIds(struct mapitest *mt)
        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);
@@ -571,13 +571,13 @@ _PUBLIC_ bool mapitest_nspi_ModProps(struct mapitest *mt)
        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;
@@ -590,7 +590,7 @@ _PUBLIC_ bool mapitest_nspi_ModProps(struct mapitest *mt)
                                          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;
@@ -600,11 +600,11 @@ _PUBLIC_ bool mapitest_nspi_ModProps(struct mapitest *mt)
        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) {
@@ -614,30 +614,30 @@ _PUBLIC_ bool mapitest_nspi_ModProps(struct mapitest *mt)
        }
 
        /* 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);
@@ -652,34 +652,34 @@ _PUBLIC_ bool mapitest_nspi_ModProps(struct mapitest *mt)
        }
 
        /* 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);
@@ -709,14 +709,14 @@ _PUBLIC_ bool mapitest_nspi_GetSpecialTable(struct mapitest *mt)
        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) {
@@ -724,9 +724,9 @@ _PUBLIC_ bool mapitest_nspi_GetSpecialTable(struct mapitest *mt)
                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);
 
@@ -750,12 +750,12 @@ _PUBLIC_ bool mapitest_nspi_GetTemplateInfo(struct mapitest *mt)
        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);
@@ -935,7 +935,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
 {
        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];
@@ -964,7 +964,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
 
        /* 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);
@@ -981,14 +981,14 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
                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]);
@@ -996,7 +996,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
                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;
@@ -1004,7 +1004,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
 
        /* 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]);
@@ -1012,14 +1012,14 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
                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]);
@@ -1027,7 +1027,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
                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;
@@ -1046,7 +1046,7 @@ _PUBLIC_ bool mapitest_nspi_ResolveNames(struct mapitest *mt)
 _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;
@@ -1072,21 +1072,21 @@ _PUBLIC_ bool mapitest_nspi_GetGALTable(struct mapitest *mt)
        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) {
index 6ac3124aae9cd10a81a6d9893c742577579d4cbf..c102cd4fe9b1fc978bc27227d79867cbe9598b9e 100644 (file)
@@ -239,7 +239,8 @@ _PUBLIC_ bool mapitest_oxcmsg_ModifyRecipients(struct mapitest *mt)
        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];
@@ -294,32 +295,35 @@ _PUBLIC_ bool mapitest_oxcmsg_ModifyRecipients(struct mapitest *mt)
 
        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;
        }
@@ -329,7 +333,7 @@ _PUBLIC_ bool mapitest_oxcmsg_ModifyRecipients(struct mapitest *mt)
        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;
        }
@@ -340,7 +344,7 @@ _PUBLIC_ bool mapitest_oxcmsg_ModifyRecipients(struct mapitest *mt)
        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;
        }
@@ -350,12 +354,12 @@ _PUBLIC_ bool mapitest_oxcmsg_ModifyRecipients(struct mapitest *mt)
        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);
@@ -390,7 +394,8 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        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];
@@ -443,30 +448,33 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
 
        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;
        }
@@ -475,7 +483,7 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        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;
        }
@@ -485,7 +493,7 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        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;
        }
@@ -496,7 +504,7 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        retval = RemoveAllRecipients(&obj_message);
        mapitest_print_retval(mt, "RemoveAllRecipients");
        if (GetLastError() != MAPI_E_SUCCESS) {
-               MAPIFreeBuffer(SRowSet);
+               MAPIFreeBuffer(RowSet);
                MAPIFreeBuffer(flaglist);
                ret = false;
        }
@@ -505,7 +513,7 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        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;
        }
@@ -516,13 +524,13 @@ _PUBLIC_ bool mapitest_oxcmsg_RemoveAllRecipients(struct mapitest *mt)
        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);
@@ -556,7 +564,8 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
        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;
@@ -611,36 +620,39 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
 
        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;
        }
@@ -650,18 +662,17 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
        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;
        }
@@ -670,7 +681,7 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
        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;
        }
@@ -681,7 +692,7 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
        mapitest_print_retval(mt, "ReadRecipients");
        MAPIFreeBuffer(RecipientRows);
        if (retval != MAPI_E_SUCCESS) {
-               MAPIFreeBuffer(SRowSet);
+               MAPIFreeBuffer(RowSet);
                MAPIFreeBuffer(flaglist);
                return false;
        }
@@ -692,13 +703,13 @@ _PUBLIC_ bool mapitest_oxcmsg_ReadRecipients(struct mapitest *mt)
        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);
index ba2402ceeac023bf078fb58d2768e215014711d1..5c9b684135ecd2ceb2284c8e46778eb2dc2c3f16 100644 (file)
@@ -752,6 +752,7 @@ static enum MAPISTATUS openchangeclient_sendmail(TALLOC_CTX *mem_ctx,
        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;
@@ -800,12 +801,13 @@ static enum MAPISTATUS openchangeclient_sendmail(TALLOC_CTX *mem_ctx,
 
        /* 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);
@@ -2460,7 +2462,7 @@ static bool openchangeclient_userlist(TALLOC_CTX *mem_ctx,
                                      struct mapi_session *session)
 {
        struct SPropTagArray    *SPropTagArray;
-       struct SRowSet          *SRowSet;
+       struct PropertyRowSet_r *RowSet;
        uint32_t                i;
        uint32_t                count;
        uint8_t                 ulFlags;
@@ -2488,18 +2490,18 @@ static bool openchangeclient_userlist(TALLOC_CTX *mem_ctx,
        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());