如何为_beginthreadex提供64位线程标识符

Kir*_*ril 2 c++ concurrency 64-bit multithreading crt

我试图端口一些代码为64位,但它似乎该线程地址在标识符_beginthreadexunsigned int其为32位,我无法通过/接收一个64位的地址从函数标识符:

uintptr_t _beginthreadex( // NATIVE CODE
   void *security,
   unsigned stack_size,
   unsigned ( __stdcall *start_address )( void * ),
   void *arglist,
   unsigned initflag,
   unsigned *thrdaddr // <-- 32-bit address
);
Run Code Online (Sandbox Code Playgroud)

我检查了MSDN文档,但我没有看到该函数的64位版本.我是否包括错误的标头,每处理器标志或是否有其他方法来创建具有64位地址标识符的线程?

更新

该文档声明该thrdaddr参数是32位:

Thrdaddr

Points to a 32-bit variable that receives the thread identifier. Might be NULL, in which case it is not used.
Run Code Online (Sandbox Code Playgroud)

Dav*_*nan 5

thrdaddr参数接收线程ID.它不是线程函数的地址.它似乎是一个非常糟糕的参数.

start_address参数是线程函数指针,你可以通过你的64位函数指针在该参数.


您对该问题的更新表明您认为64位Windows上的线程ID是64位值.这是一种误解.所有Windows版本的线程ID都是32位值.