[ANNOUNCEMENT] TEST RELEASE: Cygwin 2.1.0-0.4

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jul 6 14:52:00 GMT 2015


On Jul  6 09:32, Ken Brown wrote:
> On 7/6/2015 9:15 AM, Ken Brown wrote:
> >On 7/6/2015 6:01 AM, Corinna Vinschen wrote:
> >>You can utilize tib and m for testing in emacs as well.  Just do this:
> >>
> >>   #include <windows.h>
> >>
> >>   NT_TIB *tib;
> >>   MEMORY_BASIC_INFORMATION m;
> >>
> >>   [...]
> >>
> >>   in main:
> >>
> >>   /* Record (approximately) where the stack begins.  */
> >>   stack_bottom = &stack_bottom_variable;
> >>   tib = (NT_TIB *) __readfsdword(PcTeb);
> >>   VirtualQuery (stack_bottom, &m, sizeof m);
> >
> >I'll try this next and report back.
> 
> PcTeb seems to be defined only on x86.  What should I do on x86_64?

Oh, sorry, I forgot.  In theory you should call

  tib = (NT_TIB *) NtCurrentTeb ();

but there's a problem in the way this inline function is defined
which makes it unusable when not optimizing the code, at least
on 32 bit.  The above NtCurrentTeb works fine on x86_64, afaics.

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20150706/79ad61b6/attachment.sig>


More information about the Cygwin mailing list