sync SHELL_FindExecutable and SHELL_FindExecutableByOperation with wine 1.1.19

svn path=/trunk/; revision=40631
This commit is contained in:
Christoph von Wittich 2009-04-21 09:49:59 +00:00
parent e6661c0b54
commit f27e9f53f1
2 changed files with 9 additions and 6 deletions

View file

@ -217,9 +217,6 @@ typedef UINT_PTR (*SHELL_ExecuteW32)(const WCHAR *lpCmd, WCHAR *env, BOOL shWait
BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc);
UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args);
extern WCHAR swShell32Name[MAX_PATH];
BOOL UNIXFS_is_rooted_at_desktop(void);

View file

@ -449,7 +449,7 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, filetype, 0, 0x02000000, &hkeyClass))
return SE_ERR_NOASSOC;
if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb)))
if (!HCR_GetDefaultVerbW(hkeyClass, lpOperation, verb, sizeof(verb)/sizeof(verb[0])))
return SE_ERR_NOASSOC;
RegCloseKey(hkeyClass);
@ -511,7 +511,7 @@ static UINT SHELL_FindExecutableByOperation(LPCWSTR lpOperation, LPWSTR key, LPW
* command (it'll be used afterwards for more information
* on the operation)
*/
UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
static UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
LPWSTR lpResult, int resultLen, LPWSTR key, WCHAR **env, LPITEMIDLIST pidl, LPCWSTR args)
{
static const WCHAR wWindows[] = {'w','i','n','d','o','w','s',0};
@ -565,6 +565,12 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
}
else
{
/* Did we get something? Anything? */
if (xlpFile[0]==0)
{
TRACE("Returning SE_ERR_FNF\n");
return SE_ERR_FNF;
}
/* First thing we need is the file's extension */
extension = wcsrchr(xlpFile, '.'); /* Assume last "." is the one; */
/* File->Run in progman uses */
@ -609,7 +615,7 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
* attached */
TRACE("found %s\n", debugstr_w(lpResult));
return 33;
/* Greater than 32 to indicate success */
/* Greater than 32 to indicate success */
}
tok = p;
}