Opening a Public Information Store

Once you have a handle to a MAPI session, you can use it to find the public information store. Information stores are cataloged in the message store table, which can be searched using the IMAPISession::GetMsgStoresTable method.

Each information store is identified through its GUID (globally unique identifier). The Microsoft Exchange Server public information store has the PR_MDB_PROVIDER property set to pbExchangeProviderPublicGuid, which is defined in the EDKMDB.H file.

    To open a public information store
  1. Log on to a MAPI profile with the MAPILogonEx function. This call returns a MAPI session handle.
  2. Call the HrOpenExchangePublicStore function, passing the session handle obtained in step 1 in the lphSession parameter. As a result of this call, the lppMDB output parameter points to the opened public information store.

For more information on obtaining a session handle, see Opening an Information Store. For an example of using the HrOpenExchangePublicStore function in use, see the sample application source file \BKOFFICE\SAMPLES\EXCHANGE\SMBAGENT\SMBAGENT.C.