Defrag Tools: #3 - Process Monitor

Play Defrag Tools: #3 - Process Monitor

The Discussion

  • User profile image


    Nice videos in show.

    Process explorer shows what are all the handle (also the File Object associated with it) is held by process. Process monitor shows us the Win32 calls.

    Can we combine those two pieces of information? Can we get the handle value returned from CreateFile call (shown in the ProcMon)?

  • User profile image

    @Debojyoti: Great question. The answer unfortunately is No. ProcMon doesn't run in the right area of the kernel to know what handle is allocated for the successful operation.

    The way Process Monitor gets the file operations is to insert itself as a filter driver. It is called first, just after FltrMgr.sys. It logs the result of IRP_MJ_CREATE operations that is receives as ProcMon 'CreateFile' operations. If you turn Advanced Output on, you'lll see that the Operation will be renamed from CreateFile to IRP_MJ_CREATE (the real name). At the time that the ProcMon driver sees the result of the IRP_MJ_CREATE operation (and last time it is involved in the call), all that exists is the pointer to the object. The object hasn't been added the handle table of the target process.

    It isn't feasible to leverage the Process Explorer data either. ProcExp is only able to view the handle data on a process by process basis - this design doesn't gel with how Process Monitor works.

    Note that some, if not most, CreateFile operations in ProcMon aren't actually a CreateFile call, they are the result of a memory mapping (nt!MmCreateSection) call that maps a file in to an address space, be it directly (CreateFileMapping) or indirectly (LoadLibrary).

    ProcMon simplifies the world - maybe a little too much.

    Once again - great question!  Thanks for watching.

  • User profile image
    Dave Colvin

    Hi All,

    Thanks for the insight, I feel that we could all muck-around with the tool and learn what we did here - as I think we have.

    This was an opportunity to teach something new, what it means, how to find a process, how to track a file open, a registry failing, etc etc, but it was lost on a simple how it works video..

    Sorry all, but you lost a fan.

  • User profile image

    @Dave Colvin: Next week's video should have more of what you wanted to see.

  • User profile image

    @windev I understood the point.

    Thanks for your reply. ProcMon is a good tool and I use it in a great extent to get my work done.

    It would be nice if you put something on Channel 9 on NetMon (

    I am looking forward for the next videos.

  • User profile image

    @Debojyoti: NetMon (and Fiddler) is on the list of future episides - probably around episode #15.

  • User profile image

    Is there a advanced documentation of procmon? I always get confused with the types of operation. It would be nice to have a detailed definition.

    Good video.

Add Your 2 Cents