Hi List, I've pushed on trunk (r711) a new and easier way to get/set mapi named properties:
1. You don't have to deal anymore with hexadecimal values for
named properties described in MS-OXCPROPS.pdf. Canonical names
for named properties are now auto-generated with mparse.pl and
added to mapi_nameid.h. For example:
Before:timezone = (const char
*)find_mapi_SPropValue_data(properties, 0x8234001F);
After: timezone = (const char
*)find_mapi_SPropValue_data(properties, PidLidTimeZoneDescription);
2. Before you could use GetProps with a set of properties
including named ones, you had to initialize a mapi_nameid
structure, perform a set of add operations, call
GetIDsFromNames, copy the resulting SPropTagArray into the
original one, call GetProps and finally map the properties back
so you can them using their *static PropId*.
Now you only have to set the SPropTagArray and call GetProps.
GetProps will automatically check for named properties, map them
with GetIDsFromNames and return you a SPropValue array which
property tags (for named props) are set to their canonical
values.
The mapi_nameid API will remain _PUBLIC_ because it can be of
use when constructing new named properties or checking your own
properties, but this should change life for developers only
willing to fetch "classical" MAPI data.
3. Before you could call SetProps with a set of known and named
properties you had to perform several operations (partially
similar to the GetProps example described above).
Now you only have to set the SPropValue array using the
canonical name of named properties and SetProps will resolve and
map everything properly.
4. Last but not least, this new approach speeds up the map/unmap
process. the mapi_nameid API was calling GetIDsFromNames when
mapping properties and GetNamesFromIds to revert these property
tags to their original values. I've included a small hack in
mapi_nameid.c which saves the original position and value and
restores it when needed.
Some example of the mapi_nameid API remains in openchange code base
(mostly torture), other tools have already been converted to use this
new approach (see exchange2ical.c or openchangeclient.c).
Cheers,
Julien.
--
Julien Kerihuel
[EMAIL PROTECTED]
OpenChange Project Manager
GPG Fingerprint: 0B55 783D A781 6329 108A B609 7EF6 FE11 A35F 1F79
signature.asc
Description: This is a digitally signed message part
_______________________________________________ devel mailing list [email protected] http://mailman.openchange.org/listinfo/devel
