24#define NONAMELESSUNION
103 IBinding_AddRef(iface);
129 IBinding_Release(
This->binding);
140 return IBinding_Abort(
This->binding);
163 return IBinding_SetPriority(
This->binding, nPriority);
172 return IBinding_GetPriority(
This->binding, pnPriority);
185static IBindingVtbl XMLView_BindingVtbl = {
186 XMLView_Binding_QueryInterface,
187 XMLView_Binding_AddRef,
188 XMLView_Binding_Release,
189 XMLView_Binding_Abort,
190 XMLView_Binding_Suspend,
191 XMLView_Binding_Resume,
192 XMLView_Binding_SetPriority,
193 XMLView_Binding_GetPriority,
194 XMLView_Binding_GetBindResult
205 bind->IBinding_iface.lpVtbl = &XMLView_BindingVtbl;
208 bind->binding = binding;
209 IBinding_AddRef(binding);
219 IBindStatusCallback_iface);
222static HRESULT WINAPI XMLView_BindStatusCallback_QueryInterface(
231 IBindStatusCallback_AddRef(iface);
239static ULONG WINAPI XMLView_BindStatusCallback_AddRef(
250static ULONG WINAPI XMLView_BindStatusCallback_Release(
260 IStream_Release(
This->stream);
261 IBindStatusCallback_Release(
This->bsc);
262 IMoniker_Release(
This->mon);
268static HRESULT WINAPI XMLView_BindStatusCallback_OnStartBinding(
277 hres = XMLView_Binding_Create(pib, &binding);
285 IBinding_Abort(binding);
289 IBinding_Release(binding);
301static HRESULT WINAPI XMLView_BindStatusCallback_OnLowResource(
314 TRACE(
"(%p)->(%d %d %x %s)\n",
This, ulProgress, ulProgressMax,
317 switch(ulStatusCode) {
318 case BINDSTATUS_BEGINDOWNLOADDATA:
319 return IBindStatusCallback_OnProgress(
This->bsc, ulProgress,
320 ulProgressMax, ulStatusCode, szStatusText);
321 case BINDSTATUS_MIMETYPEAVAILABLE:
324 FIXME(
"ulStatusCode: %d\n", ulStatusCode);
329static HRESULT WINAPI XMLView_BindStatusCallback_OnStopBinding(
334 return IBindStatusCallback_OnStopBinding(
This->bsc, hresult, szError);
341 TRACE(
"(%p)->(%p %p)\n",
This, grfBINDF, pbindinfo);
342 return IBindStatusCallback_GetBindInfo(
This->bsc, grfBINDF, pbindinfo);
347 FORMATETC formatetc = {0,
NULL, 1, -1, TYMED_ISTREAM};
354 hres = IStream_Seek(
This->stream, off, STREAM_SEEK_CUR, &
size);
358 hres = IStream_Seek(
This->stream, off, STREAM_SEEK_SET,
NULL);
362 stgmedium.tymed = TYMED_ISTREAM;
363 stgmedium.u.pstm =
This->stream;
364 stgmedium.pUnkForRelease =
NULL;
366 hres = IBindStatusCallback_OnDataAvailable(
This->bsc,
367 BSCF_FIRSTDATANOTIFICATION|BSCF_LASTDATANOTIFICATION,
368 size.u.LowPart, &formatetc, &stgmedium);
370 IStream_Release(
This->stream);
377 FIXME(
"Error page not implemented yet.\n");
383 static const WCHAR selectW[] = {
'p',
'r',
'o',
'c',
'e',
's',
's',
'i',
'n',
'g',
'-',
384 'i',
'n',
's',
't',
'r',
'u',
'c',
't',
'i',
'o',
'n',
'(',
'\'',
'x',
'm',
'l',
385 '-',
's',
't',
'y',
'l',
'e',
's',
'h',
'e',
'e',
't',
'\'',
')',0};
386 static const WCHAR hrefW[] = {
'h',
'r',
'e',
'f',
'=',0};
388 IXMLDOMDocument3 *xml =
NULL, *xsl =
NULL;
401 hres = IStream_Seek(
This->stream, off, STREAM_SEEK_SET,
NULL);
403 return display_error_page(
This);
407 return display_error_page(
This);
411 hres = IXMLDOMDocument3_load(xml,
var, &succ);
413 IXMLDOMDocument3_Release(xml);
414 return display_error_page(
This);
419 hres = IXMLDOMDocument3_selectSingleNode(xml, bstr, &stylesheet);
422 IXMLDOMDocument3_Release(xml);
423 return display_error_page(
This);
426 hres = IXMLDOMNode_get_nodeValue(stylesheet, &
var);
427 IXMLDOMNode_Release(stylesheet);
434 IXMLDOMDocument3_Release(xml);
435 return display_error_page(
This);
441 if(*
p!=
'\'' && *
p!=
'\"')
p =
NULL;
451 IXMLDOMDocument3_Release(xml);
452 return display_error_page(
This);
458 IXMLDOMDocument3_Release(xml);
459 return display_error_page(
This);
464 hres = IMoniker_GetDisplayName(mon, pbc,
NULL, &xsl_url);
465 IMoniker_Release(mon);
466 IBindCtx_Release(pbc);
469 IXMLDOMDocument3_Release(xml);
470 return display_error_page(
This);
477 IXMLDOMDocument3_Release(xml);
478 return display_error_page(
This);
484 IXMLDOMDocument3_Release(xml);
485 return display_error_page(
This);
489 hres = IXMLDOMDocument3_load(xsl,
var, &succ);
492 IXMLDOMDocument3_Release(xsl);
493 IXMLDOMDocument3_Release(xml);
494 return display_error_page(
This);
498 IXMLDOMDocument3_Release(xsl);
499 IXMLDOMDocument3_Release(xml);
501 return display_error_page(
This);
503 hres = IStream_Seek(
This->stream, off, STREAM_SEEK_SET,
NULL);
506 return display_error_page(
This);
513 return display_error_page(
This);
518static HRESULT WINAPI XMLView_BindStatusCallback_OnDataAvailable(
520 FORMATETC *pformatetc, STGMEDIUM *pstgmed)
527 TRACE(
"(%p)->(%x %d %p %p)\n",
This, grfBSCF,
dwSize, pformatetc, pstgmed);
542 return handle_xml_load(
This);
545static HRESULT WINAPI XMLView_BindStatusCallback_OnObjectAvailable(
553static IBindStatusCallbackVtbl XMLView_BindStatusCallbackVtbl = {
554 XMLView_BindStatusCallback_QueryInterface,
555 XMLView_BindStatusCallback_AddRef,
556 XMLView_BindStatusCallback_Release,
557 XMLView_BindStatusCallback_OnStartBinding,
558 XMLView_BindStatusCallback_GetPriority,
559 XMLView_BindStatusCallback_OnLowResource,
560 XMLView_BindStatusCallback_OnProgress,
561 XMLView_BindStatusCallback_OnStopBinding,
562 XMLView_BindStatusCallback_GetBindInfo,
563 XMLView_BindStatusCallback_OnDataAvailable,
564 XMLView_BindStatusCallback_OnObjectAvailable
576 bsc->IBindStatusCallback_iface.lpVtbl = &XMLView_BindStatusCallbackVtbl;
580 IBindStatusCallback_AddRef(bsc_html);
582 IStream_AddRef(
bsc->stream);
584 IMoniker_AddRef(mon);
586 *
ret = &
bsc->IBindStatusCallback_iface;
605 IMoniker_AddRef(iface);
631 IMoniker_Release(
This->mon);
662 FIXME(
"(%p)->(%p %x)\n",
This, pStm, fClearDirty);
678 FIXME(
"(%p)->(%p %p %s %p)\n",
This, pbc, pmkToLeft,
694 *ppvObj =
This->stream;
706 FIXME(
"(%p)->(%p %d %p %p)\n",
This, pbc, dwReduceHowFar, ppmkToLeft, ppmkReduced);
714 FIXME(
"(%p)->(%p %x %p)\n",
This, pmkRight, fOnlyIfNotGeneric, ppmkComposite);
722 FIXME(
"(%p)->(%x %p)\n",
This, fForward, ppenumMoniker);
730 FIXME(
"(%p)->(%p)\n",
This, pmkOtherMoniker);
745 FIXME(
"(%p)->(%p %p %p)\n",
This, pbc, pmkToLeft, pmkNewlyRunning);
753 FIXME(
"(%p)->(%p %p %p)\n",
This, pbc, pmkToLeft, pFileTime);
768 FIXME(
"(%p)->(%p %p)\n",
This, pmkOther, ppmkPrefix);
776 FIXME(
"(%p)->(%p %p)\n",
This, pmkOther, ppmkRelPath);
784 TRACE(
"(%p)->(%p %p %p)\n",
This, pbc, pmkToLeft, ppszDisplayName);
785 return IMoniker_GetDisplayName(
This->mon, pbc, pmkToLeft, ppszDisplayName);
793 FIXME(
"(%p)->(%p %p %s %p %p)\n",
This, pbc, pmkToLeft,
794 debugstr_w(pszDisplayName), pchEaten, ppmkOut);
806static IMonikerVtbl XMLView_MonikerVtbl = {
807 XMLView_Moniker_QueryInterface,
808 XMLView_Moniker_AddRef,
809 XMLView_Moniker_Release,
810 XMLView_Moniker_GetClassID,
811 XMLView_Moniker_IsDirty,
812 XMLView_Moniker_Load,
813 XMLView_Moniker_Save,
814 XMLView_Moniker_GetSizeMax,
815 XMLView_Moniker_BindToObject,
816 XMLView_Moniker_BindToStorage,
817 XMLView_Moniker_Reduce,
818 XMLView_Moniker_ComposeWith,
819 XMLView_Moniker_Enum,
820 XMLView_Moniker_IsEqual,
821 XMLView_Moniker_Hash,
822 XMLView_Moniker_IsRunning,
823 XMLView_Moniker_GetTimeOfLastChange,
824 XMLView_Moniker_Inverse,
825 XMLView_Moniker_CommonPrefixWith,
826 XMLView_Moniker_RelativePathTo,
827 XMLView_Moniker_GetDisplayName,
828 XMLView_Moniker_ParseDisplayName,
829 XMLView_Moniker_IsSystemMoniker
841 wrap->IMoniker_iface.lpVtbl = &XMLView_MonikerVtbl;
845 IMoniker_AddRef(mon);
877 IPersistMoniker_AddRef(&
This->IPersistMoniker_iface);
900 IMoniker_Release(
This->mon);
901 IUnknown_Release(
This->html_doc);
925 static const WCHAR XSLParametersW[] = {
'X',
'S',
'L',
'P',
'a',
'r',
'a',
'm',
'e',
't',
'e',
'r',
's',0};
926 static const WCHAR XMLBufferStreamW[] = {
'X',
'M',
'L',
'B',
'u',
'f',
'f',
'e',
'r',
'S',
't',
'r',
'e',
'a',
'm',0};
927 static const WCHAR DWNBINDINFOW[] = {
'_',
'_',
'D',
'W',
'N',
'B',
'I',
'N',
'D',
'I',
'N',
'F',
'O',0};
928 static const WCHAR HTMLLOADOPTIONSW[] = {
'_',
'_',
'H',
'T',
'M',
'L',
'L',
'O',
'A',
'D',
'O',
'P',
'T',
'I',
'O',
'N',
'S',0};
929 static const WCHAR BSCBHolderW[] = {
'_',
'B',
'S',
'C',
'B',
'_',
'H',
'o',
'l',
'd',
'e',
'r',
'_',0 };
940 TRACE(
"(%p)->(%x %p %p %x)\n",
This, fFullyAvailable, pimkName, pibc, grfMode);
942 hres = IBindCtx_GetObjectParam(pibc, (
LPOLESTR)XSLParametersW, &unk);
944 FIXME(
"ignoring XSLParameters\n");
945 IUnknown_Release(unk);
947 hres = IBindCtx_GetObjectParam(pibc, (
LPOLESTR)XMLBufferStreamW, &unk);
949 FIXME(
"ignoring XMLBufferStream\n");
950 IUnknown_Release(unk);
957 hres = IBindCtx_GetObjectParam(pibc, (
LPOLESTR)DWNBINDINFOW, &unk);
959 IBindCtx_RegisterObjectParam(bindctx, (
LPOLESTR)DWNBINDINFOW, unk);
960 IUnknown_Release(unk);
962 hres = IBindCtx_GetObjectParam(pibc, (
LPOLESTR)HTMLLOADOPTIONSW, &unk);
964 IBindCtx_RegisterObjectParam(bindctx, (
LPOLESTR)HTMLLOADOPTIONSW, unk);
965 IUnknown_Release(unk);
970 IUnknown_Release(unk);
975 IBindCtx_Release(bindctx);
980 IMoniker_Release(
This->mon);
981 This->mon = pimkName;
982 IMoniker_AddRef(
This->mon);
987 IBindCtx_Release(bindctx);
991 hres = IUnknown_QueryInterface(
This->html_doc,
992 &IID_IPersistMoniker, (
void**)&html_persist_mon);
994 IMoniker_Release(mon);
996 IBindCtx_Release(bindctx);
1000 hres = IPersistMoniker_Load(html_persist_mon,
FALSE, mon, bindctx, 0);
1001 IPersistMoniker_Release(html_persist_mon);
1002 IMoniker_Release(mon);
1005 IBindCtx_Release(bindctx);
1009 hres = IBindCtx_GetObjectParam(bindctx, (
LPOLESTR)BSCBHolderW, &unk);
1010 IBindCtx_Release(bindctx);
1015 hres = IUnknown_QueryInterface(unk, &IID_IBindStatusCallback, (
void**)&bsc_html);
1016 IUnknown_Release(unk);
1025 IBindStatusCallback_OnStopBinding(bsc_html,
hres,
NULL);
1026 IBindStatusCallback_Release(bsc_html);
1031 IBindStatusCallback_Release(
bsc);
1033 IBindStatusCallback_OnStopBinding(bsc_html,
hres,
NULL);
1034 IBindStatusCallback_Release(bsc_html);
1038 hres = IMoniker_BindToStorage(pimkName, pibc,
NULL,
1039 &IID_IStream, (
void**)&
stream);
1041 IBindStatusCallback_OnStopBinding(bsc_html,
hres,
NULL);
1042 IBindStatusCallback_Release(bsc_html);
1048 IBindStatusCallback_Release(bsc_html);
1056 FIXME(
"(%p)->(%p %p %x)\n",
This, pimkName, pbc, fRemember);
1064 FIXME(
"(%p)->(%p %p)\n",
This, pimkName, pibc);
1076static IPersistMonikerVtbl XMLView_PersistMonikerVtbl = {
1077 XMLView_PersistMoniker_QueryInterface,
1078 XMLView_PersistMoniker_AddRef,
1079 XMLView_PersistMoniker_Release,
1080 XMLView_PersistMoniker_GetClassID,
1081 XMLView_PersistMoniker_IsDirty,
1082 XMLView_PersistMoniker_Load,
1083 XMLView_PersistMoniker_Save,
1084 XMLView_PersistMoniker_SaveCompleted,
1085 XMLView_PersistMoniker_GetCurMoniker
1097 return IPersistMoniker_QueryInterface(&
This->IPersistMoniker_iface,
riid,
ppvObject);
1103 return IPersistMoniker_AddRef(&
This->IPersistMoniker_iface);
1109 return IPersistMoniker_Release(&
This->IPersistMoniker_iface);
1124 FIXME(
"(%p)->(%p %p)\n",
This, pStream, pbc);
1136static HRESULT WINAPI XMLView_PersistHistory_SetPositionCookie(
1140 FIXME(
"(%p)->(%d)\n",
This, dwPositioncookie);
1144static HRESULT WINAPI XMLView_PersistHistory_GetPositionCookie(
1148 FIXME(
"(%p)->(%p)\n",
This, pdwPositioncookie);
1152static IPersistHistoryVtbl XMLView_PersistHistoryVtbl = {
1153 XMLView_PersistHistory_QueryInterface,
1154 XMLView_PersistHistory_AddRef,
1155 XMLView_PersistHistory_Release,
1156 XMLView_PersistHistory_GetClassID,
1157 XMLView_PersistHistory_LoadHistory,
1158 XMLView_PersistHistory_SaveHistory,
1159 XMLView_PersistHistory_SetPositionCookie,
1160 XMLView_PersistHistory_GetPositionCookie
1168static HRESULT WINAPI XMLView_OleCommandTarget_QueryInterface(
1172 return IPersistMoniker_QueryInterface(&
This->IPersistMoniker_iface,
riid,
ppvObject);
1178 return IPersistMoniker_AddRef(&
This->IPersistMoniker_iface);
1184 return IPersistMoniker_Release(&
This->IPersistMoniker_iface);
1188 const GUID *pguidCmdGroup,
ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
1191 FIXME(
"(%p)->(%p %x %p %p)\n",
This, pguidCmdGroup, cCmds, prgCmds, pCmdText);
1200 FIXME(
"(%p)->(%p %d %x %p %p)\n",
This, pguidCmdGroup,
1201 nCmdID, nCmdexecopt, pvaIn, pvaOut);
1205static IOleCommandTargetVtbl XMLView_OleCommandTargetVtbl = {
1206 XMLView_OleCommandTarget_QueryInterface,
1207 XMLView_OleCommandTarget_AddRef,
1208 XMLView_OleCommandTarget_Release,
1209 XMLView_OleCommandTarget_QueryStatus,
1210 XMLView_OleCommandTarget_Exec
1222 return IPersistMoniker_QueryInterface(&
This->IPersistMoniker_iface,
riid,
ppvObject);
1228 return IPersistMoniker_AddRef(&
This->IPersistMoniker_iface);
1234 return IPersistMoniker_Release(&
This->IPersistMoniker_iface);
1241 FIXME(
"(%p)->(%p)\n",
This, pClientSite);
1249 FIXME(
"(%p)->(%p)\n",
This, ppClientSite);
1254 LPCOLESTR szContainerApp, LPCOLESTR szContainerObj)
1264 FIXME(
"(%p)->(%x)\n",
This, dwSaveOption);
1272 FIXME(
"(%p)->(%x %p)\n",
This, dwWhichMoniker, pmk);
1280 FIXME(
"(%p)->(%x %x %p)\n",
This, dwAssign, dwWhichMoniker, ppmk);
1305 FIXME(
"(%p)->(%d %p %p %d %p %p)\n",
This, iVerb, lpmsg,
1306 pActiveSite, lindex,
hwndParent, lprcPosRect);
1314 FIXME(
"(%p)->{%p)\n",
This, ppEnumOleVerb);
1343 FIXME(
"(%p)->(%x %p)\n",
This, dwFormOfType, pszUserType);
1351 FIXME(
"(%p)->(%x %p)\n",
This, dwDrawAspect, psizel);
1359 FIXME(
"(%p)->(%x %p)\n",
This, dwDrawAspect, psizel);
1367 FIXME(
"(%p)->(%p %p)\n",
This, pAdvSink, pdwConnection);
1375 FIXME(
"(%p)->(%d)\n",
This, dwConnection);
1383 FIXME(
"(%p)->(%p)\n",
This, ppenumAdvise);
1391 FIXME(
"(%p)->(%d %p)\n",
This, dwAspect, pdwStatus);
1403static IOleObjectVtbl XMLView_OleObjectVtbl = {
1404 XMLView_OleObject_QueryInterface,
1405 XMLView_OleObject_AddRef,
1406 XMLView_OleObject_Release,
1407 XMLView_OleObject_SetClientSite,
1408 XMLView_OleObject_GetClientSite,
1409 XMLView_OleObject_SetHostNames,
1410 XMLView_OleObject_Close,
1411 XMLView_OleObject_SetMoniker,
1412 XMLView_OleObject_GetMoniker,
1413 XMLView_OleObject_InitFromData,
1414 XMLView_OleObject_GetClipboardData,
1415 XMLView_OleObject_DoVerb,
1416 XMLView_OleObject_EnumVerbs,
1417 XMLView_OleObject_Update,
1418 XMLView_OleObject_IsUpToDate,
1419 XMLView_OleObject_GetUserClassID,
1420 XMLView_OleObject_GetUserType,
1421 XMLView_OleObject_SetExtent,
1422 XMLView_OleObject_GetExtent,
1423 XMLView_OleObject_Advise,
1424 XMLView_OleObject_Unadvise,
1425 XMLView_OleObject_EnumAdvise,
1426 XMLView_OleObject_GetMiscStatus,
1427 XMLView_OleObject_SetColorScheme
1435 TRACE(
"(%p)\n", ppObj);
1437 This = heap_alloc_zero(
sizeof(*
This));
1441 This->IPersistMoniker_iface.lpVtbl = &XMLView_PersistMonikerVtbl;
1442 This->IPersistHistory_iface.lpVtbl = &XMLView_PersistHistoryVtbl;
1443 This->IOleCommandTarget_iface.lpVtbl = &XMLView_OleCommandTargetVtbl;
1444 This->IOleObject_iface.lpVtbl = &XMLView_OleObjectVtbl;
1454 *ppObj = &
This->IPersistMoniker_iface;
1462 MESSAGE(
"This program tried to use a XMLView object, but\n"
1463 "libxml2 support was not present at compile time.\n");
static BOOL heap_free(void *mem)
#define InterlockedIncrement
#define InterlockedDecrement
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
static void report_data(Binding *This, DWORD bscf, ULONG progress, ULONG progress_max)
static Binding * impl_from_IBinding(IBinding *iface)
HRESULT DOMDocument_create(MSXML_VERSION version, void **ppObj)
HRESULT XMLView_create(void **ppObj)
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT WINAPI CreateStreamOnHGlobal(HGLOBAL hGlobal, BOOL fDeleteOnRelease, LPSTREAM *ppstm)
static DocHost * impl_from_IOleCommandTarget(IOleCommandTarget *iface)
#define wrap(journal, var)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR selectW[]
VOID WINAPI CoTaskMemFree(LPVOID ptr)
static HlinkImpl * impl_from_IBindStatusCallback(IBindStatusCallback *iface)
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
IHTMLDocument2 * html_doc
static IBindStatusCallbackEx bsc
static const WCHAR SZ_HTML_CLIENTSITE_OBJECTPARAM[]
static HTMLDocument * impl_from_IPersistHistory(IPersistHistory *iface)
static HTMLDocument * impl_from_IPersistMoniker(IPersistMoniker *iface)
_In_ HANDLE _In_ DWORD _In_ DWORD _Inout_opt_ LPOVERLAPPED _In_opt_ LPTRANSMIT_FILE_BUFFERS _In_ DWORD dwReserved
_In_ UINT _In_ DWORD _Out_ DWORD * pdwResult
interface IBindCtx * LPBC
HRESULT WINAPI CreateBindCtx(DWORD reserved, LPBC *ppbc)
BSTR WINAPI SysAllocString(LPCOLESTR str)
UINT WINAPI SysStringLen(BSTR str)
void WINAPI DECLSPEC_HOTPATCH SysFreeString(BSTR str)
const GUID IID_IOleObject
static WebBrowser * impl_from_IOleObject(IOleObject *iface)
const GUID IID_IPersistStream
#define IsEqualGUID(rguid1, rguid2)
INT WSAAPI bind(IN SOCKET s, IN CONST struct sockaddr *name, IN INT namelen)
#define CONTAINING_RECORD(address, type, field)
HRESULT WINAPI CreateURLMonikerEx(IMoniker *pmkContext, LPCWSTR szURL, IMoniker **ppmk, DWORD dwFlags)
HRESULT WINAPI RegisterBindStatusCallback(IBindCtx *pbc, IBindStatusCallback *pbsc, IBindStatusCallback **ppbscPrevious, DWORD dwReserved)
HRESULT WINAPI DECLSPEC_HOTPATCH VariantClear(VARIANTARG *pVarg)
_Reserved_ DWORD * pdwReserved
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject