emsabp_property.c File Reference

Property Tag to AD attributes mapping. More...

Functions

static void _map_proptag_to_unicode_ansi (uint32_t ulPropTag, uint32_t *pAnsiPropTag, uint32_t *pUniPropTag)
 /details Maps ulPropTag ot its PT_STRING8 and PT_UNICODE versions /param ulPropTag the proptag to map /param pAnsiPropTag pointer to the ansi version of the tag to return /param pUniPropTag pointer to the unicode version of the tag to return More...
 
_PUBLIC_ const char * emsabp_property_get_attribute (uint32_t ulPropTag)
 
_PUBLIC_ const char * emsabp_property_get_ref_attr (uint32_t ulPropTag)
 
_PUBLIC_ uint32_t emsabp_property_get_ulPropTag (const char *attribute)
 
_PUBLIC_ int emsabp_property_is_ref (uint32_t ulPropTag)
 

Variables

static const struct emsabp_property emsabp_property []
 

Detailed Description

Property Tag to AD attributes mapping.

Function Documentation

◆ _map_proptag_to_unicode_ansi()

static void _map_proptag_to_unicode_ansi ( uint32_t  ulPropTag,
uint32_t *  pAnsiPropTag,
uint32_t *  pUniPropTag 
)
inlinestatic

/details Maps ulPropTag ot its PT_STRING8 and PT_UNICODE versions /param ulPropTag the proptag to map /param pAnsiPropTag pointer to the ansi version of the tag to return /param pUniPropTag pointer to the unicode version of the tag to return

/note When the function return, ulPropTag holds the PT_STRING8 version of the tag and uniPropTag the PT_UNICODE version. Note that the mapping is only going to work for string properties

Referenced by emsabp_property_get_attribute(), emsabp_property_get_ref_attr(), and emsabp_property_is_ref().

◆ emsabp_property_get_attribute()

_PUBLIC_ const char* emsabp_property_get_attribute ( uint32_t  ulPropTag)

Return the AD attribute name associated to a property tag

Parameters
ulPropTagthe property tag to lookup
Returns
valid pointer to the attribute name on success, otherwise NULL

References _map_proptag_to_unicode_ansi().

Referenced by emsabp_query(), and emsabp_search().

◆ emsabp_property_get_ref_attr()

_PUBLIC_ const char* emsabp_property_get_ref_attr ( uint32_t  ulPropTag)

Returns the reference attr for a given attribute

Parameters
ulPropTagproperty tag to lookup
Returns
pointer to a valid reference attribute on success, otherwise NULL

References _map_proptag_to_unicode_ansi().

Referenced by emsabp_query().

◆ emsabp_property_get_ulPropTag()

_PUBLIC_ uint32_t emsabp_property_get_ulPropTag ( const char *  attribute)

Return the property tag associated to AD attribute name

Parameters
attributethe AD attribute name to lookup
Returns
property tag value on success, otherwise PT_ERROR

◆ emsabp_property_is_ref()

_PUBLIC_ int emsabp_property_is_ref ( uint32_t  ulPropTag)

Returns whether the given attribute's value references another AD record

Parameters
ulPropTagthe property tag to lookup
Returns
1 if the attribute is a reference, 0 if not and -1 if an error occurred.

References _map_proptag_to_unicode_ansi().

Referenced by emsabp_query().

Variable Documentation

◆ emsabp_property

const struct emsabp_property emsabp_property[]
static
Initial value:
= {
{ PidTagAnr, "anr", false, NULL },
{ PidTagAccount, "sAMAccountName", false, NULL },
{ PidTagGivenName, "givenName", false, NULL },
{ PidTagSurname, "sn", false, NULL },
{ PidTagOriginalDisplayName, "displayName", false, NULL },
{ PidTagTransmittableDisplayName, "displayName", false, NULL },
{ PidTagSmtpAddress, "mail", false, NULL },
{ PidTagAddressBookDisplayNamePrintable,"displayName", false, NULL },
{ PR_EMS_AB_HOME_MTA, "homeMTA", true, "legacyExchangeDN" },
{ PR_EMS_AB_ASSOC_NT_ACCOUNT, "assocNTAccount", false, NULL },
{ PidTagDepartmentName, "department", false, NULL },
{ PidTagCompanyName, "company", false, NULL },
{ PidTagDisplayName, "displayName", false, NULL },
{ PidTagEmailAddress, "legacyExchangeDN", false, NULL },
{ PidTagAddressBookHomeMessageDatabase, "homeMDB", true, "legacyExchangeDN" },
{ PidTagAddressBookProxyAddresses, "proxyAddresses", false, NULL },
{ PidTagAddressBookNetworkAddress, "networkAddress", false, NULL },
{ PidTagTitle, "personalTitle", false, NULL },
{ PidTagAddressBookObjectGuid, "objectGUID", false, NULL },
{ PidTagObjectType, "msExchRecipientTypeDetails", false, NULL },
{ PidTagDisplayType, "msExchRecipientDisplayType", false, NULL },
{ 0, NULL, false, NULL }
}

Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/