ReactOS  0.4.15-dev-313-g8fde48b
protocol.c File Reference
#include "mshtml_private.h"
Include dependency graph for protocol.c:

Go to the source code of this file.

Classes

struct  ProtocolFactory
 
struct  AboutProtocol
 
struct  ResProtocol
 

Functions

static ProtocolFactoryimpl_from_IInternetProtocolInfo (IInternetProtocolInfo *iface)
 
static HRESULT WINAPI InternetProtocolInfo_QueryInterface (IInternetProtocolInfo *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI InternetProtocolInfo_AddRef (IInternetProtocolInfo *iface)
 
static ULONG WINAPI InternetProtocolInfo_Release (IInternetProtocolInfo *iface)
 
static HRESULT WINAPI InternetProtocolInfo_CombineUrl (IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI InternetProtocolInfo_CompareUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
 
static ProtocolFactoryimpl_from_IClassFactory (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_QueryInterface (IClassFactory *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ClassFactory_AddRef (IClassFactory *iface)
 
static ULONG WINAPI ClassFactory_Release (IClassFactory *iface)
 
static HRESULT WINAPI ClassFactory_LockServer (IClassFactory *iface, BOOL dolock)
 
static AboutProtocolAboutProtocol_from_IInternetProtocol (IInternetProtocol *iface)
 
static HRESULT WINAPI AboutProtocol_QueryInterface (IInternetProtocol *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AboutProtocol_AddRef (IInternetProtocol *iface)
 
static ULONG WINAPI AboutProtocol_Release (IInternetProtocol *iface)
 
static HRESULT WINAPI AboutProtocol_Start (IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI AboutProtocol_Continue (IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI AboutProtocol_Abort (IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI AboutProtocol_Terminate (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI AboutProtocol_Suspend (IInternetProtocol *iface)
 
static HRESULT WINAPI AboutProtocol_Resume (IInternetProtocol *iface)
 
static HRESULT WINAPI AboutProtocol_Read (IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI AboutProtocol_Seek (IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI AboutProtocol_LockRequest (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI AboutProtocol_UnlockRequest (IInternetProtocol *iface)
 
static HRESULT WINAPI AboutProtocolFactory_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI AboutProtocolInfo_ParseUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI AboutProtocolInfo_QueryInfo (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
 
static ResProtocolResProtocol_from_IInternetProtocol (IInternetProtocol *iface)
 
static HRESULT WINAPI ResProtocol_QueryInterface (IInternetProtocol *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI ResProtocol_AddRef (IInternetProtocol *iface)
 
static ULONG WINAPI ResProtocol_Release (IInternetProtocol *iface)
 
static HRESULT WINAPI ResProtocol_Start (IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI ResProtocol_Continue (IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI ResProtocol_Abort (IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI ResProtocol_Terminate (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI ResProtocol_Suspend (IInternetProtocol *iface)
 
static HRESULT WINAPI ResProtocol_Resume (IInternetProtocol *iface)
 
static HRESULT WINAPI ResProtocol_Read (IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI ResProtocol_Seek (IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI ResProtocol_LockRequest (IInternetProtocol *iface, DWORD dwOptions)
 
static HRESULT WINAPI ResProtocol_UnlockRequest (IInternetProtocol *iface)
 
static HRESULT WINAPI ResProtocolFactory_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI ResProtocolInfo_ParseUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI ResProtocolInfo_QueryInfo (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
 
static HRESULT WINAPI JSProtocolFactory_CreateInstance (IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
 
static HRESULT WINAPI JSProtocolInfo_ParseUrl (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
 
static HRESULT WINAPI JSProtocolInfo_QueryInfo (IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
 
HRESULT ProtocolFactory_Create (REFCLSID rclsid, REFIID riid, void **ppv)
 

Variables

static const IInternetProtocolVtbl AboutProtocolVtbl
 
static const IInternetProtocolInfoVtbl AboutProtocolInfoVtbl
 
static const IClassFactoryVtbl AboutProtocolFactoryVtbl
 
static ProtocolFactory AboutProtocolFactory
 
static const IInternetProtocolVtbl ResProtocolVtbl
 
static const IInternetProtocolInfoVtbl ResProtocolInfoVtbl
 
static const IClassFactoryVtbl ResProtocolFactoryVtbl
 
static ProtocolFactory ResProtocolFactory
 
static const IInternetProtocolInfoVtbl JSProtocolInfoVtbl
 
static const IClassFactoryVtbl JSProtocolFactoryVtbl
 
static ProtocolFactory JSProtocolFactory
 

Function Documentation

◆ AboutProtocol_Abort()

static HRESULT WINAPI AboutProtocol_Abort ( IInternetProtocol iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 273 of file protocol.c.

275 {
277  FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
278  return E_NOTIMPL;
279 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_AddRef()

static ULONG WINAPI AboutProtocol_AddRef ( IInternetProtocol iface)
static

Definition at line 171 of file protocol.c.

172 {
175  TRACE("(%p) ref=%d\n", iface, ref);
176  return This->pUnkOuter ? IUnknown_AddRef(This->pUnkOuter) : ref;
177 }
Definition: send.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135
unsigned int ULONG
Definition: retypes.h:1

◆ AboutProtocol_Continue()

static HRESULT WINAPI AboutProtocol_Continue ( IInternetProtocol iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 266 of file protocol.c.

267 {
269  FIXME("(%p)->(%p)\n", This, pProtocolData);
270  return E_NOTIMPL;
271 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_from_IInternetProtocol()

static AboutProtocol* AboutProtocol_from_IInternetProtocol ( IInternetProtocol iface)
inlinestatic

Definition at line 135 of file protocol.c.

136 {
137  return CONTAINING_RECORD(iface, AboutProtocol, IInternetProtocol_iface);
138 }
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 AboutProtocol_Abort(), AboutProtocol_AddRef(), AboutProtocol_Continue(), AboutProtocol_LockRequest(), AboutProtocol_QueryInterface(), AboutProtocol_Read(), AboutProtocol_Release(), AboutProtocol_Resume(), AboutProtocol_Seek(), AboutProtocol_Start(), AboutProtocol_Suspend(), AboutProtocol_Terminate(), and AboutProtocol_UnlockRequest().

◆ AboutProtocol_LockRequest()

static HRESULT WINAPI AboutProtocol_LockRequest ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 330 of file protocol.c.

331 {
333 
334  TRACE("(%p)->(%d)\n", This, dwOptions);
335 
336  return S_OK;
337 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_QueryInterface()

static HRESULT WINAPI AboutProtocol_QueryInterface ( IInternetProtocol iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 140 of file protocol.c.

141 {
143 
144  *ppv = NULL;
145 
146  if(IsEqualGUID(&IID_IUnknown, riid)) {
147  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
148  if(This->pUnkOuter)
149  return IUnknown_QueryInterface(This->pUnkOuter, riid, ppv);
150  *ppv = &This->IInternetProtocol_iface;
151  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
152  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", iface, ppv);
153  *ppv = &This->IInternetProtocol_iface;
154  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
155  TRACE("(%p)->(IID_IInternetProtocol %p)\n", iface, ppv);
156  *ppv = &This->IInternetProtocol_iface;
157  }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
158  FIXME("IServiceProvider is not implemented\n");
159  return E_NOINTERFACE;
160  }
161 
162  if(!*ppv) {
163  TRACE("unknown interface %s\n", debugstr_guid(riid));
164  return E_NOINTERFACE;
165  }
166 
167  IInternetProtocol_AddRef(iface);
168  return S_OK;
169 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
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:4112
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_Read()

static HRESULT WINAPI AboutProtocol_Read ( IInternetProtocol iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 302 of file protocol.c.

303 {
305 
306  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
307 
308  if(!This->data)
309  return E_FAIL;
310 
311  *pcbRead = (cb > This->data_len-This->cur ? This->data_len-This->cur : cb);
312 
313  if(!*pcbRead)
314  return S_FALSE;
315 
316  memcpy(pv, This->data+This->cur, *pcbRead);
317  This->cur += *pcbRead;
318 
319  return S_OK;
320 }
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

◆ AboutProtocol_Release()

static ULONG WINAPI AboutProtocol_Release ( IInternetProtocol iface)
static

Definition at line 179 of file protocol.c.

180 {
182  IUnknown *pUnkOuter = This->pUnkOuter;
184 
185  TRACE("(%p) ref=%x\n", iface, ref);
186 
187  if(!ref) {
188  heap_free(This->data);
189  heap_free(This);
190  }
191 
192  return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
193 }
Definition: send.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135
unsigned int ULONG
Definition: retypes.h:1
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ AboutProtocol_Resume()

static HRESULT WINAPI AboutProtocol_Resume ( IInternetProtocol iface)
static

Definition at line 295 of file protocol.c.

296 {
298  FIXME("(%p)\n", This);
299  return E_NOTIMPL;
300 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_Seek()

static HRESULT WINAPI AboutProtocol_Seek ( IInternetProtocol iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 322 of file protocol.c.

324 {
326  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
327  return E_NOTIMPL;
328 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135
struct _LARGE_INTEGER::@2245 u

◆ AboutProtocol_Start()

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

Definition at line 195 of file protocol.c.

198 {
200  BINDINFO bindinfo;
201  DWORD grfBINDF = 0;
202  LPCWSTR text = NULL;
203  DWORD data_len;
204  BYTE *data;
205  HRESULT hres;
206 
207  static const WCHAR html_begin[] = {0xfeff,'<','H','T','M','L','>',0};
208  static const WCHAR html_end[] = {'<','/','H','T','M','L','>',0};
209  static const WCHAR wszBlank[] = {'b','l','a','n','k',0};
210  static const WCHAR wszAbout[] = {'a','b','o','u','t',':'};
211  static const WCHAR wszTextHtml[] = {'t','e','x','t','/','h','t','m','l',0};
212 
213  /* NOTE:
214  * the about protocol seems not to work as I would expect. It creates html document
215  * for a given url, eg. about:some_text -> <HTML>some_text</HTML> except for the case when
216  * some_text = "blank", when document is blank (<HTML></HMTL>). The same happens
217  * when the url does not have "about:" in the beginning.
218  */
219 
220  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
221  pOIBindInfo, grfPI, dwReserved);
222 
223  memset(&bindinfo, 0, sizeof(bindinfo));
224  bindinfo.cbSize = sizeof(BINDINFO);
225  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
226  if(FAILED(hres))
227  return hres;
228  ReleaseBindInfo(&bindinfo);
229 
230  TRACE("bindf %x\n", grfBINDF);
231 
232  if(strlenW(szUrl)>=sizeof(wszAbout)/sizeof(WCHAR) && !memcmp(wszAbout, szUrl, sizeof(wszAbout))) {
233  text = szUrl + sizeof(wszAbout)/sizeof(WCHAR);
234  if(!strcmpW(wszBlank, text))
235  text = NULL;
236  }
237 
238  data_len = sizeof(html_begin)+sizeof(html_end)-sizeof(WCHAR)
239  + (text ? strlenW(text)*sizeof(WCHAR) : 0);
240  data = heap_alloc(data_len);
241  if(!data)
242  return E_OUTOFMEMORY;
243 
244  heap_free(This->data);
245  This->data = data;
246  This->data_len = data_len;
247 
248  memcpy(This->data, html_begin, sizeof(html_begin));
249  if(text)
250  strcatW((LPWSTR)This->data, text);
251  strcatW((LPWSTR)This->data, html_end);
252 
253  This->cur = 0;
254 
255  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, wszTextHtml);
256 
257  IInternetProtocolSink_ReportData(pOIProtSink,
258  BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE,
259  This->data_len, This->data_len);
260 
261  IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
262 
263  return S_OK;
264 }
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
Definition: urlmon_main.c:572
const WCHAR * text
Definition: package.c:1827
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
_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
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR wszTextHtml[]
Definition: url.c:157
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
unsigned char BYTE
Definition: xxhash.c:193
#define S_OK
Definition: intsafe.h:59
WINE_UNICODE_INLINE WCHAR * strcatW(WCHAR *dst, const WCHAR *src)
Definition: unicode.h:242
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135
WINE_UNICODE_INLINE int strcmpW(const WCHAR *str1, const WCHAR *str2)
Definition: unicode.h:229
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
static const WCHAR wszAbout[]
Definition: misc.c:326
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ AboutProtocol_Suspend()

static HRESULT WINAPI AboutProtocol_Suspend ( IInternetProtocol iface)
static

Definition at line 288 of file protocol.c.

289 {
291  FIXME("(%p)\n", This);
292  return E_NOTIMPL;
293 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_Terminate()

static HRESULT WINAPI AboutProtocol_Terminate ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 281 of file protocol.c.

282 {
284  TRACE("(%p)->(%08x)\n", This, dwOptions);
285  return S_OK;
286 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocol_UnlockRequest()

static HRESULT WINAPI AboutProtocol_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 339 of file protocol.c.

340 {
342 
343  TRACE("(%p)\n", This);
344 
345  return S_OK;
346 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static AboutProtocol * AboutProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:135

◆ AboutProtocolFactory_CreateInstance()

static HRESULT WINAPI AboutProtocolFactory_CreateInstance ( IClassFactory iface,
IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 364 of file protocol.c.

366 {
368  HRESULT hres = S_OK;
369 
370  TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv);
371 
372  ret = heap_alloc(sizeof(AboutProtocol));
373  ret->IInternetProtocol_iface.lpVtbl = &AboutProtocolVtbl;
374  ret->ref = 0;
375 
376  ret->data = NULL;
377  ret->data_len = 0;
378  ret->cur = 0;
379  ret->pUnkOuter = pUnkOuter;
380 
381  if(pUnkOuter) {
382  ret->ref = 1;
384  *ppv = &ret->IInternetProtocol_iface;
385  else
386  hres = E_INVALIDARG;
387  }else {
388  hres = IInternetProtocol_QueryInterface(&ret->IInternetProtocol_iface, riid, ppv);
389  }
390 
391  if(FAILED(hres))
392  heap_free(ret);
393 
394  return hres;
395 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
const GUID IID_IUnknown
int ret
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static const IInternetProtocolVtbl AboutProtocolVtbl
Definition: protocol.c:348
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ AboutProtocolInfo_ParseUrl()

static HRESULT WINAPI AboutProtocolInfo_ParseUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
PARSEACTION  ParseAction,
DWORD  dwParseFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 397 of file protocol.c.

400 {
401  TRACE("%p)->(%s %d %08x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), ParseAction,
402  dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved);
403 
404  if(ParseAction == PARSE_SECURITY_URL) {
405  unsigned int len = strlenW(pwzUrl)+1;
406 
407  *pcchResult = len;
408  if(len > cchResult)
409  return S_FALSE;
410 
411  memcpy(pwzResult, pwzUrl, len*sizeof(WCHAR));
412  return S_OK;
413  }
414 
415  if(ParseAction == PARSE_DOMAIN) {
416  if(!pcchResult)
417  return E_POINTER;
418 
419  if(pwzUrl)
420  *pcchResult = strlenW(pwzUrl)+1;
421  else
422  *pcchResult = 1;
423  return E_FAIL;
424  }
425 
426  return INET_E_DEFAULT_ACTION;
427 }
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define E_FAIL
Definition: ddrawi.h:102
_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 S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define E_POINTER
Definition: winerror.h:2365

◆ AboutProtocolInfo_QueryInfo()

static HRESULT WINAPI AboutProtocolInfo_QueryInfo ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
QUERYOPTION  QueryOption,
DWORD  dwQueryFlags,
LPVOID  pBuffer,
DWORD  cbBuffer,
DWORD pcbBuf,
DWORD  dwReserved 
)
static

Definition at line 429 of file protocol.c.

432 {
433  TRACE("%p)->(%s %08x %08x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), QueryOption, dwQueryFlags, pBuffer,
434  cbBuffer, pcbBuf, dwReserved);
435 
436  switch(QueryOption) {
437  case QUERY_CAN_NAVIGATE:
438  return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
439 
440  case QUERY_USES_NETWORK:
441  if(!pBuffer || cbBuffer < sizeof(DWORD))
442  return E_FAIL;
443 
444  *(DWORD*)pBuffer = 0;
445  if(pcbBuf)
446  *pcbBuf = sizeof(DWORD);
447 
448  break;
449 
450  case QUERY_IS_CACHED:
451  FIXME("Unsupported option QUERY_IS_CACHED\n");
452  return E_NOTIMPL;
453  case QUERY_IS_INSTALLEDENTRY:
454  FIXME("Unsupported option QUERY_IS_INSTALLEDENTRY\n");
455  return E_NOTIMPL;
456  case QUERY_IS_CACHED_OR_MAPPED:
457  FIXME("Unsupported option QUERY_IS_CACHED_OR_MAPPED\n");
458  return E_NOTIMPL;
459  case QUERY_IS_SECURE:
460  FIXME("Unsupported option QUERY_IS_SECURE\n");
461  return E_NOTIMPL;
462  case QUERY_IS_SAFE:
463  FIXME("Unsupported option QUERY_IS_SAFE\n");
464  return E_NOTIMPL;
465  case QUERY_USES_HISTORYFOLDER:
466  FIXME("Unsupported option QUERY_USES_HISTORYFOLDER\n");
467  return E_FAIL;
468  case QUERY_IS_CACHED_AND_USABLE_OFFLINE:
469  FIXME("Unsupported option QUERY_IS_CACHED_AND_USABLE_OFFLINE\n");
470  return E_NOTIMPL;
471  default:
472  return E_FAIL;
473  }
474 
475  return S_OK;
476 }
#define E_FAIL
Definition: ddrawi.h:102
_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 FIXME(fmt,...)
Definition: debug.h:111
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
static IInternetSession DWORD
Definition: protocol.c:33
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ClassFactory_AddRef()

static ULONG WINAPI ClassFactory_AddRef ( IClassFactory iface)
static

Definition at line 101 of file protocol.c.

102 {
104  return IInternetProtocolInfo_AddRef(&This->IInternetProtocolInfo_iface);
105 }
static ProtocolFactory * impl_from_IClassFactory(IClassFactory *iface)
Definition: protocol.c:90

◆ ClassFactory_LockServer()

static HRESULT WINAPI ClassFactory_LockServer ( IClassFactory iface,
BOOL  dolock 
)
static

Definition at line 113 of file protocol.c.

114 {
115  TRACE("(%p)->(%x)\n", iface, dolock);
116  return S_OK;
117 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59

◆ ClassFactory_QueryInterface()

static HRESULT WINAPI ClassFactory_QueryInterface ( IClassFactory iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 95 of file protocol.c.

96 {
98  return IInternetProtocolInfo_QueryInterface(&This->IInternetProtocolInfo_iface, riid, ppv);
99 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
static ProtocolFactory * impl_from_IClassFactory(IClassFactory *iface)
Definition: protocol.c:90

◆ ClassFactory_Release()

static ULONG WINAPI ClassFactory_Release ( IClassFactory iface)
static

Definition at line 107 of file protocol.c.

108 {
110  return IInternetProtocolInfo_Release(&This->IInternetProtocolInfo_iface);
111 }
static ProtocolFactory * impl_from_IClassFactory(IClassFactory *iface)
Definition: protocol.c:90

◆ impl_from_IClassFactory()

static ProtocolFactory* impl_from_IClassFactory ( IClassFactory iface)
inlinestatic

Definition at line 90 of file protocol.c.

91 {
92  return CONTAINING_RECORD(iface, ProtocolFactory, IClassFactory_iface);
93 }
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 ClassFactory_AddRef(), ClassFactory_QueryInterface(), and ClassFactory_Release().

◆ impl_from_IInternetProtocolInfo()

static ProtocolFactory* impl_from_IInternetProtocolInfo ( IInternetProtocolInfo iface)
inlinestatic

Definition at line 30 of file protocol.c.

31 {
32  return CONTAINING_RECORD(iface, ProtocolFactory, IInternetProtocolInfo_iface);
33 }
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 InternetProtocolInfo_QueryInterface().

◆ InternetProtocolInfo_AddRef()

static ULONG WINAPI InternetProtocolInfo_AddRef ( IInternetProtocolInfo iface)
static

Definition at line 60 of file protocol.c.

61 {
62  TRACE("(%p)\n", iface);
63  return 2;
64 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ InternetProtocolInfo_CombineUrl()

static HRESULT WINAPI InternetProtocolInfo_CombineUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzBaseUrl,
LPCWSTR  pwzRelativeUrl,
DWORD  dwCombineFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 72 of file protocol.c.

75 {
76  TRACE("%p)->(%s %s %08x %p %d %p %d)\n", iface, debugstr_w(pwzBaseUrl),
77  debugstr_w(pwzRelativeUrl), dwCombineFlags, pwzResult, cchResult,
78  pcchResult, dwReserved);
79 
80  return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
81 }
_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

◆ InternetProtocolInfo_CompareUrl()

static HRESULT WINAPI InternetProtocolInfo_CompareUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl1,
LPCWSTR  pwzUrl2,
DWORD  dwCompareFlags 
)
static

Definition at line 83 of file protocol.c.

85 {
86  TRACE("%p)->(%s %s %08x)\n", iface, debugstr_w(pwzUrl1), debugstr_w(pwzUrl2), dwCompareFlags);
87  return E_NOTIMPL;
88 }
#define debugstr_w
Definition: kernel32.h:32
#define TRACE(s)
Definition: solgame.cpp:4
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ InternetProtocolInfo_QueryInterface()

static HRESULT WINAPI InternetProtocolInfo_QueryInterface ( IInternetProtocolInfo iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 35 of file protocol.c.

36 {
38 
39  *ppv = NULL;
41  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
42  *ppv = &This->IInternetProtocolInfo_iface;
43  }else if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) {
44  TRACE("(%p)->(IID_IInternetProtocolInfo %p)\n", This, ppv);
45  *ppv = &This->IInternetProtocolInfo_iface;
46  }else if(IsEqualGUID(&IID_IClassFactory, riid)) {
47  TRACE("(%p)->(IID_IClassFactory %p)\n", This, ppv);
48  *ppv = &This->IClassFactory_iface;
49  }
50 
51  if(!*ppv) {
52  WARN("unknown interface %s\n", debugstr_guid(riid));
53  return E_NOINTERFACE;
54  }
55 
56  IInternetProtocolInfo_AddRef(iface);
57  return S_OK;
58 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
REFIID LPVOID * ppv
Definition: atlbase.h:39
static ProtocolFactory * impl_from_IInternetProtocolInfo(IInternetProtocolInfo *iface)
Definition: protocol.c:30
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:4112
const GUID IID_IClassFactory

◆ InternetProtocolInfo_Release()

static ULONG WINAPI InternetProtocolInfo_Release ( IInternetProtocolInfo iface)
static

Definition at line 66 of file protocol.c.

67 {
68  TRACE("(%p)\n", iface);
69  return 1;
70 }
#define TRACE(s)
Definition: solgame.cpp:4

◆ JSProtocolFactory_CreateInstance()

static HRESULT WINAPI JSProtocolFactory_CreateInstance ( IClassFactory iface,
IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 959 of file protocol.c.

961 {
962  FIXME("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv);
963  return E_NOTIMPL;
964 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JSProtocolInfo_ParseUrl()

static HRESULT WINAPI JSProtocolInfo_ParseUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
PARSEACTION  ParseAction,
DWORD  dwParseFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 966 of file protocol.c.

969 {
970  TRACE("%p)->(%s %d %x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), ParseAction,
971  dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved);
972 
973  switch(ParseAction) {
974  case PARSE_SECURITY_URL:
975  FIXME("PARSE_SECURITY_URL\n");
976  return E_NOTIMPL;
977  case PARSE_DOMAIN:
978  FIXME("PARSE_DOMAIN\n");
979  return E_NOTIMPL;
980  default:
981  return INET_E_DEFAULT_ACTION;
982  }
983 
984  return S_OK;
985 }
_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 FIXME(fmt,...)
Definition: debug.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ JSProtocolInfo_QueryInfo()

static HRESULT WINAPI JSProtocolInfo_QueryInfo ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
QUERYOPTION  QueryOption,
DWORD  dwQueryFlags,
LPVOID  pBuffer,
DWORD  cbBuffer,
DWORD pcbBuf,
DWORD  dwReserved 
)
static

Definition at line 987 of file protocol.c.

990 {
991  TRACE("%p)->(%s %08x %08x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), QueryOption, dwQueryFlags, pBuffer,
992  cbBuffer, pcbBuf, dwReserved);
993 
994  switch(QueryOption) {
995  case QUERY_USES_NETWORK:
996  if(!pBuffer || cbBuffer < sizeof(DWORD))
997  return E_FAIL;
998 
999  *(DWORD*)pBuffer = 0;
1000  if(pcbBuf)
1001  *pcbBuf = sizeof(DWORD);
1002  break;
1003 
1004  case QUERY_IS_SECURE:
1005  FIXME("QUERY_IS_SECURE not supported\n");
1006  return E_NOTIMPL;
1007 
1008  default:
1009  return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
1010  }
1011 
1012  return S_OK;
1013 }
#define E_FAIL
Definition: ddrawi.h:102
_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 FIXME(fmt,...)
Definition: debug.h:111
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
static IInternetSession DWORD
Definition: protocol.c:33
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ProtocolFactory_Create()

HRESULT ProtocolFactory_Create ( REFCLSID  rclsid,
REFIID  riid,
void **  ppv 
)

Definition at line 1038 of file protocol.c.

1039 {
1040  ProtocolFactory *cf = NULL;
1041 
1042  if(IsEqualGUID(&CLSID_AboutProtocol, rclsid))
1044  else if(IsEqualGUID(&CLSID_ResProtocol, rclsid))
1046  else if(IsEqualGUID(&CLSID_JSProtocol, rclsid))
1047  cf = &JSProtocolFactory;
1048 
1049  if(!cf) {
1050  FIXME("not implemented protocol %s\n", debugstr_guid(rclsid));
1052  }
1053 
1054  return IInternetProtocolInfo_QueryInterface(&cf->IInternetProtocolInfo_iface, riid, ppv);
1055 }
CLSID CLSID_AboutProtocol
static ProtocolFactory JSProtocolFactory
Definition: protocol.c:1033
REFIID riid
Definition: precomp.h:44
static ProtocolFactory AboutProtocolFactory
Definition: protocol.c:496
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define CLASS_E_CLASSNOTAVAILABLE
Definition: winerror.h:2663
#define FIXME(fmt,...)
Definition: debug.h:111
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
static ProtocolFactory ResProtocolFactory
Definition: protocol.c:950
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

Referenced by DllGetClassObject().

◆ ResProtocol_Abort()

static HRESULT WINAPI ResProtocol_Abort ( IInternetProtocol iface,
HRESULT  hrReason,
DWORD  dwOptions 
)
static

Definition at line 700 of file protocol.c.

702 {
704  FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
705  return E_NOTIMPL;
706 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_AddRef()

static ULONG WINAPI ResProtocol_AddRef ( IInternetProtocol iface)
static

Definition at line 552 of file protocol.c.

553 {
556  TRACE("(%p) ref=%d\n", iface, ref);
557  return This->pUnkOuter ? IUnknown_AddRef(This->pUnkOuter) : ref;
558 }
Definition: send.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516
unsigned int ULONG
Definition: retypes.h:1

◆ ResProtocol_Continue()

static HRESULT WINAPI ResProtocol_Continue ( IInternetProtocol iface,
PROTOCOLDATA *  pProtocolData 
)
static

Definition at line 693 of file protocol.c.

694 {
696  FIXME("(%p)->(%p)\n", This, pProtocolData);
697  return E_NOTIMPL;
698 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_from_IInternetProtocol()

static ResProtocol* ResProtocol_from_IInternetProtocol ( IInternetProtocol iface)
inlinestatic

Definition at line 516 of file protocol.c.

517 {
518  return CONTAINING_RECORD(iface, ResProtocol, IInternetProtocol_iface);
519 }
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 ResProtocol_Abort(), ResProtocol_AddRef(), ResProtocol_Continue(), ResProtocol_LockRequest(), ResProtocol_QueryInterface(), ResProtocol_Read(), ResProtocol_Resume(), ResProtocol_Seek(), ResProtocol_Start(), ResProtocol_Suspend(), ResProtocol_Terminate(), and ResProtocol_UnlockRequest().

◆ ResProtocol_LockRequest()

static HRESULT WINAPI ResProtocol_LockRequest ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 760 of file protocol.c.

761 {
763 
764  TRACE("(%p)->(%d)\n", This, dwOptions);
765 
766  /* test show that we don't have to do anything here */
767  return S_OK;
768 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_QueryInterface()

static HRESULT WINAPI ResProtocol_QueryInterface ( IInternetProtocol iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 521 of file protocol.c.

522 {
524 
525  *ppv = NULL;
526 
527  if(IsEqualGUID(&IID_IUnknown, riid)) {
528  TRACE("(%p)->(IID_IUnknown %p)\n", iface, ppv);
529  if(This->pUnkOuter)
530  return IUnknown_QueryInterface(This->pUnkOuter, &IID_IUnknown, ppv);
531  *ppv = &This->IInternetProtocol_iface;
532  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
533  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", iface, ppv);
534  *ppv = &This->IInternetProtocol_iface;
535  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
536  TRACE("(%p)->(IID_IInternetProtocol %p)\n", iface, ppv);
537  *ppv = &This->IInternetProtocol_iface;
538  }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
539  FIXME("IServiceProvider is not implemented\n");
540  return E_NOINTERFACE;
541  }
542 
543  if(!*ppv) {
544  TRACE("unknown interface %s\n", debugstr_guid(riid));
545  return E_NOINTERFACE;
546  }
547 
548  IInternetProtocol_AddRef(iface);
549  return S_OK;
550 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define FIXME(fmt,...)
Definition: debug.h:111
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
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

◆ ResProtocol_Read()

static HRESULT WINAPI ResProtocol_Read ( IInternetProtocol iface,
void pv,
ULONG  cb,
ULONG pcbRead 
)
static

Definition at line 732 of file protocol.c.

733 {
735 
736  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
737 
738  if(!This->data)
739  return E_FAIL;
740 
741  *pcbRead = (cb > This->data_len-This->cur ? This->data_len-This->cur : cb);
742 
743  if(!*pcbRead)
744  return S_FALSE;
745 
746  memcpy(pv, This->data+This->cur, *pcbRead);
747  This->cur += *pcbRead;
748 
749  return S_OK;
750 }
#define E_FAIL
Definition: ddrawi.h:102
#define S_FALSE
Definition: winerror.h:2357
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define S_OK
Definition: intsafe.h:59
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516
static HMODULE MODULEINFO DWORD cb
Definition: module.c:32

◆ ResProtocol_Release()

static ULONG WINAPI ResProtocol_Release ( IInternetProtocol iface)
static

Definition at line 560 of file protocol.c.

561 {
562  ResProtocol *This = (ResProtocol*)iface;
563  IUnknown *pUnkOuter = This->pUnkOuter;
565 
566  TRACE("(%p) ref=%x\n", iface, ref);
567 
568  if(!ref) {
569  heap_free(This->data);
570  heap_free(This);
571  }
572 
573  return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
574 }
Definition: send.c:48
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ResProtocol_Resume()

static HRESULT WINAPI ResProtocol_Resume ( IInternetProtocol iface)
static

Definition at line 725 of file protocol.c.

726 {
728  FIXME("(%p)\n", This);
729  return E_NOTIMPL;
730 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_Seek()

static HRESULT WINAPI ResProtocol_Seek ( IInternetProtocol iface,
LARGE_INTEGER  dlibMove,
DWORD  dwOrigin,
ULARGE_INTEGER plibNewPosition 
)
static

Definition at line 752 of file protocol.c.

754 {
756  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
757  return E_NOTIMPL;
758 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516
struct _LARGE_INTEGER::@2245 u

◆ ResProtocol_Start()

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

Definition at line 576 of file protocol.c.

579 {
581  WCHAR *url_dll, *url_file, *url, *mime, *res_type = (LPWSTR)RT_HTML, *ptr;
582  DWORD grfBINDF = 0, len;
583  BINDINFO bindinfo;
584  HMODULE hdll;
585  HRSRC src;
586  HRESULT hres;
587 
588  static const WCHAR wszRes[] = {'r','e','s',':','/','/'};
589 
590  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
591  pOIBindInfo, grfPI, dwReserved);
592 
593  memset(&bindinfo, 0, sizeof(bindinfo));
594  bindinfo.cbSize = sizeof(BINDINFO);
595  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &grfBINDF, &bindinfo);
596  if(FAILED(hres))
597  return hres;
598  ReleaseBindInfo(&bindinfo);
599 
600  len = strlenW(szUrl)+16;
601  url = heap_alloc(len*sizeof(WCHAR));
602  hres = CoInternetParseUrl(szUrl, PARSE_ENCODE, 0, url, len, &len, 0);
603  if(FAILED(hres)) {
604  WARN("CoInternetParseUrl failed: %08x\n", hres);
605  heap_free(url);
606  IInternetProtocolSink_ReportResult(pOIProtSink, hres, 0, NULL);
607  return hres;
608  }
609 
610  if(len < sizeof(wszRes)/sizeof(wszRes[0]) || memcmp(url, wszRes, sizeof(wszRes))) {
611  WARN("Wrong protocol of url: %s\n", debugstr_w(url));
612  IInternetProtocolSink_ReportResult(pOIProtSink, E_INVALIDARG, 0, NULL);
613  heap_free(url);
614  return E_INVALIDARG;
615  }
616 
617  url_dll = url + sizeof(wszRes)/sizeof(wszRes[0]);
618  if(!(res_type = strchrW(url_dll, '/'))) {
619  WARN("wrong url: %s\n", debugstr_w(url));
620  IInternetProtocolSink_ReportResult(pOIProtSink, MK_E_SYNTAX, 0, NULL);
621  heap_free(url);
622  return MK_E_SYNTAX;
623  }
624 
625  *res_type++ = 0;
626  if ((url_file = strchrW(res_type, '/'))) {
627  *url_file++ = 0;
628  }else {
629  url_file = res_type;
630  res_type = (LPWSTR)RT_HTML;
631  }
632 
633  /* Ignore query and hash parts. */
634  if((ptr = strchrW(url_file, '?')))
635  *ptr = 0;
636  if(*url_file && (ptr = strchrW(url_file+1, '#')))
637  *ptr = 0;
638 
640  if(!hdll) {
641  WARN("Could not open dll: %s\n", debugstr_w(url_dll));
642  IInternetProtocolSink_ReportResult(pOIProtSink, HRESULT_FROM_WIN32(GetLastError()), 0, NULL);
643  heap_free(url);
645  }
646 
647  TRACE("trying to find resource type %s, name %s\n", debugstr_w(res_type), debugstr_w(url_file));
648 
649  src = FindResourceW(hdll, url_file, res_type);
650  if(!src) {
651  LPWSTR endpoint = NULL;
652  DWORD file_id = strtolW(url_file, &endpoint, 10);
653  if(endpoint == url_file+strlenW(url_file))
654  src = FindResourceW(hdll, MAKEINTRESOURCEW(file_id), res_type);
655 
656  if(!src) {
657  WARN("Could not find resource\n");
658  IInternetProtocolSink_ReportResult(pOIProtSink,
660  heap_free(url);
662  }
663  }
664 
665  if(This->data) {
666  WARN("data already loaded\n");
667  heap_free(This->data);
668  }
669 
670  This->data_len = SizeofResource(hdll, src);
671  This->data = heap_alloc(This->data_len);
672  memcpy(This->data, LoadResource(hdll, src), This->data_len);
673  This->cur = 0;
674 
675  FreeLibrary(hdll);
676 
677  hres = FindMimeFromData(NULL, url_file, This->data, This->data_len, NULL, 0, &mime, 0);
678  heap_free(url);
679  if(SUCCEEDED(hres)) {
680  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, mime);
682  }
683 
684  IInternetProtocolSink_ReportData(pOIProtSink,
685  BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION | BSCF_DATAFULLYAVAILABLE,
686  This->data_len, This->data_len);
687 
688  IInternetProtocolSink_ReportResult(pOIProtSink, S_OK, 0, NULL);
689 
690  return S_OK;
691 }
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
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
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define WARN(fmt,...)
Definition: debug.h:112
#define strtolW(s, e, b)
Definition: unicode.h:33
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
HRESULT WINAPI CoInternetParseUrl(LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwFlags, LPWSTR pszResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: internet.c:392
HRSRC WINAPI FindResourceW(HINSTANCE hModule, LPCWSTR name, LPCWSTR type)
Definition: res.c:176
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
#define RT_HTML
Definition: winuser.h:618
_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
static PVOID ptr
Definition: dispmode.c:27
HGLOBAL WINAPI LoadResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:532
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:414
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:78
static const WCHAR url[]
Definition: encode.c:1432
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLenum src
Definition: glext.h:6340
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define S_OK
Definition: intsafe.h:59
Definition: nis.h:10
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516
static PVOID hdll
Definition: shimdbg.c:126
DWORD WINAPI SizeofResource(HINSTANCE hModule, HRSRC hRsrc)
Definition: res.c:568
static const WCHAR wszRes[]
Definition: misc.c:323
#define MK_E_SYNTAX
Definition: winerror.h:2785
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define memset(x, y, z)
Definition: compat.h:39
HRESULT WINAPI FindMimeFromData(LPBC pBC, LPCWSTR pwzUrl, LPVOID pBuffer, DWORD cbSize, LPCWSTR pwzMimeProposed, DWORD dwMimeFlags, LPWSTR *ppwzMimeOut, DWORD dwReserved)
Definition: mimefilter.c:680
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ResProtocol_Suspend()

static HRESULT WINAPI ResProtocol_Suspend ( IInternetProtocol iface)
static

Definition at line 718 of file protocol.c.

719 {
721  FIXME("(%p)\n", This);
722  return E_NOTIMPL;
723 }
#define FIXME(fmt,...)
Definition: debug.h:111
#define E_NOTIMPL
Definition: ddrawi.h:99
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_Terminate()

static HRESULT WINAPI ResProtocol_Terminate ( IInternetProtocol iface,
DWORD  dwOptions 
)
static

Definition at line 708 of file protocol.c.

709 {
711 
712  TRACE("(%p)->(%08x)\n", This, dwOptions);
713 
714  /* test show that we don't have to do anything here */
715  return S_OK;
716 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocol_UnlockRequest()

static HRESULT WINAPI ResProtocol_UnlockRequest ( IInternetProtocol iface)
static

Definition at line 770 of file protocol.c.

771 {
773 
774  TRACE("(%p)\n", This);
775 
776  /* test show that we don't have to do anything here */
777  return S_OK;
778 }
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static ResProtocol * ResProtocol_from_IInternetProtocol(IInternetProtocol *iface)
Definition: protocol.c:516

◆ ResProtocolFactory_CreateInstance()

static HRESULT WINAPI ResProtocolFactory_CreateInstance ( IClassFactory iface,
IUnknown pUnkOuter,
REFIID  riid,
void **  ppv 
)
static

Definition at line 796 of file protocol.c.

798 {
799  ResProtocol *ret;
800  HRESULT hres = S_OK;
801 
802  TRACE("(%p)->(%p %s %p)\n", iface, pUnkOuter, debugstr_guid(riid), ppv);
803 
804  ret = heap_alloc(sizeof(ResProtocol));
805  ret->IInternetProtocol_iface.lpVtbl = &ResProtocolVtbl;
806  ret->ref = 0;
807  ret->data = NULL;
808  ret->data_len = 0;
809  ret->cur = 0;
810  ret->pUnkOuter = pUnkOuter;
811 
812  if(pUnkOuter) {
813  ret->ref = 1;
815  *ppv = &ret->IInternetProtocol_iface;
816  else
817  hres = E_FAIL;
818  }else {
819  hres = IInternetProtocol_QueryInterface(&ret->IInternetProtocol_iface, riid, ppv);
820  }
821 
822  if(FAILED(hres))
823  heap_free(ret);
824 
825  return hres;
826 }
static const IInternetProtocolVtbl ResProtocolVtbl
Definition: protocol.c:780
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define E_FAIL
Definition: ddrawi.h:102
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:78
const GUID IID_IUnknown
int ret
#define S_OK
Definition: intsafe.h:59
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ ResProtocolInfo_ParseUrl()

static HRESULT WINAPI ResProtocolInfo_ParseUrl ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
PARSEACTION  ParseAction,
DWORD  dwParseFlags,
LPWSTR  pwzResult,
DWORD  cchResult,
DWORD pcchResult,
DWORD  dwReserved 
)
static

Definition at line 828 of file protocol.c.

831 {
832  TRACE("%p)->(%s %d %x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), ParseAction,
833  dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved);
834 
835  if(ParseAction == PARSE_SECURITY_URL) {
836  WCHAR file_part[MAX_PATH], full_path[MAX_PATH];
837  WCHAR *ptr;
838  DWORD size, len;
839 
840  static const WCHAR wszFile[] = {'f','i','l','e',':','/','/'};
841  static const WCHAR wszRes[] = {'r','e','s',':','/','/'};
842 
843  if(strlenW(pwzUrl) <= sizeof(wszRes)/sizeof(WCHAR) || memcmp(pwzUrl, wszRes, sizeof(wszRes)))
844  return E_INVALIDARG;
845 
846  ptr = strchrW(pwzUrl + sizeof(wszRes)/sizeof(WCHAR), '/');
847  if(!ptr)
848  return E_INVALIDARG;
849 
850  len = ptr - (pwzUrl + sizeof(wszRes)/sizeof(WCHAR));
851  if(len >= sizeof(file_part)/sizeof(WCHAR)) {
852  FIXME("Too long URL\n");
853  return MK_E_SYNTAX;
854  }
855 
856  memcpy(file_part, pwzUrl + sizeof(wszRes)/sizeof(WCHAR), len*sizeof(WCHAR));
857  file_part[len] = 0;
858 
859  len = SearchPathW(NULL, file_part, NULL, sizeof(full_path)/sizeof(WCHAR), full_path, NULL);
860  if(!len) {
861  HMODULE module;
862 
863  /* SearchPath does not work well with winelib files (like our test executable),
864  * so we also try to load the library here */
866  if(!module) {
867  WARN("Could not find file %s\n", debugstr_w(file_part));
868  return MK_E_SYNTAX;
869  }
870 
871  len = GetModuleFileNameW(module, full_path, sizeof(full_path)/sizeof(WCHAR));
873  if(!len)
874  return E_FAIL;
875  }
876 
877  size = sizeof(wszFile)/sizeof(WCHAR) + len + 1;
878  if(pcchResult)
879  *pcchResult = size;
880  if(size > cchResult)
881  return S_FALSE;
882 
883  memcpy(pwzResult, wszFile, sizeof(wszFile));
884  memcpy(pwzResult + sizeof(wszFile)/sizeof(WCHAR), full_path, (len+1)*sizeof(WCHAR));
885  return S_OK;
886  }
887 
888  if(ParseAction == PARSE_DOMAIN) {
889  if(!pcchResult)
890  return E_POINTER;
891 
892  if(pwzUrl)
893  *pcchResult = strlenW(pwzUrl)+1;
894  else
895  *pcchResult = 1;
896  return E_FAIL;
897  }
898 
899  return INET_E_DEFAULT_ACTION;
900 }
DWORD WINAPI GetModuleFileNameW(HINSTANCE hModule, LPWSTR lpFilename, DWORD nSize)
Definition: loader.c:600
HMODULE module
Definition: main.cpp:47
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
HINSTANCE WINAPI DECLSPEC_HOTPATCH LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
Definition: loader.c:288
#define WARN(fmt,...)
Definition: debug.h:112
#define E_FAIL
Definition: ddrawi.h:102
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
static const WCHAR wszFile[]
Definition: urlmon_main.c:386
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:111
static PVOID ptr
Definition: dispmode.c:27
#define S_FALSE
Definition: winerror.h:2357
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
#define FreeLibrary(x)
Definition: compat.h:414
GLsizeiptr size
Definition: glext.h:5919
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAX_PATH
Definition: compat.h:26
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
DWORD WINAPI SearchPathW(IN LPCWSTR lpPath OPTIONAL, IN LPCWSTR lpFileName, IN LPCWSTR lpExtension OPTIONAL, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart OPTIONAL)
Definition: path.c:1297
#define LOAD_LIBRARY_AS_DATAFILE
Definition: winbase.h:338
#define S_OK
Definition: intsafe.h:59
static const WCHAR wszRes[]
Definition: misc.c:323
#define MK_E_SYNTAX
Definition: winerror.h:2785
#define E_POINTER
Definition: winerror.h:2365

◆ ResProtocolInfo_QueryInfo()

static HRESULT WINAPI ResProtocolInfo_QueryInfo ( IInternetProtocolInfo iface,
LPCWSTR  pwzUrl,
QUERYOPTION  QueryOption,
DWORD  dwQueryFlags,
LPVOID  pBuffer,
DWORD  cbBuffer,
DWORD pcbBuf,
DWORD  dwReserved 
)
static

Definition at line 902 of file protocol.c.

905 {
906  TRACE("%p)->(%s %08x %08x %p %d %p %d)\n", iface, debugstr_w(pwzUrl), QueryOption, dwQueryFlags, pBuffer,
907  cbBuffer, pcbBuf, dwReserved);
908 
909  switch(QueryOption) {
910  case QUERY_USES_NETWORK:
911  if(!pBuffer || cbBuffer < sizeof(DWORD))
912  return E_FAIL;
913 
914  *(DWORD*)pBuffer = 0;
915  if(pcbBuf)
916  *pcbBuf = sizeof(DWORD);
917  break;
918 
919  case QUERY_IS_SECURE:
920  FIXME("QUERY_IS_SECURE not supported\n");
921  return E_NOTIMPL;
922  case QUERY_IS_SAFE:
923  FIXME("QUERY_IS_SAFE not supported\n");
924  return E_NOTIMPL;
925  default:
926  return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
927  }
928 
929  return S_OK;
930 }
#define E_FAIL
Definition: ddrawi.h:102
_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 FIXME(fmt,...)
Definition: debug.h:111
PVOID pBuffer
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define S_OK
Definition: intsafe.h:59
static IInternetSession DWORD
Definition: protocol.c:33
#define E_NOTIMPL
Definition: ddrawi.h:99

Variable Documentation

◆ AboutProtocolFactory

ProtocolFactory AboutProtocolFactory
static
Initial value:
= {
}
static const IClassFactoryVtbl AboutProtocolFactoryVtbl
Definition: protocol.c:488
static const IInternetProtocolInfoVtbl AboutProtocolInfoVtbl
Definition: protocol.c:478

Definition at line 496 of file protocol.c.

Referenced by ProtocolFactory_Create().

◆ AboutProtocolFactoryVtbl

const IClassFactoryVtbl AboutProtocolFactoryVtbl
static
Initial value:
= {
}
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: protocol.c:101
static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: protocol.c:364
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: protocol.c:113
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: protocol.c:107
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: protocol.c:95

Definition at line 488 of file protocol.c.

◆ AboutProtocolInfoVtbl

const IInternetProtocolInfoVtbl AboutProtocolInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: protocol.c:83
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: protocol.c:35
static HRESULT WINAPI AboutProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
Definition: protocol.c:429
static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:72
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: protocol.c:66
static HRESULT WINAPI AboutProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:397
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: protocol.c:60

Definition at line 478 of file protocol.c.

◆ AboutProtocolVtbl

const IInternetProtocolVtbl AboutProtocolVtbl
static
Initial value:
= {
}
static ULONG WINAPI AboutProtocol_Release(IInternetProtocol *iface)
Definition: protocol.c:179
static HRESULT WINAPI AboutProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: protocol.c:322
static HRESULT WINAPI AboutProtocol_UnlockRequest(IInternetProtocol *iface)
Definition: protocol.c:339
static HRESULT WINAPI AboutProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
Definition: protocol.c:330
static HRESULT WINAPI AboutProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
Definition: protocol.c:140
static HRESULT WINAPI AboutProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
Definition: protocol.c:273
static HRESULT WINAPI AboutProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: protocol.c:195
static HRESULT WINAPI AboutProtocol_Resume(IInternetProtocol *iface)
Definition: protocol.c:295
static ULONG WINAPI AboutProtocol_AddRef(IInternetProtocol *iface)
Definition: protocol.c:171
static HRESULT WINAPI AboutProtocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: protocol.c:302
static HRESULT WINAPI AboutProtocol_Suspend(IInternetProtocol *iface)
Definition: protocol.c:288
static HRESULT WINAPI AboutProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
Definition: protocol.c:281
static HRESULT WINAPI AboutProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
Definition: protocol.c:266

Definition at line 348 of file protocol.c.

Referenced by AboutProtocolFactory_CreateInstance().

◆ JSProtocolFactory

ProtocolFactory JSProtocolFactory
static
Initial value:
= {
}
static const IInternetProtocolInfoVtbl JSProtocolInfoVtbl
Definition: protocol.c:1015
static const IClassFactoryVtbl JSProtocolFactoryVtbl
Definition: protocol.c:1025

Definition at line 1033 of file protocol.c.

Referenced by ProtocolFactory_Create().

◆ JSProtocolFactoryVtbl

const IClassFactoryVtbl JSProtocolFactoryVtbl
static
Initial value:
= {
}
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: protocol.c:101
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: protocol.c:113
static HRESULT WINAPI JSProtocolFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: protocol.c:959
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: protocol.c:107
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: protocol.c:95

Definition at line 1025 of file protocol.c.

◆ JSProtocolInfoVtbl

const IInternetProtocolInfoVtbl JSProtocolInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: protocol.c:83
static HRESULT WINAPI JSProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:966
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: protocol.c:35
static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:72
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: protocol.c:66
static HRESULT WINAPI JSProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
Definition: protocol.c:987
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: protocol.c:60

Definition at line 1015 of file protocol.c.

◆ ResProtocolFactory

ProtocolFactory ResProtocolFactory
static
Initial value:
= {
}
static const IClassFactoryVtbl ResProtocolFactoryVtbl
Definition: protocol.c:942
static const IInternetProtocolInfoVtbl ResProtocolInfoVtbl
Definition: protocol.c:932

Definition at line 950 of file protocol.c.

Referenced by ProtocolFactory_Create().

◆ ResProtocolFactoryVtbl

const IClassFactoryVtbl ResProtocolFactoryVtbl
static
Initial value:
= {
}
static ULONG WINAPI ClassFactory_AddRef(IClassFactory *iface)
Definition: protocol.c:101
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
Definition: protocol.c:113
static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
Definition: protocol.c:107
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void **ppv)
Definition: protocol.c:95
static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IUnknown *pUnkOuter, REFIID riid, void **ppv)
Definition: protocol.c:796

Definition at line 942 of file protocol.c.

◆ ResProtocolInfoVtbl

const IInternetProtocolInfoVtbl ResProtocolInfoVtbl
static
Initial value:
= {
}
static HRESULT WINAPI InternetProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
Definition: protocol.c:83
static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
Definition: protocol.c:35
static HRESULT WINAPI ResProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
Definition: protocol.c:902
static HRESULT WINAPI InternetProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:72
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
Definition: protocol.c:66
static HRESULT WINAPI ResProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
Definition: protocol.c:828
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
Definition: protocol.c:60

Definition at line 932 of file protocol.c.

◆ ResProtocolVtbl

const IInternetProtocolVtbl ResProtocolVtbl
static
Initial value:
= {
}
static HRESULT WINAPI ResProtocol_UnlockRequest(IInternetProtocol *iface)
Definition: protocol.c:770
static HRESULT WINAPI ResProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
Definition: protocol.c:708
static HRESULT WINAPI ResProtocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: protocol.c:732
static HRESULT WINAPI ResProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: protocol.c:752
static HRESULT WINAPI ResProtocol_Suspend(IInternetProtocol *iface)
Definition: protocol.c:718
static HRESULT WINAPI ResProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
Definition: protocol.c:521
static ULONG WINAPI ResProtocol_Release(IInternetProtocol *iface)
Definition: protocol.c:560
static HRESULT WINAPI ResProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
Definition: protocol.c:693
static HRESULT WINAPI ResProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
Definition: protocol.c:700
static ULONG WINAPI ResProtocol_AddRef(IInternetProtocol *iface)
Definition: protocol.c:552
static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: protocol.c:576
static HRESULT WINAPI ResProtocol_Resume(IInternetProtocol *iface)
Definition: protocol.c:725
static HRESULT WINAPI ResProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
Definition: protocol.c:760

Definition at line 780 of file protocol.c.

Referenced by ResProtocolFactory_CreateInstance().