Jacek Caban : urlmon: Make HttpProtocol implementation vtbl offset independent.

Alexandre Julliard julliard at winehq.org
Thu Feb 26 09:04:53 CST 2009


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

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Thu Feb 26 01:47:24 2009 +0100

urlmon: Make HttpProtocol implementation vtbl offset independent.

---

 dlls/urlmon/http.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/urlmon/http.c b/dlls/urlmon/http.c
index 9bb4ffa..bbad056 100644
--- a/dlls/urlmon/http.c
+++ b/dlls/urlmon/http.c
@@ -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)




More information about the wine-cvs mailing list