2 * Copyright 2009 Jacek Caban for CodeWeavers
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #include "urlmon_main.h"
20 #include "wine/debug.h"
22 WINE_DEFAULT_DEBUG_CHANNEL(urlmon);
25 const IInternetProtocolVtbl *lpInternetProtocolVtbl;
30 #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
32 #define PROTOCOL_THIS(iface) DEFINE_THIS(GopherProtocol, InternetProtocol, iface)
34 static HRESULT WINAPI GopherProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
36 GopherProtocol *This = PROTOCOL_THIS(iface);
39 if(IsEqualGUID(&IID_IUnknown, riid)) {
40 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
41 *ppv = PROTOCOL(This);
42 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
43 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
44 *ppv = PROTOCOL(This);
45 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
46 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
47 *ppv = PROTOCOL(This);
51 IInternetProtocol_AddRef(iface);
55 WARN("not supported interface %s\n", debugstr_guid(riid));
59 static ULONG WINAPI GopherProtocol_AddRef(IInternetProtocol *iface)
61 GopherProtocol *This = PROTOCOL_THIS(iface);
62 LONG ref = InterlockedIncrement(&This->ref);
63 TRACE("(%p) ref=%d\n", This, ref);
67 static ULONG WINAPI GopherProtocol_Release(IInternetProtocol *iface)
69 GopherProtocol *This = PROTOCOL_THIS(iface);
70 LONG ref = InterlockedDecrement(&This->ref);
72 TRACE("(%p) ref=%d\n", This, ref);
77 URLMON_UnlockModule();
83 static HRESULT WINAPI GopherProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
84 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
85 DWORD grfPI, DWORD dwReserved)
87 GopherProtocol *This = PROTOCOL_THIS(iface);
88 FIXME("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink,
89 pOIBindInfo, grfPI, dwReserved);
93 static HRESULT WINAPI GopherProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
95 GopherProtocol *This = PROTOCOL_THIS(iface);
96 FIXME("(%p)->(%p)\n", This, pProtocolData);
100 static HRESULT WINAPI GopherProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
103 GopherProtocol *This = PROTOCOL_THIS(iface);
104 FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
108 static HRESULT WINAPI GopherProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
110 GopherProtocol *This = PROTOCOL_THIS(iface);
111 FIXME("(%p)->(%08x)\n", This, dwOptions);
115 static HRESULT WINAPI GopherProtocol_Suspend(IInternetProtocol *iface)
117 GopherProtocol *This = PROTOCOL_THIS(iface);
118 FIXME("(%p)\n", This);
122 static HRESULT WINAPI GopherProtocol_Resume(IInternetProtocol *iface)
124 GopherProtocol *This = PROTOCOL_THIS(iface);
125 FIXME("(%p)\n", This);
129 static HRESULT WINAPI GopherProtocol_Read(IInternetProtocol *iface, void *pv,
130 ULONG cb, ULONG *pcbRead)
132 GopherProtocol *This = PROTOCOL_THIS(iface);
133 FIXME("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
137 static HRESULT WINAPI GopherProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,
138 DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
140 GopherProtocol *This = PROTOCOL_THIS(iface);
141 FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
145 static HRESULT WINAPI GopherProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
147 GopherProtocol *This = PROTOCOL_THIS(iface);
148 FIXME("(%p)->(%08x)\n", This, dwOptions);
152 static HRESULT WINAPI GopherProtocol_UnlockRequest(IInternetProtocol *iface)
154 GopherProtocol *This = PROTOCOL_THIS(iface);
155 FIXME("(%p)\n", This);
161 static const IInternetProtocolVtbl GopherProtocolVtbl = {
162 GopherProtocol_QueryInterface,
163 GopherProtocol_AddRef,
164 GopherProtocol_Release,
165 GopherProtocol_Start,
166 GopherProtocol_Continue,
167 GopherProtocol_Abort,
168 GopherProtocol_Terminate,
169 GopherProtocol_Suspend,
170 GopherProtocol_Resume,
173 GopherProtocol_LockRequest,
174 GopherProtocol_UnlockRequest
177 HRESULT GopherProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
181 TRACE("(%p %p)\n", pUnkOuter, ppobj);
185 ret = heap_alloc_zero(sizeof(GopherProtocol));
187 ret->lpInternetProtocolVtbl = &GopherProtocolVtbl;
190 *ppobj = PROTOCOL(ret);