|
|
|
IHttpNegotiate2 Interface |
|
IID_IHttpNegotiate2 |
{4F9F9FCB-E0F4-48EB-B7AB-FA2EA9365CB4} |
|
This interface is implemented by a client application to provide support for HTTP negotiations. It extends the 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. |
|
IHttpNegotiate2 Method |
Description |
|
GetRootSecurityId |
Obtains a root security identifier (ID). |
|
IHttpNegotiate2 interface implementation |
$IID_IHttpNegotiate2 = GUID$("{4F9F9FCB-E0F4-48EB-B7AB-FA2EA9365CB4}")
' ****************************************************************************************
' IHttpNegotiate2 interface virtual table
' ****************************************************************************************
TYPE IHttpNegotiate2Vtbl
' 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
' IHttpNegotiate2 method
pGetRootSecurityId AS DWORD ' // GetRootSecurityId method
' Custom data
pVtblAddr AS DWORD ' // Address of the virtual table
cRef AS DWORD ' // Reference count
END TYPE
' ****************************************************************************************
' ****************************************************************************************
' Builds the IHttpNegotiate2 Virtual Table
' Returns a cookie that is a pointer to a IHttpNegotiate2Vtbl structure.
' ****************************************************************************************
FUNCTION IHttpNegotiate2_BuildVtbl () AS DWORD
LOCAL pVtbl AS IHttpNegotiate2Vtbl PTR
LOCAL pUnk AS IHttpNegotiate2Vtbl PTR
pVtbl = HeapAlloc(GetProcessHeap(), %HEAP_ZERO_MEMORY, SIZEOF(@pVtbl))
IF pVtbl = 0 THEN EXIT FUNCTION
@pVtbl.pQueryInterface = CODEPTR(IHttpNegotiate2_QueryInterface)
@pVtbl.pAddRef = CODEPTR(IHttpNegotiate2_AddRef)
@pVtbl.pRelease = CODEPTR(IHttpNegotiate2_Release)
@pVtbl.pBeginningTransaction = CODEPTR(IHttpNegotiate2_BeginningTransaction)
@pVtbl.pOnResponse = CODEPTR(IHttpNegotiate2_OnResponse)
@pVtbl.pGetRootSecurityId = CODEPTR(IHttpNegotiate2_GetRootSecurityId)
@pVtbl.pVtblAddr = pVtbl
@pVtbl.cRef = 1
pUnk = VARPTR(@pVtbl.pVtblAddr)
FUNCTION = pUnk
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate2_QueryInterface method
' Returns the IUnknown of our class and increments the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate2_QueryInterface (BYVAL pCookie AS IHttpNegotiate2Vtbl PTR, BYREF riid AS GUID, BYREF ppvObj AS DWORD) AS LONG
IF riid = $IID_IHttpNegotiate2 THEN
ppvObj = pCookie
INCR @@pCookie.cRef
FUNCTION = %S_OK
ELSE
FUNCTION = %E_NOINTERFACE
END IF
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate2_IUnknown_AddRef method
' Increments the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate2_AddRef (BYVAL pCookie AS IHttpNegotiate2Vtbl PTR) AS DWORD
INCR @@pCookie.cRef
FUNCTION = @@pCookie.cRef
END FUNCTION
' ****************************************************************************************
' ****************************************************************************************
' IHttpNegotiate2_IUnknown_Release method
' Releases our class if there is only a reference to him and decrements the reference counter.
' ****************************************************************************************
FUNCTION IHttpNegotiate2_Release (BYVAL pCookie AS IHttpNegotiate2Vtbl 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 IHttpNegotiate2_BeginningTransaction ( _
BYVAL pCookie AS IHttpNegotiate2Vtbl 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 IHttpNegotiate2_OnResponse ( _
BYVAL pCookie AS IHttpNegotiate2Vtbl 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
' ****************************************************************************************
' ****************************************************************************************
' Obtains a root security identifier (ID).
' ****************************************************************************************
FUNCTION IHttpNegotiate2_GetRootSecurityId ( _
BYVAL pCookie AS IHttpNegotiate2Vtbl PTR _
, BYREF pbSecurityId AS DWORD _
, BYREF pcbSecurityId AS DWORD _
. BYVAL dwReserved AS DWORD _
) AS LONG
' Put your code here
' FUNCTION = %S_OK or an error value
END FUNCTION
' ****************************************************************************************
|
Page last updated on Monday, 03 April 2006 19:58:51 +0200