|
|
|
IHttpNegotiate Interface |
|
IID_IHttpNegotiate |
{79EAC9D2-BAF9-11CE-8C82-00AA004BA90B} |
|
This interface is implemented by a client application to provide support for HTTP negotiations.
Urlmon.dll uses the QueryInterface method on your implementation of IBindStatusCallback to obtain a pointer to your IHttpNegotiate interface.
|
|
Methods in VTable order |
|
|
IUnknown Methods |
Description |
|
QueryInterface |
Returns pointers to supported interfaces. |
|
AddRef |
Increments reference count. |
|
Release |
Decrements reference count. |
|
IHttpNegotiate Method |
Description |
|
BeginningTransaction |
Notifies the client of the URL being bound to at the beginning of an HTTP transaction. |
|
OnResponse |
Allows the client of a bind operation to examine the response headers, optionally terminate the bind operation, and add HTTP headers to a request before resending the request. |
|
IHttpNegotiate interface implementation |
$IID_IHttpNegotiate = GUID$("{79EAC9D2-BAF9-11CE-8C82-00AA004BA90B}")
' ****************************************************************************************
' IHttpNegotiate interface virtual table
' ****************************************************************************************
TYPE IHttpNegotiateVtbl
' IUnknown methods
pQueryInterface AS DWORD ' // QueryInterface method
pAddRef AS DWORD ' // AddRef method
pRelease AS DWORD ' // Release method
' IHttpNegotiate method
pBeginningTransaction AS DWORD ' // BeginningTransaction method
pOnResponse AS DWORD ' // OnResponse method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IHttpNegotiate Virtual Table
' Returns a cookie that is a pointer to a IHttpNegotiateVtbl structure.
' ****************************************************************************************
FUNCTION IHttpNegotiate_BuildVtbl () AS DWORD
LOCAL pVtbl AS IHttpNegotiateVtbl PTR
LOCAL pUnk AS IHttpNegotiateVtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IHttpNegotiate_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IHttpNegotiate_AddRef)
@pVtbl.pRelease = CODEPTR(IHttpNegotiate_Release)
@pVtbl.pBeginningTransaction = CODEPTR(IHttpNegotiate_BeginningTransaction)
@pVtbl.pOnResponse = CODEPTR(IHttpNegotiate_OnResponse)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate_QueryInterface (BYVAL pCookie AS IHttpNegotiateVtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IHttpNegotiate THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate_AddRef (BYVAL pCookie AS IHttpNegotiateVtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate_Release (BYVAL pCookie AS IHttpNegotiateVtbl PTR) AS DWORD
DECR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
IF @@pCookie.cRef = 0 THEN
IF ISTRUE @@pCookie.pVtblAddr THEN
HeapFree(GetProcessHeap(), 0, BYVAL @@pCookie.pVtblAddr)
END IF
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Notifies the client of the URL being bound to at the beginning of an HTTP transaction.
' ****************************************************************************************
FUNCTION IHttpNegotiate_BeginningTransaction ( _
BYVAL pCookie AS IHttpNegotiateVtbl PTR _
, BYVAL szURL AS DWORD _
, BYVAL szHeaders AS DWORD _
, BYVAL dwReserved AS DWORD _
, BYREF pszAdditionalHeaders AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_ABORT or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' Allows the client of a bind operation to examine the response headers, optionally
' terminate the bind operation, and add HTTP headers to a request before resending the
' request.
' ****************************************************************************************
FUNCTION IHttpNegotiate_OnResponse ( _
BYVAL pCookie AS IHttpNegotiateVtbl PTR _
, BYVAL dwResponseCode AS DWORD _
, BYVAL szResponseHeaders AS DWORD _
. BYVAL szRequestHeaders AS DWORD _
, BYVAL pszAdditionalRequestHeaders AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or %E_ABORT or %E_INVALIDARG
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:58:44 +0200