??Windows????????С? -- ??????
???????????? ???????[ 2012/12/4 10:31:42 ] ????????
????????????_endthreadex??
void __cdecl _endthreadex (unsigned retcode) {
_ptiddata ptd; // Pointer to thread's data block
// Clean up floating-point support (code not shown).
// Get the address of this thread's tiddata block.
ptd = _getptd_noexit ();
// Free the tiddata block.
if (ptd != NULL)
_freeptd(ptd);
// Terminate the thread.
ExitThread(retcode);
}
????????_endthreadex????????????????
????1??C???п??_getptd_noexit????????????ò???????TlsGetValue??????????????????????tiddata?????????
????2?????_endthreadex??????????????????ò???????ExitThread???????????????????????????????????????
?????????????????ExitThread????????????????“???”?????????????????????????е??????????????????з?????????????κ?C++???????????????????????????_tiddata???鱻???????ó?????????й?????????????????????
??????????t?????C/C++???п?????_beginthreadex??_endthreadex??????????????ò??????????????CreateThread??ExitThread????
????????????α???
????HANDLE GetCurrentProcess();
????HANDLE GetCurrentThread();
????????????????????????????????????????????????????α????????????????????????????????????????????????????????????????????????????????????????????????????ü????????????CloseHandle???????????????“α???”??CloseHandle????????????á?
??????α?????????????????DuplicateHandle???????????????????????????????д?????????????
<SPAN style="FONT-SIZE: 14px"> DuplicateHandle(
GetCurrentProcess()?? // Handle of process that thread
// pseudohandle is relative to
GetCurrentThread()?? // Parent thread's pseudohandle
GetCurrentProcess()?? // Handle of process that the new?? real??
// thread handle is relative to
&hThreadParent?? // Will receive the new?? real?? handle
// identifying the parent thread
0?? // Ignored due to DUPLICATE_SAME_ACCESS
FALSE?? // New thread handle is not inheritable
DUPLICATE_SAME_ACCESS); // New thread handle has same </SPAN>
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11