Hello
The aim I want to reach - is to close all handles to my process. I use NtQuerySystemInformation with SystemExtendedHandleInformation class. It returns a bunch of structures of type "SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX". Here they are:
OR are there even better solutions to close all handles to my process?
Thanks in advance for your answers!
The aim I want to reach - is to close all handles to my process. I use NtQuerySystemInformation with SystemExtendedHandleInformation class. It returns a bunch of structures of type "SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX". Here they are:
Code: Select all
there is a member "ObjectTypeIndex". Since I'm closing handles to my process, I need to search for handles of type "Process". ObjectTypeIndex is exactly whan I need to check, but its values differ from windows to windows. How can I obtain its value in the right way without using NtQueryObject every time?typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
{
PVOID Object;
HANDLE UniqueProcessId;
HANDLE HandleValue;
ULONG GrantedAccess;
USHORT CreatorBackTraceIndex;
USHORT ObjectTypeIndex;
ULONG HandleAttributes;
ULONG Reserved;
} SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
OR are there even better solutions to close all handles to my process?
Thanks in advance for your answers!