delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/2001/03/19/20:16:14

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-developers-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-developers/>
List-Post: <mailto:cygwin-developers AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-developers-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-developers-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin-developers AT sources DOT redhat DOT com
content-class: urn:content-classes:message
Subject: RE: exceptions
MIME-Version: 1.0
Date: Tue, 20 Mar 2001 12:07:32 +1100
X-MimeOLE: Produced By Microsoft Exchange V6.0.4417.0
Message-ID: <EA18B9FA0FE4194AA2B4CDB91F73C0EF02E26A@itdomain002.itdomain.net.au>
Thread-Topic: exceptions
Thread-Index: AcCw1XlS4OsdlGrgRWOXuBYpuD1EnQABHCOw
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: <cygwin-developers AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id UAA27692

Thanks Chris, 
	I took your code and cut it back to 

/* Generic memory acccess routine - where should it live ? */
int __stdcall
check_valid_pointer (void *pointer)
{
  MEMORY_BASIC_INFORMATION m;
  if (!pointer || !VirtualQuery (pointer, &m, sizeof (m)) || (m.State !=
MEM_COMMIT))
    return EFAULT;
  return 0;
}
 

because thread.cc should not depend on path.h IMO... and the check for
*name was not necessarily appropriate in all cases for me.

However the path.cc function should wrap this one, but my question is -
where should check_valid_pointer go?

Rob

> -----Original Message-----
> From: Christopher Faylor [mailto:cgf AT redhat DOT com]
> Sent: Tuesday, March 20, 2001 11:18 AM
> To: cygwin-developers AT cygwin DOT com
> Subject: Re: exceptions
> 
> 
> On Tue, Mar 20, 2001 at 10:20:38AM +1100, Robert Collins wrote:
> >are we able to use c++ exception handling within cygwin1.dll?
> 
> No, not currently.  I don't remember if this doesn't work in DLLs
> or if it bloated the code alarmingly.
> 
> >ie to guard against invalid memory access on user supplied 
> parameters?
> 
> check_null_empty_path is the method for doing that.  It validates an
> address.  Probably should change the name...
> 
> cgf
> 

- Raw text -


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