ReactOS  0.4.14-dev-115-g4576127
file.c File Reference
#include "urlmon_main.h"
#include "winreg.h"
#include "shlwapi.h"
#include "wine/debug.h"
Include dependency graph for file.c:

Go to the source code of this file.

Classes

class  FileProtocol
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (urlmon)
 
static FileProtocolimpl_from_IUnknown (IUnknown *iface)
 
static FileProtocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static FileProtocolimpl_from_IInternetPriority (IInternetPriority *iface)
 
static HRESULT WINAPI FileProtocolUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FileProtocolUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI FileProtocolUnk_Release (IUnknown *iface)
 
static HRESULT WINAPI FileProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FileProtocol_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI FileProtocol_Release (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FileProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI FileProtocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI FileProtocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI FileProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI FileProtocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FileProtocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI FileProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI FileProtocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI FileProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI FileProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT report_result (IInternetProtocolSink *protocol_sink, HRESULT hres, DWORD res)
 
static HRESULT WINAPI FileProtocol_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
static HRESULT WINAPI FilePriority_QueryInterface (IInternetPriority *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI FilePriority_AddRef (IInternetPriority *iface)
 
static ULONG WINAPI FilePriority_Release (IInternetPriority *iface)
 
static HRESULT WINAPI FilePriority_SetPriority (IInternetPriority *iface, LONG nPriority)
 
static HRESULT WINAPI FilePriority_GetPriority (IInternetPriority *iface, LONG *pnPriority)
 
HRESULT FileProtocol_Construct (IUnknown *outer, LPVOID *ppobj)
 

Variables

static const IUnknownVtbl FileProtocolUnkVtbl
 
static const IInternetProtocolExVtbl FileProtocolExVtbl
 
static const IInternetPriorityVtbl FilePriorityVtbl
 

Function Documentation

◆ FilePriority_AddRef()

static ULONG WINAPI FilePriority_AddRef ( IInternetPriority iface)
static

Definition at line 381 of file file.c.

382 {
384  return IInternetProtocolEx_AddRef(&This->IInternetProtocolEx_iface);
385 }
static FileProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: file.c:51

◆ FilePriority_GetPriority()

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

Definition at line 403 of file file.c.

404 {
406 
407  TRACE("(%p)->(%p)\n", This, pnPriority);
408 
409  *pnPriority = This->priority;
410  return S_OK;
411 }
#define TRACE(s)
Definition: solgame.cpp:4
static FileProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: file.c:51
#define S_OK
Definition: intsafe.h:59

◆ FilePriority_QueryInterface()

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

Definition at line 374 of file file.c.

376 {
378  return IInternetProtocolEx_QueryInterface(&This->IInternetProtocolEx_iface, riid, ppv);
379 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static FileProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: file.c:51

◆ FilePriority_Release()

static ULONG WINAPI FilePriority_Release ( IInternetPriority iface)
static

Definition at line 387 of file file.c.

388 {
390  return IInternetProtocolEx_Release(&This->IInternetProtocolEx_iface);
391 }
static FileProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: file.c:51

◆ FilePriority_SetPriority()

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

Definition at line 393 of file file.c.

394 {
396 
397  TRACE("(%p)->(%d)\n", This, nPriority);
398 
399  This->priority = nPriority;
400  return S_OK;
401 }
#define TRACE(s)
Definition: solgame.cpp:4
static FileProtocol * impl_from_IInternetPriority(IInternetPriority *iface)
Definition: file.c:51
#define S_OK
Definition: intsafe.h:59

◆ FileProtocol_Abort()

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

Definition at line 169 of file file.c.

171 {
173  FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
174  return E_NOTIMPL;
175 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_AddRef()

static ULONG WINAPI FileProtocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 126 of file file.c.

127 {
129  TRACE("(%p)\n", This);
130  return IUnknown_AddRef(This->outer);
131 }
#define TRACE(s)
Definition: solgame.cpp:4
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Construct()

HRESULT FileProtocol_Construct ( IUnknown outer,
LPVOID ppobj 
)

Definition at line 421 of file file.c.

422 {
423  FileProtocol *ret;
424 
425  TRACE("(%p %p)\n", outer, ppobj);
426 
428 
429  ret = heap_alloc(sizeof(FileProtocol));
430 
431  ret->IUnknown_outer.lpVtbl = &FileProtocolUnkVtbl;
432  ret->IInternetProtocolEx_iface.lpVtbl = &FileProtocolExVtbl;
433  ret->IInternetPriority_iface.lpVtbl = &FilePriorityVtbl;
434  ret->file = INVALID_HANDLE_VALUE;
435  ret->priority = 0;
436  ret->ref = 1;
437  ret->outer = outer ? outer : (IUnknown*)&ret->IUnknown_outer;
438 
439  *ppobj = &ret->IUnknown_outer;
440  return S_OK;
441 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
static const IInternetProtocolExVtbl FileProtocolExVtbl
Definition: file.c:357
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define S_OK
Definition: intsafe.h:59
static const IInternetPriorityVtbl FilePriorityVtbl
Definition: file.c:413
static void URLMON_LockModule(void)
Definition: urlmon_main.h:67
static const IUnknownVtbl FileProtocolUnkVtbl
Definition: file.c:113

◆ FileProtocol_Continue()

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

Definition at line 162 of file file.c.

163 {
165  FIXME("(%p)->(%p)\n", This, pProtocolData);
166  return E_NOTIMPL;
167 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_LockRequest()

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

Definition at line 231 of file file.c.

232 {
234 
235  TRACE("(%p)->(%08x)\n", This, dwOptions);
236 
237  return S_OK;
238 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_QueryInterface()

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

Definition at line 119 of file file.c.

120 {
122  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
123  return IUnknown_QueryInterface(This->outer, riid, ppv);
124 }
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 FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Read()

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

Definition at line 200 of file file.c.

202 {
204  DWORD read = 0;
205 
206  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
207 
208  if (pcbRead)
209  *pcbRead = 0;
210 
211  if(This->file == INVALID_HANDLE_VALUE)
212  return INET_E_DATA_NOT_AVAILABLE;
213 
214  if (!ReadFile(This->file, pv, cb, &read, NULL))
215  return INET_E_DOWNLOAD_FAILURE;
216 
217  if(pcbRead)
218  *pcbRead = read;
219 
220  return cb == read ? S_OK : S_FALSE;
221 }
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
#define S_FALSE
Definition: winerror.h:2357
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
static DWORD cb
Definition: integrity.c:41
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI ReadFile(IN HANDLE hFile, IN LPVOID lpBuffer, IN DWORD nNumberOfBytesToRead, OUT LPDWORD lpNumberOfBytesRead OPTIONAL, IN LPOVERLAPPED lpOverlapped OPTIONAL)
Definition: rw.c:123
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46
_CRTIMP int __cdecl read(_In_ int _FileHandle, _Out_writes_bytes_(_MaxCharCount) void *_DstBuf, _In_ unsigned int _MaxCharCount)

◆ FileProtocol_Release()

static ULONG WINAPI FileProtocol_Release ( IInternetProtocolEx iface)
static

Definition at line 133 of file file.c.

134 {
136  TRACE("(%p)\n", This);
137  return IUnknown_Release(This->outer);
138 }
#define TRACE(s)
Definition: solgame.cpp:4
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Resume()

static HRESULT WINAPI FileProtocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 193 of file file.c.

194 {
196  FIXME("(%p)\n", This);
197  return E_NOTIMPL;
198 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Seek()

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

Definition at line 223 of file file.c.

225 {
227  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
228  return E_NOTIMPL;
229 }
#define FIXME(fmt,...)
Definition: debug.h:110
struct _LARGE_INTEGER::@2205 u
#define E_NOTIMPL
Definition: ddrawi.h:99
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Start()

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

Definition at line 140 of file file.c.

143 {
145  IUri *uri;
146  HRESULT hres;
147 
148  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
149  pOIBindInfo, grfPI, dwReserved);
150 
151  hres = CreateUri(szUrl, Uri_CREATE_FILE_USE_DOS_PATH, 0, &uri);
152  if(FAILED(hres))
153  return hres;
154 
155  hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
156  pOIBindInfo, grfPI, (HANDLE*)dwReserved);
157 
158  IUri_Release(uri);
159  return hres;
160 }
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
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5701
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_StartEx()

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

Definition at line 255 of file file.c.

258 {
260  WCHAR path[MAX_PATH], *ptr;
263  BINDINFO bindinfo;
264  DWORD grfBINDF = 0;
265  DWORD scheme, size;
266  LPWSTR mime = NULL;
267  WCHAR null_char = 0;
268  BSTR ext;
269  HRESULT hres;
270 
271  TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
272  pOIBindInfo, grfPI, dwReserved);
273 
274  if(!pUri)
275  return E_INVALIDARG;
276 
277  scheme = 0;
278  hres = IUri_GetScheme(pUri, &scheme);
279  if(FAILED(hres))
280  return hres;
281  if(scheme != URL_SCHEME_FILE)
282  return E_INVALIDARG;
283 
284  memset(&bindinfo, 0, sizeof(bindinfo));
285  bindinfo.cbSize = sizeof(BINDINFO);
286  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
287  if(FAILED(hres)) {
288  WARN("GetBindInfo failed: %08x\n", hres);
289  return hres;
290  }
291 
292  ReleaseBindInfo(&bindinfo);
293 
294  if(!(grfBINDF & BINDF_FROMURLMON))
295  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_DIRECTBIND, NULL);
296 
297  if(This->file != INVALID_HANDLE_VALUE) {
298  IInternetProtocolSink_ReportData(pOIProtSink,
299  BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION,
300  This->size, This->size);
301  return S_OK;
302  }
303 
304  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, &null_char);
305 
306  size = 0;
307  hres = CoInternetParseIUri(pUri, PARSE_PATH_FROM_URL, 0, path, ARRAY_SIZE(path), &size, 0);
308  if(FAILED(hres)) {
309  WARN("CoInternetParseIUri failed: %08x\n", hres);
310  return report_result(pOIProtSink, hres, 0);
311  }
312 
315  if(file_handle == INVALID_HANDLE_VALUE && (ptr = strrchrW(path, '#'))) {
316  /* If path contains fragment part, try without it. */
317  *ptr = 0;
320  }
322  return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
323 
326  return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, GetLastError());
327  }
328 
329  This->file = file_handle;
330  This->size = file_size.u.LowPart;
331  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_CACHEFILENAMEAVAILABLE, path);
332 
333  hres = IUri_GetExtension(pUri, &ext);
334  if(SUCCEEDED(hres)) {
335  if(hres == S_OK && *ext) {
336  if((ptr = strchrW(ext, '#')))
337  *ptr = 0;
339  if(SUCCEEDED(hres)) {
340  IInternetProtocolSink_ReportProgress(pOIProtSink,
341  (grfBINDF & BINDF_FROMURLMON) ?
342  BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE : BINDSTATUS_MIMETYPEAVAILABLE,
343  mime);
345  }
346  }
348  }
349 
350  IInternetProtocolSink_ReportData(pOIProtSink,
351  BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION,
352  This->size, This->size);
353 
354  return report_result(pOIProtSink, S_OK, 0);
355 }
#define CloseHandle
Definition: compat.h:398
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
const WCHAR * mime
Definition: mimefilter.c:512
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
Definition: urlmon_main.c:572
#define WARN(fmt,...)
Definition: debug.h:111
DWORD scheme
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
OLECHAR * BSTR
Definition: compat.h:1934
#define FILE_SHARE_READ
Definition: compat.h:125
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
static PVOID ptr
Definition: dispmode.c:27
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static HRESULT report_result(IInternetProtocolSink *protocol_sink, HRESULT hres, DWORD res)
Definition: file.c:249
char ext[3]
Definition: mkdosfs.c:358
#define OPEN_EXISTING
Definition: compat.h:426
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GetFileSizeEx
Definition: compat.h:414
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
#define GENERIC_READ
Definition: compat.h:124
WINE_UNICODE_INLINE WCHAR * strrchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:254
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
HRESULT WINAPI CoInternetParseIUri(IUri *pIUri, PARSEACTION ParseAction, DWORD dwFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD_PTR dwReserved)
Definition: uri.c:7253
#define CreateFileW
Definition: compat.h:400
HRESULT find_mime_from_ext(const WCHAR *ext, WCHAR **ret)
Definition: mimefilter.c:425
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46
#define file_size(inode)
Definition: reiserfs_fs.h:1869
static FILE * file_handle
Definition: regtests2xml.c:45
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ FileProtocol_Suspend()

