urlmon: Don't use DEFINE_THIS2 for the Protocol vtbl functions.

This commit is contained in:
Michael Stefaniuc 2011-01-04 10:59:54 +01:00 committed by Alexandre Julliard
parent 51d05e241a
commit 5db4caee8e
4 changed files with 19 additions and 17 deletions

View file

@ -50,12 +50,15 @@ static inline FtpProtocol *impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
return CONTAINING_RECORD(iface, FtpProtocol, IWinInetHttpInfo_iface);
}
#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(FtpProtocol, base, iface)
static inline FtpProtocol *impl_from_Protocol(Protocol *prot)
{
return CONTAINING_RECORD(prot, FtpProtocol, base);
}
static HRESULT FtpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags,
HINTERNET internet_session, IInternetBindInfo *bind_info)
{
FtpProtocol *This = ASYNCPROTOCOL_THIS(prot);
FtpProtocol *This = impl_from_Protocol(prot);
BSTR url;
HRESULT hres;
@ -82,7 +85,7 @@ static HRESULT FtpProtocol_end_request(Protocol *prot)
static HRESULT FtpProtocol_start_downloading(Protocol *prot)
{
FtpProtocol *This = ASYNCPROTOCOL_THIS(prot);
FtpProtocol *This = impl_from_Protocol(prot);
DWORD size;
BOOL res;
@ -104,8 +107,6 @@ static void FtpProtocol_on_error(Protocol *prot, DWORD error)
FIXME("(%p) %d - stub\n", prot, error);
}
#undef ASYNCPROTOCOL_THIS
static const ProtocolVtbl AsyncProtocolVtbl = {
FtpProtocol_open_request,
FtpProtocol_end_request,

View file

@ -32,12 +32,15 @@ typedef struct {
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(GopherProtocol, base, iface)
static inline GopherProtocol *impl_from_Protocol(Protocol *prot)
{
return CONTAINING_RECORD(prot, GopherProtocol, base);
}
static HRESULT GopherProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags,
HINTERNET internet_session, IInternetBindInfo *bind_info)
{
GopherProtocol *This = ASYNCPROTOCOL_THIS(prot);
GopherProtocol *This = impl_from_Protocol(prot);
BSTR url;
HRESULT hres;
@ -75,8 +78,6 @@ static void GopherProtocol_on_error(Protocol *prot, DWORD error)
FIXME("(%p) %d - stub\n", prot, error);
}
#undef ASYNCPROTOCOL_THIS
static const ProtocolVtbl AsyncProtocolVtbl = {
GopherProtocol_open_request,
GopherProtocol_end_request,

View file

@ -122,12 +122,15 @@ static ULONG send_http_request(HttpProtocol *This)
return res ? 0 : GetLastError();
}
#define ASYNCPROTOCOL_THIS(iface) DEFINE_THIS2(HttpProtocol, base, iface)
static inline HttpProtocol *impl_from_Protocol(Protocol *prot)
{
return CONTAINING_RECORD(prot, HttpProtocol, base);
}
static HRESULT HttpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags,
HINTERNET internet_session, IInternetBindInfo *bind_info)
{
HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
HttpProtocol *This = impl_from_Protocol(prot);
LPWSTR addl_header = NULL, post_cookie = NULL;
IServiceProvider *service_provider = NULL;
IHttpNegotiate2 *http_negotiate2 = NULL;
@ -306,7 +309,7 @@ static HRESULT HttpProtocol_end_request(Protocol *protocol)
static HRESULT HttpProtocol_start_downloading(Protocol *prot)
{
HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
HttpProtocol *This = impl_from_Protocol(prot);
LPWSTR content_type, content_length, ranges;
DWORD len = sizeof(DWORD);
DWORD status_code;
@ -374,7 +377,7 @@ static HRESULT HttpProtocol_start_downloading(Protocol *prot)
static void HttpProtocol_close_connection(Protocol *prot)
{
HttpProtocol *This = ASYNCPROTOCOL_THIS(prot);
HttpProtocol *This = impl_from_Protocol(prot);
if(This->http_negotiate) {
IHttpNegotiate_Release(This->http_negotiate);
@ -393,8 +396,6 @@ static void HttpProtocol_on_error(Protocol *prot, DWORD error)
FIXME("(%p) %d - stub\n", prot, error);
}
#undef ASYNCPROTOCOL_THIS
static const ProtocolVtbl AsyncProtocolVtbl = {
HttpProtocol_open_request,
HttpProtocol_end_request,

View file

@ -62,8 +62,7 @@ extern LONG URLMON_refCount;
static inline void URLMON_LockModule(void) { InterlockedIncrement( &URLMON_refCount ); }
static inline void URLMON_UnlockModule(void) { InterlockedDecrement( &URLMON_refCount ); }
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
IInternetProtocolInfo *get_protocol_info(LPCWSTR);
HRESULT get_protocol_handler(IUri*,CLSID*,BOOL*,IClassFactory**);