ReactOS  0.4.13-dev-687-g023794c
ftp.c File Reference
#include "urlmon_main.h"
#include "shlwapi.h"
#include "wine/debug.h"
Include dependency graph for ftp.c:

Go to the source code of this file.

Classes

class  FtpProtocol
 

Macros

#define NO_SHLWAPI_REG
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (urlmon)
 
static FtpProtocolimpl_from_IUnknown (IUnknown *iface)
 
static FtpProtocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static FtpProtocolimpl_from_IInternetPriority (IInternetPriority *iface)
 
static FtpProtocolimpl_from_IWinInetHttpInfo (IWinInetHttpInfo *iface)
 
static FtpProtocolimpl_from_Protocol (Protocol *prot)
 
static HRESULT FtpProtocol_open_request (Protocol *prot, IUri *uri, DWORD request_flags, HINTERNET internet_session, IInternetBindInfo *bind_info)
 
static HRESULT FtpProtocol_end_request (Protocol *prot)
 
static HRESULT FtpProtocol_start_downloading (Protocol *prot)
 
static void FtpProtocol_close_connection (Protocol *prot)
 
static void FtpProtocol_on_error (Protocol *prot, DWORD error)
 
static HRESULT WINAPI FtpProtocolUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FtpProtocolUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI FtpProtocolUnk_Release (IUnknown *iface)
 
