1.5. Handles and Objects

Windows uses the concepts of a handle and an object throughout the system services. An object is owned by the operating system and represents a system resource. For example, a thread is represented as an object. The operating system stores all information about the thread in the thread's object. The object is opaque to the programmer.

A handle points to an object. It is possible to create a single object and refer to it with several different handles. You can think of the handles as pointers that let you access the object.

The 32-bit API defines the following " kernel objects." All of them return a handle when they are created or opened:

ObjectFunctionChapter
Access tokensOpenProcessTokenChapter 13
 CloseHandle
Console ...

Get Win32 System Services: The Heart of Windows® 98 and Windows® 2000 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.