Jacek Caban : urlmon: Added IWinInetHttpInfo stub implementation to HttpProtocol object.
Alexandre Julliard
julliard at winehq.org
Mon Mar 30 12:08:45 CDT 2009
Module: wine
Branch: master
Commit: 3fa595e2a85b1160f4a8a2c4a10459099f684313
URL: http://source.winehq.org/git/wine.git/?a=commit;h=3fa595e2a85b1160f4a8a2c4a10459099f684313
Author: Jacek Caban <jacek at codeweavers.com>
Date: Sun Mar 29 21:30:29 2009 +0200
urlmon: Added IWinInetHttpInfo stub implementation to HttpProtocol object.
---
dlls/urlmon/http.c | 59 ++++++++++++++++++++++++++++++++++++++++-
dlls/urlmon/tests/protocol.c | 14 ++++++++++
2 files changed, 71 insertions(+), 2 deletions(-)
diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index 80eefbe..f3ea158 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -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;
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index 6044c31..d37e152 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -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);
More information about the wine-cvs
mailing list