static HRESULT WINAPI FtpProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FtpProtocol_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI FtpProtocol_Release (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FtpProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI FtpProtocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI FtpProtocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI FtpProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI FtpProtocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FtpProtocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FtpProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI FtpProtocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI FtpProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI FtpProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FtpProtocol_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
static HRESULT WINAPI FtpPriority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FtpPriority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI FtpPriority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI FtpPriority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI FtpPriority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
static HRESULT WINAPI HttpInfo_QueryInterface (IWinInetHttpInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI HttpInfo_AddRef (IWinInetHttpInfo *iface)
 
static ULONG WINAPI HttpInfo_Release (IWinInetHttpInfo *iface)
 
static HRESULT WINAPI HttpInfo_QueryOption (IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer)
 
static HRESULT WINAPI HttpInfo_QueryInfo (IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
 
HRESULT FtpProtocol_Construct (IUnknown *outer, void **ppv)
 

Variables

static const ProtocolVtbl AsyncProtocolVtbl
 
static const IUnknownVtbl FtpProtocolUnkVtbl
 
static const IInternetProtocolExVtbl FtpProtocolVtbl
 
static const IInternetPriorityVtbl FtpPriorityVtbl
 
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
 

Macro Definition Documentation

◆ NO_SHLWAPI_REG

#define NO_SHLWAPI_REG

Definition at line 21 of file ftp.c.

Function Documentation

◆ FtpPriority_AddRef()

static ULONG WINAPI FtpPriority_AddRef ( IInternetPriority iface)
static

Definition at line 357 of file ftp.c.

358 {
360  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
361 }
static FtpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: ftp.c:50

◆ FtpPriority_GetPriority()

static HRESULT WINAPI FtpPriority_GetPriority ( IInternetPriority iface,
LONG pnPriority 
)
static

Definition at line 379 of file ftp.c.

380 {
382 
383  TRACE("(%p)->(%p)\n", This, pnPriority);
384 
385  *pnPriority = This->base.priority;
386  return S_OK;
387 }
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: ftp.c:50
#define S_OK
Definition: intsafe.h:59

◆ FtpPriority_QueryInterface()

static HRESULT WINAPI FtpPriority_QueryInterface ( IInternetPriority iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 351 of file ftp.c.

352 {
354  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
355 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static FtpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: ftp.c:50

◆ FtpPriority_Release()

static ULONG WINAPI FtpPriority_Release ( IInternetPriority iface)
static

Definition at line 363 of file ftp.c.

364 {
366  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
367 }
static FtpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: ftp.c:50

◆ FtpPriority_SetPriority()

static HRESULT WINAPI FtpPriority_SetPriority ( IInternetPriority iface,
LONG  nPriority 
)
static

Definition at line 369 of file ftp.c.

370 {
372 
373  TRACE("(%p)->(%d)\n", This, nPriority);
374 
375  This->base.priority = nPriority;
376  return S_OK;
377 }
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: ftp.c:50
#define S_OK
Definition: intsafe.h:59

◆ FtpProtocol_Abort()

static HRESULT WINAPI FtpProtocol_Abort ( IInternetProtocolEx iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 243 of file ftp.c.

245 {
247 
248  TRACE("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
249 
250  return protocol_abort(&This->base, hrReason);
251 }
DWORD dwOptions
Definition: solitaire.cpp:23
HRESULT protocol_abort(Protocol *protocol, HRESULT reason)
Definition: protocol.c:518
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_AddRef()

static ULONG WINAPI FtpProtocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 198 of file ftp.c.

199 {
201  TRACE("(%p)\n", This);
202  return IUnknown_AddRef(This->outer);
203 }
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_close_connection()

static void FtpProtocol_close_connection ( Protocol prot)
static

Definition at line 108 of file ftp.c.

109 {
110 }

◆ FtpProtocol_Construct()

HRESULT FtpProtocol_Construct ( IUnknown outer,
void **  ppv 
)

Definition at line 451 of file ftp.c.

452 {
453  FtpProtocol *ret;
454 
455  TRACE("(%p %p)\n", outer, ppv);
456 
458 
459  ret = heap_alloc_zero(sizeof(FtpProtocol));
460 
461  ret->base.vtbl = &AsyncProtocolVtbl;
462  ret->IUnknown_outer.lpVtbl = &FtpProtocolUnkVtbl;
463  ret->IInternetProtocolEx_iface.lpVtbl = &FtpProtocolVtbl;
464  ret->IInternetPriority_iface.lpVtbl = &FtpPriorityVtbl;
465  ret->IWinInetHttpInfo_iface.lpVtbl = &WinInetHttpInfoVtbl;
466  ret->ref = 1;
467  ret->outer = outer ? outer : &ret->IUnknown_outer;
468 
469  *ppv = &ret->IUnknown_outer;
470  return S_OK;
471 }
static const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
Definition: ftp.c:443
REFIID LPVOID * ppv
Definition: atlbase.h:39
static const IInternetPriorityVtbl FtpPriorityVtbl
Definition: ftp.c:389
static const IInternetProtocolExVtbl FtpProtocolVtbl
Definition: ftp.c:334
#define TRACE(s)
Definition: solgame.cpp:4
static const ProtocolVtbl AsyncProtocolVtbl
Definition: ftp.c:117
int ret
#define S_OK
Definition: intsafe.h:59
static void URLMON_LockModule(void)
Definition: urlmon_main.h:67
static const IUnknownVtbl FtpProtocolUnkVtbl
Definition: ftp.c:185

◆ FtpProtocol_Continue()

static HRESULT WINAPI FtpProtocol_Continue ( IInternetProtocolEx iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 234 of file ftp.c.

235 {
237 
238  TRACE("(%p)->(%p)\n", This, pProtocolData);
239 
240  return protocol_continue(&This->base, pProtocolData);
241 }
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT protocol_continue(Protocol *protocol, PROTOCOLDATA *data)
Definition: protocol.c:355
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_end_request()

static HRESULT FtpProtocol_end_request ( Protocol prot)
static

Definition at line 88 of file ftp.c.

89 {
90  return E_NOTIMPL;
91 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ FtpProtocol_LockRequest()

static HRESULT WINAPI FtpProtocol_LockRequest ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 295 of file ftp.c.

296 {
298 
299  TRACE("(%p)->(%08x)\n", This, dwOptions);
300 
301  return protocol_lock_request(&This->base);
302 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT protocol_lock_request(Protocol *protocol)
Definition: protocol.c:498
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_on_error()

static void FtpProtocol_on_error ( Protocol prot,
DWORD  error 
)
static

Definition at line 112 of file ftp.c.

113 {
114  FIXME("(%p) %d - stub\n", prot, error);
115 }
#define error(str)
Definition: mkdosfs.c:1605
#define FIXME(fmt,...)
Definition: debug.h:110

◆ FtpProtocol_open_request()

static HRESULT FtpProtocol_open_request ( Protocol prot,
IUri uri,
DWORD  request_flags,
HINTERNET  internet_session,
IInternetBindInfo bind_info 
)
static

Definition at line 65 of file ftp.c.

67 {
69  BSTR url;
70  HRESULT hres;
71 
72  hres = IUri_GetAbsoluteUri(uri, &url);
73  if(FAILED(hres))
74  return hres;
75 
76  This->base.request = InternetOpenUrlW(internet_session, url, NULL, 0,
78  (DWORD_PTR)&This->base);
80  if (!This->base.request && GetLastError() != ERROR_IO_PENDING) {
81  WARN("InternetOpenUrl failed: %d\n", GetLastError());
82  return INET_E_RESOURCE_NOT_FOUND;
83  }
84 
85  return S_OK;
86 }
const char * uri
Definition: sec_mgr.c:1594
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static HINTERNET internet_session
Definition: protocol.c:288
OLECHAR * BSTR
Definition: compat.h:1934
#define ERROR_IO_PENDING
Definition: dderror.h:15
HINTERNET WINAPI InternetOpenUrlW(HINTERNET hInternet, LPCWSTR lpszUrl, LPCWSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext)
Definition: internet.c:3608
smooth NULL
Definition: ftsmooth.c:416
#define INTERNET_FLAG_EXISTING_CONNECT
Definition: wininet.h:63
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static const WCHAR url[]
Definition: encode.c:1432
uint32_t DWORD_PTR
Definition: typedefs.h:63
#define INTERNET_FLAG_PASSIVE
Definition: wininet.h:65
#define S_OK
Definition: intsafe.h:59
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static FtpProtocol * impl_from_Protocol(Protocol *prot)
Definition: ftp.c:60

◆ FtpProtocol_QueryInterface()

static HRESULT WINAPI FtpProtocol_QueryInterface ( IInternetProtocolEx iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 191 of file ftp.c.

192 {
194  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
195  return IUnknown_QueryInterface(This->outer, riid, ppv);
196 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Read()

static HRESULT WINAPI FtpProtocol_Read ( IInternetProtocolEx iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 277 of file ftp.c.

279 {
281 
282  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
283 
284  return protocol_read(&This->base, pv, cb, pcbRead);
285 }
#define TRACE(s)
Definition: solgame.cpp:4
static DWORD cb
Definition: integrity.c:41
static int protocol_read
Definition: htmldoc.c:205
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Release()

static ULONG WINAPI FtpProtocol_Release ( IInternetProtocolEx iface)
static

Definition at line 205 of file ftp.c.

206 {
208  TRACE("(%p)\n", This);
209  return IUnknown_Release(This->outer);
210 }
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Resume()

static HRESULT WINAPI FtpProtocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 270 of file ftp.c.

271 {
273  FIXME("(%p)\n", This);
274  return E_NOTIMPL;
275 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Seek()

static HRESULT WINAPI FtpProtocol_Seek ( IInternetProtocolEx iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 287 of file ftp.c.

289 {
291  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
292  return E_NOTIMPL;
293 }
#define FIXME(fmt,...)
Definition: debug.h:110
struct _LARGE_INTEGER::@2199 u
#define E_NOTIMPL
Definition: ddrawi.h:99
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Start()

static HRESULT WINAPI FtpProtocol_Start ( IInternetProtocolEx iface,
LPCWSTR  szUrl,
IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  grfPI,
HANDLE_PTR  dwReserved 
)
static

Definition at line 212 of file ftp.c.

215 {
217  IUri *uri;
218  HRESULT hres;
219 
220  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
221  pOIBindInfo, grfPI, dwReserved);
222 
223  hres = CreateUri(szUrl, 0, 0, &uri);
224  if(FAILED(hres))
225  return hres;
226 
227  hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
228  pOIBindInfo, grfPI, (HANDLE*)dwReserved);
229 
230  IUri_Release(uri);
231  return hres;
232 }
const char * uri
Definition: sec_mgr.c:1594
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5701

◆ FtpProtocol_start_downloading()

static HRESULT FtpProtocol_start_downloading ( Protocol prot)
static

Definition at line 93 of file ftp.c.

94 {
96  DWORD size;
97  BOOL res;
98 
99  res = FtpGetFileSize(This->base.request, &size);
100  if(res)
101  This->base.content_length = size;
102  else
103  WARN("FtpGetFileSize failed: %d\n", GetLastError());
104 
105  return S_OK;
106 }
#define WARN(fmt,...)
Definition: debug.h:111
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
DWORD WINAPI FtpGetFileSize(HINTERNET hFile, LPDWORD lpdwFileSizeHigh)
Definition: ftp.c:1754
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
GLuint res
Definition: glext.h:9613
static FtpProtocol * impl_from_Protocol(Protocol *prot)
Definition: ftp.c:60

◆ FtpProtocol_StartEx()

static HRESULT WINAPI FtpProtocol_StartEx ( IInternetProtocolEx iface,
IUri pUri,
IInternetProtocolSink pOIProtSink,
IInternetBindInfo pOIBindInfo,
DWORD  grfPI,
HANDLE dwReserved 
)
static

Definition at line 313 of file ftp.c.

316 {
318  DWORD scheme = 0;
319  HRESULT hres;
320 
321  TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
322  pOIBindInfo, grfPI, dwReserved);
323 
324  hres = IUri_GetScheme(pUri, &scheme);
325  if(FAILED(hres))
326  return hres;
327  if(scheme != URL_SCHEME_FTP)
328  return MK_E_SYNTAX;
329 
330  return protocol_start(&This->base, (IInternetProtocol*)&This->IInternetProtocolEx_iface, pUri,
331  pOIProtSink, pOIBindInfo);
332 }
DWORD scheme
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
#define protocol_start(p, u, e)
Definition: protocol.c:303
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45
#define MK_E_SYNTAX
Definition: winerror.h:2785

◆ FtpProtocol_Suspend()

static HRESULT WINAPI FtpProtocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 263 of file ftp.c.

264 {
266  FIXME("(%p)\n", This);
267  return E_NOTIMPL;
268 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_Terminate()

static HRESULT WINAPI FtpProtocol_Terminate ( IInternetProtocolEx iface,
DWORD  dwOptions 
)
static

Definition at line 253 of file ftp.c.

254 {
256 
257  TRACE("(%p)->(%08x)\n", This, dwOptions);
258 
260  return S_OK;
261 }
DWORD dwOptions
Definition: solitaire.cpp:23
void protocol_close_connection(Protocol *protocol)
Definition: protocol.c:531
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocol_UnlockRequest()

static HRESULT WINAPI FtpProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 304 of file ftp.c.

305 {
307 
308  TRACE("(%p)\n", This);
309 
310  return protocol_unlock_request(&This->base);
311 }
HRESULT protocol_unlock_request(Protocol *protocol)
Definition: protocol.c:506
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: ftp.c:45

◆ FtpProtocolUnk_AddRef()

static ULONG WINAPI FtpProtocolUnk_AddRef ( IUnknown iface)
static

Definition at line 160 of file ftp.c.

161 {
164  TRACE("(%p) ref=%d\n", This, ref);
165  return ref;
166 }
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: ftp.c:40
#define InterlockedIncrement
Definition: armddk.h:53

◆ FtpProtocolUnk_QueryInterface()

static HRESULT WINAPI FtpProtocolUnk_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 125 of file ftp.c.

126 {
128 
129  if(IsEqualGUID(&IID_IUnknown, riid)) {
130  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
131  *ppv = &This->IUnknown_outer;
132  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
133  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
134  *ppv = &This->IInternetProtocolEx_iface;
135  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
136  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
137  *ppv = &This->IInternetProtocolEx_iface;
138  }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
139  TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
140  *ppv = &This->IInternetProtocolEx_iface;
141  }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
142  TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
143  *ppv = &This->IInternetPriority_iface;
144  }else if(IsEqualGUID(&IID_IWinInetInfo, riid)) {
145  TRACE("(%p)->(IID_IWinInetInfo %p)\n", This, ppv);
146  *ppv = &This->IWinInetHttpInfo_iface;
147  }else if(IsEqualGUID(&IID_IWinInetHttpInfo, riid)) {
148  TRACE("(%p)->(IID_IWinInetHttpInfo %p)\n", This, ppv);
149  *ppv = &This->IWinInetHttpInfo_iface;
150  }else {
151  *ppv = NULL;
152  WARN("not supported interface %s\n", debugstr_guid(riid));
153  return E_NOINTERFACE;
154  }
155 
156  IUnknown_AddRef((IUnknown*)*ppv);
157  return S_OK;
158 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
static FtpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: ftp.c:40
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ FtpProtocolUnk_Release()

static ULONG WINAPI FtpProtocolUnk_Release ( IUnknown iface)
static

Definition at line 168 of file ftp.c.

169 {
172 
173  TRACE("(%p) ref=%d\n", This, ref);
174 
175  if(!ref) {
177  heap_free(This);
178 
180  }
181 
182  return ref;
183 }
Definition: send.c:47
void protocol_close_connection(Protocol *protocol)
Definition: protocol.c:531
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
static void URLMON_UnlockModule(void)
Definition: urlmon_main.h:68
#define TRACE(s)
Definition: solgame.cpp:4
static FtpProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: ftp.c:40
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ HttpInfo_AddRef()

static ULONG WINAPI HttpInfo_AddRef ( IWinInetHttpInfo iface)
static

Definition at line 403 of file ftp.c.

404 {
406  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
407 }
static FtpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: ftp.c:54

◆ HttpInfo_QueryInfo()

static HRESULT WINAPI HttpInfo_QueryInfo ( IWinInetHttpInfo iface,
DWORD  dwOption,
void pBuffer,
DWORD pcbBuffer,
DWORD pdwFlags,
DWORD pdwReserved 
)
static

Definition at line 429 of file ftp.c.

431 {
433  TRACE("(%p)->(%x %p %p %p %p)\n", This, dwOption, pBuffer, pcbBuffer, pdwFlags, pdwReserved);
434 
435  if(!This->base.request)
436  return E_FAIL;
437 
438  if(!HttpQueryInfoW(This->base.request, dwOption, pBuffer, pcbBuffer, pdwFlags))
439  return S_FALSE;
440  return S_OK;
441 }
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
BOOL WINAPI HttpQueryInfoW(HINTERNET hHttpRequest, DWORD dwInfoLevel, LPVOID lpBuffer, LPDWORD lpdwBufferLength, LPDWORD lpdwIndex)
Definition: http.c:3807
_Reserved_ DWORD * pdwReserved
Definition: wincrypt.h:4254
#define S_OK
Definition: intsafe.h:59
static FtpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: ftp.c:54

◆ HttpInfo_QueryInterface()

static HRESULT WINAPI HttpInfo_QueryInterface ( IWinInetHttpInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 397 of file ftp.c.

398 {
400  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
401 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static FtpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: ftp.c:54

◆ HttpInfo_QueryOption()

static HRESULT WINAPI HttpInfo_QueryOption ( IWinInetHttpInfo iface,
DWORD  dwOption,
void pBuffer,
DWORD pcbBuffer 
)
static

Definition at line 415 of file ftp.c.

417 {
419  TRACE("(%p)->(%x %p %p)\n", This, dwOption, pBuffer, pcbBuffer);
420 
421  if(!This->base.request)
422  return E_FAIL;
423 
424  if(!InternetQueryOptionW(This->base.request, dwOption, pBuffer, pcbBuffer))
425  return S_FALSE;
426  return S_OK;
427 }
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FtpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: ftp.c:54
BOOL WINAPI InternetQueryOptionW(HINTERNET hInternet, DWORD dwOption, LPVOID lpBuffer, LPDWORD lpdwBufferLength)
Definition: internet.c:2576

◆ HttpInfo_Release()

static ULONG WINAPI HttpInfo_Release ( IWinInetHttpInfo iface)
static

Definition at line 409 of file ftp.c.

410 {
412  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
413 }
static FtpProtocol * impl_from_IWinInetHttpInfo(IWinInetHttpInfo *iface)
Definition: ftp.c:54

◆ impl_from_IInternetPriority()

static FtpProtocol* impl_from_IInternetPriority ( IInternetPriority iface)
inlinestatic

Definition at line 50 of file ftp.c.

51 {
52  return CONTAINING_RECORD(iface, FtpProtocol, IInternetPriority_iface);
53 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by FtpPriority_AddRef(), FtpPriority_GetPriority(), FtpPriority_QueryInterface(), FtpPriority_Release(), and FtpPriority_SetPriority().

◆ impl_from_IInternetProtocolEx()

static FtpProtocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
inlinestatic

Definition at line 45 of file ftp.c.

46 {
47  return CONTAINING_RECORD(iface, FtpProtocol, IInternetProtocolEx_iface);
48 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by FtpProtocol_Abort(), FtpProtocol_AddRef(), FtpProtocol_Continue(), FtpProtocol_LockRequest(), FtpProtocol_QueryInterface(), FtpProtocol_Read(), FtpProtocol_Release(), FtpProtocol_Resume(), FtpProtocol_Seek(), FtpProtocol_Start(), FtpProtocol_StartEx(), FtpProtocol_Suspend(), FtpProtocol_Terminate(), and FtpProtocol_UnlockRequest().

◆ impl_from_IUnknown()

static FtpProtocol* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 40 of file ftp.c.

41 {
42  return CONTAINING_RECORD(iface, FtpProtocol, IUnknown_outer);
43 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by FtpProtocolUnk_AddRef(), FtpProtocolUnk_QueryInterface(), and FtpProtocolUnk_Release().

◆ impl_from_IWinInetHttpInfo()

static FtpProtocol* impl_from_IWinInetHttpInfo ( IWinInetHttpInfo iface)
inlinestatic

Definition at line 54 of file ftp.c.

56 {
57  return CONTAINING_RECORD(iface, FtpProtocol, IWinInetHttpInfo_iface);
58 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by HttpInfo_AddRef(), HttpInfo_QueryInfo(), HttpInfo_QueryInterface(), HttpInfo_QueryOption(), and HttpInfo_Release().

◆ impl_from_Protocol()

static FtpProtocol* impl_from_Protocol ( Protocol prot)
inlinestatic

Definition at line 60 of file ftp.c.

61 {
62  return CONTAINING_RECORD(prot, FtpProtocol, base);
63 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by FtpProtocol_open_request(), and FtpProtocol_start_downloading().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( urlmon  )

Variable Documentation

◆ AsyncProtocolVtbl

const ProtocolVtbl AsyncProtocolVtbl
static
Initial value:
= {
}
static HRESULT FtpProtocol_end_request(Protocol *prot)
Definition: ftp.c:88
static HRESULT FtpProtocol_open_request(Protocol *prot, IUri *uri, DWORD request_flags, HINTERNET internet_session, IInternetBindInfo *bind_info)
Definition: ftp.c:65
static void FtpProtocol_on_error(Protocol *prot, DWORD error)
Definition: ftp.c:112
static HRESULT FtpProtocol_start_downloading(Protocol *prot)
Definition: ftp.c:93
static void FtpProtocol_close_connection(Protocol *prot)
Definition: ftp.c:108

Definition at line 117 of file ftp.c.

Referenced by FtpProtocol_Construct().

◆ FtpPriorityVtbl

const IInternetPriorityVtbl FtpPriorityVtbl
static
Initial value:
= {
}
static HRESULT WINAPI FtpPriority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: ftp.c:369
static ULONG WINAPI FtpPriority_Release(IInternetPriority *iface)
Definition: ftp.c:363
static ULONG WINAPI FtpPriority_AddRef(IInternetPriority *iface)
Definition: ftp.c:357
static HRESULT WINAPI FtpPriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
Definition: ftp.c:351
static HRESULT WINAPI FtpPriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: ftp.c:379

Definition at line 389 of file ftp.c.

Referenced by FtpProtocol_Construct().

◆ FtpProtocolUnkVtbl

const IUnknownVtbl FtpProtocolUnkVtbl
static
Initial value:
= {
}
static ULONG WINAPI FtpProtocolUnk_Release(IUnknown *iface)
Definition: ftp.c:168
static ULONG WINAPI FtpProtocolUnk_AddRef(IUnknown *iface)
Definition: ftp.c:160
static HRESULT WINAPI FtpProtocolUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: ftp.c:125

Definition at line 185 of file ftp.c.

Referenced by FtpProtocol_Construct().

◆ FtpProtocolVtbl

const IInternetProtocolExVtbl FtpProtocolVtbl
static
Initial value:
= {
}
static ULONG WINAPI FtpProtocol_AddRef(IInternetProtocolEx *iface)
Definition: ftp.c:198
static HRESULT WINAPI FtpProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: ftp.c:277
static HRESULT WINAPI FtpProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: ftp.c:234
static HRESULT WINAPI FtpProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: ftp.c:243
static ULONG WINAPI FtpProtocol_Release(IInternetProtocolEx *iface)
Definition: ftp.c:205
static HRESULT WINAPI FtpProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
Definition: ftp.c:191
static HRESULT WINAPI FtpProtocol_Suspend(IInternetProtocolEx *iface)
Definition: ftp.c:263
static HRESULT WINAPI FtpProtocol_Resume(IInternetProtocolEx *iface)
Definition: ftp.c:270
static HRESULT WINAPI FtpProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: ftp.c:295
static HRESULT WINAPI FtpProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: ftp.c:253
static HRESULT WINAPI FtpProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: ftp.c:287
static HRESULT WINAPI FtpProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: ftp.c:212
static HRESULT WINAPI FtpProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
Definition: ftp.c:313
static HRESULT WINAPI FtpProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: ftp.c:304

Definition at line 334 of file ftp.c.

Referenced by FtpProtocol_Construct().

◆ WinInetHttpInfoVtbl

const IWinInetHttpInfoVtbl WinInetHttpInfoVtbl
static
Initial value:
= {
}
static ULONG WINAPI HttpInfo_Release(IWinInetHttpInfo *iface)
Definition: ftp.c:409
static ULONG WINAPI HttpInfo_AddRef(IWinInetHttpInfo *iface)
Definition: ftp.c:403
static HRESULT WINAPI HttpInfo_QueryOption(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer)
Definition: ftp.c:415
static HRESULT WINAPI HttpInfo_QueryInterface(IWinInetHttpInfo *iface, REFIID riid, void **ppv)
Definition: ftp.c:397
static HRESULT WINAPI HttpInfo_QueryInfo(IWinInetHttpInfo *iface, DWORD dwOption, void *pBuffer, DWORD *pcbBuffer, DWORD *pdwFlags, DWORD *pdwReserved)
Definition: ftp.c:429

Definition at line 443 of file ftp.c.

Referenced by FtpProtocol_Construct().