shell32/tests: Improve the shell_execute{_ex}() tracing.

This commit is contained in:
Francois Gouget 2012-10-01 03:30:47 +02:00 committed by Alexandre Julliard
parent 906127fe29
commit 483b8f7608
1 changed files with 20 additions and 21 deletions

View File

@ -75,18 +75,17 @@ static void init_event(const char* child_file)
hEvent=CreateEvent(NULL, FALSE, FALSE, event_name); hEvent=CreateEvent(NULL, FALSE, FALSE, event_name);
} }
static void strcat_param(char* str, const char* param) static void strcat_param(char* str, const char* name, const char* param)
{ {
if (param!=NULL) if (param)
{ {
strcat(str, "\""); if (str[strlen(str)-1] == '"')
strcat(str, ", ");
strcat(str, name);
strcat(str, "=\"");
strcat(str, param); strcat(str, param);
strcat(str, "\""); strcat(str, "\"");
} }
else
{
strcat(str, "null");
}
} }
static char shell_call[2048]=""; static char shell_call[2048]="";
@ -99,13 +98,10 @@ static INT_PTR shell_execute(LPCSTR operation, LPCSTR file, LPCSTR parameters, L
rcEmpty = shell_execute("", file, parameters, directory); rcEmpty = shell_execute("", file, parameters, directory);
strcpy(shell_call, "ShellExecute("); strcpy(shell_call, "ShellExecute(");
strcat_param(shell_call, operation); strcat_param(shell_call, "verb", operation);
strcat(shell_call, ", "); strcat_param(shell_call, "file", file);
strcat_param(shell_call, file); strcat_param(shell_call, "params", parameters);
strcat(shell_call, ", "); strcat_param(shell_call, "dir", directory);
strcat_param(shell_call, parameters);
strcat(shell_call, ", ");
strcat_param(shell_call, directory);
strcat(shell_call, ")"); strcat(shell_call, ")");
if (winetest_debug > 1) if (winetest_debug > 1)
trace("%s\n", shell_call); trace("%s\n", shell_call);
@ -162,13 +158,16 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR operation, LPCSTR file,
INT_PTR rc; INT_PTR rc;
strcpy(shell_call, "ShellExecuteEx("); strcpy(shell_call, "ShellExecuteEx(");
strcat_param(shell_call, operation); if (mask)
strcat(shell_call, ", "); {
strcat_param(shell_call, file); char smask[11];
strcat(shell_call, ", "); sprintf(smask, "0x%x", mask);
strcat_param(shell_call, parameters); strcat_param(shell_call, "mask", smask);
strcat(shell_call, ", "); }
strcat_param(shell_call, directory); strcat_param(shell_call, "verb", operation);
strcat_param(shell_call, "file", file);
strcat_param(shell_call, "params", parameters);
strcat_param(shell_call, "dir", directory);
strcat(shell_call, ")"); strcat(shell_call, ")");
if (winetest_debug > 1) if (winetest_debug > 1)
trace("%s\n", shell_call); trace("%s\n", shell_call);