3 回答
![?](http://img1.sycdn.imooc.com/54584cde0001d19202200220-100-100.jpg)
TA贡献1811条经验 获得超5个赞
CreateThread()
_beginthread()
& _beginthreadex()
CreateThread()
CreateThread()
_beginthread/ex()
_beginthreadex()
![?](http://img1.sycdn.imooc.com/5333a207000118af02200220-100-100.jpg)
TA贡献2021条经验 获得超8个赞
_beginthread()
_beginthreadex()
. _beginthreadex()
CreateThread()
_beginthread()
/_beginthreadex()
CreateThread()
CreateThread()
_beginthread()
/_beginthreadex()
_beginthread()
_beginthreadex()
Differences between _beginthread/_endthread and the "ex" versions: 1) _beginthreadex takes the 3 extra parameters to CreateThread which are lacking in _beginthread(): A) security descriptor for the new thread B) initial thread state (running/asleep) C) pointer to return ID of newly created thread 2) The routine passed to _beginthread() must be __cdecl and has no return code, but the routine passed to _beginthreadex() must be __stdcall and returns a thread exit code. _endthread likewise takes no parameter and calls ExitThread() with a parameter of zero, but _endthreadex() takes a parameter as thread exit code. 3) _endthread implicitly closes the handle to the thread, but _endthreadex does not! 4) _beginthread returns -1 for failure, _beginthreadex returns 0 for failure (just like CreateThread).
_beginthreadex()
GetCurrentPackageId()
![?](http://img1.sycdn.imooc.com/545863aa00014aa802200220-100-100.jpg)
TA贡献1830条经验 获得超9个赞
_beginthread()/_endthread()
ex()
DllMain
DLL_THREAD_ATTACH
DLL_THREAD_DETACH
CreateThread()
ExitThread()
DllMain
- 3 回答
- 0 关注
- 960 浏览
添加回答
举报