[DllImport("kernel32.dll")]
static extern bool GetHandleInformation(IntPtr hObject, out uint lpdwFlags);
// If this flag is set, a child process created with the bInheritHandles parameter of CreateProcess set to TRUE will inherit the object handle.
const uint HANDLE_FLAG_INHERIT = 0x00000001;
// If this flag is set, calling the CloseHandle function will not close the object handle.
const uint HANDLE_FLAG_PROTECT_FROM_CLOSE = 0x00000002;
None.
Please add some!
uint flags;
IntPtr handle;
// define handle
bool result = GetHandleInformation(handle, out flags);
Console.WriteLine(flags & HANDLE_FLAG_INHERIT);
Console.WriteLine(flags & HANDLE_FLAG_PROTECT_FROM_CLOSE);
Do you know one? Please contribute it!