Results 1 to 4 of 4

Thread: GDI handles per process

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156

    GDI handles per process

    Folks, is it even possible to enumerate the GDI handles that
    belong to a process? I have a pseudo-solution for 9x systems
    where I loop from 0-65535, check to see if the number is a valid
    GDI handle, and optionally dump the handle's contents to the
    screen; however, this approach would be far too slow for an
    NT system (seeing as that the GDI handle numeric value is 32-bit)
    and it does not associate a process with the handle.

    Thanks,

    -CC

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156
    * bump *

    Any thoughts on this folks?

  3. #3
    Frenzied Member
    Join Date
    Jul 2002
    Posts
    1,370
    You're talking about device contexts -- DC's - right?

    There are two types - one that is allocated permanently to a process, and one that is allocated from the DC pool.
    In NT, you can allocate lots of them, in Win9X there is a limited number.

    In NT, they all live in kernel address space, in Win9x, partly in user space.

    What I'd do is go to www.sysinternals.com.
    Download PSTools. There is free source for a lot of the modules.
    You cannot do some of this in VB - so be warned -- it's C.

    Out of curiosity - why do you want to do this - trying to figure out how many more resources you can gobble up without damaging the system?

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Location
    Middle Earth
    Posts
    156
    Hi Jim, nope I am not talking about DCs. I am actually talking
    about Bitmap handles, Brush handles, etc... (all in all I think
    there are 13 different types of GDI). I'll check out the sources at
    Sysinternals (just in case they have what I am looking for).

    The reason I am doing this is because I want to be able to
    detect GDI resource leaks from another application. From what
    I have seen on the Market, there exists no tool that can do this
    but at the same time alot of people are looking for such a tool.
    These facts imply making a tool like this would be exceptionally
    difficult... but so long as it's not impossible, I'm game

    -CC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width