This is the mail archive of the cygwin 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]
Other format: [Raw text]

Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.1.0-0.4


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

Attachment: pgpUHS17MZyXm.pgp
Description: PGP signature


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