Module: wine Branch: master Commit: 0856f774704b33db2f016805803333c549e731f2 URL: http://source.winehq.org/git/wine.git/?a=commit;h=0856f774704b33db2f01680580...
Author: Alexandre Julliard julliard@winehq.org Date: Tue Oct 27 11:22:32 2009 +0100
shdocvw: Specify the full application path when starting winemenubuilder.exe.
---
dlls/shdocvw/intshcut.c | 37 +++++++++++++++++++++++++++++-------- 1 files changed, 29 insertions(+), 8 deletions(-)
diff --git a/dlls/shdocvw/intshcut.c b/dlls/shdocvw/intshcut.c index 86bc543..b389ec3 100644 --- a/dlls/shdocvw/intshcut.c +++ b/dlls/shdocvw/intshcut.c @@ -65,32 +65,35 @@ static inline InternetShortcut* impl_from_IPersistFile(IPersistFile *iface) return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, persistFile)); }
-static BOOL StartLinkProcessor(LPCOLESTR szLink) +static BOOL run_winemenubuilder( const WCHAR *args ) { - 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 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];
- len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR); + 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;
- wsprintfW( buffer, szFormat, szLink ); + strcpyW( buffer, app ); + strcatW( buffer, args );
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 ); + ret = CreateProcessW( app, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
- HeapFree( GetProcessHeap(), 0, buffer ); + heap_free( buffer );
if (ret) { @@ -101,6 +104,24 @@ static BOOL StartLinkProcessor(LPCOLESTR szLink) 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 ); + if( !buffer ) + return FALSE; + + wsprintfW( buffer, szFormat, szLink ); + ret = run_winemenubuilder( buffer ); + heap_free( buffer ); + return ret; +} + /* interface functions */
static HRESULT Unknown_QueryInterface(InternetShortcut *This, REFIID riid, PVOID *ppvObject)