This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: pthreads works, sorta


I'm not sure either.  If that is the case, replacing IsBadWritePtr
with IsBadReadPtr maybe the answer since can't read mans can't write.

-Tak

On Wed, 27 Jun 2001 15:33:27 +1000, "Robert Collins" <robert.collins@itdomain.com.au> wrote:

> I'm not sure you can get write but not read memory in win32. Can you? If
> you can, then yes checking both should be done.
> 
> Rob
>  
> 
> > -----Original Message-----
> > From: Tak Ota [mailto:Takaaki.Ota@am.sony.com]
> > Sent: Wednesday, June 27, 2001 3:41 PM
> > To: cygwin@cygwin.com
> > Subject: Re: pthreads works, sorta
> > 
> > 
> > How about using IsBadReadPtr in addition to IsBadWritePtr?
> > 
> > -Tak
> > 
> > On Wed, 27 Jun 2001 01:29:32 -0400, Christopher Faylor 
> > <cgf@redhat.com> wrote:
> > 
> > > On Wed, Jun 27, 2001 at 01:10:35PM +1000, Robert Collins wrote:
> > > >> -----Original Message-----
> > > >> From: Greg Smith [mailto:gsmith@nc.rr.com]
> > > > 
> > > >> 
> > > >> More experimenting with my home computer, dual pIII 850:
> > > >> 
> > > >> 1. 117  157 328
> > > >> 2. 822 1527 ---
> > > >> 3. 194  240 453
> > > >> 4. 169  181 516
> > > >> 
> > > >As usual, I write a missive, then solve the puzzle.
> > > >
> > > >try this:
> > > >
> > > >
> > > >int __stdcall
> > > >check_valid_pointer (void *pointer)
> > > >{
> > > >  if (!pointer || IsBadWritePtr(pointer, sizeof 
> > (verifyable_object)))
> > > >    return EFAULT;
> > > >  return 0;
> > > >}
> > > 
> > > This is not quite the same thing as VirtualQuery.  This 
> > verifies that the
> > > process can write to memory.  It doesn't verify that it is 
> > accessible.
> > > 
> > > Maybe that is not important but I would have to think about this.
> > > 
> > > Nice find, though, Rob.
> > > 
> > > cgf
> > > 
> > > --
> > > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > > Bug reporting:         http://cygwin.com/bugs.html
> > > Documentation:         http://cygwin.com/docs.html
> > > FAQ:                   http://cygwin.com/faq/
> > 
> > --
> > Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
> > Bug reporting:         http://cygwin.com/bugs.html
> > Documentation:         http://cygwin.com/docs.html
> > FAQ:                   http://cygwin.com/faq/
> > 
> > 

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]