다음을 통해 공유


IRegisterProvider::SetURLMapping

Registers the ability of a provider binder object to process a particular URL scheme or scheme and prefix.

Syntax

HRESULT SetURLMapping(
   LPCOLESTR      pwszURL,
   DB_DWRESERVE   dwReserved,
   REFCLSID       rclsidProvider
);

Parameters

  • pwszURL
    [in] The canonical URL scheme or scheme and prefix to be mapped.

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

  • rclsidProvider
    [in] A reference to the CLSID of the provider binder object, which is to be mapped to this URL scheme or scheme and prefix.

Return Code

  • S_OK
    The method succeeded.

  • DB_E_RESOURCEEXISTS
    The URL scheme or scheme and prefix combination was already mapped to a different provider binder object.

  • DB_SEC_E_PERMISSIONDENIED
    The caller did not have permission to register this URL mapping.

  • E_FAIL
    A provider-specific error occurred.

  • E_INVALIDARG
    pwszURL was a null pointer or pointed to an invalid URL.

    dwReserved was not 0.

Comments

Each URL scheme or scheme and prefix combination may be mapped to at most a single OLE DB provider. A URL scheme and prefix may be mapped to the same provider multiple times; however, the root binder should return S_OK on each call.

Note

Provider Binder Objects discusses case-sensitivity issues for URL-to-provider mapping.

IRegisterProvider::SetURLMapping uses InternetCrackUrl to validate URLs for mapping. In addition to the URLs accepted by InternetCrackUrl, IRegisterProvider::SetURLMapping accepts scheme-only URLs such as "http", "http:", "myscheme" and "myscheme:".

For more information about InternetCrackUrl, see the MSDN Library documentation.