2 * Copyright 2005 Jacek Caban
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "urlmon_main.h"
30 #include "wine/debug.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
35 const IInternetProtocolVtbl *lpInternetProtocolVtbl;
39 #define PROTOCOL_THIS(iface) DEFINE_THIS(HttpProtocol, InternetProtocol, iface)
41 #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
43 static HRESULT WINAPI HttpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
45 HttpProtocol *This = PROTOCOL_THIS(iface);
48 if(IsEqualGUID(&IID_IUnknown, riid)) {
49 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
50 *ppv = PROTOCOL(This);
51 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
52 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
53 *ppv = PROTOCOL(This);
54 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
55 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
56 *ppv = PROTOCOL(This);
60 IInternetProtocol_AddRef(iface);
64 WARN("not supported interface %s\n", debugstr_guid(riid));
68 static ULONG WINAPI HttpProtocol_AddRef(IInternetProtocol *iface)
70 HttpProtocol *This = PROTOCOL_THIS(iface);
71 LONG ref = InterlockedIncrement(&This->ref);
72 TRACE("(%p) ref=%ld\n", This, ref);
76 static ULONG WINAPI HttpProtocol_Release(IInternetProtocol *iface)
78 HttpProtocol *This = PROTOCOL_THIS(iface);
79 LONG ref = InterlockedDecrement(&This->ref);
81 TRACE("(%p) ref=%ld\n", This, ref);
84 HeapFree(GetProcessHeap(), 0, This);
86 URLMON_UnlockModule();
92 static HRESULT WINAPI HttpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
93 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
94 DWORD grfPI, DWORD dwReserved)
96 HttpProtocol *This = PROTOCOL_THIS(iface);
97 FIXME("(%p)->(%s %p %p %08lx %ld)\n", This, debugstr_w(szUrl), pOIProtSink,
98 pOIBindInfo, grfPI, dwReserved);
102 static HRESULT WINAPI HttpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
104 HttpProtocol *This = PROTOCOL_THIS(iface);
105 FIXME("(%p)->(%p)\n", This, pProtocolData);
109 static HRESULT WINAPI HttpProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
112 HttpProtocol *This = PROTOCOL_THIS(iface);
113 FIXME("(%p)->(%08lx %08lx)\n", This, hrReason, dwOptions);
117 static HRESULT WINAPI HttpProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
119 HttpProtocol *This = PROTOCOL_THIS(iface);
120 FIXME("(%p)->(%08lx)\n", This, dwOptions);
124 static HRESULT WINAPI HttpProtocol_Suspend(IInternetProtocol *iface)
126 HttpProtocol *This = PROTOCOL_THIS(iface);
127 FIXME("(%p)\n", This);
131 static HRESULT WINAPI HttpProtocol_Resume(IInternetProtocol *iface)
133 HttpProtocol *This = PROTOCOL_THIS(iface);
134 FIXME("(%p)\n", This);
138 static HRESULT WINAPI HttpProtocol_Read(IInternetProtocol *iface, void *pv,
139 ULONG cb, ULONG *pcbRead)
141 HttpProtocol *This = PROTOCOL_THIS(iface);
142 FIXME("(%p)->(%p %lu %p)\n", This, pv, cb, pcbRead);
146 static HRESULT WINAPI HttpProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,
147 DWORD dwOrgin, ULARGE_INTEGER *plibNewPosition)
149 HttpProtocol *This = PROTOCOL_THIS(iface);
150 FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.u.LowPart, dwOrgin, plibNewPosition);
154 static HRESULT WINAPI HttpProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
156 HttpProtocol *This = PROTOCOL_THIS(iface);
157 FIXME("(%p)->(%08lx)\n", This, dwOptions);
161 static HRESULT WINAPI HttpProtocol_UnlockRequest(IInternetProtocol *iface)
163 HttpProtocol *This = PROTOCOL_THIS(iface);
164 FIXME("(%p)\n", This);
170 static const IInternetProtocolVtbl HttpProtocolVtbl = {
171 HttpProtocol_QueryInterface,
173 HttpProtocol_Release,
175 HttpProtocol_Continue,
177 HttpProtocol_Terminate,
178 HttpProtocol_Suspend,
182 HttpProtocol_LockRequest,
183 HttpProtocol_UnlockRequest
186 HRESULT HttpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
190 TRACE("(%p %p)\n", pUnkOuter, ppobj);
194 ret = HeapAlloc(GetProcessHeap(), 0, sizeof(HttpProtocol));
196 ret->lpInternetProtocolVtbl = &HttpProtocolVtbl;
199 *ppobj = PROTOCOL(ret);