The IProviderAdmin::OpenProfileSection method opens a profile section from the current profile and returns an IProfSect pointer for further access.
See IProviderAdmin : IUnknown.
HRESULT OpenProfileSection(
LPMAPIUID lpUID,
LPCIID lpInterface,
ULONG ulFlags,
LPPROFSECT FAR * lppProfSect
);
The IProviderAdmin::OpenProfileSection method opens a profile section, allowing the caller to read information from and possibly write information to the active profile.
Clients cannot open profile sections belonging to providers using the IProviderAdmin::OpenProfileSection method.
Multiple clients or service providers can simultaneously open a profile section with read-only access. However, when a profile section is open with read/write access, no other calls can be made to open the section, regardless of the type of access. If a profile section is open with read-only access, a subsequent call to request read/write access will fail with MAPI_E_NO_ACCESS. Likewise, if a section is open with read/write access, a subsequent call to request read-only access will also fail.
If you request that OpenProfileSection open a nonexistent profile section by passing MAPI_MODIFY in ulFlags and an unknown MAPIUID in lpUID, the profile section will be created.
If you request that OpenProfileSection open a nonexistent section with read-only access, it returns MAPI_E_NOT_FOUND.
IMAPIProp : IUnknown, IProfSect : IMAPIProp, MAPIUID