Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7745009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:54:23+00:00 2026-06-01T09:54:23+00:00

Digging into the implementation of Win32 API functions that work with TIB (Thread Information

  • 0

Digging into the implementation of Win32 API functions that work with TIB (Thread Information Block), such as:

  • TLS access functions: TlsAlloc, TlsFree, TlsSetValue, TlsGetValue
  • GetLastError, SetLastError
  • messaging subsystem: GetMessage, PeekMessage and etc.

one finds out that all of them access the TIB, sometimes called TEB (Thread Environment Block), by reading the contents of the fs:[0x18] selector.

OTOH this is unnecessary, since the fs register directly points to it. According to this article and what I see in practice, the fs register holds the address to the beginning of the TIB structure, whereas at offset 0x18 it has a pointer to itself.

What could be the reason to access the TIB indirectly nevertheless?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:54:24+00:00Added an answer on June 1, 2026 at 9:54 am

    Any instruction using FS requires an override, which adds a byte to the instruction (and generally requires assembly language to use it at all). The pointer at FS:18 is (at least if memory serves correctly) based off of DS instead, so it can be used without an override, saving a byte when it’s used and (most importantly for many people) can be used directly from a higher level language such as C or C++ instead of requiring assembly language.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started digging into JavaFX and have a requirement that I am
Digging into the api looking for methods to translate a property of a category
So I'm digging into tombstoning of WP7 but haven't found sufficient information on when
Digging into a legacy project (C++) that needs to be extended, I realized that
I recently began digging into the South documentation and discovered that it had two
I'm digging into a node package that uses a CLI, and am trying to
As I am further digging into MVVM and MVVM-light I recognized, that there is
I am digging into LINQ--trying to understand basic models (it seems pretty cool to
I'm digging into Reflection for the first time and I'm truely stuck. I've googled
I recently started digging into design patterns. Generally speaking, I thought the design issues

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.