IHttpServer2::GetExtendedInterface Method

Retrieves the correct down-casted pointer based on version GUID (globally unique identifier) values.

Syntax

virtual HRESULT GetExtendedInterface(  
   _In_ const GUID &       Version1,  
   _In_ PVOID              pInput,  
   _In_ const GUID &       Version2,  
   _Outptr_ PVOID *        ppOutput  
) = 0;  

Parameters

Version1
[IN] GUID of the legacy instance.

pInput
[IN] Points to the legacy instance.

Version2
[IN] GUID of the interface to down cast to.

ppOutput
[OUT] Points to the down-casted instance.

Return Value

An HRESULT. Possible values include, but are not limited to, those in the following table.

Value Description
S_OK Indicates that the operation was successful.

Remarks

This method is intended for down casting a base class pointer to a derived class. For example, assuming you have an existing instance pointer to IHttpRequest. your code would need to down cast to its derived class IHttpRequest2 in order to call one of its new methods.

HRESULT SomeFunction(   
    IHttpServer2* pHttpServer,  
    IHttpRequest pHttpRequest   
)  
{  
    IHttpRequest2 pHttpRequest2 = NULL;  
    // Grab a new interface!  
    pHttpServer-> GetExtendedInterface(__uuidof(pHttpRequest), pHttpRequest, __uuidof(pHttpRequest2), &pHttpRequest2 );  
    …  
}  

Instead of using GetExtendedInterface, you could use the client HttpGetExtendedInterface utility function to down cast the pointer.

Requirements

Type Description
Client - IIS 7.0 on Windows Vista
- IIS 7.5 on Windows 7
- IIS 8.0 on Windows 8
- IIS 10.0 on Windows 10
Server - IIS 7.0 on Windows Server 2008
- IIS 7.5 on Windows Server 2008 R2
- IIS 8.0 on Windows Server 2012
- IIS 8.5 on Windows Server 2012 R2
- IIS 10.0 on Windows Server 2016
Product - 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
Header Httpserv.h

See Also

IHttpServer2 Interface