implement hlink.dll
Aric Stewart
aric at codeweavers.com
Mon Sep 19 11:01:49 CDT 2005
Here is a very basic implementation of hlink.dll, Just enough to get the
slide show working in PowerPoint 2003.
-------------- next part --------------
Index: configure
===================================================================
RCS file: /home/wine/wine/configure,v
retrieving revision 1.707
diff -u -r1.707 configure
--- configure 15 Sep 2005 09:48:18 -0000 1.707
+++ configure 19 Sep 2005 15:36:28 -0000
@@ -18593,7 +18593,7 @@
MAKE_PROG_RULES=programs/Makeprog.rules
- ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Makeimplib.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/activeds/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/advpack/Makefile dlls/advpack/tests/Makefile dlls/amstream/Makefile dlls/atl/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cards/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/crypt32/tests/Makefile dlls/cryptdll/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3drm/Makefile dlls/d3dx8/Makefile dlls/d3dxof/Makefile dlls/dbghelp/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput/tests/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/dpnet/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxdiagn/Makefile dlls/dxerr8/Makefile dlls/dxerr9/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/hhctrl.ocx/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/ifsmgr.vxd/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/itss/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/lzexpand/tests/Makefile dlls/mapi32/Makefile dlls/mapi32/tests/Makefile dlls/mciavi32/Makefile dlls/mcicda/Makefile dlls/mciseq/Makefile dlls/midimap/Makefile dlls/mlang/Makefile dlls/mlang/tests/Makefile dlls/mmdevldr.vxd/Makefile dlls/monodebg.vxd/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/tests/Makefile dlls/msacm/winemp3/Makefile dlls/mscms/Makefile dlls/mscms/tests/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/mshtml/tests/Makefile dlls/msi/Makefile dlls/msi/tests/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvcrtd/tests/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/mswsock/Makefile dlls/msxml3/Makefile dlls/msxml3/tests/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/objsel/Makefile dlls/odbc32/Makefile dlls/odbccp32/Makefile dlls/ole32/Makefile dlls/ole32/tests/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/powrprof/Makefile dlls/psapi/Makefile dlls/psapi/tests/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/quartz/tests/Makefile dlls/rasapi32/Makefile dlls/riched20/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/rsabase/Makefile dlls/rsabase/tests/Makefile dlls/rsaenh/Makefile dlls/rsaenh/tests/Makefile dlls/secur32/Makefile dlls/secur32/tests/Makefile dlls/sensapi/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/stdole2.tlb/Makefile dlls/stdole32.tlb/Makefile dlls/sti/Makefile dlls/strmiids/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/usp10/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/vdhcp.vxd/Makefile dlls/vdmdbg/Makefile dlls/version/Makefile dlls/version/tests/Makefile dlls/vmm.vxd/Makefile dlls/vnbt.vxd/Makefile dlls/vnetbios.vxd/Makefile dlls/vtdapi.vxd/Makefile dlls/vwin32.vxd/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winecrt0/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/wineesd/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/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/wldap32/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/wtsapi32/Makefile dlls/x11drv/Makefile documentation/Makefile fonts/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/hh/Makefile programs/msiexec/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/taskmgr/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/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/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
+ ac_config_files="$ac_config_files Make.rules dlls/Makedll.rules dlls/Makeimplib.rules dlls/Maketest.rules libs/Makelib.rules programs/Makeprog.rules Makefile dlls/Makefile dlls/activeds/Makefile dlls/advapi32/Makefile dlls/advapi32/tests/Makefile dlls/advpack/Makefile dlls/advpack/tests/Makefile dlls/amstream/Makefile dlls/atl/Makefile dlls/avicap32/Makefile dlls/avifil32/Makefile dlls/cabinet/Makefile dlls/capi2032/Makefile dlls/cards/Makefile dlls/cfgmgr32/Makefile dlls/comcat/Makefile dlls/comctl32/Makefile dlls/comctl32/tests/Makefile dlls/commdlg/Makefile dlls/crtdll/Makefile dlls/crypt32/Makefile dlls/crypt32/tests/Makefile dlls/cryptdll/Makefile dlls/ctl3d/Makefile dlls/d3d8/Makefile dlls/d3d9/Makefile dlls/d3dim/Makefile dlls/d3drm/Makefile dlls/d3dx8/Makefile dlls/d3dxof/Makefile dlls/dbghelp/Makefile dlls/dciman32/Makefile dlls/ddraw/Makefile dlls/ddraw/tests/Makefile dlls/devenum/Makefile dlls/dinput/Makefile dlls/dinput/tests/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/dpnet/Makefile dlls/dpnhpast/Makefile dlls/dsound/Makefile dlls/dsound/tests/Makefile dlls/dswave/Makefile dlls/dxdiagn/Makefile dlls/dxerr8/Makefile dlls/dxerr9/Makefile dlls/dxguid/Makefile dlls/gdi/Makefile dlls/gdi/tests/Makefile dlls/glu32/Makefile dlls/glut32/Makefile dlls/hhctrl.ocx/Makefile dlls/hlink/Makefile dlls/iccvid/Makefile dlls/icmp/Makefile dlls/ifsmgr.vxd/Makefile dlls/imagehlp/Makefile dlls/imm32/Makefile dlls/iphlpapi/Makefile dlls/iphlpapi/tests/Makefile dlls/itss/Makefile dlls/kernel/Makefile dlls/kernel/tests/Makefile dlls/lzexpand/Makefile dlls/lzexpand/tests/Makefile dlls/mapi32/Makefile dlls/mapi32/tests/Makefile dlls/mciavi32/Makefile dlls/mcicda/Makefile dlls/mciseq/Makefile dlls/midimap/Makefile dlls/mlang/Makefile dlls/mlang/tests/Makefile dlls/mmdevldr.vxd/Makefile dlls/monodebg.vxd/Makefile dlls/mpr/Makefile dlls/msacm/Makefile dlls/msacm/imaadp32/Makefile dlls/msacm/msadp32/Makefile dlls/msacm/msg711/Makefile dlls/msacm/tests/Makefile dlls/msacm/winemp3/Makefile dlls/mscms/Makefile dlls/mscms/tests/Makefile dlls/msdmo/Makefile dlls/mshtml/Makefile dlls/mshtml/tests/Makefile dlls/msi/Makefile dlls/msi/tests/Makefile dlls/msimg32/Makefile dlls/msisys/Makefile dlls/msnet32/Makefile dlls/msrle32/Makefile dlls/msvcrt/Makefile dlls/msvcrt/tests/Makefile dlls/msvcrt20/Makefile dlls/msvcrt40/Makefile dlls/msvcrtd/Makefile dlls/msvcrtd/tests/Makefile dlls/msvidc32/Makefile dlls/msvideo/Makefile dlls/mswsock/Makefile dlls/msxml3/Makefile dlls/msxml3/tests/Makefile dlls/netapi32/Makefile dlls/netapi32/tests/Makefile dlls/newdev/Makefile dlls/ntdll/Makefile dlls/ntdll/tests/Makefile dlls/objsel/Makefile dlls/odbc32/Makefile dlls/odbccp32/Makefile dlls/ole32/Makefile dlls/ole32/tests/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/powrprof/Makefile dlls/psapi/Makefile dlls/psapi/tests/Makefile dlls/qcap/Makefile dlls/quartz/Makefile dlls/quartz/tests/Makefile dlls/rasapi32/Makefile dlls/riched20/Makefile dlls/richedit/Makefile dlls/rpcrt4/Makefile dlls/rpcrt4/tests/Makefile dlls/rsabase/Makefile dlls/rsabase/tests/Makefile dlls/rsaenh/Makefile dlls/rsaenh/tests/Makefile dlls/secur32/Makefile dlls/secur32/tests/Makefile dlls/sensapi/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/stdole2.tlb/Makefile dlls/stdole32.tlb/Makefile dlls/sti/Makefile dlls/strmiids/Makefile dlls/tapi32/Makefile dlls/ttydrv/Makefile dlls/twain/Makefile dlls/unicows/Makefile dlls/url/Makefile dlls/urlmon/Makefile dlls/urlmon/tests/Makefile dlls/user/Makefile dlls/user/tests/Makefile dlls/usp10/Makefile dlls/uuid/Makefile dlls/uxtheme/Makefile dlls/vdhcp.vxd/Makefile dlls/vdmdbg/Makefile dlls/version/Makefile dlls/version/tests/Makefile dlls/vmm.vxd/Makefile dlls/vnbt.vxd/Makefile dlls/vnetbios.vxd/Makefile dlls/vtdapi.vxd/Makefile dlls/vwin32.vxd/Makefile dlls/win32s/Makefile dlls/winaspi/Makefile dlls/winecrt0/Makefile dlls/wined3d/Makefile dlls/winedos/Makefile dlls/wineps/Makefile dlls/wininet/Makefile dlls/wininet/tests/Makefile dlls/winmm/Makefile dlls/winmm/joystick/Makefile dlls/winmm/mciwave/Makefile dlls/winmm/tests/Makefile dlls/winmm/wavemap/Makefile dlls/winmm/winealsa/Makefile dlls/winmm/winearts/Makefile dlls/winmm/wineaudioio/Makefile dlls/winmm/wineesd/Makefile dlls/winmm/winejack/Makefile dlls/winmm/winenas/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/wldap32/Makefile dlls/wow32/Makefile dlls/wsock32/Makefile dlls/wtsapi32/Makefile dlls/x11drv/Makefile documentation/Makefile fonts/Makefile include/Makefile libs/Makefile libs/port/Makefile libs/unicode/Makefile libs/wine/Makefile libs/wpp/Makefile loader/Makefile programs/Makefile programs/avitools/Makefile programs/clock/Makefile programs/cmdlgtst/Makefile programs/control/Makefile programs/expand/Makefile programs/hh/Makefile programs/msiexec/Makefile programs/notepad/Makefile programs/progman/Makefile programs/regedit/Makefile programs/regsvr32/Makefile programs/rpcss/Makefile programs/rundll32/Makefile programs/start/Makefile programs/taskmgr/Makefile programs/uninstaller/Makefile programs/view/Makefile programs/wcmd/Makefile programs/wineboot/Makefile programs/winebrowser/Makefile programs/winecfg/Makefile programs/wineconsole/Makefile programs/winedbg/Makefile programs/winefile/Makefile programs/winemenubuilder/Makefile programs/winemine/Makefile programs/winepath/Makefile programs/winetest/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/winegcc/Makefile tools/wmc/Makefile tools/wrc/Makefile"
cat >confcache <<\_ACEOF
@@ -19193,6 +19193,7 @@
"dlls/glu32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/glu32/Makefile" ;;
"dlls/glut32/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/glut32/Makefile" ;;
"dlls/hhctrl.ocx/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/hhctrl.ocx/Makefile" ;;
+ "dlls/hlink/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/hlink/Makefile" ;;
"dlls/iccvid/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/iccvid/Makefile" ;;
"dlls/icmp/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/icmp/Makefile" ;;
"dlls/ifsmgr.vxd/Makefile" ) CONFIG_FILES="$CONFIG_FILES dlls/ifsmgr.vxd/Makefile" ;;
Index: configure.ac
===================================================================
RCS file: /home/wine/wine/configure.ac,v
retrieving revision 1.408
diff -u -r1.408 configure.ac
--- configure.ac 15 Sep 2005 09:48:18 -0000 1.408
+++ configure.ac 19 Sep 2005 15:36:29 -0000
@@ -1563,6 +1563,7 @@
dlls/glu32/Makefile
dlls/glut32/Makefile
dlls/hhctrl.ocx/Makefile
+dlls/hlink/Makefile
dlls/iccvid/Makefile
dlls/icmp/Makefile
dlls/ifsmgr.vxd/Makefile
Index: dlls/Makefile.in
===================================================================
RCS file: /home/wine/wine/dlls/Makefile.in,v
retrieving revision 1.263
diff -u -r1.263 Makefile.in
--- dlls/Makefile.in 26 Aug 2005 08:52:06 -0000 1.263
+++ dlls/Makefile.in 19 Sep 2005 15:36:30 -0000
@@ -60,6 +60,7 @@
dxdiagn \
gdi \
hhctrl.ocx \
+ hlink \
iccvid \
icmp \
ifsmgr.vxd \
@@ -304,6 +305,7 @@
dxdiagn.dll.so \
gdi32.dll.so \
hhctrl.ocx.so \
+ hlink.dll.so \
iccvid.dll.so \
icmp.dll.so \
ifsmgr.vxd.so \
@@ -605,6 +607,9 @@
hhctrl.ocx.so: hhctrl.ocx/hhctrl.ocx.so
$(RM) $@ && $(LN_S) hhctrl.ocx/hhctrl.ocx.so $@
+hlink.dll.so: hlink/hlink.dll.so
+ $(RM) $@ && $(LN_S) hlink/hlink.dll.so $@
+
iccvid.dll.so: iccvid/iccvid.dll.so
$(RM) $@ && $(LN_S) iccvid/iccvid.dll.so $@
@@ -1631,6 +1636,7 @@
glu32/glu32.dll.so: glu32
glut32/glut32.dll.so: glut32
hhctrl.ocx/hhctrl.ocx.so: hhctrl.ocx
+hlink/hlink.dll.so: hlink
iccvid/iccvid.dll.so: iccvid
icmp/icmp.dll.so: icmp
ifsmgr.vxd/ifsmgr.vxd.so: ifsmgr.vxd
--- /dev/null 2005-03-17 08:20:53.000000000 -0600
+++ dlls/hlink/Makefile.in 2005-09-19 10:30:57.000000000 -0500
@@ -0,0 +1,17 @@
+TOPSRCDIR = @top_srcdir@
+TOPOBJDIR = ../..
+SRCDIR = @srcdir@
+VPATH = @srcdir@
+MODULE = hlink.dll
+IMPORTS = kernel32 advapi32
+DELAYIMPORTS = ole32 urlmon
+EXTRALIBS = -luuid $(LIBUNICODE)
+
+C_SRCS = \
+ hlink_main.c\
+ hlink.c\
+ hlinkbc.c\
+
+ at MAKE_DLL_RULES@
+
+### Dependencies:
--- /dev/null 2005-03-17 08:20:53.000000000 -0600
+++ dlls/hlink/hlink.spec 2005-09-19 10:30:57.000000000 -0500
@@ -0,0 +1,32 @@
+3 stdcall HlinkCreateFromMoniker(ptr wstr wstr ptr long ptr ptr ptr)
+4 stub HlinkCreateFromString
+5 stub HlinkCreateFromData
+6 stdcall HlinkCreateBrowseContext(ptr ptr ptr)
+7 stub HlinkClone
+8 stub HlinkNavigateToStringReference
+9 stdcall HlinkOnNavigate(ptr ptr long ptr wstr wstr ptr)
+10 stdcall HlinkNavigate(ptr ptr long ptr ptr ptr)
+11 stub HlinkUpdateStackItem
+12 stub HlinkOnRenameDocument
+13 stdcall -private DllCanUnloadNow( )
+14 stub HlinkResolveMonikerForData
+15 stub HlinkResolveStringForData
+16 stub OleSaveToStreamEx
+17 stdcall -private DllGetClassObject(ptr ptr ptr)
+18 stub HlinkParseDisplayName
+19 stub -private DllRegisterServer
+20 stub HlinkQueryCreateFromData
+21 stub HlinkSetSpecialReference
+22 stub HlinkGetSpecialReference
+23 stub HlinkCreateShortcut
+24 stub HlinkResolveShortcut
+25 stub HlinkIsShortcut
+26 stub HlinkResolveShortcutToString
+27 stub HlinkCreateShortcutFromString
+28 stub HlinkGetValueFromParams
+29 stub HlinkCreateShortcutFromMoniker
+30 stub HlinkResolveShortcutToMoniker
+31 stub HlinkTranslateURL
+32 stub HlinkCreateExtensionServices
+33 stub HlinkPreprocessMoniker
+34 stub -private DllUnregisterServer
--- /dev/null 2005-03-17 08:20:53.000000000 -0600
+++ dlls/hlink/hlink_main.c 2005-09-19 10:30:57.000000000 -0500
@@ -0,0 +1,265 @@
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "winerror.h"
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "unknwn.h"
+
+#include "wine/debug.h"
+#include "hlink.h"
+
+#include "initguid.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(hlink);
+
+DEFINE_GUID( CLSID_StdHlink, 0x79eac9d0, 0xbaf9, 0x11ce, 0x8c, 0x82, 0x00,
+ 0xaa,0x00,0x4b,0xa9,0x0b);
+DEFINE_GUID( CLSID_StdHlinkBrowseContext, 0x79eac9d1, 0xbaf9, 0x11ce, 0x8c,
+ 0x82, 0x00, 0xaa,0x00,0x4b,0xa9,0x0b);
+
+typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid,
+ LPVOID* ppvObject);
+
+static const IClassFactoryVtbl hlcfvt;
+extern HRESULT WINAPI HLink_Constructor(IUnknown *pUnkOuter, REFIID riid,
+ LPVOID* ppv);
+extern HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter,
+ REFIID riid, LPVOID* ppv);
+
+typedef struct
+{
+ const IClassFactoryVtbl *lpVtbl;
+ LONG ref;
+ CLSID *rclsid;
+ LPFNCREATEINSTANCE lpfnCI;
+ const IID *riidInst;
+} CFImpl;
+
+static const IHlinkVtbl hlvt;
+static IClassFactory * base_fnConstructor(LPFNCREATEINSTANCE lpfnCI, REFIID riidInst);
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
+{
+ TRACE("(0x%p, %ld, %p)\n",hinstDLL,fdwReason,lpvReserved);
+
+ if (fdwReason == DLL_PROCESS_ATTACH)
+ {
+ DisableThreadLibraryCalls(hinstDLL);
+ /* FIXME: Initialisation */
+ }
+ else if (fdwReason == DLL_PROCESS_DETACH)
+ {
+ /* FIXME: Cleanup */
+ }
+
+ return TRUE;
+}
+
+HRESULT WINAPI DllCanUnloadNow( void )
+{
+ FIXME("STUB\n");
+ return S_OK;
+}
+
+HRESULT WINAPI HlinkCreateFromMoniker( IMoniker *pimkTrgt, LPCWSTR pwzLocation,
+ LPCWSTR pwzFriendlyName, IHlinkSite* pihlsite, DWORD dwSiteData,
+ IUnknown* piunkOuter, REFIID riid, void* ppvObj)
+{
+ HRESULT r = S_OK;
+
+ TRACE("%p %s %s %p %li %p %s %p\n", pimkTrgt, debugstr_w(pwzLocation),
+ debugstr_w(pwzFriendlyName), pihlsite, dwSiteData, piunkOuter,
+ debugstr_guid(riid), ppvObj);
+
+ r = CoCreateInstance(&CLSID_StdHlink,piunkOuter,CLSCTX_INPROC_SERVER, riid,
+ ppvObj);
+
+ if (r == S_OK);
+ {
+ if (pwzLocation)
+ IHlink_SetStringReference(*(IHlink**)ppvObj, HLINKSETF_LOCATION,
+ NULL, pwzLocation);
+ if (pwzFriendlyName)
+ IHlink_SetFriendlyName(*(IHlink**)ppvObj, pwzFriendlyName);
+ if (pihlsite)
+ IHlink_SetHlinkSite(*(IHlink**)ppvObj, pihlsite, dwSiteData);
+ if (pimkTrgt)
+ IHlink_SetMonikerReference(*(IHlink**)ppvObj, 0, pimkTrgt,
+ pwzLocation);
+ }
+
+ TRACE("Returning %li\n",r);
+
+ return r;
+}
+
+HRESULT WINAPI HlinkCreateBrowseContext( IUnknown* piunkOuter, REFIID riid,
+ void* ppvObj)
+{
+ HRESULT r = S_OK;
+
+ TRACE("%p %s %p\n", piunkOuter, debugstr_guid(riid), ppvObj);
+
+ r = CoCreateInstance(&CLSID_StdHlinkBrowseContext, piunkOuter,
+ CLSCTX_INPROC_SERVER, riid, ppvObj);
+
+ TRACE("returning %li\n",r);
+
+ return r;
+}
+
+HRESULT WINAPI HlinkNavigate(IHlink *phl, IHlinkFrame *phlFrame,
+ DWORD grfHLNF, LPBC pbc, IBindStatusCallback *pbsc,
+ IHlinkBrowseContext *phlbc)
+{
+ HRESULT r = S_OK;
+
+ TRACE("%p %p %li %p %p %p\n", phl, phlFrame, grfHLNF, pbc, pbsc, phlbc);
+
+ if (phlFrame)
+ r = IHlinkFrame_Navigate(phlFrame,grfHLNF, pbc, pbsc, phl);
+ else if (phl)
+ r = IHlink_Navigate(phl, grfHLNF,pbc, pbsc, phlbc);
+
+ return r;
+}
+
+HRESULT WINAPI HlinkOnNavigate( IHlinkFrame *phlFrame,
+ IHlinkBrowseContext* phlbc, DWORD grfHLNF, IMoniker *pmkTarget,
+ LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName, ULONG* puHLID)
+{
+ HRESULT r = S_OK;
+
+ TRACE("%p %p %li %p %s %s %p\n",phlFrame, phlbc, grfHLNF, pmkTarget,
+ debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID);
+
+ r = IHlinkBrowseContext_OnNavigateHlink(phlbc, grfHLNF, pmkTarget,
+ pwzLocation, pwzFriendlyName, puHLID);
+
+ if (phlFrame)
+ r = IHlinkFrame_OnNavigate(phlFrame,grfHLNF,pmkTarget, pwzLocation,
+ pwzFriendlyName, 0);
+
+ return r;
+}
+
+HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID iid, LPVOID *ppv)
+{
+ HRESULT hres = E_OUTOFMEMORY;
+ IClassFactory *pcf = NULL;
+
+ TRACE("%s %s %p\n", debugstr_guid(rclsid), debugstr_guid(iid), ppv);
+
+ if (!ppv) return E_INVALIDARG;
+ *ppv = NULL;
+
+ if (IsEqualIID(rclsid, &CLSID_StdHlink))
+ pcf = base_fnConstructor(&HLink_Constructor, NULL);
+ else if (IsEqualIID(rclsid, &CLSID_StdHlinkBrowseContext))
+ pcf = base_fnConstructor(&HLinkBrowseContext_Constructor, NULL);
+ else
+ return CLASS_E_CLASSNOTAVAILABLE;
+
+ hres = IClassFactory_QueryInterface(pcf, iid, ppv);
+ IClassFactory_Release(pcf);
+
+ return hres;
+}
+
+static IClassFactory* base_fnConstructor(LPFNCREATEINSTANCE lpfnCI,
+ REFIID riidInst)
+{
+ CFImpl* lpclf;
+
+ TRACE("\n");
+
+ lpclf = HeapAlloc(GetProcessHeap(),0,sizeof(CFImpl));
+ lpclf->ref = 1;
+ lpclf->lpVtbl = &hlcfvt;
+ lpclf->lpfnCI = lpfnCI;
+ lpclf->riidInst = riidInst;
+
+ return (LPCLASSFACTORY)lpclf;
+}
+
+static HRESULT WINAPI HLinkCF_fnQueryInterface ( LPCLASSFACTORY iface,
+ REFIID riid, LPVOID *ppvObj)
+{
+ CFImpl *This = (CFImpl *)iface;
+ TRACE("(%p)->(%s)\n",This,debugstr_guid(riid));
+
+ *ppvObj = NULL;
+
+ if(IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IClassFactory))
+ {
+ *ppvObj = This;
+ InterlockedIncrement(&This->ref);
+ return S_OK;
+ }
+
+ TRACE("-- E_NOINTERFACE\n");
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI HLinkCF_fnAddRef (LPCLASSFACTORY iface)
+{
+ CFImpl *This = (CFImpl *)iface;
+ ULONG refCount = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI HLinkCF_fnRelease(LPCLASSFACTORY iface)
+{
+ CFImpl *This = (CFImpl *)iface;
+ ULONG refCount = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount + 1);
+
+ if (!refCount)
+ {
+ TRACE("-- destroying IClassFactory(%p)\n",This);
+ HeapFree(GetProcessHeap(),0,This);
+ return 0;
+ }
+ return refCount;
+}
+
+static HRESULT WINAPI HLinkCF_fnCreateInstance( LPCLASSFACTORY iface,
+ LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObject)
+{
+ CFImpl *This = (CFImpl *)iface;
+ TRACE("%p->(%p,%s,%p)\n",This,pUnkOuter,debugstr_guid(riid),ppvObject);
+
+ *ppvObject = NULL;
+
+ if ( This->riidInst==NULL || IsEqualCLSID(riid, This->riidInst) ||
+ IsEqualCLSID(riid, &IID_IUnknown) )
+ {
+ return This->lpfnCI(pUnkOuter, riid, ppvObject);
+ }
+
+ ERR("unknown IID requested %s\n",debugstr_guid(riid));
+ return E_NOINTERFACE;
+}
+
+static HRESULT WINAPI HLinkCF_fnLockServer(LPCLASSFACTORY iface, BOOL fLock)
+{
+ return E_NOTIMPL;
+}
+
+static const IClassFactoryVtbl hlcfvt =
+{
+ HLinkCF_fnQueryInterface,
+ HLinkCF_fnAddRef,
+ HLinkCF_fnRelease,
+ HLinkCF_fnCreateInstance,
+ HLinkCF_fnLockServer
+};
+
--- /dev/null 2005-03-17 08:20:53.000000000 -0600
+++ dlls/hlink/hlink.c 2005-09-19 10:30:57.000000000 -0500
@@ -0,0 +1,399 @@
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "winerror.h"
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "unknwn.h"
+#include "objidl.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+#include "hlink.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(hlink);
+
+static const IHlinkVtbl hlvt;
+
+typedef struct
+{
+ const IHlinkVtbl *lpVtbl;
+ LONG ref;
+ LPWSTR FriendlyName;
+ LPWSTR Location;
+ LPWSTR Target;
+ IMoniker *Moniker;
+ IHlinkSite *Site;
+ DWORD SiteData;
+} IHlinkImpl;
+
+
+HRESULT WINAPI HLink_Constructor(IUnknown *pUnkOuter, REFIID riid,
+ LPVOID *ppv)
+{
+ IHlinkImpl * hl;
+
+ TRACE("unkOut=%p riid=%s\n",pUnkOuter, debugstr_guid(riid));
+ *ppv = NULL;
+
+ if (pUnkOuter)
+ return CLASS_E_NOAGGREGATION;
+
+ hl = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IHlinkImpl));
+ if (!hl)
+ return E_OUTOFMEMORY;
+
+ hl->ref = 1;
+ hl->lpVtbl = &hlvt;
+
+ *ppv = hl;
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnQueryInterface(IHlink* iface, REFIID riid,
+ LPVOID *ppvObj)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj);
+
+ *ppvObj = NULL;
+
+ if (IsEqualIID(riid, &IID_IUnknown) || (IsEqualIID(riid, &IID_IHlink)))
+ *ppvObj = This;
+
+ if (*ppvObj)
+ {
+ IUnknown_AddRef((IUnknown*)(*ppvObj));
+ return S_OK;
+ }
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI IHlink_fnAddRef (IHlink* iface)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+ ULONG refCount = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI IHlink_fnRelease (IHlink* iface)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+ ULONG refCount = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount + 1);
+ if (refCount)
+ return refCount;
+
+ TRACE("-- destryoing IHlink (%p)\n",This);
+ HeapFree(GetProcessHeap(),0,This->FriendlyName);
+ HeapFree(GetProcessHeap(),0,This->Target);
+ HeapFree(GetProcessHeap(),0,This->Location);
+ if (This->Moniker)
+ IMoniker_Release(This->Moniker);
+ if (This->Site)
+ IHlinkSite_Release(This->Site);
+ HeapFree(GetProcessHeap(),0,This);
+ return 0;
+}
+
+static HRESULT WINAPI IHlink_fnSetHlinkSite( IHlink* iface,
+ IHlinkSite* pihlSite, DWORD dwSiteData)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p)->(%p %li)\n", This, pihlSite, dwSiteData);
+
+ if (This->Site)
+ IHlinkSite_Release(This->Site);
+
+ This->Site = pihlSite;
+ if (This->Site)
+ IHlinkSite_AddRef(This->Site);
+
+ This->SiteData = dwSiteData;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnGetHlinkSite( IHlink* iface,
+ IHlinkSite** ppihlSite, DWORD *pdwSiteData)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p)->(%p %p)\n", This, ppihlSite, pdwSiteData);
+
+ *ppihlSite = This->Site;
+ *pdwSiteData = This->SiteData;
+
+ if (This->Site)
+ IHlinkSite_AddRef(This->Site);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnSetMonikerReference( IHlink* iface,
+ DWORD rfHLSETF, IMoniker *pmkTarget, LPCWSTR pwzLocation)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p)->(%li %p %s)\n", This, rfHLSETF, pmkTarget, debugstr_w(pwzLocation));
+
+ if (This->Moniker)
+ IMoniker_Release(This->Moniker);
+
+ This->Moniker = pmkTarget;
+ if (This->Moniker)
+ IMoniker_AddRef(This->Moniker);
+
+ HeapFree(GetProcessHeap(),0,This->Location);
+ This->Location= HeapAlloc(GetProcessHeap(),0,(lstrlenW(pwzLocation)+1)
+ *sizeof(WCHAR));
+ strcpyW(This->Location,pwzLocation);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnSetStringReference(IHlink* iface,
+ DWORD grfHLSETF, LPCWSTR pwzTarget, LPCWSTR pwzLocation)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p)->(%li %s %s)\n",This,grfHLSETF, debugstr_w(pwzTarget),
+ debugstr_w(pwzLocation));
+
+ if (grfHLSETF & HLINKSETF_TARGET)
+ {
+ HeapFree(GetProcessHeap(),0,This->Target);
+ This->Target = HeapAlloc(GetProcessHeap(),0,(lstrlenW(pwzTarget)+1)
+ *sizeof(WCHAR));
+ strcpyW(This->Target,pwzTarget);
+ }
+ if (grfHLSETF & HLINKSETF_LOCATION)
+ {
+ HeapFree(GetProcessHeap(),0,This->Location);
+ This->Location= HeapAlloc(GetProcessHeap(),0,(lstrlenW(pwzLocation)+1)
+ *sizeof(WCHAR));
+ strcpyW(This->Location,pwzLocation);
+ }
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnGetMonikerReference(IHlink* iface,
+ DWORD dwWhichRef, IMoniker **ppimkTarget, LPWSTR *ppwzLocation)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p) -> (%li %p %p)\n",This, dwWhichRef, ppimkTarget, ppwzLocation);
+
+ if(ppimkTarget)
+ {
+ if (This->Moniker)
+ *ppimkTarget = This->Moniker;
+ else if (This->Site)
+ IHlinkSite_GetMoniker(This->Site, This->SiteData,
+ OLEGETMONIKER_FORCEASSIGN, OLEWHICHMK_CONTAINER,
+ (LPVOID)ppimkTarget);
+ }
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnGetStringReference (IHlink* iface,
+ DWORD dwWhichRef, LPWSTR *ppwzTarget, LPWSTR *ppwzLocation)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p) -> (%li %p %p)\n",This, dwWhichRef, ppwzTarget, ppwzLocation);
+
+ if (ppwzTarget)
+ {
+ if (This->Target)
+ {
+ *ppwzTarget = HeapAlloc(GetProcessHeap(),0,
+ (lstrlenW(This->Target)+1) * sizeof(WCHAR));
+ strcpyW(*ppwzTarget,This->Target);
+ }
+ else
+ *ppwzTarget = NULL;
+ }
+ if (ppwzLocation)
+ {
+ if (This->Location)
+ {
+ *ppwzLocation = HeapAlloc(GetProcessHeap(),0,
+ (lstrlenW(This->Location)+1) * sizeof(WCHAR));
+ strcpyW(*ppwzLocation,This->Location);
+ }
+ else
+ *ppwzLocation = NULL;
+ }
+
+ TRACE("(Target: %s Location: %s)\n",debugstr_w(*ppwzTarget),
+ debugstr_w(*ppwzLocation));
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnSetFriendlyName (IHlink *iface,
+ LPCWSTR pwzFriendlyName)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p) -> (%s)\n",This,debugstr_w(pwzFriendlyName));
+
+ HeapFree(GetProcessHeap(),0,This->FriendlyName);
+ This->FriendlyName = HeapAlloc(GetProcessHeap(),0,
+ (lstrlenW(pwzFriendlyName)+1) * sizeof(WCHAR));
+ strcpyW(This->FriendlyName,pwzFriendlyName);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnGetFriendlyName (IHlink* iface,
+ DWORD grfHLFNAMEF, LPWSTR* ppwzFriendlyName)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+
+ TRACE("(%p) -> (%li %p)\n",This,grfHLFNAMEF,ppwzFriendlyName);
+
+ FIXME("Only using explesitly set and cached friendly names\n");
+
+ if (This->FriendlyName)
+ {
+ *ppwzFriendlyName = HeapAlloc(GetProcessHeap(),0,
+ (lstrlenW(This->FriendlyName)+1) * sizeof(WCHAR));
+ strcpyW(*ppwzFriendlyName,This->FriendlyName);
+ }
+ else if (This->Moniker)
+ {
+ IBindCtx *bcxt;
+ CreateBindCtx(0, &bcxt);
+
+ IMoniker_GetDisplayName(This->Moniker, bcxt, NULL, ppwzFriendlyName);
+ IBindCtx_Release(bcxt);
+ }
+ else
+ *ppwzFriendlyName = NULL;
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnSetTargetFrameName(IHlink* iface,
+ LPCWSTR pwzTargetFramename)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlink_fnGetTargetFrameName(IHlink* iface,
+ LPWSTR *ppwzTargetFrameName)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlink_fnGetMiscStatus(IHlink* iface, DWORD* pdwStatus)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlink_fnNavigate(IHlink* iface, DWORD grfHLNF, LPBC pbc,
+ IBindStatusCallback *pbsc, IHlinkBrowseContext *phbc)
+{
+ IHlinkImpl *This = (IHlinkImpl*)iface;
+ IMoniker *mon = NULL;
+
+ TRACE("(%p)->(%li %p %p %p)\n",This, grfHLNF, pbc, pbsc, phbc);
+
+ if (This->Site)
+ IHlinkSite_ReadyToNavigate(This->Site, This->SiteData, 0);
+
+ if (This->Moniker)
+ {
+ mon = This->Moniker;
+ IMoniker_AddRef(This->Moniker);
+ }
+ else if (This->Site)
+ IHlinkSite_GetMoniker(This->Site, This->SiteData,
+ OLEGETMONIKER_FORCEASSIGN, OLEWHICHMK_CONTAINER, &mon);
+
+ TRACE("Moniker %p\n",mon);
+
+ if (mon)
+ {
+ IBindCtx *bcxt;
+ IHlinkTarget *target;
+ HRESULT r = S_OK;
+
+ CreateBindCtx(0, &bcxt);
+
+ RegisterBindStatusCallback(bcxt, pbsc, NULL, 0);
+
+ r = IMoniker_BindToObject(mon, bcxt, NULL, &IID_IHlinkTarget,
+ (LPVOID*)&target);
+ TRACE("IHlinkTarget returned 0x%lx\n",r);
+ if (r == S_OK)
+ {
+ IHlinkTarget_SetBrowseContext(target, phbc);
+ IHlinkTarget_Navigate(target, grfHLNF, This->Location);
+ }
+
+ RevokeBindStatusCallback(bcxt,pbsc);
+
+ IBindCtx_Release(bcxt);
+ IHlinkTarget_Release(target);
+ IMoniker_Release(mon);
+ }
+
+ if (This->Site)
+ IHlinkSite_OnNavigationComplete(This->Site, This->SiteData, 0, 0, NULL);
+
+ TRACE("Finished Navigation\n");
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlink_fnSetAdditonalParams(IHlink* iface,
+ LPCWSTR pwzAdditionalParams)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlink_fnGetAdditionalParams(IHlink* iface,
+ LPWSTR* ppwzAdditionalParams)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static const IHlinkVtbl hlvt =
+{
+ IHlink_fnQueryInterface,
+ IHlink_fnAddRef,
+ IHlink_fnRelease,
+ IHlink_fnSetHlinkSite,
+ IHlink_fnGetHlinkSite,
+ IHlink_fnSetMonikerReference,
+ IHlink_fnGetMonikerReference,
+ IHlink_fnSetStringReference,
+ IHlink_fnGetStringReference,
+ IHlink_fnSetFriendlyName,
+ IHlink_fnGetFriendlyName,
+ IHlink_fnSetTargetFrameName,
+ IHlink_fnGetTargetFrameName,
+ IHlink_fnGetMiscStatus,
+ IHlink_fnNavigate,
+ IHlink_fnSetAdditonalParams,
+ IHlink_fnGetAdditionalParams
+};
+
--- /dev/null 2005-03-17 08:20:53.000000000 -0600
+++ dlls/hlink/hlinkbc.c 2005-09-19 10:30:57.000000000 -0500
@@ -0,0 +1,271 @@
+#include <stdarg.h>
+
+#define COBJMACROS
+
+#include "winerror.h"
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "unknwn.h"
+#include "objidl.h"
+
+#include "wine/debug.h"
+#include "hlink.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(hlink);
+
+static const IHlinkBrowseContextVtbl hlvt;
+
+typedef struct
+{
+ const IHlinkBrowseContextVtbl *lpVtbl;
+ LONG ref;
+
+ HLBWINFO* BrowseWindowInfo;
+
+ IHlink* CurrentPage;
+} IHlinkBCImpl;
+
+
+extern HRESULT WINAPI HlinkCreateFromMoniker( IMoniker *pimkTrgt, LPCWSTR
+ pwzLocation, LPCWSTR pwzFriendlyName, void* pihlsite, DWORD dwSiteData,
+ IUnknown* piunkOuter, REFIID riid, void* ppvObj);
+
+
+HRESULT WINAPI HLinkBrowseContext_Constructor(IUnknown *pUnkOuter, REFIID riid,
+ LPVOID *ppv)
+{
+ IHlinkBCImpl * hl;
+
+ TRACE("unkOut=%p riid=%s\n",pUnkOuter, debugstr_guid(riid));
+ *ppv = NULL;
+
+ if (pUnkOuter)
+ return CLASS_E_NOAGGREGATION;
+
+ hl = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(IHlinkBCImpl));
+ if (!hl)
+ return E_OUTOFMEMORY;
+
+ hl->ref = 1;
+ hl->lpVtbl = &hlvt;
+
+ *ppv = hl;
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlinkBC_fnQueryInterface( IHlinkBrowseContext *iface,
+ REFIID riid, LPVOID* ppvObj)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ TRACE ("(%p)->(%s,%p)\n", This, debugstr_guid (riid), ppvObj);
+
+ if (IsEqualIID(riid, &IID_IUnknown) || (IsEqualIID(riid,
+ &IID_IHlinkBrowseContext)))
+ *ppvObj = This;
+
+ if (*ppvObj)
+ {
+ IUnknown_AddRef((IUnknown*)(*ppvObj));
+ return S_OK;
+ }
+ return E_NOINTERFACE;
+}
+
+static ULONG WINAPI IHlinkBC_fnAddRef (IHlinkBrowseContext* iface)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ ULONG refCount = InterlockedIncrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount - 1);
+
+ return refCount;
+}
+
+static ULONG WINAPI IHlinkBC_fnRelease (IHlinkBrowseContext* iface)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ ULONG refCount = InterlockedDecrement(&This->ref);
+
+ TRACE("(%p)->(count=%lu)\n", This, refCount + 1);
+ if (refCount)
+ return refCount;
+
+ TRACE("-- destryoing IHlinkBrowseContext (%p)\n",This);
+ HeapFree(GetProcessHeap(),0,This->BrowseWindowInfo);
+ if (This->CurrentPage)
+ IHlink_Release(This->CurrentPage);
+ HeapFree(GetProcessHeap(),0,This);
+ return 0;
+}
+
+static HRESULT WINAPI IHlinkBC_Register(IHlinkBrowseContext* iface,
+ DWORD dwReserved, IUnknown *piunk, IMoniker *pimk, DWORD *pdwRegister)
+{
+ static const WCHAR szIdent[] = {'W','I','N','E','H','L','I','N','K',0};
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ IMoniker *mon;
+ IMoniker *composite;
+ IRunningObjectTable *ROT;
+
+
+ TRACE("(%p)->(%li %p %p %p)\n",This, dwReserved, piunk, pimk, pdwRegister);
+
+ CreateItemMoniker(NULL, szIdent, &mon);
+ CreateGenericComposite(mon, pimk,&composite);
+
+ GetRunningObjectTable(0,&ROT);
+ IRunningObjectTable_Register(ROT, 0, piunk, composite, pdwRegister);
+
+
+ IRunningObjectTable_Release(ROT);
+ IMoniker_Release(composite);
+ IMoniker_Release(mon);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlinkBC_GetObject(IHlinkBrowseContext* face,
+ IMoniker *pimk, BOOL fBindifRootRegistered, IUnknown **ppiunk)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_Revoke(IHlinkBrowseContext* iface,
+ DWORD dwRegister)
+{
+ HRESULT r = S_OK;
+ IRunningObjectTable *ROT;
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+
+ TRACE("(%p)->(%li)\n", This, dwRegister);
+
+ GetRunningObjectTable(0,&ROT);
+ r = IRunningObjectTable_Revoke(ROT, dwRegister);
+ IRunningObjectTable_Release(ROT);
+
+ return r;
+}
+
+static HRESULT WINAPI IHlinkBC_SetBrowseWindowInfo(IHlinkBrowseContext* iface,
+ HLBWINFO *phlbwi)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ TRACE("(%p)->(%p)\n", This, phlbwi);
+
+ HeapFree(GetProcessHeap(),0,This->BrowseWindowInfo);
+ This->BrowseWindowInfo = HeapAlloc(GetProcessHeap(),0,phlbwi->cbSize);
+ memcpy(This->BrowseWindowInfo,phlbwi,phlbwi->cbSize);
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlinkBC_GetBrowseWindowInfo(IHlinkBrowseContext* iface,
+ HLBWINFO *phlbwi)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_SetInitialHlink(IHlinkBrowseContext* iface,
+ IMoniker *pimkTarget, LPCWSTR pwzLocation, LPCWSTR pwzFriendlyName)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+
+ TRACE("(%p)->(%p %s %s)\n",This, pimkTarget, debugstr_w(pwzLocation),
+ debugstr_w(pwzFriendlyName));
+
+ if (This->CurrentPage)
+ IHlink_Release(This->CurrentPage);
+
+ HlinkCreateFromMoniker(pimkTarget, pwzLocation, pwzFriendlyName, NULL,
+ 0, NULL, &IID_IHlink, &(This->CurrentPage));
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlinkBC_OnNavigateHlink(IHlinkBrowseContext *iface,
+ DWORD grfHLNF, IMoniker* pmkTarget, LPCWSTR pwzLocation, LPCWSTR
+ pwzFriendlyName, ULONG *puHLID)
+{
+ IHlinkBCImpl *This = (IHlinkBCImpl*)iface;
+ TRACE("(%p)->(%li %p %s %s %p)\n",This, grfHLNF, pmkTarget,
+ debugstr_w(pwzLocation), debugstr_w(pwzFriendlyName), puHLID);
+
+
+ return S_OK;
+}
+
+static HRESULT WINAPI IHlinkBC_UpdateHlink(IHlinkBrowseContext* iface,
+ ULONG uHLID, IMoniker* pimkTarget, LPCWSTR pwzLocation,
+ LPCWSTR pwzFriendlyName)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_EnumNavigationStack( IHlinkBrowseContext *iface,
+ DWORD dwReserved, DWORD grfHLFNAMEF, IEnumHLITEM** ppienumhlitem)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_QueryHlink( IHlinkBrowseContext* iface,
+ DWORD grfHLONG, ULONG uHLID)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_GetHlink( IHlinkBrowseContext* iface,
+ ULONG uHLID, IHlink** ppihl)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_SetCurrentHlink( IHlinkBrowseContext* iface,
+ ULONG uHLID)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_Clone( IHlinkBrowseContext* iface,
+ IUnknown* piunkOuter, REFIID riid, IUnknown** ppiunkOjb)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static HRESULT WINAPI IHlinkBC_Close(IHlinkBrowseContext* iface,
+ DWORD reserverd)
+{
+ FIXME("STUB\n");
+ return E_NOTIMPL;
+}
+
+static const IHlinkBrowseContextVtbl hlvt =
+{
+ IHlinkBC_fnQueryInterface,
+ IHlinkBC_fnAddRef,
+ IHlinkBC_fnRelease,
+ IHlinkBC_Register,
+ IHlinkBC_GetObject,
+ IHlinkBC_Revoke,
+ IHlinkBC_SetBrowseWindowInfo,
+ IHlinkBC_GetBrowseWindowInfo,
+ IHlinkBC_SetInitialHlink,
+ IHlinkBC_OnNavigateHlink,
+ IHlinkBC_UpdateHlink,
+ IHlinkBC_EnumNavigationStack,
+ IHlinkBC_QueryHlink,
+ IHlinkBC_GetHlink,
+ IHlinkBC_SetCurrentHlink,
+ IHlinkBC_Clone,
+ IHlinkBC_Close
+};
+
More information about the wine-patches
mailing list