Table of Contents

Windows - Handle

About

A handle is a pointer to a resource.

For example, if a process wants to use a particular service offered by a particular object, the process asks the object for a handle to that service.

Inside the kernel, Windows maintains a table of all the different objects that the kernel is responsible for:

All get an entry in the table, and each entry is assigned a unique identifier known as a HANDLE.

A HANDLE in the Win32 APIs is a:

that represents a resource that is managed by the Windows kernel. An HANDLE can be seen an instance of a class with no methods who's state is only modifiable by other functions.

They provide encapsulation and abstraction from internal Win32 resources which hides a real memory address from the API user, allowing the system to reorganize physical memory transparently to the program.

The HANDLE itself is just an integral type.

Documentation / Reference