diff --git a/misc/options.c b/misc/options.c index ca8d99a8556..72c52ee5c3d 100644 --- a/misc/options.c +++ b/misc/options.c @@ -10,6 +10,7 @@ #include "winbase.h" #include "winnls.h" +#include "ntddk.h" #include "wine/library.h" #include "options.h" #include "version.h" @@ -165,6 +166,12 @@ static void do_debugmsg( const char *arg ) char *opt, *options = strdup(arg); int i; + /* defined in relay32/relay386.c */ + extern char **debug_relay_includelist; + extern char **debug_relay_excludelist; + /* defined in relay32/snoop.c */ + extern char **debug_snoop_includelist; + extern char **debug_snoop_excludelist; if (!(opt = strtok( options, "," ))) goto error; do @@ -192,6 +199,48 @@ static void do_debugmsg( const char *arg ) { if (*p == '+') set = ~0; else clear = ~0; + if (!strncasecmp(p+1, "relay=", 6) || + !strncasecmp(p+1, "snoop=", 6)) + { + int i, l; + char *s, *s2, ***output, c; + + if (strchr(p,',')) + l=strchr(p,',')-p; + else + l=strlen(p); + set = ~0; + clear = 0; + output = (*p == '+') ? + ((*(p+1) == 'r') ? + &debug_relay_includelist : + &debug_snoop_includelist) : + ((*(p+1) == 'r') ? + &debug_relay_excludelist : + &debug_snoop_excludelist); + s = p + 7; + /* if there are n ':', there are n+1 modules, and we need + n+2 slots, last one being for the sentinel (NULL) */ + i = 2; + while((s = strchr(s, ':'))) i++, s++; + *output = malloc(sizeof(char **) * i); + i = 0; + s = p + 7; + while((s2 = strchr(s, ':'))) { + c = *s2; + *s2 = '\0'; + *((*output)+i) = _strupr(strdup(s)); + *s2 = c; + s = s2 + 1; + i++; + } + c = *(p + l); + *(p + l) = '\0'; + *((*output)+i) = _strupr(strdup(s)); + *(p + l) = c; + *((*output)+i+1) = NULL; + *(p + 6) = '\0'; + } } p++; if (!strcmp( p, "all" )) p = ""; /* empty string means all */