uot;System" );
continue;
}
// Open Process And Get Process Infomation
hProcess = OpenProcess(
PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, lpPsInfo[ulIndex].dwPID );
if( hProcess != NULL )
{
// Here we call EnumProcessModules to get only the
// first module in the process this is important,
// because this will be the .EXE module for which we
// will retrieve the full path name in a second.
if( EnumProcessModules( hProcess, &hModule,
sizeof(hModule), &dwSize ) ) {
// Get Full pathname:
if( GetModuleFileNameEx( hProcess, hModule,
path_buffer, sizeof(path_buffer) ) ) {
_tsplitpath( path_buffer, drive, dir, fname, ext );
strcpy( lpPsInfo[ulIndex].strPath, path_buffer );
sprintf( lpPsInfo[ulIndex].strName, "%s%s", fname, ext );
// TRACE( "ModuleFileName:%s\r\n", path_buffer );
}
}
CloseHandle( hProcess ) ;
}
}
return TRUE;
}