Export (0) Print
Expand All

IProviderAdmin::GetProviderTable

Last modified: July 23, 2011

Applies to: Outlook

Provides access to the message service's provider table, a list of the service providers in the message service.

HRESULT GetProviderTable(
  ULONG ulFlags,
  LPMAPITABLE FAR * lppTable
);

ulFlags

[in] A bitmask of flags that controls the type of the strings returned in the provider table's columns. The following flag can be set:

MAPI_UNICODE

The string columns are in Unicode format. If the MAPI_UNICODE flag is not set, the columns are in ANSI format.

lppTable

[out] A pointer to a pointer to the provider table.

S_OK

The provider table was successfully returned.

The IProviderAdmin::GetProviderTable method retrieves a pointer to the message service's provider table, a table that MAPI maintains that contains information about each service provider in the message service.

Unlike the provider table returned by the IMsgServiceAdmin::GetProviderTable method, the provider table returned by IProviderAdmin::GetProviderTable may include additional rows that represent information associated with one or more of the service providers in the message service. This extra information is added to the profile with the "Sections" keyword of the Mapisvc.inf file. When a provider has extra profile sections, it stores the MAPIUID structures for these sections in the PR_SERVICE_EXTRA_UIDS (PidTagServiceExtraUids) property. PR_SERVICE_EXTRA_UIDS is saved in the message service profile section.

Providers that have been deleted, or are in use but have been marked for deletion, are not included in the provider table. Provider tables are static, meaning that subsequent additions to or deletions from the message service are not reflected in the table.

If the message service has no providers, IProviderAdmin::GetProviderTable returns a table with zero rows and the S_OK return value.

Setting the MAPI_UNICODE flag in the ulFlags parameter affects the format of the columns returned from the IMAPITable::QueryColumns and IMAPITable::QueryRows methods.

This flag also controls the property types in the sort order returned by the IMAPITable::QuerySortOrder method.

For a complete list of the columns in the provider table, see Provider Table.

To retrieve the rows of a provider table in transport order, sort the table by the PR_PROVIDER_ORDINAL (PidTagProviderOrdinal) column.

To retrieve only those rows that represent service providers (without including any extra rows), limit your retrieval to the rows that have a value of PT_ERROR in their PR_RESOURCE_TYPE (PidTagResourceType) column.

For MFCMAPI sample code, see the following table.

File

Function

Comment

MsgServiceTableDlg.cpp

CMsgServiceTableDlg::OnDisplayItem

MFCMAPI uses the IProviderAdmin::GetProviderTable method to get the table of providers to render in a new dialog box.

Show:
© 2014 Microsoft