20#define NONAMELESSUNION
91 r->mhtml_len =
p -
r->mhtml;
109 IInternetProtocolSink_Release(
protocol->sink);
124 hres = IMimeMessage_FindFirst(mime_message, &
find, &
body);
131 hres = IMimeMessage_FindNext(mime_message, &
find, &
body);
138 hres = IMimeMessage_GetBodyProp(mime_message,
body,
"content-location", 0, &
value);
139 if(
hres == MIME_E_NOT_FOUND)
148 hres = IMimeMessage_FindNext(mime_message, &
find, &
body);
155 hres = IMimeMessage_BindToObject(mime_message,
body, &IID_IMimeBody, (
void**)&mime_body);
160 hres = IMimeBody_GetProp(mime_body,
"content-type", 0, &
value);
162 hres = IInternetProtocolSink_ReportProgress(
protocol->sink, BINDSTATUS_MIMETYPEAVAILABLE,
value.u.pwszVal);
168 hres = IMimeBody_GetData(mime_body, IET_DECODED, &
protocol->stream);
172 IInternetProtocolSink_ReportData(
protocol->sink, BSCF_FIRSTDATANOTIFICATION
173 | BSCF_INTERMEDIATEDATANOTIFICATION
174 | BSCF_LASTDATANOTIFICATION
175 | BSCF_DATAFULLYAVAILABLE
176 | BSCF_AVAILABLEDATASIZEUNKNOWN, 0, 0);
190 IMimeMessage_InitNew(mime_message);
192 hres = IMimeMessage_Load(mime_message,
stream);
194 IMimeMessage_Release(mime_message);
214 *
ppv = &
This->IBindStatusCallback_iface;
216 TRACE(
"(%p)->(IID_IBindStatusCallback %p)\n",
This,
ppv);
217 *
ppv = &
This->IBindStatusCallback_iface;
247 IInternetProtocol_Release(&
This->protocol->IInternetProtocol_iface);
249 IStream_Release(
This->stream);
281 TRACE(
"(%p)->(%u/%u %u %s)\n",
This, ulProgress, ulProgressMax, ulStatusCode,
debugstr_w(szStatusText));
294 IStream_Release(
This->stream);
298 This->status = hresult;
306 IMimeMessage_Release(mime_message);
307 IInternetProtocol_Release(&
This->protocol->IInternetProtocol_iface);
313 DWORD* grfBINDF, BINDINFO* pbindinfo)
319 *grfBINDF = BINDF_ASYNCHRONOUS;
324 DWORD dwSize, FORMATETC* pformatetc, STGMEDIUM* pstgmed)
333 assert(pstgmed->tymed == TYMED_ISTREAM);
380 *
ppv = &
This->IInternetProtocol_iface;
382 TRACE(
"(%p)->(IID_IInternetProtocolRoot %p)\n",
This,
ppv);
383 *
ppv = &
This->IInternetProtocol_iface;
386 *
ppv = &
This->IInternetProtocol_iface;
388 TRACE(
"(%p)->(IID_IInternetProtocolInfo %p)\n",
This,
ppv);
389 *
ppv = &
This->IInternetProtocolInfo_iface;
419 IInternetProtocolSink_Release(
This->sink);
421 IStream_Release(
This->stream);
443 return IUnknown_QueryInterface(
This->outer_unk,
riid,
ppv);
449 return IUnknown_AddRef(
This->outer_unk);
455 return IUnknown_Release(
This->outer_unk);
463 BINDINFO bindinfo = {
sizeof(bindinfo) };
481 hres = IInternetBindInfo_GetBindInfo(pOIBindInfo, &
bindf, &bindinfo);
483 WARN(
"GetBindInfo failed: %08x\n",
hres);
486 if((
bindf & (BINDF_ASYNCHRONOUS|BINDF_FROMURLMON|BINDF_NEEDFILE)) != (BINDF_ASYNCHRONOUS|BINDF_FROMURLMON|BINDF_NEEDFILE))
489 IInternetProtocolSink_AddRef(
This->sink = pOIProtSink);
495 binding->
url[
url.mhtml_len] = 0;
511 IMoniker_Release(mon);
516 IInternetProtocol_AddRef(&
This->IInternetProtocol_iface);
519 hres = IMoniker_BindToStorage(mon, bind_ctx,
NULL, &IID_IStream, (
void**)&
stream);
520 IBindCtx_Release(bind_ctx);
521 IMoniker_Release(mon);
534 FIXME(
"(%p)->(%p)\n",
This, pProtocolData);
572 TRACE(
"(%p)->(%p %u %p)\n",
This, pv,
cb, pcbRead);
587 FIXME(
"(%p)->(%d %d %p)\n",
This, dlibMove.
u.LowPart, dwOrigin, plibNewPosition);
629 return IUnknown_QueryInterface(
This->outer_unk,
riid,
ppv);
635 return IUnknown_AddRef(
This->outer_unk);
641 return IUnknown_Release(
This->outer_unk);
650 dwParseFlags, pwzResult, cchResult, pcchResult,
dwReserved);
651 return INET_E_DEFAULT_ACTION;
665 debugstr_w(pwzRelativeUrl), dwCombineFlags, pwzResult, cchResult,
673 FIXME(
"Relative URL is mhtml protocol\n");
674 return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
680 if(
len >= cchResult) {
689 if(*pwzRelativeUrl) {
716 return INET_E_USE_DEFAULT_PROTOCOLHANDLER;
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static HRESULT load_mime_message(IStream *stream, IMimeMessage **ret)
static HRESULT parse_mhtml_url(const WCHAR *url, mhtml_url_t *r)
static HRESULT WINAPI MimeHtmlProtocolInfo_CombineUrl(IInternetProtocolInfo *iface, LPCWSTR pwzBaseUrl, LPCWSTR pwzRelativeUrl, DWORD dwCombineFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
static ULONG WINAPI MimeHtmlProtocol_Release(IUnknown *iface)
static HRESULT on_mime_message_available(MimeHtmlProtocol *protocol, IMimeMessage *mime_message)
static HRESULT WINAPI MimeHtmlProtocol_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static MimeHtmlBinding * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
static ULONG WINAPI BindStatusCallback_AddRef(IBindStatusCallback *iface)
static HRESULT WINAPI MimeHtmlProtocol_Continue(IInternetProtocol *iface, PROTOCOLDATA *pProtocolData)
static const IUnknownVtbl MimeHtmlProtocolInnerVtbl
static HRESULT WINAPI MimeHtmlProtocolInfo_QueryInfo(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, QUERYOPTION QueryOption, DWORD dwQueryFlags, LPVOID pBuffer, DWORD cbBuffer, DWORD *pcbBuf, DWORD dwReserved)
static HRESULT WINAPI BindStatusCallback_OnObjectAvailable(IBindStatusCallback *iface, REFIID riid, IUnknown *punk)
static HRESULT WINAPI BindStatusCallback_OnDataAvailable(IBindStatusCallback *iface, DWORD grfBSCF, DWORD dwSize, FORMATETC *pformatetc, STGMEDIUM *pstgmed)
static ULONG WINAPI MimeHtmlProtocolInfo_Release(IInternetProtocolInfo *iface)
static HRESULT WINAPI MimeHtmlProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl, PARSEACTION ParseAction, DWORD dwParseFlags, LPWSTR pwzResult, DWORD cchResult, DWORD *pcchResult, DWORD dwReserved)
static ULONG WINAPI BindStatusCallback_Release(IBindStatusCallback *iface)
static LPWSTR heap_strdupW(LPCWSTR str)
static HRESULT WINAPI MimeHtmlProtocolInfo_CompareUrl(IInternetProtocolInfo *iface, LPCWSTR pwzUrl1, LPCWSTR pwzUrl2, DWORD dwCompareFlags)
static HRESULT WINAPI BindStatusCallback_GetBindInfo(IBindStatusCallback *iface, DWORD *grfBINDF, BINDINFO *pbindinfo)
static const IBindStatusCallbackVtbl BindStatusCallbackVtbl
static ULONG WINAPI InternetProtocol_Release(IInternetProtocol *iface)
static HRESULT WINAPI BindStatusCallback_GetPriority(IBindStatusCallback *iface, LONG *pnPriority)
static const IInternetProtocolInfoVtbl MimeHtmlProtocolInfoVtbl
static HRESULT WINAPI MimeHtmlProtocol_Seek(IInternetProtocol *iface, LARGE_INTEGER dlibMove, DWORD dwOrigin, ULARGE_INTEGER *plibNewPosition)
static HRESULT WINAPI MimeHtmlProtocol_Start(IInternetProtocol *iface, const WCHAR *szUrl, IInternetProtocolSink *pOIProtSink, IInternetBindInfo *pOIBindInfo, DWORD grfPI, HANDLE_PTR dwReserved)
static HRESULT WINAPI MimeHtmlProtocolInfo_QueryInterface(IInternetProtocolInfo *iface, REFIID riid, void **ppv)
static ULONG WINAPI MimeHtmlProtocolInfo_AddRef(IInternetProtocolInfo *iface)
static const WCHAR mhtml_prefixW[]
static ULONG WINAPI MimeHtmlProtocol_AddRef(IUnknown *iface)
static MimeHtmlProtocol * impl_from_IInternetProtocol(IInternetProtocol *iface)
static MimeHtmlProtocol * impl_from_IUnknown(IUnknown *iface)
static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *iface, HRESULT hresult, LPCWSTR szError)
HRESULT MimeHtmlProtocol_create(IUnknown *outer, void **obj)
static HRESULT WINAPI MimeHtmlProtocol_UnlockRequest(IInternetProtocol *iface)
static HRESULT WINAPI BindStatusCallback_OnStartBinding(IBindStatusCallback *iface, DWORD dwReserved, IBinding *pib)
static ULONG WINAPI InternetProtocol_AddRef(IInternetProtocol *iface)
static HRESULT report_result(MimeHtmlProtocol *protocol, HRESULT result)
static const IInternetProtocolVtbl MimeHtmlProtocolVtbl
static HRESULT WINAPI MimeHtmlProtocol_Read(IInternetProtocol *iface, void *pv, ULONG cb, ULONG *pcbRead)
static MimeHtmlProtocol * impl_from_IInternetProtocolInfo(IInternetProtocolInfo *iface)
static HRESULT WINAPI BindStatusCallback_OnProgress(IBindStatusCallback *iface, ULONG ulProgress, ULONG ulProgressMax, ULONG ulStatusCode, LPCWSTR szStatusText)
static HRESULT WINAPI MimeHtmlProtocol_Abort(IInternetProtocol *iface, HRESULT hrReason, DWORD dwOptions)
static HRESULT WINAPI BindStatusCallback_OnLowResource(IBindStatusCallback *iface, DWORD dwReserved)
static const WCHAR mhtml_separatorW[]
static HRESULT WINAPI MimeHtmlProtocol_LockRequest(IInternetProtocol *iface, DWORD dwOptions)
static HRESULT WINAPI MimeHtmlProtocol_Suspend(IInternetProtocol *iface)
static HRESULT WINAPI MimeHtmlProtocol_Terminate(IInternetProtocol *iface, DWORD dwOptions)
static HRESULT WINAPI InternetProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv)
static HRESULT WINAPI MimeHtmlProtocol_Resume(IInternetProtocol *iface)
static HRESULT WINAPI BindStatusCallback_QueryInterface(IBindStatusCallback *iface, REFIID riid, void **ppv)
int WINAPI lstrcmpW(LPCWSTR str1, LPCWSTR str2)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
HRESULT WINAPI PropVariantClear(PROPVARIANT *pvar)
GLdouble GLdouble GLdouble r
GLenum GLuint GLenum GLsizei const GLchar * buf
HRESULT MimeMessage_create(IUnknown *outer, void **obj) DECLSPEC_HIDDEN
#define memcpy(s1, s2, n)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
static HMODULE MODULEINFO DWORD cb
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
#define IsEqualGUID(rguid1, rguid2)
_Check_return_ _CRTIMP int __cdecl wcsncmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
_Check_return_ _CRTIMP int __cdecl _wcsnicmp(_In_reads_or_z_(_MaxCount) const wchar_t *_Str1, _In_reads_or_z_(_MaxCount) const wchar_t *_Str2, _In_ size_t _MaxCount)
static const void * body(MD5_CTX *ctx, const void *data, unsigned long size)
IBindStatusCallback IBindStatusCallback_iface
MimeHtmlProtocol * protocol
IInternetProtocol IInternetProtocol_iface
IInternetProtocolSink * sink
IInternetProtocolInfo IInternetProtocolInfo_iface
#define FIELD_OFFSET(t, f)
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI CreateURLMoniker(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk)
struct _LARGE_INTEGER::@2299 u
HRESULT WINAPI CreateAsyncBindCtx(DWORD reserved, IBindStatusCallback *callback, IEnumFORMATETC *format, IBindCtx **pbind)