求助啊,大侠看下这个代码怎么了,老崩溃。。。。。
#include"windows.h"#include"stdio.h"
#include"tlhelp32.h"
int main(int argc,char *argv[])
{
PROCESSENTRY32 pe32;
pe32.dwSize=sizeof(pe32);
HANDLE hProcessSnap=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if (hProcessSnap==INVALID_HANDLE_VALUE)
{
printf("CreateToolhelp32Snapshot is failed");
return -1;
}
BOOL bResult =Process32First(hProcessSnap,&pe32);
while (bResult)
{
printf("process_name is %s :\n",pe32.szExeFile);
printf("process_Id is %s :\n",pe32.th32ParentProcessID);
bResult=Process32Next(hProcessSnap,&pe32);
}
CloseHandle(hProcessSnap);
return 0;
}