??Windows????????С? -- ??????
???????????? ???????[ 2012/12/4 10:31:42 ] ????????
??????????
?????????????????????????????????????
????1?????????????????????????????????????????л??洢?????????????????????????????????????????????????????????????????????CONTEXT??????????д洢????????????е????CPU???????????
????2?????????????????????????????????к?????????????????
????λ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????С????????????????????????????????????
?????????????????????????Ч?????????????????????????????????????????????????????????μ??????????????
??????????д???????????
??????????????????????????????????е??????????????????_tmain??_tWinmain???????????д??????????????????????????
???????磺
DWORD WINAPI ThreadFunc(PVOID pvParam){
DWORD dwResult = 0;
...
return(dwResult);
}
?????????????????κ????????????е??????????????????????????????????????????????????????ü??????0??????????
????1???????????????????????????????main??wmain??WinMain??wWinMain????????????????/ENTRY:??????????????????????????????????
????2????????????????????????????????????ANSI/Unicode?汾???????????????????????????????????????塣??????????????????????????????????????????????????????????????????
????3??????????????????????????????ExitThread????????????????
????4?????????????????t??????????????????????????????????????????????????????????t??????????????????????????????Щ???????????????????????
????????CreateThread ????
?????????????????????????????????????????е???????CreateThread ??
????HANDLE CreateThread(
????PSECURITY_ATTRIBUTES psa?? //???SECURITY_ATTRIBUTES???????
????DWORD cbStackSize?? //??????????????????????????? ?????С ??????0???????????? ??????/STACK ???????С ???1M
????PTHREAD_START_ROUTINE pfnStartAddr?? //????????????
????PVOID pvParam?? //??????????
????DWORD dwCreateFlags?? //????????????????????????? CREATE_SUSPENDED ??????
????PDWORD pdwThreadID); //?洢?????????????ID;
????????
DWORD WINAPI FirstThread(PVOID pvParam)
{
int x=0; //???????????SecoundThread ???????????????static?????FirstThread ?????SecoundThread ??????????????硣
DWORD dwThreadID;
HANDLE hThread = CreatThread( NULL?? 0 ?? SecondThread ?? (PVOID)&x ?? 0?? &dwThread);
}
DWORD WINAPI SecondThread (PVOID pvParam)
{
*(int *)pvParam =5;
}
???????? CreateThread ??????????????????????????????????з?????????????á?????????????????????????о?????????е????????????????????????????????????
????CreateThread ????????????????Windows?????????????д????C/C++??????????? CreateThread?? ?????????????Microsoft C++???п???_beginthreadex????????????Microsoft C++???????????????????????????????????????? CreateThread ??????????????????????????????????
??????
???·???
??????????????????
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