Commit d72e7af9 authored by Alexandre Julliard's avatar Alexandre Julliard

shell32: Specify the full application path when starting winemenubuilder.exe.

parent c4ebf368
...@@ -105,31 +105,6 @@ static const char * DumpEvent( LONG event ) ...@@ -105,31 +105,6 @@ static const char * DumpEvent( LONG event )
#undef DUMPEV #undef DUMPEV
} }
static BOOL RefreshFileTypeAssociations(void)
{
static WCHAR szWinemenubuilder[] = {
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
' ','-','a',0 };
STARTUPINFOW si;
PROCESS_INFORMATION pi;
BOOL ret;
TRACE("starting %s\n",debugstr_w(szWinemenubuilder));
memset(&si, 0, sizeof(si));
si.cb = sizeof(si);
ret = CreateProcessW( NULL, szWinemenubuilder, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
if (ret)
{
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
return ret;
}
static const char * NodeName(const NOTIFICATIONLIST *item) static const char * NodeName(const NOTIFICATIONLIST *item)
{ {
const char *str; const char *str;
...@@ -425,8 +400,9 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID ...@@ -425,8 +400,9 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
if (wEventId & SHCNE_ASSOCCHANGED) if (wEventId & SHCNE_ASSOCCHANGED)
{ {
static const WCHAR args[] = {' ','-','a',0 };
TRACE("refreshing file type associations\n"); TRACE("refreshing file type associations\n");
RefreshFileTypeAssociations(); run_winemenubuilder( args );
} }
/* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */ /* if we allocated it, free it. The ANSI flag is also set in its Unicode sibling. */
......
...@@ -197,6 +197,8 @@ BOOL UNIXFS_is_rooted_at_desktop(void); ...@@ -197,6 +197,8 @@ BOOL UNIXFS_is_rooted_at_desktop(void);
extern const GUID CLSID_UnixFolder; extern const GUID CLSID_UnixFolder;
extern const GUID CLSID_UnixDosFolder; extern const GUID CLSID_UnixDosFolder;
extern BOOL run_winemenubuilder( const WCHAR *args );
/* Default shell folder value registration */ /* Default shell folder value registration */
HRESULT SHELL_RegisterShellFolders(void); HRESULT SHELL_RegisterShellFolders(void);
......
...@@ -395,30 +395,33 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile ...@@ -395,30 +395,33 @@ static HRESULT WINAPI IPersistFile_fnLoad(IPersistFile* iface, LPCOLESTR pszFile
return r; return r;
} }
static BOOL StartLinkProcessor( LPCOLESTR szLink ) BOOL run_winemenubuilder( const WCHAR *args )
{ {
static const WCHAR szFormat[] = { static const WCHAR menubuilder[] = {'\\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0};
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
' ','-','w',' ','"','%','s','"',0 };
LONG len; LONG len;
LPWSTR buffer; LPWSTR buffer;
STARTUPINFOW si; STARTUPINFOW si;
PROCESS_INFORMATION pi; PROCESS_INFORMATION pi;
BOOL ret; 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 = HeapAlloc( GetProcessHeap(), 0, len ); buffer = HeapAlloc( GetProcessHeap(), 0, len );
if( !buffer ) if( !buffer )
return FALSE; return FALSE;
wsprintfW( buffer, szFormat, szLink ); strcpyW( buffer, app );
strcatW( buffer, args );
TRACE("starting %s\n",debugstr_w(buffer)); TRACE("starting %s\n",debugstr_w(buffer));
memset(&si, 0, sizeof(si)); memset(&si, 0, sizeof(si));
si.cb = 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 ); HeapFree( GetProcessHeap(), 0, buffer );
...@@ -431,6 +434,24 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink ) ...@@ -431,6 +434,24 @@ static BOOL StartLinkProcessor( LPCOLESTR szLink )
return ret; return ret;
} }
static BOOL StartLinkProcessor( LPCOLESTR szLink )
{
static const WCHAR szFormat[] = {' ','-','w',' ','"','%','s','"',0 };
LONG len;
LPWSTR buffer;
BOOL ret;
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
buffer = HeapAlloc( GetProcessHeap(), 0, len );
if( !buffer )
return FALSE;
wsprintfW( buffer, szFormat, szLink );
ret = run_winemenubuilder( buffer );
HeapFree( GetProcessHeap(), 0, buffer );
return ret;
}
static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember) static HRESULT WINAPI IPersistFile_fnSave(IPersistFile* iface, LPCOLESTR pszFileName, BOOL fRemember)
{ {
IShellLinkImpl *This = impl_from_IPersistFile(iface); IShellLinkImpl *This = impl_from_IPersistFile(iface);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment