[SHDOCVW]
authorChristoph von Wittich <christoph_vw@reactos.org>
Sun, 30 May 2010 10:25:19 +0000 (10:25 +0000)
committerChristoph von Wittich <christoph_vw@reactos.org>
Sun, 30 May 2010 10:25:19 +0000 (10:25 +0000)
sync to wine 1.2 RC2

svn path=/trunk/; revision=47439

reactos/dll/win32/shdocvw/iexplore.c
reactos/dll/win32/shdocvw/intshcut.c
reactos/dll/win32/shdocvw/navigate.c
reactos/dll/win32/shdocvw/shdocvw.h
reactos/dll/win32/shdocvw/shdocvw.inf
reactos/dll/win32/shdocvw/shdocvw.spec
reactos/dll/win32/shdocvw/shdocvw_main.c
reactos/dll/win32/shdocvw/view.c
reactos/dll/win32/shdocvw/webbrowser.c

index d65810f..9c14cfc 100644 (file)
@@ -37,6 +37,8 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
 
+#define IDI_APPICON 101
+
 static const WCHAR szIEWinFrame[] = { 'I','E','F','r','a','m','e',0 };
 
 static LRESULT iewnd_OnCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
@@ -85,7 +87,7 @@ ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
 void register_iewindow_class(void)
 {
-    WNDCLASSW wc;
+    WNDCLASSEXW wc;
 
     memset(&wc, 0, sizeof wc);
     wc.style = 0;
@@ -93,13 +95,15 @@ void register_iewindow_class(void)
     wc.cbClsExtra = 0;
     wc.cbWndExtra = sizeof(InternetExplorer*);
     wc.hInstance = shdocvw_hinstance;
-    wc.hIcon = 0;
-    wc.hCursor = LoadCursorW(0, MAKEINTRESOURCEW(IDI_APPLICATION));
+    wc.hIcon = LoadIconW(GetModuleHandleW(0), MAKEINTRESOURCEW(IDI_APPICON));
+    wc.hIconSm = LoadImageW(GetModuleHandleW(0), MAKEINTRESOURCEW(IDI_APPICON), IMAGE_ICON,
+                            GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
+    wc.hCursor = LoadCursorW(0, MAKEINTRESOURCEW(IDC_ARROW));
     wc.hbrBackground = 0;
     wc.lpszClassName = szIEWinFrame;
     wc.lpszMenuName = NULL;
 
-    RegisterClassW(&wc);
+    RegisterClassExW(&wc);
 }
 
 void unregister_iewindow_class(void)
index b389ec3..32dab6d 100644 (file)
@@ -74,6 +74,7 @@ static BOOL run_winemenubuilder( const WCHAR *args )
     PROCESS_INFORMATION pi;
     BOOL ret;
     WCHAR app[MAX_PATH];
+    void *redir;
 
     GetSystemDirectoryW( app, MAX_PATH - sizeof(menubuilder)/sizeof(WCHAR) );
     strcatW( app, menubuilder );
@@ -91,7 +92,9 @@ static BOOL run_winemenubuilder( const WCHAR *args )
     memset(&si, 0, sizeof(si));
     si.cb = sizeof(si);
 
+    Wow64DisableWow64FsRedirection( &redir );
     ret = CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
+    Wow64RevertWow64FsRedirection( redir );
 
     heap_free( buffer );
 
index 8ba5f69..99980c7 100644 (file)
@@ -642,7 +642,7 @@ static HRESULT async_doc_navigate(DocHost *This, LPCWSTR url, LPCWSTR headers, P
             return free_doc_navigate_task(task, TRUE);
     }
 
-    if(task->post_data) {
+    if(post_data) {
         task->post_data = SafeArrayCreateVector(VT_UI1, 0, post_data_size);
         if(!task->post_data)
             return free_doc_navigate_task(task, TRUE);
@@ -950,7 +950,132 @@ static const IHlinkFrameVtbl HlinkFrameVtbl = {
     HlinkFrame_UpdateHlink
 };
 
+#define TARGETFRAME2_THIS(iface) DEFINE_THIS(WebBrowser, ITargetFrame2, iface)
+
+static HRESULT WINAPI TargetFrame2_QueryInterface(ITargetFrame2 *iface, REFIID riid, void **ppv)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    return IWebBrowser2_QueryInterface(WEBBROWSER2(This), riid, ppv);
+}
+
+static ULONG WINAPI TargetFrame2_AddRef(ITargetFrame2 *iface)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    return IWebBrowser2_AddRef(WEBBROWSER2(This));
+}
+
+static ULONG WINAPI TargetFrame2_Release(ITargetFrame2 *iface)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    return IWebBrowser2_Release(WEBBROWSER2(This));
+}
+
+static HRESULT WINAPI TargetFrame2_SetFrameName(ITargetFrame2 *iface, LPCWSTR pszFrameName)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(pszFrameName));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetFrameName(ITargetFrame2 *iface, LPWSTR *ppszFrameName)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppszFrameName);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetParentFrame(ITargetFrame2 *iface, IUnknown **ppunkParent)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppunkParent);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_SetFrameSrc(ITargetFrame2 *iface, LPCWSTR pszFrameSrc)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%s)\n", This, debugstr_w(pszFrameSrc));
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetFrameSrc(ITargetFrame2 *iface, LPWSTR *ppszFrameSrc)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetFramesContainer(ITargetFrame2 *iface, IOleContainer **ppContainer)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppContainer);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_SetFrameOptions(ITargetFrame2 *iface, DWORD dwFlags)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%x)\n", This, dwFlags);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetFrameOptions(ITargetFrame2 *iface, DWORD *pdwFlags)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, pdwFlags);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_SetFrameMargins(ITargetFrame2 *iface, DWORD dwWidth, DWORD dwHeight)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%d %d)\n", This, dwWidth, dwHeight);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetFrameMargins(ITargetFrame2 *iface, DWORD *pdwWidth, DWORD *pdwHeight)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%p %p)\n", This, pdwWidth, pdwHeight);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_FindFrame(ITargetFrame2 *iface, LPCWSTR pszTargetName, DWORD dwFlags, IUnknown **ppunkTargetFrame)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(pszTargetName), dwFlags, ppunkTargetFrame);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI TargetFrame2_GetTargetAlias(ITargetFrame2 *iface, LPCWSTR pszTargetName, LPWSTR *ppszTargetAlias)
+{
+    WebBrowser *This = TARGETFRAME2_THIS(iface);
+    FIXME("(%p)->(%s %p)\n", This, debugstr_w(pszTargetName), ppszTargetAlias);
+    return E_NOTIMPL;
+}
+
+#undef TARGETFRAME2_THIS
+
+static const ITargetFrame2Vtbl TargetFrame2Vtbl = {
+    TargetFrame2_QueryInterface,
+    TargetFrame2_AddRef,
+    TargetFrame2_Release,
+    TargetFrame2_SetFrameName,
+    TargetFrame2_GetFrameName,
+    TargetFrame2_GetParentFrame,
+    TargetFrame2_SetFrameSrc,
+    TargetFrame2_GetFrameSrc,
+    TargetFrame2_GetFramesContainer,
+    TargetFrame2_SetFrameOptions,
+    TargetFrame2_GetFrameOptions,
+    TargetFrame2_SetFrameMargins,
+    TargetFrame2_GetFrameMargins,
+    TargetFrame2_FindFrame,
+    TargetFrame2_GetTargetAlias
+};
+
 void WebBrowser_HlinkFrame_Init(WebBrowser *This)
 {
     This->lpHlinkFrameVtbl = &HlinkFrameVtbl;
+    This->lpITargetFrame2Vtbl = &TargetFrame2Vtbl;
 }
