Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. DebugActiveProcess question

DebugActiveProcess question

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cptkli
    wrote on last edited by
    #1

    hello, after i used DebugActiveProcess how can i have the handle of the thread who caused a debugging event? I am lost :cool: Thank you!

    D 1 Reply Last reply
    0
    • C Cptkli

      hello, after i used DebugActiveProcess how can i have the handle of the thread who caused a debugging event? I am lost :cool: Thank you!

      D Offline
      D Offline
      Duncan Edwards Jones
      wrote on last edited by
      #2

      It is in DEBUG_EVENT_HEADER.dwThreadId, which is passed into WaitForDebugEvent() '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

      K 1 Reply Last reply
      0
      • D Duncan Edwards Jones

        It is in DEBUG_EVENT_HEADER.dwThreadId, which is passed into WaitForDebugEvent() '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

        K Offline
        K Offline
        klington
        wrote on last edited by
        #3

        dwThreadId is a DWORD value. Is it possible to convert DWORD to HANDLE?

        D 1 Reply Last reply
        0
        • K klington

          dwThreadId is a DWORD value. Is it possible to convert DWORD to HANDLE?

          D Offline
          D Offline
          Duncan Edwards Jones
          wrote on last edited by
          #4

          You can get a handle to the thread on the CREATE_THREAD_DEBUG_EVENT event - the DEBUG_CREATE_THREAD_DEBUG_INFO structure's .Handle member. Then create a collection keyed by dwThreadId and look up the handle using that? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

          K 1 Reply Last reply
          0
          • D Duncan Edwards Jones

            You can get a handle to the thread on the CREATE_THREAD_DEBUG_EVENT event - the DEBUG_CREATE_THREAD_DEBUG_INFO structure's .Handle member. Then create a collection keyed by dwThreadId and look up the handle using that? '--8<------------------------ Ex Datis: Duncan Jones Merrion Computing Ltd

            K Offline
            K Offline
            klington
            wrote on last edited by
            #5

            ok :cool: This works fine: case CREATE_PROCESS_DEBUG_EVENT: myHandle=DebugEv.u.CreateProcessInfo.hThread; strangely not this case CREATE_THREAD_DEBUG_EVENT: myHandle=DebugEv.u.CreateThread.hThread; Am i doing something wrong?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups