Commit 3fa595e2 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Added IWinInetHttpInfo stub implementation to HttpProtocol object.

parent 36dbb69b
......@@ -34,6 +34,7 @@ typedef struct {
const IInternetProtocolVtbl *lpInternetProtocolVtbl;
const IInternetPriorityVtbl *lpInternetPriorityVtbl;
const IWinInetHttpInfoVtbl *lpWinInetHttpInfoVtbl;
BOOL https;
IHttpNegotiate *http_negotiate;
......@@ -42,8 +43,9 @@ typedef struct {
LONG ref;
} HttpProtocol;
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define INETHTTPINFO(x) ((IWinInetHttpInfo*) &(x)->lpWinInetHttpInfoVtbl)
/* Default headers from native */
static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',
......@@ -326,6 +328,12 @@ static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFI
}else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
*ppv = PRIORITY(This);
}else if(IsEqualGUID(&IID_IWinInetInfo, riid)) {
TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv);
*ppv = INETHTTPINFO(This);
}else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
*ppv = INETHTTPINFO(This);
}
if(*ppv) {
......@@ -527,6 +535,52 @@ static const IInternetPriorityVtbl HttpPriorityVtbl = {
HttpPriority_GetPriority
};
#define INETINFO_THIS(iface) DEFINE_THIS(HttpProtocol, WinInetHttpInfo, iface)
static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
{
HttpProtocol *This = INETINFO_THIS(iface);
return IBinding_QueryInterface(PROTOCOL(This), riid, ppv);
}
static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
{
HttpProtocol *This = INETINFO_THIS(iface);
return IBinding_AddRef(PROTOCOL(This));
}
static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
{
HttpProtocol *This = INETINFO_THIS(iface);
return IBinding_Release(PROTOCOL(This));
}
static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption,
void *pBuffer, DWORD *pcbBuffer)
{
HttpProtocol *This = INETINFO_THIS(iface);
FIXME("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer);
return E_NOTIMPL;
}
static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption,
void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
{
HttpProtocol *This = INETINFO_THIS(iface);
FIXME("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
return E_NOTIMPL;
}
#undef INETINFO_THIS
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl = {
HttpInfo_QueryInterface,
HttpInfo_AddRef,
HttpInfo_Release,
HttpInfo_QueryOption,
HttpInfo_QueryInfo
};
static HRESULT create_http_protocol(BOOL https, void **ppobj)
{
HttpProtocol *ret;
......@@ -538,6 +592,7 @@ static HRESULT create_http_protocol(BOOL https, void **ppobj)
ret->base.vtbl = &AsyncProtocolVtbl;
ret->lpInternetProtocolVtbl = &HttpProtocolVtbl;
ret->lpInternetPriorityVtbl = &HttpPriorityVtbl;
ret->lpWinInetHttpInfoVtbl = &WinInetHttpInfoVtbl;
ret->https = https;
ret->ref = 1;
......
......@@ -1610,6 +1610,19 @@ static void test_protocol_terminate(IInternetProtocol *protocol)
ok(hres == S_OK, "UnlockRequest failed: %08x\n", hres);
}
static void test_http_info(IInternetProtocol *protocol)
{
IWinInetHttpInfo *info;
HRESULT hres;
hres = IInternetProtocol_QueryInterface(protocol, &IID_IWinInetHttpInfo, (void**)&info);
ok(hres == S_OK, "Could not get IWinInterHttpInfo iface: %08x\n", hres);
/* TODO */
IWinInetHttpInfo_Release(info);
}
/* is_first refers to whether this is the first call to this function
* _for this url_ */
static void test_http_protocol_url(LPCWSTR url, BOOL is_https, BOOL is_first)
......@@ -1648,6 +1661,7 @@ static void test_http_protocol_url(LPCWSTR url, BOOL is_https, BOOL is_first)
ULONG ref;
test_priority(async_protocol);
test_http_info(async_protocol);
SET_EXPECT(ReportProgress_FINDINGRESOURCE);
SET_EXPECT(ReportProgress_CONNECTING);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment