urlmon: Added IWinInetHttpInfo stub implementation to FtpProtocol object.

This commit is contained in:
Jacek Caban 2009-03-29 21:30:50 +02:00 committed by Alexandre Julliard
parent b83fd688a2
commit c31e6537fb
2 changed files with 58 additions and 2 deletions

View File

@ -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);

View File

@ -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);