Mail Archives: cygwin-apps/2002/03/27/09:07:55

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Message-ID: <>
Date: Wed, 27 Mar 2002 15:02:54 +0100
From: Ton van Overbeek <tvoverbe AT cistron DOT nl>
X-Accept-Language: en, en-US, en-GB, nl, sv
MIME-Version: 1.0
To: cygwin-apps AT cygwin DOT com, cygwin-patches AT cygwin DOT com
CC: jonas_eriksson AT home DOT se
Subject: Patch for Setup.exe problem and for

This is a multi-part message in MIME format.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Found the problem causing the segment violation and probably causing
Jonas Eriksson's problem. It is a typical case of 'off by 1'.
In PickView::set_headers the loop filling the window header does one
iteration too much, resulting in a call to DoInsertItem with a NULL
string pointer and hence a crash following.
While debugging this I could not compile the new ( the
c++ version of the original mklink2.c). It seems three & (address of operator)
have disappeared in the transition. Putting them back made the compiler
happy. Is this OK Robert ?

2002-03-27  Ton van Overbeek (tvoverbe AT cistron DOT nl)
* (PickView::set_headers) Correct loop count for DoInsertItem.

* (make_link_2) Reinsert three & operators which got lost in the
  c -> c++ transition.

Patch in attached file.

Ton van Overbeek
Content-Type: text/plain; charset=us-ascii;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

---	Wed Mar 27 12:18:34 2002
+++	Wed Mar 27 12:41:16 2002
@@ -20,9 +20,9 @@ make_link_2 (char const *exepath, char c
   IPersistFile *pf;
   WCHAR widepath[_MAX_PATH];
-  CoCreateInstance (CLSID_ShellLink, NULL,
-		    CLSCTX_INPROC_SERVER, IID_IShellLink, (LPVOID *) & sl);
-  sl->lpVtbl->QueryInterface (sl, IID_IPersistFile, (void **) &pf);
+  CoCreateInstance (&CLSID_ShellLink, NULL,
+		    CLSCTX_INPROC_SERVER, &IID_IShellLink, (LPVOID *) & sl);
+  sl->lpVtbl->QueryInterface (sl, &IID_IPersistFile, (void **) &pf);
   sl->lpVtbl->SetPath (sl, exepath);
   sl->lpVtbl->SetArguments (sl, args);
---	Wed Mar 27 12:18:26 2002
+++	Wed Mar 27 12:20:16 2002
@@ -110,7 +110,7 @@ PickView::set_headers ()
       SendMessage (listheader, HDM_DELETEITEM, n - 1, 0);
   int i;
-  for (i = 0; i <= last_col; i++)
+  for (i = 0; i < last_col; i++)
     DoInsertItem (listheader, i, headers[i].width, (char *) headers[i].text);


- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019