由 SharePoint 2016 弃用的接口导致的协议处理程序错误
如果协议处理程序实现代码在 srchprth.h 头文件中使用本文列出的接口,现在会遭 SharePoint 2016 弃用。 具体而言,使用弃用接口的协议处理程序会生成错误“无法加载协议处理程序”。
症状
加载协议处理程序时,看到以下错误消息:
The protocol handler <name of custom protocol handler> cannot be loaded. Error description: No such interface supported.
原因
在协议处理程序实现代码中使用 srchprth.h 头文件。 此文件包含 SharePoint 2016 弃用的接口。
解决方案
将协议处理程序实现代码中的弃用接口替换为目前支持的接口:
srchprth.h(已更新)
urlaccsdk.h(新)
弃用的接口
弃用的接口包括:
interface ISearchProtocol: IUnknown
{
HRESULT Init([in] TIMEOUT_INFO *pTimeoutInfo,
[in] IProtocolHandlerSite *pProtocolHandlerSite,
[in] PROXY_INFO *pProxyInfo);
HRESULT CreateAccessor([in] LPCWSTR pcwszURL,
[in] AUTHENTICATION_INFO *pAuthenticationInfo,
[in] INCREMENTAL_ACCESS_INFO *pIncrementalAccessInfo,
[in] ITEM_INFO *pItemInfo,
[out] IUrlAccessor **ppAccessor);
HRESULT CloseAccessor([in] IUrlAccessor *pAccessor);
HRESULT ShutDown();
}
TIMEOUT_INFO
{
DWORD dwSize;
DWORD dwConnectTimeout;
DWORD dwDataTimeout;
}
PROXY_INFO
{
DWORD dwSize;
LPCWSTR pcwszUserAgent;
PROXY_ACCESS paUseProxy;
BOOL fLocalBypass;
DWORD dwPortNumber;
LPCWSTR pcwszProxyName;
LPCWSTR pcwszBypassList;
}
AUTHENTICATION_INFO
{
DWORD dwSize;
AUTH_TYPE atAuthenticationType;
LPCWSTR pcwszUser;
LPCWSTR pcwszPassword;
}
INCREMENTAL_ACCESS_INFO
{
DWORD dwSize;
FILETIME ftLastModifiedTime;
}
IProtocolHandler: public IUnknown
{
public:
HRESULT Init(
/* [in] */ LPCWSTR pwszUserAgent,
/* [in] */ DWORD dwUseProxy,
/* [in] */ DWORD dwConnectTimeout,
/* [in] */ DWORD dwDataTimeout,
/* [in] */ DWORD dwLocalByPassProxy,
/* [in] */ DWORD dwPortNumber,
/* [in] */ LPCWSTR pcwszProxyName,
/* [in] */ LPCWSTR pcwszByPassList,
/* [in] */ LPCWSTR pcwszProxyUserName,
/* [in] */ LPCWSTR pcwszProxyPassword,
/* [in] */ IProtocolHandlerSite *pProtocolHandlerSite) = 0;
HRESULT CreateAccessor(
/* [in] */ AccessorInitParams *pParams,
/* [out] */ IUrlAccessor **ppAccessor) = 0;
HRESULT CloseAccessor(
/* [in] */ IUrlAccessor *pAccessor) = 0;
HRESULT SetProcessMemorySize(
/* [in] */ DWORD dwFltrDmnMemoryQuota) = 0;
};
struct AccessorInitParameters
{
LPCWSTR pwszUrl;
LPCWSTR pwszCrawlTarget;
BOOL fUseSSLWithCT;
BOOL fUseCTForIntranet;
DWORD eAuthenticationType;
LPCWSTR pwszUser;
LPCWSTR pwszPassword;
LPCWSTR pwszHttpFrom;
FILETIME ftIfModifiedSince;
DWORD dwCrawlId;
DWORD dwMiniCrawlID;
DWORD dwDeletedCount;
DWORD dwDeletedCountSync;
BOOL fDeletedCountValid;
LPCWSTR pwszAppName;
LPCWSTR pwszCatName;
DWORD dwFilterPipeFlags;
LPCWSTR pwszContentClass;
LPCWSTR pwszSearchPropertyMappingUrl;
BYTE *pbChangeLogCookie;
DWORD cbChangeLogCookieLength;
BYTE *pbChangeLogCookieEnd;
DWORD cbChangeLogCookieEndLength;
LPCWSTR pwszFormsAuthURL;
LPCWSTR pwszFormsAuthPost;
BYTE *pbCachedBlob;
DWORD cbCachedBlobLength;
DWORD dwPHFlags;
LPCWSTR pwszSecurityId;
LPCWSTR pwszCorrelationId;
CLSID *pTenantID;
HANDLE hImpersonationToken;
} AccessorInitParams;
- AccessorInitParams 包含许多参数,其中部分可能是可选参数。 这些参数大多是之前弃用结构的扩展。
另请参阅
有关详细信息,请参阅 企业搜索协议处理程序。