How to get current thread ID in Native mode?

Discussion in 'Win32' started by unmeshjoshi, Apr 23, 2010.

  1. unmeshjoshi

    unmeshjoshi New Member

    Joined:
    Mar 17, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Hello all,

    Can anybody please tell me how to get current thread ID in Native application? (inside NtProcessStartup ?)
     
  2. davidk

    davidk New Member

    Joined:
    Mar 25, 2010
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    0
    Home Page:
    http://www.firmdev.com/firm_framework
    You need to get info from Thread Information Block (TIB).

    See 'struct NT_TIB' in winnt.h
    Current thread ID has 0x24 offset. Get it as FS:[0x24]
     
  3. unmeshjoshi

    unmeshjoshi New Member

    Joined:
    Mar 17, 2010
    Messages:
    12
    Likes Received:
    0
    Trophy Points:
    0
    Thanks a lot, it helped a lot.
    I was out of station so could not reply early.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice