HttpGetExtendedInterface 函式
根據 HTTP 伺服器實例和要向下轉換的指標,擷取擴充 HTTP 介面。
語法
template <class HttpType1, class HttpType2>
HRESULT HttpGetExtendedInterface(
__in IHttpServer* pHttpServer,
__in HttpType1* pInput,
__deref_out HttpType2** ppOutput
);
參數
pHttpServer
[IN]指向 IHttpServer 介面的實例。
pInput
[IN]指向要向下轉換之介面的實例。
ppOutput
[OUT]指向擴充 HTTP 介面。
傳回值
HRESULT
。 可能的值包括 (但不限於) 下表中的這些值。
值 | 描述 |
---|---|
S_OK | 表示作業成功。 |
備註
您可以從函式的引數推斷範本參數 (HttpType1
和 HttpType2
) ,如下列範例所示。
IHttpRequest * pHttpRequest = pHttpContext->GetRequest();
IHttpRequest2 * pHttpRequest2;
HRESULT hr = HttpGetExtendedInterface(g_pHttpServer, pHttpRequest, &pHttpRequest2);
if( SUCCEEDED(hr) )
{
// Use pHttpRequest2.
}
其中 pHttpContext
是 IHttpCoNtext 指標,而 g_pHttpServer
是 IHttpServer 指標。
規格需求
類型 | 描述 |
---|---|
Client | - Windows Vista 上的 IIS 7.0 - Windows 7 上的 IIS 7.5 - Windows 8 上的 IIS 8.0 - Windows 10上的 IIS 10.0 |
伺服器 | - Windows Server 2008 上的 IIS 7.0 - Windows Server 2008 R2 上的 IIS 7.5 - Windows Server 2012 上的 IIS 8.0 - Windows Server 2012 R2 上的 IIS 8.5 - Windows Server 2016上的 IIS 10.0 |
產品 | - IIS 7.0、IIS 7.5、IIS 8.0、IIS 8.5、IIS 10.0 - IIS Express 7.5、IIS Express 8.0、IIS Express 10.0 |
標頭 | Httpserv.h |