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(FtpProtocol, InternetProtocol, iface)
41 #define PROTOCOL(x) ((IInternetProtocol*) &(x)->lpInternetProtocolVtbl)
43 static HRESULT WINAPI FtpProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
45 FtpProtocol *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 FtpProtocol_AddRef(IInternetProtocol *iface)
70 FtpProtocol *This = PROTOCOL_THIS(iface);
71 LONG ref = InterlockedIncrement(&This->ref);
72 TRACE("(%p) ref=%ld\n", This, ref);
76 static ULONG WINAPI FtpProtocol_Release(IInternetProtocol *iface)
78 FtpProtocol *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 FtpProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
93 IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo,
94 DWORD grfPI, DWORD dwReserved)
96 FtpProtocol *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 FtpProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
104 FtpProtocol *This = PROTOCOL_THIS(iface);
105 FIXME("(%p)->(%p)\n", This, pProtocolData);
109 static HRESULT WINAPI FtpProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason,
112 FtpProtocol *This = PROTOCOL_THIS(iface);
113 FIXME("(%p)->(%08lx %08lx)\n", This, hrReason, dwOptions);
117 static HRESULT WINAPI FtpProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
119 FtpProtocol *This = PROTOCOL_THIS(iface);
120 FIXME("(%p)->(%08lx)\n", This, dwOptions);
124 static HRESULT WINAPI FtpProtocol_Suspend(IInternetProtocol *iface)
126 FtpProtocol *This = PROTOCOL_THIS(iface);
127 FIXME("(%p)\n", This);
131 static HRESULT WINAPI FtpProtocol_Resume(IInternetProtocol *iface)
133 FtpProtocol *This = PROTOCOL_THIS(iface);
134 FIXME("(%p)\n", This);
138 static HRESULT WINAPI FtpProtocol_Read(IInternetProtocol *iface, void *pv,
139 ULONG cb, ULONG *pcbRead)
141 FtpProtocol *This = PROTOCOL_THIS(iface);
142 FIXME("(%p)->(%p %lu %p)\n", This, pv, cb, pcbRead);
146 static HRESULT WINAPI FtpProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove,
147 DWORD dwOrgin, ULARGE_INTEGER *plibNewPosition)
149 FtpProtocol *This = PROTOCOL_THIS(iface);
150 FIXME("(%p)->(%ld %ld %p)\n", This, dlibMove.u.LowPart, dwOrgin, plibNewPosition);
154 static HRESULT WINAPI FtpProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
156 FtpProtocol *This = PROTOCOL_THIS(iface);
157 FIXME("(%p)->(%08lx)\n", This, dwOptions);
161 static HRESULT WINAPI FtpProtocol_UnlockRequest(IInternetProtocol *iface)
163 FtpProtocol *This = PROTOCOL_THIS(iface);
164 FIXME("(%p)\n", This);
170 static const IInternetProtocolVtbl FtpProtocolVtbl = {
171 FtpProtocol_QueryInterface,
175 FtpProtocol_Continue,
177 FtpProtocol_Terminate,
182 FtpProtocol_LockRequest,
183 FtpProtocol_UnlockRequest
186 HRESULT FtpProtocol_Construct(IUnknown *pUnkOuter, LPVOID *ppobj)
190 TRACE("(%p %p)\n", pUnkOuter, ppobj);
194 ret = HeapAlloc(GetProcessHeap(), 0, sizeof(FtpProtocol));
196 ret->lpInternetProtocolVtbl = &FtpProtocolVtbl;
199 *ppobj = PROTOCOL(ret);