Author: cwittich
Date: Tue Mar 2 20:38:02 2010
New Revision: 45764
URL:
http://svn.reactos.org/svn/reactos?rev=45764&view=rev
Log:
[SHDOCVW]
sync shdocvw to wine 1.1.39
Modified:
trunk/reactos/dll/win32/shdocvw/dochost.c
trunk/reactos/dll/win32/shdocvw/intshcut.c
trunk/reactos/dll/win32/shdocvw/oleobject.c
trunk/reactos/dll/win32/shdocvw/shdocvw.h
trunk/reactos/dll/win32/shdocvw/shdocvw.inf
trunk/reactos/dll/win32/shdocvw/shdocvw_main.c
trunk/reactos/dll/win32/shdocvw/webbrowser.c
Modified: trunk/reactos/dll/win32/shdocvw/dochost.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/dochost.…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/dochost.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/dochost.c [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -362,6 +362,29 @@
This->document = NULL;
}
+void release_dochost_client(DocHost *This)
+{
+ if(This->hwnd) {
+ DestroyWindow(This->hwnd);
+ This->hwnd = NULL;
+ }
+
+ if(This->hostui) {
+ IDocHostUIHandler_Release(This->hostui);
+ This->hostui = NULL;
+ }
+
+ if(This->client_disp) {
+ IDispatch_Release(This->client_disp);
+ This->client_disp = NULL;
+ }
+
+ if(This->frame) {
+ IOleInPlaceFrame_Release(This->frame);
+ This->frame = NULL;
+ }
+}
+
#define OLECMD_THIS(iface) DEFINE_THIS(DocHost, OleCommandTarget, iface)
static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
@@ -387,8 +410,13 @@
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{
DocHost *This = OLECMD_THIS(iface);
+ ULONG i= 0;
FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup),
cCmds, prgCmds,
pCmdText);
+ while (prgCmds && (cCmds > i)) {
+ FIXME("command_%u: %u, 0x%x\n", i, prgCmds[i].cmdID, prgCmds[i].cmdf);
+ i++;
+ }
return E_NOTIMPL;
}
@@ -744,14 +772,10 @@
void DocHost_Release(DocHost *This)
{
- if(This->client_disp)
- IDispatch_Release(This->client_disp);
- if(This->frame)
- IOleInPlaceFrame_Release(This->frame);
-
+ release_dochost_client(This);
DocHost_ClientSite_Release(This);
ConnectionPointContainer_Destroy(&This->cps);
- SysFreeString(This->url);
-}
+ CoTaskMemFree(This->url);
+}
Modified: trunk/reactos/dll/win32/shdocvw/intshcut.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/intshcut…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/intshcut.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/intshcut.c [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -65,16 +65,51 @@
return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut,
persistFile));
}
-static BOOL StartLinkProcessor(LPCOLESTR szLink)
-{
- static const WCHAR szFormat[] = {
-
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
- ' ','-','w',' ','-','u','
','"','%','s','"',0 };
+static BOOL run_winemenubuilder( const WCHAR *args )
+{
+ static const WCHAR menubuilder[] =
{'\\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0};
LONG len;
LPWSTR buffer;
STARTUPINFOW si;
PROCESS_INFORMATION pi;
BOOL ret;
+ WCHAR app[MAX_PATH];
+
+ GetSystemDirectoryW( app, MAX_PATH - sizeof(menubuilder)/sizeof(WCHAR) );
+ strcatW( app, menubuilder );
+
+ len = (strlenW( app ) + strlenW( args ) + 1) * sizeof(WCHAR);
+ buffer = heap_alloc( len );
+ if( !buffer )
+ return FALSE;
+
+ strcpyW( buffer, app );
+ strcatW( buffer, args );
+
+ TRACE("starting %s\n",debugstr_w(buffer));
+
+ memset(&si, 0, sizeof(si));
+ si.cb = sizeof(si);
+
+ ret = CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi
);
+
+ heap_free( buffer );
+
+ if (ret)
+ {
+ CloseHandle( pi.hProcess );
+ CloseHandle( pi.hThread );
+ }
+
+ return ret;
+}
+
+static BOOL StartLinkProcessor( LPCOLESTR szLink )
+{
+ static const WCHAR szFormat[] = { ' ','-','w','
','-','u','
','"','%','s','"',0 };
+ LONG len;
+ LPWSTR buffer;
+ BOOL ret;
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
buffer = heap_alloc( len );
@@ -82,22 +117,8 @@
return FALSE;
wsprintfW( buffer, szFormat, szLink );
-
- TRACE("starting %s\n",debugstr_w(buffer));
-
- memset(&si, 0, sizeof(si));
- si.cb = sizeof(si);
-
- ret = CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si,
&pi );
-
- HeapFree( GetProcessHeap(), 0, buffer );
-
- if (ret)
- {
- CloseHandle( pi.hProcess );
- CloseHandle( pi.hThread );
- }
-
+ ret = run_winemenubuilder( buffer );
+ heap_free( buffer );
return ret;
}
Modified: trunk/reactos/dll/win32/shdocvw/oleobject.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/oleobjec…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/oleobject.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/oleobject.c [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -255,6 +255,36 @@
return S_OK;
}
+static void release_client_site(WebBrowser *This)
+{
+ release_dochost_client(&This->doc_host);
+
+ if(This->shell_embedding_hwnd) {
+ DestroyWindow(This->shell_embedding_hwnd);
+ This->shell_embedding_hwnd = NULL;
+ }
+
+ if(This->inplace) {
+ IOleInPlaceSite_Release(This->inplace);
+ This->inplace = NULL;
+ }
+
+ if(This->container) {
+ IOleContainer_Release(This->container);
+ This->container = NULL;
+ }
+
+ if(This->uiwindow) {
+ IOleInPlaceUIWindow_Release(This->uiwindow);
+ This->uiwindow = NULL;
+ }
+
+ if(This->client) {
+ IOleClientSite_Release(This->client);
+ This->client = NULL;
+ }
+}
+
/**********************************************************************
* Implement the IOleObject interface for the WebBrowser control
*/
@@ -282,7 +312,9 @@
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
pClientSite)
{
WebBrowser *This = OLEOBJ_THIS(iface);
+ IDocHostUIHandler *hostui;
IOleContainer *container;
+ IDispatch *disp;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, pClientSite);
@@ -290,29 +322,7 @@
if(This->client == pClientSite)
return S_OK;
- if(This->doc_host.hwnd) {
- DestroyWindow(This->doc_host.hwnd);
- This->doc_host.hwnd = NULL;
- }
- if(This->shell_embedding_hwnd) {
- DestroyWindow(This->shell_embedding_hwnd);
- This->shell_embedding_hwnd = NULL;
- }
-
- if(This->inplace) {
- IOleInPlaceSite_Release(This->inplace);
- This->inplace = NULL;
- }
-
- if(This->doc_host.hostui) {
- IDocHostUIHandler_Release(This->doc_host.hostui);
- This->doc_host.hostui = NULL;
- }
-
- if(This->client)
- IOleClientSite_Release(This->client);
-
- This->client = pClientSite;
+ release_client_site(This);
if(!pClientSite) {
if(This->doc_host.document)
@@ -321,12 +331,17 @@
}
IOleClientSite_AddRef(pClientSite);
-
- IOleClientSite_QueryInterface(This->client, &IID_IDispatch,
- (void**)&This->doc_host.client_disp);
-
- IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
- (void**)&This->doc_host.hostui);
+ This->client = pClientSite;
+
+ hres = IOleClientSite_QueryInterface(This->client, &IID_IDispatch,
+ (void**)&disp);
+ if(SUCCEEDED(hres))
+ This->doc_host.client_disp = disp;
+
+ hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
+ (void**)&hostui);
+ if(SUCCEEDED(hres))
+ This->doc_host.hostui = hostui;
hres = IOleClientSite_GetContainer(This->client, &container);
if(SUCCEEDED(hres)) {
@@ -963,10 +978,5 @@
void WebBrowser_OleObject_Destroy(WebBrowser *This)
{
- if(This->client)
- IOleObject_SetClientSite(OLEOBJ(This), NULL);
- if(This->container)
- IOleContainer_Release(This->container);
- if(This->uiwindow)
- IOleInPlaceUIWindow_Release(This->uiwindow);
-}
+ release_client_site(This);
+}
Modified: trunk/reactos/dll/win32/shdocvw/shdocvw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw.…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/shdocvw.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/shdocvw.h [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -205,6 +205,7 @@
void DocHost_Init(DocHost*,IDispatch*);
void DocHost_ClientSite_Init(DocHost*);
void DocHost_Frame_Init(DocHost*);
+void release_dochost_client(DocHost*);
void DocHost_Release(DocHost*);
void DocHost_ClientSite_Release(DocHost*);
@@ -251,6 +252,8 @@
HRESULT register_class_object(BOOL);
HRESULT get_typeinfo(ITypeInfo**);
DWORD register_iexplore(BOOL);
+
+const char *debugstr_variant(const VARIANT*);
/* memory allocation functions */
Modified: trunk/reactos/dll/win32/shdocvw/shdocvw.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw.…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/shdocvw.inf [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/shdocvw.inf [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -34,10 +34,10 @@
HKCR,"CLSID\%CLSID_SearchAssistantOC%\InProcServer32","ThreadingModel",,"Apartment"
HKCR,"CLSID\%CLSID_SearchAssistantOC%\ProgID",,,"SearchAssistantOC.SearchAssistantOC.1"
HKCR,"CLSID\%CLSID_SearchAssistantOC%\VersionIndependentProgID",,,"SearchAssistantOC.SearchAssistantOC"
-HKCR,"SearchAssistantOC.SearchAssistantOC",,,""
+HKCR,"SearchAssistantOC.SearchAssistantOC",,,"SearchAssistantOC"
HKCR,"SearchAssistantOC.SearchAssistantOC\CLSID",,,"%CLSID_SearchAssistantOC%"
HKCR,"SearchAssistantOC.SearchAssistantOC\CurVer",,,"SearchAssistantOC.SearchAssistantOC.1"
-HKCR,"SearchAssistantOC.SearchAssistantOC.1",,,""
+HKCR,"SearchAssistantOC.SearchAssistantOC.1",,,"SearchAssistantOC"
HKCR,"SearchAssistantOC.SearchAssistantOC.1\CLSID",,,"%CLSID_SearchAssistantOC%"
HKCR,"CLSID\%CLSID_ShellNameSpace%",,,"Shell Name Space"
@@ -67,7 +67,7 @@
HKCR,"Shell.UIHelper",,,"Microsoft Shell UI Helper"
HKCR,"Shell.UIHelper\CLSID",,,"%CLSID_ShellUIHelper%"
HKCR,"Shell.UIHelper\CurVer",,,"Shell.UIHelper.2"
-HKCR,"Shell.UIHelper.1",,,""
+HKCR,"Shell.UIHelper.1",,,"Microsoft Shell UI Helper"
HKCR,"Shell.UIHelper.1\CLSID",,,"%CLSID_ShellUIHelper%"
HKCR,"CLSID\%CLSID_Internet%\DefaultIcon",,,"shdoclc.dll,-190"
@@ -86,7 +86,7 @@
HKCR,"Shell.Explorer",,,"Microsoft Web Browser"
HKCR,"Shell.Explorer\CLSID",,,"%CLSID_WebBrowser%"
HKCR,"Shell.Explorer\CurVer",,,"Shell.Explorer.2"
-HKCR,"Shell.Explorer.2",,,""
+HKCR,"Shell.Explorer.2",,,"Microsoft Web Browser"
HKCR,"Shell.Explorer.2\CLSID",,,"%CLSID_WebBrowser%"
HKCR,"CLSID\%CLSID_ShellWindows%",,,"ShellWindows"
@@ -108,14 +108,14 @@
HKCR,"CLSID\%CLSID_WebBrowser_V1%\InProcServer32","ThreadingModel",,"Apartment"
HKCR,"CLSID\%CLSID_WebBrowser_V1%\ProgID",,,"Shell.Explorer.1"
HKCR,"CLSID\%CLSID_WebBrowser_V1%\VersionIndependentProgID",,,"Shell.Explorer"
-HKCR,"Shell.Explorer.1",,,""
+HKCR,"Shell.Explorer.1",,,"Microsoft Web Browser"
HKCR,"Shell.Explorer.1\CLSID",,,"%CLSID_WebBrowser_V1%"
HKCR,"CLSID\%CLSID_InternetShortcut%",,,"Internet Shortcut"
HKCR,"CLSID\%CLSID_InternetShortcut%\InProcServer32",,,"%MODULE%"
HKCR,"CLSID\%CLSID_InternetShortcut%\InProcServer32","ThreadingModel",,"Apartment"
HKCR,"CLSID\%CLSID_InternetShortcut%\ProgID",,,"InternetShortcut"
-HKCR,"CLSID\%CLSID_InternetShortcut%\shellex\MayChangeDefaultMenu",,,
+HKCR,"CLSID\%CLSID_InternetShortcut%\shellex\MayChangeDefaultMenu",,16
HKCR,"InternetShortcut",,,"Internet Shortcut"
HKCR,"InternetShortcut","EditFlags",2,"2"
HKCR,"InternetShortcut","IsShortcut",,
Modified: trunk/reactos/dll/win32/shdocvw/shdocvw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/shdocvw_…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/shdocvw_main.c [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -65,6 +65,31 @@
*typeinfo = wb_typeinfo;
return hres;
+}
+
+const char *debugstr_variant(const VARIANT *v)
+{
+ if(!v)
+ return "(null)";
+
+ switch(V_VT(v)) {
+ case VT_EMPTY:
+ return "{VT_EMPTY}";
+ case VT_NULL:
+ return "{VT_NULL}";
+ case VT_I4:
+ return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
+ case VT_R8:
+ return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
+ case VT_BSTR:
+ return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
+ case VT_DISPATCH:
+ return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
+ case VT_BOOL:
+ return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
+ default:
+ return wine_dbg_sprintf("{vt %d}", V_VT(v));
+ }
}
/*************************************************************************
Modified: trunk/reactos/dll/win32/shdocvw/webbrowser.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shdocvw/webbrows…
==============================================================================
--- trunk/reactos/dll/win32/shdocvw/webbrowser.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shdocvw/webbrowser.c [iso-8859-1] Tue Mar 2 20:38:02 2010
@@ -269,8 +269,9 @@
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags,
TargetFrameName,
- PostData, Headers);
+ TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_w(szUrl),
debugstr_variant(Flags),
+ debugstr_variant(TargetFrameName), debugstr_variant(PostData),
+ debugstr_variant(Headers));
return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData,
Headers);
}
@@ -285,7 +286,7 @@
static HRESULT WINAPI WebBrowser_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%p)\n", This, Level);
+ FIXME("(%p)->(%s)\n", This, debugstr_variant(Level));
return E_NOTIMPL;
}
@@ -516,22 +517,28 @@
static HRESULT WINAPI WebBrowser_PutProperty(IWebBrowser2 *iface, BSTR szProperty,
VARIANT vtValue)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty));
+ FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty),
debugstr_variant(&vtValue));
return E_NOTIMPL;
}
static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szProperty,
VARIANT *pvtValue)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue);
+ FIXME("(%p)->(%s %s)\n", This, debugstr_w(szProperty),
debugstr_variant(pvtValue));
return E_NOTIMPL;
}
static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name)
{
- WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%p)\n", This, Name);
- return E_NOTIMPL;
+ static const WCHAR sName[] =
{'M','i','c','r','o','s','o','f','t','
','W','e','b',
+ '
','B','r','o','w','s','e','r','
','C','o','n','t','r','o','l',0};
+ WebBrowser *This = WEBBROWSER_THIS(iface);
+
+ TRACE("(%p)->(%p)\n", This, Name);
+
+ *Name = SysAllocString(sName);
+
+ return S_OK;
}
static HRESULT WINAPI WebBrowser_get_HWND(IWebBrowser2 *iface, LONG *pHWND)
@@ -726,7 +733,8 @@
WebBrowser *This = WEBBROWSER_THIS(iface);
LPCWSTR url;
- TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName,
PostData, Headers);
+ TRACE("(%p)->(%s %s %s %s %s)\n", This, debugstr_variant(URL),
debugstr_variant(Flags),
+ debugstr_variant(TargetFrameName), debugstr_variant(PostData),
debugstr_variant(Headers));
if(!This->client)
return E_FAIL;
@@ -761,7 +769,7 @@
OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut);
+ FIXME("(%p)->(%d %d %s %p)\n", This, cmdID, cmdexecopt,
debugstr_variant(pvaIn), pvaOut);
return E_NOTIMPL;
}
@@ -769,7 +777,8 @@
VARIANT *pvarShow, VARIANT *pvarSize)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
- FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize);
+ FIXME("(%p)->(%s %s %s)\n", This, debugstr_variant(pvaClsid),
debugstr_variant(pvarShow),
+ debugstr_variant(pvarSize));
return E_NOTIMPL;
}