[ANNOUNCEMENT] TEST RELEASE: Cygwin 2.1.0-0.4
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 819 bytes
Desc: not available
More information about the Cygwin