CFanatic

Go Back   CFanatic > Programming > Win32 Programming

Join CFanatic Forum Now

How to get current thread ID in Native mode? topic posted under Win32 Programming which is a part of Programming category in CFanatic Forum
Reply
 
Thread Tools Display Modes
  #1  
Old 04-23-2010, 04:42 AM
Junior Member
 
Join Date: Mar 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
unmeshjoshi is on a distinguished road
| More
How to get current thread ID in Native mode?

Hello all,

Can anybody please tell me how to get current thread ID in Native application? (inside NtProcessStartup ?)
Reply With Quote
  #2  
Old 04-27-2010, 05:01 AM
Junior Member
 
Join Date: Mar 2010
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
davidk is on a distinguished road
| More
Re: How to get current thread ID in Native mode?

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]
Reply With Quote
  #3  
Old 06-01-2010, 04:58 AM
Junior Member
 
Join Date: Mar 2010
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
unmeshjoshi is on a distinguished road
| More
Re: How to get current thread ID in Native mode?

Thanks a lot, it helped a lot.
I was out of station so could not reply early.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in Printing formatted output in NATIVE MODE unmeshjoshi Win32 Programming 0 04-13-2010 04:28 AM
Initial thread Unagnanitty Introduce yourself 1 08-29-2009 11:59 AM
msdos character mode console programming- multiple windows HowardL Driver Development 0 08-05-2007 11:35 AM
How can you get the current class name without using StackTrace? codeunlock C# Programming 0 04-29-2007 12:42 AM
VGA BIOS 1110h - Load User Font in Win32 app FULLSCREEN mode Tekri C Programming 0 09-20-2006 08:35 AM

 

Advertisement

CFanatic Search
Custom Search

Advertisement

All times are GMT -5. The time now is 04:40 AM.



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO ©2010, Crawlability, Inc.
Cfanatic.com is a premier member of the IDG TechNetwork. For advertising opportunities contact here
Get Paid for Working on Projects Matching Your Expertise at Go4Expert's Jobs Board