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., 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;
29 #define PROTOCOL_THIS(iface) DEFINE_THIS(FtpProtocol, InternetProtocol, iface)
31 #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
33 static HRESULT WINAPI FtpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
35 FtpProtocol *This = PROTOCOL_THIS(iface);
38 if(IsEqualGUID(&IID_IUnknown, riid)) {
39 TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
40 *ppv = PROTOCOL(This);
41 }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
42 TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
43 *ppv = PROTOCOL(This);
44 }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
45 TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
46 *ppv = PROTOCOL(This);
50 IInternetProtocol_AddRef(iface);
54 WARN("not supported interface %s\n", debugstr_guid(riid));
58 static ULONG WINAPI FtpProtocol_AddRef(IInternetProtocol *iface)
60 FtpProtocol *This = PROTOCOL_THIS(iface);
61 LONG ref = InterlockedIncrement(&This->ref);
62 TRACE("(%p) ref=%d\n", This, ref);
66 static ULONG WINAPI FtpProtocol_Release(IInternetProtocol *iface)
68 FtpProtocol *This = PROTOCOL_THIS(iface);
69 LONG ref = InterlockedDecrement(&This->ref);
71 TRACE("(%p) ref=%d\n", This, ref);
76 URLMON_UnlockModule();
82 static HRESULT WINAPI FtpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
83 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
84 DWORD grfPI, DWORD dwReserved)
86 FtpProtocol *This = PROTOCOL_THIS(iface);
87 FIXME("(%p)->(%s %p %p %08x %d)\n", This, debugstr_w(szUrl), pOIProtSink,
88 pOIBindInfo, grfPI, dwReserved);
92 static HRESULT WINAPI FtpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
94 FtpProtocol *This = PROTOCOL_THIS(iface);
95 FIXME("(%p)->(%p)\n", This, pProtocolData);
99 static HRESULT WINAPI FtpProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
102 FtpProtocol *This = PROTOCOL_THIS(iface);
103 FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
107 static HRESULT WINAPI FtpProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
109 FtpProtocol *This = PROTOCOL_THIS(iface);
110 FIXME("(%p)->(%08x)\n", This, dwOptions);
114 static HRESULT WINAPI FtpProtocol_Suspend(IInternetProtocol *iface)
116 FtpProtocol *This = PROTOCOL_THIS(iface);
117 FIXME("(%p)\n", This);
121 static HRESULT WINAPI FtpProtocol_Resume(IInternetProtocol *iface)
123 FtpProtocol *This = PROTOCOL_THIS(iface);
124 FIXME("(%p)\n", This);
128 static HRESULT WINAPI FtpProtocol_Read(IInternetProtocol *iface, void *pv,
129 ULONG cb, ULONG *pcbRead)
131 FtpProtocol *This = PROTOCOL_THIS(iface);
132 FIXME("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
136 static HRESULT WINAPI FtpProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,
137 DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
139 FtpProtocol *This = PROTOCOL_THIS(iface);
140 FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
144 static HRESULT WINAPI FtpProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
146 FtpProtocol *This = PROTOCOL_THIS(iface);
147 FIXME("(%p)->(%08x)\n", This, dwOptions);
151 static HRESULT WINAPI FtpProtocol_UnlockRequest(IInternetProtocol *iface)
153 FtpProtocol *This = PROTOCOL_THIS(iface);
154 FIXME("(%p)\n", This);
160 static const IInternetProtocolVtbl FtpProtocolVtbl = {
161 FtpProtocol_QueryInterface,
165 FtpProtocol_Continue,
167 FtpProtocol_Terminate,
172 FtpProtocol_LockRequest,
173 FtpProtocol_UnlockRequest
176 HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
180 TRACE("(%p %p)\n", pUnkOuter, ppobj);
184 ret = heap_alloc(sizeof(FtpProtocol));
186 ret->lpInternetProtocolVtbl = &FtpProtocolVtbl;
189 *ppobj = PROTOCOL(ret);