Francois Gouget : shell32/tests: Improve the shell_execute{_ex}() tracing.
Alexandre Julliard
julliard at winehq.org
Mon Oct 1 13:35:01 CDT 2012
Module: wine
Branch: master
Commit: 483b8f7608e2b4688e866d4377f39559ee946446
URL: http://source.winehq.org/git/wine.git/?a=commit;h=483b8f7608e2b4688e866d4377f39559ee946446
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Mon Oct 1 03:30:47 2012 +0200
shell32/tests: Improve the shell_execute{_ex}() tracing.
---
dlls/shell32/tests/shlexec.c | 41 ++++++++++++++++++++---------------------
1 files 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);
More information about the wine-cvs
mailing list