The thread pool API structure called TP_CALLBACK_ENVIRON is not declared in winbase.h.
Shell is cmd.exe
> ld -v
GNU ld (GNU Binutils) 2.22.90.20120727
Windows 7 64-bit Ultimate
>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../src/gcc-4.7.1/configure --build=x86_64-w64-mingw32 --enable-targets=all --enable-languages=c,c++,fortran,objc,obj-c++ --enable-libgomp --enable-lto --enable-libstdcxx-debug --enable-version-specific-ru
ntime-libs --enable-fully-dynamic-string --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --prefix=/mingw64tdm --with-local-prefix=/mingw64tdm --with-pkgversion=tdm64-1 --with-bugurl=http://tdm-gcc.tdrag
on.net/bugs
Thread model: win32
gcc version 4.7.1 (tdm64-1)
This works in MS Visual Studio 2010:
#include <Windows.h>
int main()
{
TP_CALLBACK_ENVIRON tpe;
return sizeof(tpe);
}
TP_CALLBACK_ENVIRON is 40 bytes in my test.
It is a semi-opaque structure. You're supposed to use InitializeCallbackEnvironment etc to manipulate it, but you must know the size to know how much memory to allocate. Normal win32 programs can (and do) just put an instance of TP_CALLBACK_ENVIRON somewhere and take the address of it to pass it to the appropriate APIs.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
This is the output:
> gcc d:\Code\mingwbugrepro\mingwbugrepro\mingwbugrepro.cpp
d:\Code\mingwbugrepro\mingwbugrepro\mingwbugrepro.cpp: In function 'int main()':
d:\Code\mingwbugrepro\mingwbugrepro\mingwbugrepro.cpp:5:3: error: 'TP_CALLBACK_ENVIRON' was not declared in this scope
d:\Code\mingwbugrepro\mingwbugrepro\mingwbugrepro.cpp:5:23: error: expected ';' before 'tpe'
d:\Code\mingwbugrepro\mingwbugrepro\mingwbugrepro.cpp:6:17: error: 'tpe' was not declared in this scope