ReactOS  0.4.14-dev-77-gd9e7c48
mk.c File Reference
#include "urlmon_main.h"
#include "wine/debug.h"
#include "shlwapi.h"
Include dependency graph for mk.c:

Go to the source code of this file.

Classes

struct  MkProtocol
 

Macros

#define NO_SHLWAPI_REG
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (urlmon)
 
static MkProtocolimpl_from_IUnknown (IUnknown *iface)
 
static MkProtocolimpl_from_IInternetProtocolEx (IInternetProtocolEx *iface)
 
static HRESULT WINAPI MkProtocolUnk_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MkProtocolUnk_AddRef (IUnknown *iface)
 
static ULONG WINAPI MkProtocolUnk_Release (IUnknown *iface)
 
static HRESULT WINAPI MkProtocol_QueryInterface (IInternetProtocolEx *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI MkProtocol_AddRef (IInternetProtocolEx *iface)
 
static ULONG WINAPI MkProtocol_Release (IInternetProtocolEx *iface)
 
static HRESULT report_result (IInternetProtocolSink *sink, HRESULT hres, DWORD dwError)
 
static HRESULT WINAPI MkProtocol_Start (IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
 
static HRESULT WINAPI MkProtocol_Continue (IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
 
static HRESULT WINAPI MkProtocol_Abort (IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
 
static HRESULT WINAPI MkProtocol_Terminate (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI MkProtocol_Suspend (IInternetProtocolEx *iface)
 
static HRESULT WINAPI MkProtocol_Resume (IInternetProtocolEx *iface)
 
static HRESULT WINAPI MkProtocol_Read (IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
 
static HRESULT WINAPI MkProtocol_Seek (IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
 
static HRESULT WINAPI MkProtocol_LockRequest (IInternetProtocolEx *iface, DWORD dwOptions)
 
static HRESULT WINAPI MkProtocol_UnlockRequest (IInternetProtocolEx *iface)
 
static HRESULT WINAPI MkProtocol_StartEx (IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
 
HRESULT MkProtocol_Construct (IUnknown *outer, void **ppv)
 

Variables

static const IUnknownVtbl MkProtocolUnkVtbl
 
static const IInternetProtocolExVtbl MkProtocolVtbl
 

Macro Definition Documentation

◆ NO_SHLWAPI_REG

#define NO_SHLWAPI_REG

Definition at line 22 of file mk.c.

Function Documentation

◆ impl_from_IInternetProtocolEx()

static MkProtocol* impl_from_IInternetProtocolEx ( IInternetProtocolEx iface)
inlinestatic

Definition at line 42 of file mk.c.

43 {
44  return CONTAINING_RECORD(iface, MkProtocol, IInternetProtocolEx_iface);
45 }
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
Definition: mk.c:27

Referenced by MkProtocol_Abort(), MkProtocol_AddRef(), MkProtocol_Continue(), MkProtocol_LockRequest(), MkProtocol_QueryInterface(), MkProtocol_Read(), MkProtocol_Release(), MkProtocol_Resume(), MkProtocol_Seek(), MkProtocol_Start(), MkProtocol_StartEx(), MkProtocol_Suspend(), MkProtocol_Terminate(), and MkProtocol_UnlockRequest().

◆ impl_from_IUnknown()

static MkProtocol* impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 37 of file mk.c.

38 {
39  return CONTAINING_RECORD(iface, MkProtocol, IUnknown_outer);
40 }
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
Definition: mk.c:27

Referenced by MkProtocolUnk_AddRef(), MkProtocolUnk_QueryInterface(), and MkProtocolUnk_Release().

◆ MkProtocol_Abort()

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

Definition at line 162 of file mk.c.

164 {
166  FIXME("(%p)->(%08x %08x)\n", This, hrReason, dwOptions);
167  return E_NOTIMPL;
168 }
DWORD dwOptions
Definition: solitaire.cpp:23
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: mk.c:27
#define E_NOTIMPL
Definition: ddrawi.h:99
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_AddRef()

static ULONG WINAPI MkProtocol_AddRef ( IInternetProtocolEx iface)
static

Definition at line 113 of file mk.c.

114 {
116  TRACE("(%p)\n", This);
117  return IUnknown_AddRef(This->outer);
118 }
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Construct()

HRESULT MkProtocol_Construct ( IUnknown outer,
void **  ppv 
)

Definition at line 365 of file mk.c.

366 {
367  MkProtocol *ret;
368 
369  TRACE("(%p %p)\n", outer, ppv);
370 
372 
373  ret = heap_alloc(sizeof(MkProtocol));
374 
375  ret->IUnknown_outer.lpVtbl = &MkProtocolUnkVtbl;
376  ret->IInternetProtocolEx_iface.lpVtbl = &MkProtocolVtbl;
377  ret->ref = 1;
378  ret->outer = outer ? outer : &ret->IUnknown_outer;
379  ret->stream = NULL;
380 
381  /* NOTE:
382  * Native returns NULL ppobj and S_OK in CreateInstance if called with IID_IUnknown riid and no outer.
383  */
384  *ppv = &ret->IUnknown_outer;
385  return S_OK;
386 }
static const IUnknownVtbl MkProtocolUnkVtbl
Definition: mk.c:100
REFIID LPVOID * ppv
Definition: atlbase.h:39
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
smooth NULL
Definition: ftsmooth.c:416
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
int ret
#define S_OK
Definition: intsafe.h:59
static const IInternetProtocolExVtbl MkProtocolVtbl
Definition: mk.c:348
static void URLMON_LockModule(void)
Definition: urlmon_main.h:67

◆ MkProtocol_Continue()

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

Definition at line 155 of file mk.c.

156 {
158  FIXME("(%p)->(%p)\n", This, pProtocolData);
159  return E_NOTIMPL;
160 }
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: mk.c:27
#define E_NOTIMPL
Definition: ddrawi.h:99
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_LockRequest()

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

Definition at line 214 of file mk.c.

215 {
217 
218  TRACE("(%p)->(%08x)\n", This, dwOptions);
219 
220  return S_OK;
221 }
DWORD dwOptions
Definition: solitaire.cpp:23
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_QueryInterface()

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

Definition at line 106 of file mk.c.

107 {
109  TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
110  return IUnknown_QueryInterface(This->outer, riid, ppv);
111 }
REFIID riid
Definition: precomp.h:44
REFIID LPVOID * ppv
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Read()

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

Definition at line 193 of file mk.c.

195 {
197 
198  TRACE("(%p)->(%p %u %p)\n", This, pv, cb, pcbRead);
199 
200  if(!This->stream)
201  return E_FAIL;
202 
203  return IStream_Read(This->stream, pv, cb, pcbRead);
204 }
#define E_FAIL
Definition: ddrawi.h:102
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
static DWORD cb
Definition: integrity.c:41
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Release()

static ULONG WINAPI MkProtocol_Release ( IInternetProtocolEx iface)
static

Definition at line 120 of file mk.c.

121 {
123  TRACE("(%p)\n", This);
124  return IUnknown_Release(This->outer);
125 }
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Resume()

static HRESULT WINAPI MkProtocol_Resume ( IInternetProtocolEx iface)
static

Definition at line 186 of file mk.c.

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

◆ MkProtocol_Seek()

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

Definition at line 206 of file mk.c.

208 {
210  FIXME("(%p)->(%d %d %p)\n", This, dlibMove.u.LowPart, dwOrigin, plibNewPosition);
211  return E_NOTIMPL;
212 }
struct _LARGE_INTEGER::@2201 u
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: mk.c:27
#define E_NOTIMPL
Definition: ddrawi.h:99
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Start()

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

Definition at line 133 of file mk.c.

136 {
138  HRESULT hres;
139  IUri *uri;
140 
141  TRACE("(%p)->(%s %p %p %08x %lx)\n", This, debugstr_w(szUrl), pOIProtSink,
142  pOIBindInfo, grfPI, dwReserved);
143 
144  hres = CreateUri(szUrl, 0, 0, &uri);
145  if(FAILED(hres))
146  return hres;
147 
148  hres = IInternetProtocolEx_StartEx(&This->IInternetProtocolEx_iface, uri, pOIProtSink,
149  pOIBindInfo, grfPI, (HANDLE*)dwReserved);
150 
151  IUri_Release(uri);
152  return hres;
153 }
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
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42
HRESULT WINAPI CreateUri(LPCWSTR pwzURI, DWORD dwFlags, DWORD_PTR dwReserved, IUri **ppURI)
Definition: uri.c:5701

◆ MkProtocol_StartEx()

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

Definition at line 232 of file mk.c.

235 {
237  LPWSTR mime, progid, display_name, colon_ptr;
238  DWORD bindf=0, eaten=0, scheme=0, len;
239  BSTR url, path = NULL;
240  IParseDisplayName *pdn;
241  BINDINFO bindinfo;
242  STATSTG statstg;
243  IMoniker *mon;
244  HRESULT hres;
245  CLSID clsid;
246 
247  TRACE("(%p)->(%p %p %p %08x %p)\n", This, pUri, pOIProtSink,
248  pOIBindInfo, grfPI, dwReserved);
249 
250  hres = IUri_GetScheme(pUri, &scheme);
251  if(FAILED(hres))
252  return hres;
253  if(scheme != URL_SCHEME_MK)
254  return INET_E_INVALID_URL;
255 
256  memset(&bindinfo, 0, sizeof(bindinfo));
257  bindinfo.cbSize = sizeof(BINDINFO);
258  hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &bindf, &bindinfo);
259  if(FAILED(hres)) {
260  WARN("GetBindInfo failed: %08x\n", hres);
261  return hres;
262  }
263 
264  ReleaseBindInfo(&bindinfo);
265 
266  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_SENDINGREQUEST, NULL);
267 
268  hres = IUri_GetDisplayUri(pUri, &url);
269  if(FAILED(hres))
270  return hres;
271  hres = FindMimeFromData(NULL, url, NULL, 0, NULL, 0, &mime, 0);
273  if(SUCCEEDED(hres)) {
274  IInternetProtocolSink_ReportProgress(pOIProtSink, BINDSTATUS_MIMETYPEAVAILABLE, mime);
276  }
277 
278  hres = IUri_GetPath(pUri, &path);
279  if(FAILED(hres))
280  return hres;
281  len = SysStringLen(path)+1;
283  if (FAILED(hres)) {
285  return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, ERROR_INVALID_PARAMETER);
286  }
287 
288  progid = path+1; /* skip '@' symbol */
289  colon_ptr = strchrW(path, ':');
290  if(!colon_ptr) {
292  return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, ERROR_INVALID_PARAMETER);
293  }
294 
295  len = strlenW(path);
296  display_name = heap_alloc((len+1)*sizeof(WCHAR));
297  memcpy(display_name, path, (len+1)*sizeof(WCHAR));
298 
299  progid[colon_ptr-progid] = 0; /* overwrite ':' with NULL terminator */
302  if(FAILED(hres))
303  {
304  heap_free(display_name);
305  return report_result(pOIProtSink, INET_E_RESOURCE_NOT_FOUND, ERROR_INVALID_PARAMETER);
306  }
307 
308  hres = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
309  &IID_IParseDisplayName, (void**)&pdn);
310  if(FAILED(hres)) {
311  WARN("Could not create object %s\n", debugstr_guid(&clsid));
312  heap_free(display_name);
313  return report_result(pOIProtSink, hres, ERROR_INVALID_PARAMETER);
314  }
315 
316  hres = IParseDisplayName_ParseDisplayName(pdn, NULL /* FIXME */, display_name, &eaten, &mon);
317  heap_free(display_name);
318  IParseDisplayName_Release(pdn);
319  if(FAILED(hres)) {
320  WARN("ParseDisplayName failed: %08x\n", hres);
321  return report_result(pOIProtSink, hres, ERROR_INVALID_PARAMETER);
322  }
323 
324  if(This->stream) {
325  IStream_Release(This->stream);
326  This->stream = NULL;
327  }
328 
329  hres = IMoniker_BindToStorage(mon, NULL /* FIXME */, NULL, &IID_IStream, (void**)&This->stream);
330  IMoniker_Release(mon);
331  if(FAILED(hres)) {
332  WARN("BindToStorage failed: %08x\n", hres);
333  return report_result(pOIProtSink, hres, ERROR_INVALID_PARAMETER);
334  }
335 
336  hres = IStream_Stat(This->stream, &statstg, STATFLAG_NONAME);
337  if(FAILED(hres)) {
338  WARN("Stat failed: %08x\n", hres);
339  return report_result(pOIProtSink, hres, ERROR_INVALID_PARAMETER);
340  }
341 
342  IInternetProtocolSink_ReportData(pOIProtSink,
343  BSCF_FIRSTDATANOTIFICATION | BSCF_LASTDATANOTIFICATION,
344  statstg.cbSize.u.LowPart, statstg.cbSize.u.LowPart);
345  return report_result(pOIProtSink, S_OK, ERROR_SUCCESS);
346 }
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:422
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
#define ERROR_SUCCESS
Definition: deptool.c:10
const WCHAR * mime
Definition: mimefilter.c:512
WINE_UNICODE_INLINE WCHAR * strchrW(const WCHAR *str, WCHAR ch)
Definition: unicode.h:248
#define URL_UNESCAPE_INPLACE
Definition: shlwapi.h:1224
void WINAPI ReleaseBindInfo(BINDINFO *pbindinfo)
Definition: urlmon_main.c:572
#define WARN(fmt,...)
Definition: debug.h:111
DWORD scheme
OLECHAR * BSTR
Definition: compat.h:1934
HRESULT WINAPI DECLSPEC_HOTPATCH CLSIDFromProgID(LPCOLESTR progid, LPCLSID clsid)
Definition: compobj.c:2511
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
HRESULT WINAPI UrlUnescapeW(LPWSTR pszUrl, LPWSTR pszUnescaped, LPDWORD pcchUnescaped, DWORD dwFlags)
Definition: url.c:1367
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
Definition: mswsock.h:90
smooth NULL
Definition: ftsmooth.c:416
const GUID IID_IParseDisplayName
#define debugstr_guid
Definition: kernel32.h:35
Definition: mk.c:27
#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:77
static const WCHAR url[]
Definition: encode.c:1432
unsigned long DWORD
Definition: ntddk_ex.h:95
REFCLSID clsid
Definition: msctf.c:84
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
UINT WINAPI SysStringLen(BSTR str)
Definition: oleaut.c:199
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3234
#define S_OK
Definition: intsafe.h:59
Definition: services.c:325
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
Definition: oleaut.c:274
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42
#define progid(str)
Definition: exdisp.idl:31
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 HRESULT report_result(IInternetProtocolSink *sink, HRESULT hres, DWORD dwError)
Definition: mk.c:127
static BOOL heap_free(void *mem)
Definition: appwiz.h:75
static DWORD bindf
Definition: protocol.c:70

◆ MkProtocol_Suspend()

static HRESULT WINAPI MkProtocol_Suspend ( IInternetProtocolEx iface)
static

Definition at line 179 of file mk.c.

180 {
182  FIXME("(%p)\n", This);
183  return E_NOTIMPL;
184 }
#define FIXME(fmt,...)
Definition: debug.h:110
Definition: mk.c:27
#define E_NOTIMPL
Definition: ddrawi.h:99
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_Terminate()

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

Definition at line 170 of file mk.c.

171 {
173 
174  TRACE("(%p)->(%08x)\n", This, dwOptions);
175 
176  return S_OK;
177 }
DWORD dwOptions
Definition: solitaire.cpp:23
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocol_UnlockRequest()

static HRESULT WINAPI MkProtocol_UnlockRequest ( IInternetProtocolEx iface)
static

Definition at line 223 of file mk.c.

224 {
226 
227  TRACE("(%p)\n", This);
228 
229  return S_OK;
230 }
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define S_OK
Definition: intsafe.h:59
static MkProtocol * impl_from_IInternetProtocolEx(IInternetProtocolEx *iface)
Definition: mk.c:42

◆ MkProtocolUnk_AddRef()

static ULONG WINAPI MkProtocolUnk_AddRef ( IUnknown iface)
static

Definition at line 73 of file mk.c.

74 {
77  TRACE("(%p) ref=%d\n", This, ref);
78  return ref;
79 }
static MkProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: mk.c:37
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
Definition: mk.c:27
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53

◆ MkProtocolUnk_QueryInterface()

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

Definition at line 47 of file mk.c.

48 {
50 
52  TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
53  *ppv = &This->IUnknown_outer;
54  }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) {
55  TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv);
56  *ppv = &This->IInternetProtocolEx_iface;
57  }else if(IsEqualGUID(&IID_IInternetProtocol, riid)) {
58  TRACE("(%p)->(IID_IInternetProtocol %p)\n", This, ppv);
59  *ppv = &This->IInternetProtocolEx_iface;
60  }else if(IsEqualGUID(&IID_IInternetProtocolEx, riid)) {
61  TRACE("(%p)->(IID_IInternetProtocolEx %p)\n", This, ppv);
62  *ppv = &This->IInternetProtocolEx_iface;
63  }else {
64  *ppv = NULL;
65  WARN("not supported interface %s\n", debugstr_guid(riid));
66  return E_NOINTERFACE;
67  }
68 
69  IUnknown_AddRef((IUnknown*)*ppv);
70  return S_OK;
71 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
static MkProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: mk.c:37
#define WARN(fmt,...)
Definition: debug.h:111
REFIID LPVOID * ppv
Definition: atlbase.h:39
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
Definition: mk.c:27
#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

◆ MkProtocolUnk_Release()

static ULONG WINAPI MkProtocolUnk_Release ( IUnknown iface)
static

Definition at line 81 of file mk.c.

82 {
85 
86  TRACE("(%p) ref=%d\n", This, ref);
87 
88  if(!ref) {
89  if(This->stream)
90  IStream_Release(This->stream);
91 
92  heap_free(This);
93 
95  }
96 
97  return ref;
98 }
static MkProtocol * impl_from_IUnknown(IUnknown *iface)
Definition: mk.c:37
Definition: send.c:47
long LONG
Definition: pedump.c:60
GLenum GLint ref
Definition: glext.h:6028
Definition: mk.c:27
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

◆ report_result()

static HRESULT report_result ( IInternetProtocolSink sink,
HRESULT  hres,
DWORD  dwError 
)
static

Definition at line 127 of file mk.c.

128 {
129  IInternetProtocolSink_ReportResult(sink, hres, dwError, NULL);
130  return hres;
131 }
GLsizei GLenum GLboolean sink
Definition: glext.h:5672
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465

Referenced by MkProtocol_StartEx().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( urlmon  )

Variable Documentation

◆ MkProtocolUnkVtbl

const IUnknownVtbl MkProtocolUnkVtbl
static
Initial value:
= {
}
static ULONG WINAPI MkProtocolUnk_AddRef(IUnknown *iface)
Definition: mk.c:73
static ULONG WINAPI MkProtocolUnk_Release(IUnknown *iface)
Definition: mk.c:81
static HRESULT WINAPI MkProtocolUnk_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
Definition: mk.c:47

Definition at line 100 of file mk.c.

Referenced by MkProtocol_Construct().

◆ MkProtocolVtbl

const IInternetProtocolExVtbl MkProtocolVtbl
static
Initial value:
= {
}
static HRESULT WINAPI MkProtocol_Suspend(IInternetProtocolEx *iface)
Definition: mk.c:179
static HRESULT WINAPI MkProtocol_LockRequest(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: mk.c:214
static ULONG WINAPI MkProtocol_Release(IInternetProtocolEx *iface)
Definition: mk.c:120
static HRESULT WINAPI MkProtocol_Seek(IInternetProtocolEx *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
Definition: mk.c:206
static HRESULT WINAPI MkProtocol_StartEx(IInternetProtocolEx *iface, IUri *pUri, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE *dwReserved)
Definition: mk.c:232
static HRESULT WINAPI MkProtocol_Resume(IInternetProtocolEx *iface)
Definition: mk.c:186
static HRESULT WINAPI MkProtocol_Read(IInternetProtocolEx *iface, void *pv, ULONG cb, ULONG *pcbRead)
Definition: mk.c:193
static HRESULT WINAPI MkProtocol_Terminate(IInternetProtocolEx *iface, DWORD dwOptions)
Definition: mk.c:170
static ULONG WINAPI MkProtocol_AddRef(IInternetProtocolEx *iface)
Definition: mk.c:113
static HRESULT WINAPI MkProtocol_Continue(IInternetProtocolEx *iface, PROTOCOLDATA *pProtocolData)
Definition: mk.c:155
static HRESULT WINAPI MkProtocol_Start(IInternetProtocolEx *iface, LPCWSTR szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
Definition: mk.c:133
static HRESULT WINAPI MkProtocol_UnlockRequest(IInternetProtocolEx *iface)
Definition: mk.c:223
static HRESULT WINAPI MkProtocol_QueryInterface(IInternetProtocolEx *iface, REFIID riid, void **ppv)
Definition: mk.c:106
static HRESULT WINAPI MkProtocol_Abort(IInternetProtocolEx *iface, HRESULT hrReason, DWORD dwOptions)
Definition: mk.c:162

Definition at line 348 of file mk.c.

Referenced by MkProtocol_Construct().