index 1184298..1af0365 100644 (file)
@@ -37,6 +37,7 @@
 #include "exdisp.h"
 #include "mshtmhst.h"
 #include "hlink.h"
+#include "htiframe.h"
 
 #include "wine/unicode.h"
 
@@ -126,7 +127,9 @@ struct WebBrowser {
     const IOleInPlaceActiveObjectVtbl   *lpOleInPlaceActiveObjectVtbl;
     const IOleCommandTargetVtbl         *lpOleCommandTargetVtbl;
     const IHlinkFrameVtbl               *lpHlinkFrameVtbl;
+    const ITargetFrame2Vtbl             *lpITargetFrame2Vtbl;
     const IServiceProviderVtbl          *lpServiceProviderVtbl;
+    const IDataObjectVtbl               *lpDataObjectVtbl;
 
     LONG ref;
 
@@ -184,6 +187,8 @@ struct InternetExplorer {
 #define ACTIVEOBJ(x)    ((IOleInPlaceActiveObject*)     &(x)->lpOleInPlaceActiveObjectVtbl)
 #define OLECMD(x)       ((IOleCommandTarget*)           &(x)->lpOleCommandTargetVtbl)
 #define HLINKFRAME(x)   ((IHlinkFrame*)                 &(x)->lpHlinkFrameVtbl)
+#define DATAOBJECT(x)   ((IDataObject*)                 &(x)->lpDataObjectVtbl)
+#define TARGETFRAME2(x) ((ITargetFrame2*)               &(x)->lpITargetFrame2Vtbl)
 
 #define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
 #define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
@@ -198,6 +203,7 @@ struct InternetExplorer {
 
 void WebBrowser_OleObject_Init(WebBrowser*);
 void WebBrowser_ViewObject_Init(WebBrowser*);
+void WebBrowser_DataObject_Init(WebBrowser*);
 void WebBrowser_Persist_Init(WebBrowser*);
 void WebBrowser_ClassInfo_Init(WebBrowser*);
 void WebBrowser_HlinkFrame_Init(WebBrowser*);
index 932c9be..f08759c 100644 (file)
@@ -149,9 +149,9 @@ HKLM,"Software\Microsoft\Windows\CurrentVersion\App Paths\iexplore.exe","Path",,
 
 
 [IE.Reg]
-HKLM,"Software\Microsoft\Internet Explorer","Build",,"62900.2180"
-HKLM,"Software\Microsoft\Internet Explorer","IVer",,"103"
-HKLM,"Software\Microsoft\Internet Explorer","Version",,"6.0.2900.2180"
+HKLM,"Software\Microsoft\Internet Explorer","Build",,"86001"
+HKLM,"Software\Microsoft\Internet Explorer","Version",,"8.0.6001.18702"
+HKLM,"Software\Microsoft\Internet Explorer","W2kVersion",,"8.0.6001.18702"
 
 
 [Strings]
index aa5ef51..4a0dd2c 100644 (file)
@@ -40,7 +40,7 @@
 151 stdcall -noname URLSubRegQueryA(str str long ptr long long)
 152 stub -noname CShellUIHelper_CreateInstance2
 153 stub -noname IsURLChild
-158 stub -noname SHRestricted2A
+158 stdcall -noname SHRestricted2A(long str long)
 159 stdcall -noname SHRestricted2W(long wstr long)
 160 stub -noname SHIsRestricted2W
 161 stub @ # CSearchAssistantOC::OnDraw
index 746753f..5dfd2b9 100644 (file)
@@ -440,3 +440,24 @@ DWORD WINAPI SHRestricted2W(DWORD res, LPCWSTR url, DWORD reserved)
     FIXME("(%d %s %d) stub\n", res, debugstr_w(url), reserved);
     return 0;
 }
+
+/******************************************************************
+ * SHRestricted2A (SHDOCVW.158)
+ *
+ * See SHRestricted2W
+ */
+DWORD WINAPI SHRestricted2A(DWORD restriction, LPCSTR url, DWORD reserved)
+{
+    LPWSTR urlW = NULL;
+    DWORD res;
+
+    TRACE("(%d, %s, %d)\n", restriction, debugstr_a(url), reserved);
+    if (url) {
+        DWORD len = MultiByteToWideChar(CP_ACP, 0, url, -1, NULL, 0);
+        urlW = heap_alloc(len * sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, url, -1, urlW, len);
+    }
+    res = SHRestricted2W(restriction, urlW, reserved);
+    heap_free(urlW);
+    return res;
+}
index d2e5857..9ee7c06 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright 2005 Jacek Caban
+ * Copyright 2010 Ilya Shpigor
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
 
+/**********************************************************************
+ * Implement the IViewObject interface
+ */
+
 #define VIEWOBJ_THIS(iface) DEFINE_THIS(WebBrowser, ViewObject, iface)
 
 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
@@ -122,3 +127,112 @@ void WebBrowser_ViewObject_Init(WebBrowser *This)
 {
     This->lpViewObjectVtbl = &ViewObjectVtbl;
 }
+
+/**********************************************************************
+ * Implement the IDataObject interface
+ */
+
+#define DATAOBJ_THIS(iface) DEFINE_THIS(WebBrowser, DataObject, iface)
+
+static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    return IWebBrowser2_QueryInterface(WEBBROWSER(This), riid, ppvObj);
+}
+
+static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    return IWebBrowser2_AddRef(WEBBROWSER(This));
+}
+
+static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    return IWebBrowser2_Release(WEBBROWSER(This));
+}
+
+static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
+{
+    WebBrowser *This = DATAOBJ_THIS(iface);
+    FIXME("(%p)->()\n", This);
+    return E_NOTIMPL;
+}
+
+static const IDataObjectVtbl DataObjectVtbl = {
+    DataObject_QueryInterface,
+    DataObject_AddRef,
+    DataObject_Release,
+    DataObject_GetData,
+    DataObject_GetDataHere,
+    DataObject_QueryGetData,
+    DataObject_GetCanonicalFormatEtc,
+    DataObject_SetData,
+    DataObject_EnumFormatEtc,
+    DataObject_DAdvise,
+    DataObject_DUnadvise,
+    DataObject_EnumDAdvise
+};
+
+#undef DATAOBJ_THIS
+
+void WebBrowser_DataObject_Init(WebBrowser *This)
+{
+    This->lpDataObjectVtbl = &DataObjectVtbl;
+}
index 2ac9b99..0c26a83 100644 (file)
@@ -102,9 +102,15 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
     }else if(IsEqualGUID(&IID_IHlinkFrame, riid)) {
         TRACE("(%p)->(IID_IHlinkFrame %p)\n", This, ppv);
         *ppv = HLINKFRAME(This);
+    }else if(IsEqualGUID(&IID_ITargetFrame2, riid)) {
+        TRACE("(%p)->(IID_ITargetFrame2 %p)\n", This, ppv);
+        *ppv = TARGETFRAME2(This);
     }else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
         *ppv = SERVPROV(This);
         TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
+    }else if(IsEqualGUID(&IID_IDataObject, riid)) {
+        *ppv = DATAOBJECT(This);
+        TRACE("(%p)->(IID_IDataObject %p)\n", This, ppv);
     }else if(IsEqualGUID(&IID_IQuickActivate, riid)) {
         TRACE("(%p)->(IID_IQuickActivate %p) returning NULL\n", This, ppv);
         return E_NOINTERFACE;
@@ -1132,6 +1138,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
 
     WebBrowser_OleObject_Init(ret);
     WebBrowser_ViewObject_Init(ret);
+    WebBrowser_DataObject_Init(ret);
     WebBrowser_Persist_Init(ret);
     WebBrowser_ClassInfo_Init(ret);
     WebBrowser_HlinkFrame_Init(ret);