Jacek Caban : urlmon: Added IWinInetHttpInfo stub implementation to FtpProtocol object.

Alexandre Julliard julliard at winehq.org
Mon Mar 30 12:08:46 CDT 2009


Module: wine
Branch: master
Commit: c31e6537fbb287ed8953849caf9ebd189188c5d2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c31e6537fbb287ed8953849caf9ebd189188c5d2

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Sun Mar 29 21:30:50 2009 +0200

urlmon: Added IWinInetHttpInfo stub implementation to FtpProtocol object.

---

 dlls/urlmon/ftp.c            |   59 ++++++++++++++++++++++++++++++++++++++++-
 dlls/urlmon/tests/protocol.c |    1 +
 2 files changed, 58 insertions(+), 2 deletions(-)

diff --git a/dlls/urlmon/ftp.c b/dlls/urlmon/ftp.c
index dbdd7a7..75c21f2 100644
--- a/dlls/urlmon/ftp.c
+++ b/dlls/urlmon/ftp.c
@@ -26,12 +26,14 @@ typedef struct {
 
     const IInternetProtocolVtbl  *lpInternetProtocolVtbl;
     const IInternetPriorityVtbl  *lpInternetPriorityVtbl;
+    const IWinInetHttpInfoVtbl   *lpWinInetHttpInfoVtbl;
 
     LONG ref;
 } FtpProtocol;
 
-#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)
 
 #define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(FtpProtocol, base, iface)
 
@@ -97,6 +99,12 @@ static HRESULT WINAPI FtpProtocol_QueryInterface(IInternetProtocol *iface, REFII
     }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) {
@@ -295,6 +303,52 @@ static const IInternetPriorityVtbl FtpPriorityVtbl = {
     FtpPriority_GetPriority
 };
 
+#define INETINFO_THIS(iface) DEFINE_THIS(FtpProtocol, WinInetHttpInfo, iface)
+
+static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
+{
+    FtpProtocol *This = INETINFO_THIS(iface);
+    return IBinding_QueryInterface(PROTOCOL(This), riid, ppv);
+}
+
+static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
+{
+    FtpProtocol *This = INETINFO_THIS(iface);
+    return IBinding_AddRef(PROTOCOL(This));
+}
+
+static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
+{
+    FtpProtocol *This = INETINFO_THIS(iface);
+    return IBinding_Release(PROTOCOL(This));
+}
+
+static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption,
+        void *pBuffer, DWORD *pcbBuffer)
+{
+    FtpProtocol *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)
+{
+    FtpProtocol *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
+};
+
 HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
 {
     FtpProtocol *ret;
@@ -308,6 +362,7 @@ HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
     ret->base.vtbl = &AsyncProtocolVtbl;
     ret->lpInternetProtocolVtbl = &FtpProtocolVtbl;
     ret->lpInternetPriorityVtbl = &FtpPriorityVtbl;
+    ret->lpWinInetHttpInfoVtbl  = &WinInetHttpInfoVtbl;
     ret->ref = 1;
 
     *ppobj = PROTOCOL(ret);
diff --git a/dlls/urlmon/tests/protocol.c b/dlls/urlmon/tests/protocol.c
index d37e152..9a488c0 100644
--- a/dlls/urlmon/tests/protocol.c
+++ b/dlls/urlmon/tests/protocol.c
@@ -1814,6 +1814,7 @@ static void test_ftp_protocol(void)
     ok(hres == S_OK, "Could not get IInternetProtocol: %08x\n", hres);
 
     test_priority(async_protocol);
+    test_http_info(async_protocol);
 
     SET_EXPECT(GetBindInfo);
     SET_EXPECT(GetBindString_USER_AGENT);




More information about the wine-cvs mailing list