Snoop Include/Excludwe

Rein Klazes rklazes at xs4all.nl
Wed Oct 15 10:31:44 CDT 2003


On Tue, 14 Oct 2003 12:12:13 -0700, you wrote:

> Rein Klazes <rklazes at xs4all.nl> writes:
> 
> > The wine.conf man page says that in Snoop Include/Exclude specifiying
> > <dllname>.* includes the whole dll. 
> > This does not work: you have to specify <dllname> without the ".*", at
> > least that is the code.
> >
> > What should be corrected code or documentation?
> 
> The code actually, the idea is that a name without dot is interpreted
> as a function name, and with a dot the left part is a dll name and the
> right part is either a function or '*'. That's at least how the 32-bit
> relay works, the others should probably be fixed to behave the same
> way.

For snooping:

ChangeLog:
	dlls/ntdll	: relay.c
	dlls/kernel	: relay16.c

	Make items in the snoop include/exclude lists work as
	documented: either <DLLNAME>.* or <DLLNAME>.<ordinal> or
	<DLLNAME>.<function> or <function>

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/ntdll/relay.c	2003-10-09 08:33:20.000000000 +0200
+++ mywine/dlls/ntdll/relay.c	2003-10-15 16:45:52.000000000 +0200
@@ -784,8 +784,16 @@
     for(; *listitem; listitem++)
     {
         itemlen = strlenW(*listitem);
-        if((itemlen == len && !strncmpiAW( buf, *listitem, len)) ||
+            /* item specified as <DLLNAME>.* */
+        if( (itemlen == len + 2 && !strcmpAW( ".*",*listitem + len) && 
+                !strncmpiAW( dll, *listitem, len)) ||
+            /* specified as <DLLNAME>.nnn */
            (itemlen == len2 && !strncmpiAW(buf, *listitem, len2)) ||
+            /* specified as <DLLNAME>.<function> */
+           (fname && itemlen > len + 1 && !strncmpiAW(dll, *listitem, len) &&
+                (*listitem)[len] == (WCHAR) '.' && 
+                !strcmpAW(fname, *listitem + len + 1)) ||
+            /* specified as <function> */
            (fname && !strcmpAW(fname, *listitem)))
             return !show;
     }
--- wine/dlls/kernel/relay16.c	2003-10-09 08:33:11.000000000 +0200
+++ mywine/dlls/kernel/relay16.c	2003-10-15 17:03:52.000000000 +0200
@@ -48,6 +48,13 @@
 static const WCHAR **debug_snoop_includelist;
 
 /* compare an ASCII and a Unicode string without depending on the current codepage */
+inline static int strcmpAW( const char *strA, const WCHAR *strW )
+{
+    while (*strA && ((unsigned char)*strA == *strW)) { strA++; strW++; }
+    return (unsigned char)*strA - *strW;
+}
+
+/* compare an ASCII and a Unicode string without depending on the current codepage */
 inline static int strncmpiAW( const char *strA, const WCHAR *strW, int n )
 {
     int ret = 0;
@@ -221,9 +228,18 @@
     for(; *listitem; listitem++)
     {
         itemlen = strlenW(*listitem);
-        if (itemlen == len && !strncmpiAW( buf, *listitem, len)) return !show;
-        if (itemlen == len2 && !strncmpiAW(buf, *listitem, len2)) return !show;
-        if (fname && !strncmpiAW(fname, *listitem, itemlen) && !fname[itemlen]) return !show;
+            /* item specified as <DLLNAME>.* */
+        if( (itemlen == len + 2 && !strcmpAW( ".*",*listitem + len) && 
+                !strncmpiAW( dll, *listitem, len)) ||
+            /* specified as <DLLNAME>.nnn */
+           (itemlen == len2 && !strncmpiAW(buf, *listitem, len2)) ||
+            /* specified as <DLLNAME>.<function> */
+           (fname && itemlen > len + 1 && !strncmpiAW(dll, *listitem, len) &&
+                (*listitem)[len] == (WCHAR) '.' && 
+                !strcmpAW(fname, *listitem + len + 1)) ||
+            /* specified as <function> */
+           (fname && !strcmpAW(fname, *listitem)))
+            return !show;
     }
     return show;
   }


More information about the wine-devel mailing list