Search code examples
c++winapiinternals

struct which a HANDLE points to


I tried without success to find information about the structs that HANDLEs point to. For example, CreateFile() returns a HANDLE (== void*) that I think points to a struct with information about the file. Same thing for processes and threads and every HANDLE.

So, where can I find information about the structs that the HANDLE points to?

Thanks! :-)


Solution

  • The HANDLE type in WINAPI is an opaque pointer utilized to hide implementation details from the programmer. It is usually a bad idea to write code that depends on the internals behind an opaque pointer since one of its uses is the ability for the API provider to change those internals without breaking any user code. Even if you find a way to read/write data behind them, it is not impossible for a new OS update to invalidate your software.