shell32: ShellExec with empty operation should behave same as with NULL operation.

This commit is contained in:
Andrew Eikum 2011-10-18 15:19:17 -05:00 committed by Alexandre Julliard
parent 90ca362013
commit 3f3e42b6bc
3 changed files with 11 additions and 4 deletions

View File

@ -129,7 +129,7 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l
TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
if (szVerb)
if (szVerb && *szVerb)
{
lstrcpynW(szDest, szVerb, len);
return TRUE;

View File

@ -1517,7 +1517,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd,
TRACE("Got URL: %s\n", debugstr_w(lpFile));
/* Looking for ...protocol\shell\lpOperation\command */
len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1;
if (psei->lpVerb)
if (psei->lpVerb && *psei->lpVerb)
len += lstrlenW(psei->lpVerb);
else
len += lstrlenW(wszOpen);
@ -1525,7 +1525,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd,
memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR));
lpstrProtocol[iSize] = '\0';
strcatW(lpstrProtocol, wShell);
strcatW(lpstrProtocol, psei->lpVerb? psei->lpVerb: wszOpen);
strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb: wszOpen);
strcatW(lpstrProtocol, wCommand);
/* Remove File Protocol from lpFile */

View File

@ -92,7 +92,10 @@ static void strcat_param(char* str, const char* param)
static char shell_call[2048]="";
static int shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, LPCSTR directory)
{
INT_PTR rc;
INT_PTR rc, rcEmpty = 0;
if(!operation)
rcEmpty = shell_execute("", file, parameters, directory);
strcpy(shell_call, "ShellExecute(");
strcat_param(shell_call, operation);
@ -139,6 +142,10 @@ static int shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, LPCST
if (rc > 32)
dump_child();
if(!operation)
ok(rc == rcEmpty || broken(rc > 32 && rcEmpty == SE_ERR_NOASSOC) /* NT4 */,
"Got different return value with empty string: %lu %lu\n", rc, rcEmpty);
return rc;
}