Unregisters one or more URL mappings for a provider binder object.


HRESULT UnregisterProvider(
   LPCOLESTR      pwszURL,
   DB_DWRESERVE   dwReserved,
   REFCLSID       rclsidProvider


  • pwszURL
    [in] The canonical URL scheme or scheme and prefix to be unmapped for the provider designated by rclsidProvider. If pwszURL is a null pointer, all URL scheme or scheme and prefix combinations are unmapped for this provider.

  • dwReserved
    [in] Reserved for future use; providers should set this to zero.

  • rclsidProvider
    [in] A reference to the CLSID of the provider binder object for which the root binder will unregister the named URL mapping. This CLSID must be provided and is never ignored.

Return Code

  • S_OK
    The method succeeded.

    *pwszURL is a null pointer, and no scheme/prefix combinations were mapped to rclsidProvider.

    *pwszURL was specified, and no matching scheme/prefix combinations were found or were mapped to rclsidProvider.

    The caller did not have permission to unregister URL mappings.

  • E_FAIL
    A provider-specific error occurred.

    pwszURL was not a well-formed or canonical URL.

    dwReserved was not 0.


If pwszURL is a null pointer, any URL mappings for the OLE DB provider binder object named by rclsidProvider are removed.

If pwszURL is not a null pointer, the scheme or scheme and prefix combination named by *pwszURL is unmapped.

IRegisterProvider::UnregisterProvider is not transacted. If the root binder encounters a failure, it is possible that some (but not all) mappings might have been removed.