On Tue, 15 Jan 2002 [EMAIL PROTECTED] wrote:
[...]
> Hmmm, I can not get a +snoop=riched32 trace with the native
> riched32.  That frustrated me the last time I beat my head against this
> app and riched32.  +snoop simply hangs, and +edit,-snoop=msvcrt produces
> a huge trace, but the only mention of riched is in some strings to
> mfc42.6442.

   What happens when snoop hangs? Does the process seem to get into an
infinite loop?
   I once had a problem with +snoop where it would get into an infinite
loop when the pointer was 0xffffffff (-1). I did not have time to get to
the bottom of this at the time and now I am not sure I can even
reproduce the problem.

   But I did work around the problem by checking for -1 before doing the
string check. See the attached patch. +snoop was looping where I added
the TRACEs.


--
Francois Gouget         [EMAIL PROTECTED]        http://fgouget.free.fr/
     The software said it requires Win95 or better, so I installed Linux.
Index: relay32/snoop.c
===================================================================
RCS file: /home/wine/wine/relay32/snoop.c,v
retrieving revision 1.46
diff -u -r1.46 snoop.c
--- relay32/snoop.c     2001/12/11 00:50:34     1.46
+++ relay32/snoop.c     2002/01/15 06:57:41
@@ -213,7 +215,7 @@
        int             i,nostring;
        char * volatile ret=0;
 
-       if ( !HIWORD(x) ) { /* trivial reject to avoid faults */
+       if ( !HIWORD(x) || x==-1 ) { /* trivial reject to avoid faults */
            sprintf(buf,"%08lx",x);
            return buf;
        }
@@ -221,9 +223,13 @@
                LPBYTE  s=(LPBYTE)x;
                i=0;nostring=0;
                while (i<80) {
+                    if (x==-1) TRACE("%d: i=%d\n",__LINE__,i);
                        if (s[i]==0) break;
+                    if (x==-1) TRACE("%d: i=%d\n",__LINE__,i);
                        if (s[i]<0x20) {nostring=1;break;}
+                    if (x==-1) TRACE("%d: i=%d\n",__LINE__,i);
                        if (s[i]>=0x80) {nostring=1;break;}
+                    if (x==-1) TRACE("%d: i=%d\n",__LINE__,i);
                        i++;
                }
                if (!nostring) {

Reply via email to