What is the range of a Windows HANDLE on a 64 bits application?

MSDN states: Interprocess Communication Between 32-bit and 64-bit Applications 64-bit versions of Windows use 32-bit handles for interoperability. When sharing a handle between 32-bit and 64-bit applications, only the lower 32 bits are significant, so it is safe to truncate the handle (when passing it from 64-bit to 32-bit) or sign-extend the handle (when passing … Read more

Under which circumstances does the System process (PID 4) retain an open file handle?

Files accessed through a share will be locked by the system process (PID 4). Try opening compmgmt.msc -> System Tools -> Shared Folders -> Open Files to see if the locked file is listed there See also the sysinternals forum for a way to replicate this. Not all applications lock files when they are opened, … Read more

What is a handle in C++?

A handle can be anything from an integer index to a pointer to a resource in kernel space. The idea is that they provide an abstraction of a resource, so you don’t need to know much about the resource itself to use it. For instance, the HWND in the Win32 API is a handle for … Read more

What is a Windows Handle?

It’s an abstract reference value to a resource, often memory or an open file, or a pipe. Properly, in Windows, (and generally in computing) a handle is an abstraction which hides a real memory address from the API user, allowing the system to reorganize physical memory transparently to the program. Resolving a handle into a … Read more