0

There is a lot of information on the interweb regarding the handling of processes on linux, not much on Windows.

I'm using C. I want to calculate the resource usage of all processes. Not just of the system processes, I want to include those who were opened by the user for exmaple.

This can be done using EnumProcesses(), OpenProcess() and GetProcessTimes(). However this does not include processes that are not system processes.

Any thoughts?

roee
  • 17
  • 3
  • Perhaps this C++ tagged question can help: [https://stackoverflow.com/questions/3477097/get-full-running-process-list-visual-c](https://stackoverflow.com/questions/3477097/get-full-running-process-list-visual-c) – Weather Vane Mar 30 '20 at 13:03
  • Unfortunatley I don't think so :( It still uses OpenProcess which from my understanding is only able to open system processes. – roee Mar 30 '20 at 13:15
  • @roee - *OpenProcess which from my understanding is only able to open system processes* this is absolute false – RbMm Mar 30 '20 at 13:24
  • Maybe, I will try to use it for the user processes. – roee Mar 30 '20 at 13:28
  • Still, EnumProcesses() for a fact lists only system processes. – roee Mar 30 '20 at 13:28
  • You were right, OpenProcess does work for all processes, I had a problem with my os permissions. However EnumProcesses does not... – roee Apr 01 '20 at 08:50

1 Answers1

1

This can be done using EnumProcesses(), OpenProcess() and GetProcessTimes(). However this does not include processes that are not system processes.

It still uses OpenProcess which from my understanding is only able to open system processes.

Still, EnumProcesses() for a fact lists only system processes.

These are all false.

CreateToolHelp32Snapshot() & EnumProcesses() will both list all running processes, make sure you run your application as an administrator to get access to all the information.

OpenProcess() works on all processes as well.

GuidedHacking
  • 3,628
  • 1
  • 9
  • 59