[2/4] shell32/tests: Improve the shell_execute{_ex}() tracing.
Francois Gouget
fgouget at codeweavers.com
Sun Sep 30 20:30:47 CDT 2012
---
dlls/shell32/tests/shlexec.c | 41 ++++++++++++++++++++---------------------
1 file changed, 20 insertions(+), 21 deletions(-)
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index f34e569..6cfb2b0 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -75,18 +75,17 @@ static void init_event(const char* child_file)
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, "\"");
}
- else
- {
- strcat(str, "null");
- }
}
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);
strcpy(shell_call, "ShellExecute(");
- strcat_param(shell_call, operation);
- strcat(shell_call, ", ");
- strcat_param(shell_call, file);
- strcat(shell_call, ", ");
- strcat_param(shell_call, parameters);
- 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, ")");
if (winetest_debug > 1)
trace("%s\n", shell_call);
@@ -162,13 +158,16 @@ static INT_PTR shell_execute_ex(DWORD mask, LPCSTR operation, LPCSTR file,
INT_PTR rc;
strcpy(shell_call, "ShellExecuteEx(");
- strcat_param(shell_call, operation);
- strcat(shell_call, ", ");
- strcat_param(shell_call, file);
- strcat(shell_call, ", ");
- strcat_param(shell_call, parameters);
- strcat(shell_call, ", ");
- strcat_param(shell_call, directory);
+ if (mask)
+ {
+ char smask[11];
+ sprintf(smask, "0x%x", mask);
+ strcat_param(shell_call, "mask", smask);
+ }
+ 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, ")");
if (winetest_debug > 1)
trace("%s\n", shell_call);
--
1.7.10.4
More information about the wine-patches
mailing list