exceptions

Robert Collins robert.collins@itdomain.com.au
Mon Mar 19 17:14:00 GMT 2001


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@redhat.com ]
> Sent: Tuesday, March 20, 2001 11:18 AM
> To: cygwin-developers@cygwin.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
> 



More information about the Cygwin-developers mailing list