I list process name in my program. First I use “EnumProcesses” to get all PID. Then I get Process name like this:
hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, pid );
if( hProcess ) {
EnumProcessModules( hProcess, &hModule, sizeof(hModule), NULL);
GetModuleFileNameExW( hProcess, hModule, (LPWSTR)fileName, 100*sizeof(wchar_t) );
printf ("[%d] 0x%08X %d - %ws \n", i, hProcess, pid, fileName);
}
I can get all Process in winxp. But, in Win7, Some Process’s handle is NULL, So I cannot get its infomation. like this:

I do not know why. Who can tell me why? Thank you.
Either permissions (you need SEDebugPrivilege to enumerate all of them) or you’re trying to enumerate 64 bit processes from a 32 bit process