urlmon: Make HttpProtocol implementation vtbl offset independent.

This commit is contained in:
Jacek Caban 2009-02-26 01:47:24 +01:00 committed by Alexandre Julliard
parent 6b505e1425
commit 6e5c2f961d
1 changed files with 6 additions and 6 deletions

View File

@ -77,6 +77,9 @@ typedef struct {
LONG ref;
} HttpProtocol;
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
/* Default headers from native */
static const WCHAR wszHeaders[] = {'A','c','c','e','p','t','-','E','n','c','o','d','i','n','g',
':',' ','g','z','i','p',',',' ','d','e','f','l','a','t','e',0};
@ -186,10 +189,10 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback(
if (This->grfBINDF & BINDF_FROMURLMON)
IInternetProtocolSink_Switch(This->protocol_sink, &data);
else
IInternetProtocol_Continue((IInternetProtocol *)This, &data);
IInternetProtocol_Continue(PROTOCOL(This), &data);
return;
case INTERNET_STATUS_HANDLE_CREATED:
IInternetProtocol_AddRef((IInternetProtocol *)This);
IInternetProtocol_AddRef(PROTOCOL(This));
return;
case INTERNET_STATUS_HANDLE_CLOSING:
if (*(HINTERNET *)lpvStatusInformation == This->connect)
@ -210,7 +213,7 @@ static void CALLBACK HTTPPROTOCOL_InternetStatusCallback(
memset(&This->bind_info, 0, sizeof(This->bind_info));
}
}
IInternetProtocol_Release((IInternetProtocol *)This);
IInternetProtocol_Release(PROTOCOL(This));
return;
default:
WARN("Unhandled Internet status callback %d\n", dwInternetStatus);
@ -236,9 +239,6 @@ static inline LPWSTR strndupW(LPCWSTR string, int len)
* Interface implementations
*/
#define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
#define PRIORITY(x) ((IInternetPriority*) &(x)->lpInternetPriorityVtbl)
#define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, InternetProtocol, iface)
static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)