Commit 3f3e42b6 authored by Andrew Eikum's avatar Andrew Eikum Committed by Alexandre Julliard

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

parent 90ca3620
...@@ -129,7 +129,7 @@ BOOL HCR_GetDefaultVerbW( HKEY hkeyClass, LPCWSTR szVerb, LPWSTR szDest, DWORD l ...@@ -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); TRACE("%p %s %p\n", hkeyClass, debugstr_w(szVerb), szDest);
if (szVerb) if (szVerb && *szVerb)
{ {
lstrcpynW(szDest, szVerb, len); lstrcpynW(szDest, szVerb, len);
return TRUE; return TRUE;
......
...@@ -1517,7 +1517,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, ...@@ -1517,7 +1517,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd,
TRACE("Got URL: %s\n", debugstr_w(lpFile)); TRACE("Got URL: %s\n", debugstr_w(lpFile));
/* Looking for ...protocol\shell\lpOperation\command */ /* Looking for ...protocol\shell\lpOperation\command */
len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1; len = iSize + lstrlenW(wShell) + lstrlenW(wCommand) + 1;
if (psei->lpVerb) if (psei->lpVerb && *psei->lpVerb)
len += lstrlenW(psei->lpVerb); len += lstrlenW(psei->lpVerb);
else else
len += lstrlenW(wszOpen); len += lstrlenW(wszOpen);
...@@ -1525,7 +1525,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd, ...@@ -1525,7 +1525,7 @@ static UINT_PTR SHELL_execute_url( LPCWSTR lpFile, LPCWSTR wFile, LPCWSTR wcmd,
memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR)); memcpy(lpstrProtocol, lpFile, iSize*sizeof(WCHAR));
lpstrProtocol[iSize] = '\0'; lpstrProtocol[iSize] = '\0';
strcatW(lpstrProtocol, wShell); strcatW(lpstrProtocol, wShell);
strcatW(lpstrProtocol, psei->lpVerb? psei->lpVerb: wszOpen); strcatW(lpstrProtocol, psei->lpVerb && *psei->lpVerb ? psei->lpVerb: wszOpen);
strcatW(lpstrProtocol, wCommand); strcatW(lpstrProtocol, wCommand);
/* Remove File Protocol from lpFile */ /* Remove File Protocol from lpFile */
......
...@@ -92,7 +92,10 @@ static void strcat_param(char* str, const char* param) ...@@ -92,7 +92,10 @@ static void strcat_param(char* str, const char* param)
static char shell_call[2048]=""; static char shell_call[2048]="";
static int shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, LPCSTR directory) 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("); strcpy(shell_call, "ShellExecute(");
strcat_param(shell_call, operation); strcat_param(shell_call, operation);
...@@ -139,6 +142,10 @@ static int shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, LPCST ...@@ -139,6 +142,10 @@ static int shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, LPCST
if (rc > 32) if (rc > 32)
dump_child(); 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; return rc;
} }
......
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