static HRESULT WINAPI FileProtocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 186 of file file.c.

187 {
189  FIXME("(%p)\n", This);
190  return E_NOTIMPL;
191 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_Terminate()

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

Definition at line 177 of file file.c.

178 {
180 
181  TRACE("(%p)->(%08x)\n", This, dwOptions);
182 
183  return S_OK;
184 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocol_UnlockRequest()

static HRESULT WINAPI FileProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 240 of file file.c.

241 {
243 
244  TRACE("(%p)\n", This);
245 
246  return S_OK;
247 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static FileProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: file.c:46

◆ FileProtocolUnk_AddRef()

static ULONG WINAPI FileProtocolUnk_AddRef ( IUnknown iface)
static

Definition at line 87 of file file.c.

88 {
91  TRACE("(%p) ref=%d\n", This, ref);
92  return ref;
93 }
Definition: send.c:47
static FileProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: file.c:41
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ FileProtocolUnk_QueryInterface()

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

Definition at line 56 of file file.c.

57 {
59 
60  *ppv = NULL;
62  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
63  *ppv = &This->IUnknown_outer;
64  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
65  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
66  *ppv = &This->IInternetProtocolEx_iface;
67  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
68  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
69  *ppv = &This->IInternetProtocolEx_iface;
70  }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
71  TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
72  *ppv = &This->IInternetProtocolEx_iface;
73  }else if(IsEqualGUID(&IID_IInternetPriority, riid)) {
74  TRACE("(%p)->(IID_IInternetPriority %p)\n", This, ppv);
75  *ppv = &This->IInternetPriority_iface;
76  }
77 
78  if(*ppv) {
79  IUnknown_AddRef((IUnknown*)*ppv);
80  return S_OK;
81  }
82 
83  WARN("not supported interface %s\n", debugstr_guid(riid));
84  return E_NOINTERFACE;
85 }
#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
static FileProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: file.c:41
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
const GUID IID_IUnknown
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021

◆ FileProtocolUnk_Release()

static ULONG WINAPI FileProtocolUnk_Release ( IUnknown iface)
static

Definition at line 95 of file file.c.

96 {
99 
100  TRACE("(%p) ref=%d\n", This, ref);
101 
102  if(!ref) {
103  if(This->file != INVALID_HANDLE_VALUE)
104  CloseHandle(This->file);
105  heap_free(This);
106 
108  }
109 
110  return ref;
111 }
#define CloseHandle
Definition: compat.h:398
#define INVALID_HANDLE_VALUE
Definition: compat.h:391
Definition: send.c:47
static FileProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: file.c:41
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
#define InterlockedDecrement
Definition: armddk.h:52
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ impl_from_IInternetPriority()

static FileProtocol* impl_from_IInternetPriority ( IInternetPriority iface)
inlinestatic

Definition at line 51 of file file.c.

52 {
53  return CONTAINING_RECORD(iface, FileProtocol, IInternetPriority_iface);
54 }
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 FilePriority_AddRef(), FilePriority_GetPriority(), FilePriority_QueryInterface(), FilePriority_Release(), and FilePriority_SetPriority().

◆ impl_from_IInternetProtocolEx()

static FileProtocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
inlinestatic

Definition at line 46 of file file.c.

47 {
48  return CONTAINING_RECORD(iface, FileProtocol, IInternetProtocolEx_iface);
49 }
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 FileProtocol_Abort(), FileProtocol_AddRef(), FileProtocol_Continue(), FileProtocol_LockRequest(), FileProtocol_QueryInterface(), FileProtocol_Read(), FileProtocol_Release(), FileProtocol_Resume(), FileProtocol_Seek(), FileProtocol_Start(), FileProtocol_StartEx(), FileProtocol_Suspend(), FileProtocol_Terminate(), and FileProtocol_UnlockRequest().

◆ impl_from_IUnknown()

static FileProtocol* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 41 of file file.c.

42 {
43  return CONTAINING_RECORD(iface, FileProtocol, IUnknown_outer);
44 }
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 FileProtocolUnk_AddRef(), FileProtocolUnk_QueryInterface(), and FileProtocolUnk_Release().

◆ report_result()

static HRESULT report_result ( IInternetProtocolSink protocol_sink,
HRESULT  hres,
DWORD  res 
)
inlinestatic

Definition at line 249 of file file.c.

250 {
251  IInternetProtocolSink_ReportResult(protocol_sink, hres, res, NULL);
252  return hres;
253 }
static IInternetProtocolSink protocol_sink
Definition: mimeole.c:1411
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
GLuint res
Definition: glext.h:9613

Referenced by FileProtocol_StartEx().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( urlmon  )

Variable Documentation

◆ FilePriorityVtbl

const IInternetPriorityVtbl FilePriorityVtbl
static
Initial value:
= {
}
static HRESULT WINAPI FilePriority_SetPriority(IInternetPriority *iface, LONG nPriority)
Definition: file.c:393
static ULONG WINAPI FilePriority_Release(IInternetPriority *iface)
Definition: file.c:387
static HRESULT WINAPI FilePriority_GetPriority(IInternetPriority *iface, LONG *pnPriority)
Definition: file.c:403
static HRESULT WINAPI FilePriority_QueryInterface(IInternetPriority *iface, REFIID riid, void **ppv)
Definition: file.c:374
static ULONG WINAPI FilePriority_AddRef(IInternetPriority *iface)
Definition: file.c:381

Definition at line 413 of file file.c.

Referenced by FileProtocol_Construct().

◆ FileProtocolExVtbl

const IInternetProtocolExVtbl FileProtocolExVtbl
static
Initial value:
= {
}
static HRESULT WINAPI FileProtocol_Suspend(IInternetProtocolEx *iface)
Definition: file.c:186
static HRESULT WINAPI FileProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
Definition: file.c:119
static HRESULT WINAPI FileProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: file.c:140
static HRESULT WINAPI FileProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: file.c:200
static HRESULT WINAPI FileProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: file.c:162
static HRESULT WINAPI FileProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
Definition: file.c:255
static HRESULT WINAPI FileProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: file.c:169
static ULONG WINAPI FileProtocol_Release(IInternetProtocolEx *iface)
Definition: file.c:133
static HRESULT WINAPI FileProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: file.c:177
static ULONG WINAPI FileProtocol_AddRef(IInternetProtocolEx *iface)
Definition: file.c:126
static HRESULT WINAPI FileProtocol_Resume(IInternetProtocolEx *iface)
Definition: file.c:193
static HRESULT WINAPI FileProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: file.c:231
static HRESULT WINAPI FileProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: file.c:240
static HRESULT WINAPI FileProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: file.c:223

Definition at line 357 of file file.c.

Referenced by FileProtocol_Construct().

◆ FileProtocolUnkVtbl

const IUnknownVtbl FileProtocolUnkVtbl
static
Initial value:
= {
}
static ULONG WINAPI FileProtocolUnk_Release(IUnknown *iface)
Definition: file.c:95
static ULONG WINAPI FileProtocolUnk_AddRef(IUnknown *iface)
Definition: file.c:87
static HRESULT WINAPI FileProtocolUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: file.c:56

Definition at line 113 of file file.c.

Referenced by FileProtocol_Construct().