Gettting Process

This is a discussion on Gettting Process within the Windows Programming forums, part of the Platform Specific Boards category; Hello, Please, i need know how to i can write a function that: Get all running process if process isn't ...

  1. #1
    Registered User
    Join Date
    Jan 2006

    Gettting Process


    Please, i need know how to i can write a function that:

    Get all running process
    if process isn't created by system, check his folder for a dll, if dll is found, kill the process...

    someprocess1.exe - SYSTEM
    someprocess2.exe - USER
    someprocess3.exe - USER

    someprocess1 - not checked.
    someprocess2 - checked, dll isn't found, still running...
    someprocess3 - checked, dll found, killed.

    sorry for english.

  2. #2
    Madly in anger with you
    Join Date
    Nov 2005
    may I ask why you would want to do that?

    it sounds like a good way to get yourself into some undesired and undefined behaviour, considering most SYSTEM process directories will almost always contain a DLL, as will a lot of Windows processes that are not running with SYSTEM privileges.

  3. #3
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Find all the processes with EnumProcesses, get their paths with GetModuleHandle, and check for dlls there with FindFirstFile and FindNextFile. To find their paths you will need a handle; to get one from their PID, use OpenProcess.
    “Is that when I became booksexual?” — phantomotap
    “I just want to use my computer in a productive manner, not learn how to use it.” — Elysia
    “A year spent in artificial intelligence is enough to make one believe in God.” — Alan J. Perlis

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. init adopts zombie process?
    By password636 in forum Linux Programming
    Replies: 4
    Last Post: 07-01-2009, 10:05 AM
  2. create a child process that creates a child process
    By cus in forum Linux Programming
    Replies: 9
    Last Post: 01-13-2009, 01:14 PM
  3. Replies: 3
    Last Post: 10-15-2008, 09:24 AM
  4. Problem with forking a process
    By Unitedroad in forum C Programming
    Replies: 10
    Last Post: 10-04-2007, 01:43 AM
  5. process programming
    By St0rM-MaN in forum Linux Programming
    Replies: 2
    Last Post: 09-15-2007, 07:53 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21