Last modified: July 23, 2011

Applies to: Outlook

Deletes a service provider from the message service.

HRESULT DeleteProvider(


[in, out] A pointer to the MAPIUID structure that contains the unique identifier that represents the provider to delete.


The provider was successfully deleted from the message service.


The MAPIUID pointed to by the lpUID parameter was not recognized.

The IProviderAdmin::DeleteProvider method deletes a service provider from the message service. DeleteProvider determines the service provider to delete by matching the MAPIUID structure pointed to by lpUID with the set of identifiers registered by the active service providers.

Most message services do not allow providers to be deleted while the profile is in use. If the provider to delete is in use, DeleteProvider marks it for deletion instead of removing it immediately and returns S_OK. When the provider is no longer being used, it is deleted.

DeleteProvider calls the message service's entry point function before the provider is removed from the service. The ulContext parameter is set to MSG_SERVICE_PROVIDER_DELETE. The message service entry point function performs the following tasks:

  • Deletes the service provider.

  • Deletes the service provider's profile section.

The message service entry point function is not called again after the provider has been deleted.