diff --git a/configure b/configure index f67b913ce9d..ddfc4358c4d 100755 --- a/configure +++ b/configure @@ -16712,7 +16712,7 @@ MAKE_LIB_RULES=libs/Makelib.rules MAKE_PROG_RULES=programs/Makeprog.rules - ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile miscemu/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wrc/Makefile" + ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3dx8/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput8/Makefile dlls/dmband/Makefile dlls/dmcompos/Makefile dlls/dmime/Makefile dlls/dmloader/Makefile dlls/dmscript/Makefile dlls/dmstyle/Makefile dlls/dmsynth/Makefile dlls/dmusic/Makefile dlls/dmusic32/Makefile dlls/dplay/Makefile dlls/dplayx/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/icmp/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/mapi32/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrtd/Makefile dlls/msvideo/Makefile dlls/msvideo/msrle32/Makefile dlls/mswsock/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/odbc32/Makefile dlls/ole32/Makefile dlls/oleacc/Makefile dlls/oleaut32/Makefile dlls/oleaut32/tests/Makefile dlls/olecli/Makefile dlls/oledlg/Makefile dlls/olepro32/Makefile dlls/olesvr/Makefile dlls/opengl32/Makefile dlls/psapi/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/rasapi32/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/serialui/Makefile dlls/setupapi/Makefile dlls/shdocvw/Makefile dlls/shell32/Makefile dlls/shell32/tests/Makefile dlls/shfolder/Makefile dlls/shlwapi/Makefile dlls/shlwapi/tests/Makefile dlls/snmpapi/Makefile dlls/sti/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/version/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mcianim/Makefile dlls/winmm/mciavi/Makefile dlls/winmm/mcicda/Makefile dlls/winmm/mciseq/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/midimap/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/winenas/Makefile dlls/winmm/winejack/Makefile dlls/winmm/wineoss/Makefile dlls/winnls/Makefile dlls/winsock/Makefile dlls/winsock/tests/Makefile dlls/winspool/Makefile dlls/winspool/tests/Makefile dlls/wintab32/Makefile dlls/wintrust/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/x11drv/Makefile documentation/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/uuid/Makefile libs/wine/Makefile libs/wpp/Makefile miscemu/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/notepad/Makefile programs/osversioncheck/Makefile programs/progman/Makefile programs/regapi/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/regtest/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winevdm/Makefile programs/winhelp/Makefile programs/winver/Makefile server/Makefile tools/Makefile tools/widl/Makefile tools/winapi/Makefile tools/winebuild/Makefile tools/winedump/Makefile tools/wmc/Makefile tools/wrc/Makefile" cat >confcache <<\_ACEOF @@ -17302,6 +17302,7 @@ do "dlls/msacm/msg711/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/msg711/Makefile" ;; "dlls/msacm/winemp3/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msacm/winemp3/Makefile" ;; "dlls/msdmo/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msdmo/Makefile" ;; + "dlls/mshtml/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/mshtml/Makefile" ;; "dlls/msi/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msi/Makefile" ;; "dlls/msimg32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msimg32/Makefile" ;; "dlls/msisys/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/msisys/Makefile" ;; diff --git a/configure.ac b/configure.ac index 05a06df6d21..a7df4cac47e 100644 --- a/configure.ac +++ b/configure.ac @@ -1452,6 +1452,7 @@ dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/winemp3/Makefile dlls/msdmo/Makefile +dlls/mshtml/Makefile dlls/msi/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile diff --git a/dlls/Makefile.in b/dlls/Makefile.in index eea9cd4837e..1abc45ff7f2 100644 --- a/dlls/Makefile.in +++ b/dlls/Makefile.in @@ -58,6 +58,7 @@ BASEDIRS = \ msacm/msg711 \ msacm/winemp3 \ msdmo \ + mshtml \ msi \ msimg32 \ msisys \ @@ -248,6 +249,7 @@ SYMLINKS = \ msadp32.acm$(DLLEXT) \ msdmo.dll$(DLLEXT) \ msg711.acm$(DLLEXT) \ + mshtml.dll$(DLLEXT) \ msi.dll$(DLLEXT) \ msimg32.dll$(DLLEXT) \ msisys.ocx$(DLLEXT) \ @@ -484,6 +486,9 @@ msdmo.dll$(DLLEXT): msdmo/msdmo.dll$(DLLEXT) msg711.acm$(DLLEXT): msacm/msg711/msg711.acm$(DLLEXT) $(RM) $@ && $(LN_S) msacm/msg711/msg711.acm$(DLLEXT) $@ +mshtml.dll$(DLLEXT): mshtml/mshtml.dll$(DLLEXT) + $(RM) $@ && $(LN_S) mshtml/mshtml.dll$(DLLEXT) $@ + msi.dll$(DLLEXT): msi/msi.dll$(DLLEXT) $(RM) $@ && $(LN_S) msi/msi.dll$(DLLEXT) $@ @@ -724,6 +729,7 @@ IMPORT_LIBS = \ libmpr \ libmsacm32 \ libmsdmo \ + libmshtml \ libmsi \ libmsimg32 \ libmsnet32 \ @@ -1000,6 +1006,11 @@ libmsdmo.def: msdmo/msdmo.spec.def libmsdmo.a: msdmo/msdmo.spec.def $(DLLTOOL) -k -l $@ -d msdmo/msdmo.spec.def +libmshtml.def: mshtml/mshtml.spec.def + $(RM) $@ && $(LN_S) mshtml/mshtml.spec.def $@ +libmshtml.a: mshtml/mshtml.spec.def + $(DLLTOOL) -k -l $@ -d mshtml/mshtml.spec.def + libmsi.def: msi/msi.spec.def $(RM) $@ && $(LN_S) msi/msi.spec.def $@ libmsi.a: msi/msi.spec.def @@ -1319,6 +1330,7 @@ mapi32/mapi32.spec.def: $(WINEBUILD) mpr/mpr.spec.def: $(WINEBUILD) msacm/msacm32.spec.def: $(WINEBUILD) msdmo/msdmo.spec.def: $(WINEBUILD) +mshtml/mshtml.spec.def: $(WINEBUILD) msi/msi.spec.def: $(WINEBUILD) msimg32/msimg32.spec.def: $(WINEBUILD) msnet32/msnet32.spec.def: $(WINEBUILD) @@ -1436,6 +1448,7 @@ msacm/msacm32.dll$(DLLEXT): msacm msacm/msadp32/msadp32.acm$(DLLEXT): msacm/msadp32 msdmo/msdmo.dll$(DLLEXT): msdmo msacm/msg711/msg711.acm$(DLLEXT): msacm/msg711 +mshtml/mshtml.dll$(DLLEXT): mshtml msi/msi.dll$(DLLEXT): msi msimg32/msimg32.dll$(DLLEXT): msimg32 msisys/msisys.ocx$(DLLEXT): msisys diff --git a/dlls/mshtml/.cvsignore b/dlls/mshtml/.cvsignore new file mode 100644 index 00000000000..18b485b409e --- /dev/null +++ b/dlls/mshtml/.cvsignore @@ -0,0 +1,4 @@ +Makefile +mshtml.dll.dbg.c +mshtml.spec.c +mshtml.spec.def diff --git a/dlls/mshtml/Makefile.in b/dlls/mshtml/Makefile.in new file mode 100644 index 00000000000..fcfaa473628 --- /dev/null +++ b/dlls/mshtml/Makefile.in @@ -0,0 +1,19 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = mshtml.dll +IMPORTS = user32 advapi32 kernel32 ntdll +EXTRALIBS = $(LIBUNICODE) $(LIBUUID) +EXTRADEFS = -DCOM_NO_WINDOWS_H + +LDDLLFLAGS = @LDDLLFLAGS@ +SYMBOLFILE = $(MODULE).tmp.o + +C_SRCS = \ + document.c \ + main.c + +@MAKE_DLL_RULES@ + +### Dependencies: diff --git a/dlls/mshtml/document.c b/dlls/mshtml/document.c new file mode 100644 index 00000000000..ce9e74e64d1 --- /dev/null +++ b/dlls/mshtml/document.c @@ -0,0 +1,767 @@ +/* + * HTML Document class + * + * Copyright 2003 Mike McCormack + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "winuser.h" +#include "winnls.h" +#include "docobj.h" +#include "ole2.h" +#include "uuids.h" +#include "urlmon.h" +#include "oleidl.h" +#include "objidl.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mshtml); + +typedef struct _HTMLDocument_impl { + ICOM_VTABLE(IPersistMoniker) *IPersistMoniker_vtbl; + ICOM_VTABLE(IPersistFile) *IPersistFile_vtbl; + ICOM_VTABLE(IPersist) *IPersist_vtbl; + ICOM_VTABLE(IOleObject) *IOleObject_vtbl; + ICOM_VTABLE(IViewObject) *IViewObject_vtbl; + ICOM_VTABLE(IOleDocument) *IOleDocument_vtbl; + ULONG ref_count; + IOleClientSite *site; +} HTMLDocument_impl; + + +static ULONG WINAPI HTMLDocument_AddRef(HTMLDocument_impl *This) +{ + return ++This->ref_count; +} + +static ULONG WINAPI HTMLDocument_Release(HTMLDocument_impl *This) +{ + ULONG count; + + count = --This->ref_count ; + if( !count ) + HeapFree( GetProcessHeap(), 0, This ); + + return count; +} + +static HRESULT WINAPI HTMLDocument_QueryInterface( + HTMLDocument_impl *This, REFIID riid, LPVOID *ppv) +{ + TRACE("%p %s %p\n", This, debugstr_guid(riid), ppv); + + if( IsEqualGUID( riid, &IID_IUnknown ) ) + { + TRACE("returning IUnknown\n"); + HTMLDocument_AddRef(This); + *ppv = This; + return S_OK; + } + if( IsEqualGUID( riid, &IID_IPersistMoniker ) ) + { + TRACE("returning IPersistMoniker\n"); + HTMLDocument_AddRef(This); + *ppv = This; + return S_OK; + } + if( IsEqualGUID( riid, &IID_IPersistFile ) ) + { + TRACE("returning IPersistFile\n"); + HTMLDocument_AddRef(This); + *ppv = &(This->IPersistFile_vtbl); + return S_OK; + } + if( IsEqualGUID( riid, &IID_IOleObject ) ) + { + TRACE("returning IOleObject\n"); + HTMLDocument_AddRef(This); + *ppv = &(This->IOleObject_vtbl); + return S_OK; + } + if( IsEqualGUID( riid, &IID_IPersist ) ) + { + TRACE("returning IPersist\n"); + HTMLDocument_AddRef(This); + *ppv = &(This->IPersist_vtbl); + return S_OK; + } + if( IsEqualGUID( riid, &IID_IViewObject ) ) + { + TRACE("returning IViewObject\n"); + HTMLDocument_AddRef(This); + *ppv = &(This->IViewObject_vtbl); + return S_OK; + } + if( IsEqualGUID( riid, &IID_IOleDocument ) ) + { + TRACE("returning IOleDocument\n"); + HTMLDocument_AddRef(This); + *ppv = &(This->IOleDocument_vtbl); + return S_OK; + } + if( IsEqualGUID( riid, &IID_IDispatch ) ) + { + TRACE("returning IDispatch\n"); + } + if( IsEqualGUID( riid, &IID_IOleCommandTarget ) ) + { + TRACE("returning IOleCommandTarget\n"); + } + return E_NOINTERFACE; +} + +static HRESULT WINAPI fnIPersistMoniker_QueryInterface( + IPersistMoniker *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static ULONG WINAPI fnIPersistMoniker_AddRef(IPersistMoniker *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIPersistMoniker_Release(IPersistMoniker *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIPersistMoniker_GetClassID(IPersistMoniker *iface, + CLSID *pClassID ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + FIXME("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistMoniker_IsDirty(IPersistMoniker *iface ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + FIXME("%p\n", This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistMoniker_Load(IPersistMoniker *iface, + BOOL fFullyAvailable, IMoniker *pimkName, LPBC pibc, DWORD grfMode ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + IStream *stm; + HRESULT r; + unsigned char buffer[0x201]; + ULONG count; + + TRACE("%p %d %p %p %08lx\n", This, + fFullyAvailable, pimkName, pibc, grfMode); + + r = IMoniker_BindToStorage( pimkName, pibc, NULL, + &IID_IStream, (LPVOID*) &stm ); + if( FAILED( r ) ) + { + TRACE("IMoniker_BindToStorage failed %08lx\n", r); + return r; + } + + while( 1 ) + { + r = IStream_Read( stm, buffer, sizeof buffer-1, &count); + if( FAILED( r ) ) + break; + if( count == 0 ) + break; + buffer[count]=0; + TRACE("%s\n",buffer); + } + + IStream_Release( stm ); + + return S_OK; +} + +static HRESULT WINAPI fnIPersistMoniker_Save(IPersistMoniker *iface, + IMoniker *pinkName, LPBC pibc, BOOL fRemember ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + FIXME("%p %p %p %d\n", This, pinkName, pibc, fRemember); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistMoniker_SaveCompleted(IPersistMoniker *iface, + IMoniker *pinkName, LPBC pibc ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + FIXME("%p %p %p\n", This, pinkName, pibc); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistMoniker_GetCurMoniker(IPersistMoniker *iface, + IMoniker **pinkName ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistMoniker_vtbl, iface); + FIXME("%p\n", This); + return E_NOTIMPL; +} + +static ICOM_VTABLE(IPersistMoniker) IPersistMoniker_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIPersistMoniker_QueryInterface, + fnIPersistMoniker_AddRef, + fnIPersistMoniker_Release, + fnIPersistMoniker_GetClassID, + fnIPersistMoniker_IsDirty, + fnIPersistMoniker_Load, + fnIPersistMoniker_Save, + fnIPersistMoniker_SaveCompleted, + fnIPersistMoniker_GetCurMoniker +}; + +static ULONG WINAPI fnIPersistFile_AddRef(IPersistFile *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIPersistFile_Release(IPersistFile *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIPersistFile_QueryInterface( + IPersistFile *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static HRESULT WINAPI fnIPersistFile_GetClassID(IPersistFile *iface, + CLSID *pClassID ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + + TRACE("%p\n", This); + + memcpy( pClassID, &CLSID_HTMLDocument, sizeof CLSID_HTMLDocument); + return S_OK; +} + +static HRESULT WINAPI fnIPersistFile_IsDirty(IPersistFile *iface ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistFile_Load(IPersistFile *iface, + LPCOLESTR pszFileName, DWORD grfMode ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + FIXME("%p %s %08lx\n", This, debugstr_w(pszFileName), grfMode); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistFile_Save(IPersistFile *iface, + LPCOLESTR pszFileName, BOOL fRemember ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + FIXME("%p %s %d\n", This, debugstr_w(pszFileName), fRemember); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistFile_SaveCompleted(IPersistFile *iface, + LPCOLESTR pszFileName ) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + FIXME("%p %s\n", This, debugstr_w(pszFileName)); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIPersistFile_GetCurFile(IPersistFile *iface, + LPOLESTR* ppszFileName) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersistFile_vtbl, iface); + FIXME("%p %p\n",This,ppszFileName); + return E_NOTIMPL; +} + +static ICOM_VTABLE(IPersistFile) IPersistFile_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIPersistFile_QueryInterface, + fnIPersistFile_AddRef, + fnIPersistFile_Release, + fnIPersistFile_GetClassID, + fnIPersistFile_IsDirty, + fnIPersistFile_Load, + fnIPersistFile_Save, + fnIPersistFile_SaveCompleted, + fnIPersistFile_GetCurFile, +}; + +static ULONG WINAPI fnIOleObject_AddRef(IOleObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIOleObject_Release(IOleObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIOleObject_QueryInterface( + IOleObject *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static HRESULT WINAPI fnIOleObject_SetClientSite(IOleObject *iface, + IOleClientSite *pClientSite) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + + TRACE("%p %p\n",This, pClientSite); + + if( This->site ) + IOleClientSite_Release( This->site ); + if( pClientSite ) + IOleClientSite_AddRef(pClientSite); + This->site = pClientSite; + + return S_OK; +} + +static HRESULT WINAPI fnIOleObject_GetClientSite(IOleObject *iface, + IOleClientSite **ppClientSite) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + + TRACE("%p\n",This); + + if( This->site ) + IOleClientSite_AddRef( This->site ); + *ppClientSite = This->site; + + return S_OK; +} + +static HRESULT WINAPI fnIOleObject_SetHostNames(IOleObject *iface, + LPCOLESTR szContainerApp, LPCOLESTR szContainerObj) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_Close(IOleObject *iface, + DWORD dwSaveOption) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_SetMoniker(IOleObject *iface, + DWORD dwWhichMoniker, IMoniker *pmk) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetMoniker(IOleObject *iface, + DWORD dwAssign, DWORD dwWhichMoniker, IMoniker **ppmk) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_InitFromData(IOleObject *iface, + IDataObject *pDataObject, BOOL fCreation, DWORD dwReserved) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetClipboardData(IOleObject *iface, + DWORD dwReserved, IDataObject **ppDataObject) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_DoVerb(IOleObject *iface, + LONG iVerb, struct tagMSG *lpmsg, IOleClientSite *pActiveSite, + LONG lindex, HWND hwndParent, LPCRECT lprcPosRect) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + + TRACE("%p %ld %p %p %ld %p %p\n", This, + iVerb, lpmsg, pActiveSite, lindex, hwndParent, lprcPosRect); + + switch( iVerb ) + { + case OLEIVERB_SHOW: + TRACE("OLEIVERB_SHOW r = (%ld,%ld)-(%ld,%ld)\n", + lprcPosRect->left, lprcPosRect->top, + lprcPosRect->right, lprcPosRect->bottom ); + break; + } + + /*return E_NOTIMPL; */ + return S_OK; +} + +static HRESULT WINAPI fnIOleObject_EnumVerbs(IOleObject *iface, + IEnumOLEVERB **ppEnumOleVerb) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_Update(IOleObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_IsUpToDate(IOleObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetUserClassID(IOleObject *iface, + CLSID *pClsid) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetUserType(IOleObject *iface, + DWORD dwFormOfType, LPOLESTR *pszUserType) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_SetExtent(IOleObject *iface, + DWORD dwDrawAspect, SIZEL *psizel) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetExtent(IOleObject *iface, + DWORD dwDrawAspect, SIZEL *psizel) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_Advise(IOleObject *iface, + IAdviseSink *pAdvSink, DWORD *pdwConnection) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_Unadvise(IOleObject *iface, + DWORD dwConnection) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_EnumAdvise(IOleObject *iface, + IEnumSTATDATA **ppenumAdvise) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_GetMiscStatus(IOleObject *iface, + DWORD dwAspect, DWORD *pdwStatus) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleObject_SetColorScheme(IOleObject *iface, + struct tagLOGPALETTE *pLogpal) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleObject_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static ICOM_VTABLE(IOleObject) IOleObject_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIOleObject_QueryInterface, + fnIOleObject_AddRef, + fnIOleObject_Release, + fnIOleObject_SetClientSite, + fnIOleObject_GetClientSite, + fnIOleObject_SetHostNames, + fnIOleObject_Close, + fnIOleObject_SetMoniker, + fnIOleObject_GetMoniker, + fnIOleObject_InitFromData, + fnIOleObject_GetClipboardData, + fnIOleObject_DoVerb, + fnIOleObject_EnumVerbs, + fnIOleObject_Update, + fnIOleObject_IsUpToDate, + fnIOleObject_GetUserClassID, + fnIOleObject_GetUserType, + fnIOleObject_SetExtent, + fnIOleObject_GetExtent, + fnIOleObject_Advise, + fnIOleObject_Unadvise, + fnIOleObject_EnumAdvise, + fnIOleObject_GetMiscStatus, + fnIOleObject_SetColorScheme, +}; + +static ULONG WINAPI fnIPersist_AddRef(IPersist *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersist_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIPersist_Release(IPersist *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersist_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIPersist_QueryInterface( + IPersist *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersist_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static HRESULT WINAPI fnIPersist_GetClassID( + IPersist *iface, CLSID * pClassID) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IPersist_vtbl, iface); + TRACE("%p %p\n", This, pClassID ); + memcpy( pClassID, &CLSID_HTMLDocument, sizeof CLSID_HTMLDocument); + return S_OK; +} + +static ICOM_VTABLE(IPersist) IPersist_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIPersist_QueryInterface, + fnIPersist_AddRef, + fnIPersist_Release, + fnIPersist_GetClassID, +}; + +static ULONG WINAPI fnIViewObject_AddRef(IViewObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIViewObject_Release(IViewObject *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIViewObject_QueryInterface( + IViewObject *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static HRESULT WINAPI fnIViewObject_Draw( IViewObject *iface, + DWORD dwDrawAspect, LONG lindex, void *pvAspect, + DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, + LPCRECTL lprcBounds, LPCRECTL lprcWBounds, + BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR dwContinue), + DWORD dwContinue) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIViewObject_GetColorSet( IViewObject *iface, + DWORD dwDrawAspect, LONG lindex, void *pvAspect, + DVTARGETDEVICE *ptd, HDC hicTargetDevice, + struct tagLOGPALETTE **ppColorSet) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIViewObject_Freeze( IViewObject *iface, + DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIViewObject_Unfreeze( IViewObject *iface, + DWORD dwFreeze) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIViewObject_SetAdvise( IViewObject *iface, + DWORD aspects, DWORD advf, IAdviseSink *pAdvSink) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIViewObject_GetAdvise( IViewObject *iface, + DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IViewObject_vtbl, iface); + FIXME("%p\n",This); + return E_NOTIMPL; +} + + +static ICOM_VTABLE(IViewObject) IViewObject_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIViewObject_QueryInterface, + fnIViewObject_AddRef, + fnIViewObject_Release, + fnIViewObject_Draw, + fnIViewObject_GetColorSet, + fnIViewObject_Freeze, + fnIViewObject_Unfreeze, + fnIViewObject_SetAdvise, + fnIViewObject_GetAdvise, +}; + +static ULONG WINAPI fnIOleDocument_AddRef(IOleDocument *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + return HTMLDocument_AddRef(This); +} + +static ULONG WINAPI fnIOleDocument_Release(IOleDocument *iface) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + return HTMLDocument_Release(This); +} + +static HRESULT WINAPI fnIOleDocument_QueryInterface( + IOleDocument *iface, REFIID riid, LPVOID *ppv) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + return HTMLDocument_QueryInterface(This, riid, ppv); +} + +static HRESULT WINAPI fnIOleDocument_CreateView(IOleDocument *iface, + IOleInPlaceSite *pIPSite, IStream *pstm, DWORD dwReserved, + IOleDocumentView **ppView) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleDocument_GetDocMiscStatus(IOleDocument *iface, + DWORD *pdwStatus) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static HRESULT WINAPI fnIOleDocument_EnumViews(IOleDocument *iface, + IEnumOleDocumentViews **ppEnum, IOleDocumentView **ppView) +{ + ICOM_THIS_MULTI(HTMLDocument_impl, IOleDocument_vtbl, iface); + TRACE("%p\n",This); + return E_NOTIMPL; +} + +static ICOM_VTABLE(IOleDocument) IOleDocument_vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + fnIOleDocument_QueryInterface, + fnIOleDocument_AddRef, + fnIOleDocument_Release, + fnIOleDocument_CreateView, + fnIOleDocument_GetDocMiscStatus, + fnIOleDocument_EnumViews, +}; + +HRESULT HTMLDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj) +{ + HTMLDocument_impl *This; + + TRACE("%p %p\n",pUnkOuter,ppObj); + + This = HeapAlloc(GetProcessHeap(), 0, sizeof (HTMLDocument_impl)); + This->IPersistMoniker_vtbl = &IPersistMoniker_vtbl; + This->IPersistFile_vtbl = &IPersistFile_vtbl; + This->IOleObject_vtbl = &IOleObject_vtbl; + This->IPersist_vtbl = &IPersist_vtbl; + This->IViewObject_vtbl = &IViewObject_vtbl; + This->IOleDocument_vtbl = &IOleDocument_vtbl; + This->ref_count = 1; + This->site = NULL; + + *ppObj = (LPVOID) This; + + TRACE("(%p) <- %p\n", ppObj, This); + + return S_OK; +} diff --git a/dlls/mshtml/main.c b/dlls/mshtml/main.c new file mode 100644 index 00000000000..6dad70b91cf --- /dev/null +++ b/dlls/mshtml/main.c @@ -0,0 +1,198 @@ +/* + * MSHTML Class Factory + * + * Copyright 2002 Lionel Ulmer + * Copyright 2003 Mike McCormack + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "config.h" + +#include + +#include "windef.h" +#include "winbase.h" +#include "ole2.h" + +#include "uuids.h" + +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(mshtml); + +extern HRESULT HTMLDocument_create(IUnknown *pUnkOuter, LPVOID *ppObj); + +/* For the moment, do nothing here. */ +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv) +{ + switch(fdwReason) { + case DLL_PROCESS_ATTACH: + DisableThreadLibraryCalls(hInstDLL); + break; + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + +/****************************************************************************** + * MSHTML ClassFactory + */ +typedef struct { + IClassFactory ITF_IClassFactory; + + DWORD ref; + HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); +} IClassFactoryImpl; + +struct object_creation_info +{ + const CLSID *clsid; + LPCSTR szClassName; + HRESULT (*pfnCreateInstance)(IUnknown *pUnkOuter, LPVOID *ppObj); +}; + +static const struct object_creation_info object_creation[] = +{ + { &CLSID_HTMLDocument, "HTMLDocument", HTMLDocument_create }, +}; + +static HRESULT WINAPI +HTMLCF_QueryInterface(LPCLASSFACTORY iface,REFIID riid,LPVOID *ppobj) +{ + ICOM_THIS(IClassFactoryImpl,iface); + + if (IsEqualGUID(riid, &IID_IUnknown) + || IsEqualGUID(riid, &IID_IClassFactory)) + { + IClassFactory_AddRef(iface); + *ppobj = This; + return S_OK; + } + + WARN("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppobj); + return E_NOINTERFACE; +} + +static ULONG WINAPI HTMLCF_AddRef(LPCLASSFACTORY iface) { + ICOM_THIS(IClassFactoryImpl,iface); + return ++(This->ref); +} + +static ULONG WINAPI HTMLCF_Release(LPCLASSFACTORY iface) { + ICOM_THIS(IClassFactoryImpl,iface); + + ULONG ref = --This->ref; + + if (ref == 0) + HeapFree(GetProcessHeap(), 0, This); + + return ref; +} + + +static HRESULT WINAPI HTMLCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, + REFIID riid, LPVOID *ppobj) { + ICOM_THIS(IClassFactoryImpl,iface); + HRESULT hres; + LPUNKNOWN punk; + + TRACE("(%p)->(%p,%s,%p)\n",This,pOuter,debugstr_guid(riid),ppobj); + + hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk); + if (FAILED(hres)) { + *ppobj = NULL; + return hres; + } + hres = IUnknown_QueryInterface(punk, riid, ppobj); + if (FAILED(hres)) { + *ppobj = NULL; + return hres; + } + IUnknown_Release(punk); + return hres; +} + +static HRESULT WINAPI HTMLCF_LockServer(LPCLASSFACTORY iface,BOOL dolock) { + ICOM_THIS(IClassFactoryImpl,iface); + FIXME("(%p)->(%d),stub!\n",This,dolock); + return S_OK; +} + +static ICOM_VTABLE(IClassFactory) HTMLCF_Vtbl = +{ + ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE + HTMLCF_QueryInterface, + HTMLCF_AddRef, + HTMLCF_Release, + HTMLCF_CreateInstance, + HTMLCF_LockServer +}; + + +HRESULT WINAPI MSHTML_DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv) +{ + int i; + IClassFactoryImpl *factory; + + TRACE("%s %s %p\n",debugstr_guid(rclsid), debugstr_guid(iid), ppv); + + if ( !IsEqualGUID( &IID_IClassFactory, iid ) + && ! IsEqualGUID( &IID_IUnknown, iid) ) + return E_NOINTERFACE; + + for (i=0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++) + { + if (IsEqualGUID(object_creation[i].clsid, rclsid)) + break; + } + + if (i == sizeof(object_creation)/sizeof(object_creation[0])) + { + FIXME("%s: no class found.\n", debugstr_guid(rclsid)); + return CLASS_E_CLASSNOTAVAILABLE; + } + + TRACE("Creating a class factory for %s\n",object_creation[i].szClassName); + + factory = HeapAlloc(GetProcessHeap(), 0, sizeof(*factory)); + if (factory == NULL) return E_OUTOFMEMORY; + + factory->ITF_IClassFactory.lpVtbl = &HTMLCF_Vtbl; + factory->ref = 1; + + factory->pfnCreateInstance = object_creation[i].pfnCreateInstance; + + *ppv = &(factory->ITF_IClassFactory); + + TRACE("(%p) <- %p\n", ppv, &(factory->ITF_IClassFactory) ); + + return S_OK; +} + +HRESULT WINAPI MSHTML_DllCanUnloadNow(void) +{ + FIXME("\n"); + return S_FALSE; +} + +/* appears to have the same prototype as WinMain */ +INT WINAPI RunHTMLApplication( HINSTANCE hinst, HINSTANCE hPrevInst, + LPCSTR szCmdLine, INT nCmdShow ) +{ + FIXME("%p %p %s %d\n", hinst, hPrevInst, debugstr_a(szCmdLine), nCmdShow ); + return 0; +} diff --git a/dlls/mshtml/mshtml.spec b/dlls/mshtml/mshtml.spec new file mode 100644 index 00000000000..a5effc01406 --- /dev/null +++ b/dlls/mshtml/mshtml.spec @@ -0,0 +1,22 @@ + +1 stub PrintHTML +2 stub SvrTri_ClearCache +3 stub CreateHTMLPropertyPage +4 stdcall -private DllCanUnloadNow() MSHTML_DllCanUnloadNow +5 stub DllEnumClassObjects +6 stdcall -private DllGetClassObject(ptr ptr ptr) MSHTML_DllGetClassObject +7 stub DllInstall +8 stub DllRegisterServer +9 stub DllUnregisterServer +10 stub MatchExactGetIDsOfNames +11 stub RNIGetCompatibleVersion +12 stdcall RunHTMLApplication() +13 stub ShowHTMLDialog +14 stub ShowModalDialog +15 stub ShowModelessHTMLDialog +16 stub SvrTri_GetDLText +17 stub SvrTri_NormalizeUA +18 stub com_ms_osp_ospmrshl_classInit +19 stub com_ms_osp_ospmrshl_copyToExternal +20 stub com_ms_osp_ospmrshl_releaseByValExternal +21 stub com_ms_osp_ospmrshl_toJava