The GetHandleInformation function obtains information about certain properties of an object handle. The information is obtained as a set of bit flags.
BOOL GetHandleInformation(
HANDLE hObject, // handle to an object
LPDWORD lpdwFlags // points to variable to receive flags
);
You can specify a handle to one of the following types of objects: access token, event, file, file mapping, job, mailslot, mutex, pipe, printer, process, registry key, semaphore, serial communication device, socket, thread, or waitable timer.
Windows NT 5.0 and later: This parameter can also be a handle to a console input buffer or a console screen buffer.
Value | Meaning |
---|---|
HANDLE_FLAG_INHERIT | If this flag is set, a child process created with the bInheritHandles parameter of CreateProcess set to TRUE will inherit the object handle. |
HANDLE_FLAG_PROTECT_FROM_CLOSE | If this flag is set, calling the CloseHandle function will not close the object handle. |
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.
Windows NT: Requires version 3.51 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use kernel32.lib.
Handles and Objects Overview, Handle and Object Functions, CloseHandle, CreateProcess, SetHandleInformation