What are the differences between a process id and a process handler

A process identifier is a number that uniquely identifies a process. A process handler is also a number that uniquely identifies a process core object.

Why do we need them, since any of them can identify the process.

I think the answer may lie in the ratio of the mapping between the process and the process core object. Is it true that more than one process core object can be mapped to a single process? And each process core object has its own process descriptor. So each of the process core objects can be a different access mode or something like that.

This question came to me when I use the MiniDumpWriteDump () function , which is declared as follows:

BOOL WINAPI MiniDumpWriteDump(
  __in  HANDLE hProcess,
  __in  DWORD ProcessId,
  __in  HANDLE hFile,
  __in  MINIDUMP_TYPE DumpType,
  __in  PMINIDUMP_EXCEPTION_INFORMATION ExceptionParam,
  __in  PMINIDUMP_USER_STREAM_INFORMATION UserStreamParam,
  __in  PMINIDUMP_CALLBACK_INFORMATION CallbackParam
);

Thus, the parameters include both the process identifier and the process descriptor. I just don’t know why they need it.

Thanks so much for your ideas.

+3
source share
2 answers

Process handler

  • Arbitrary
  • The internal process that acquired it. Private and cannot be shared between threads / processes.
  • It also has security access rights.

Bye process id

  • Unique
  • Universal, public, so it can be shared between threads / processes.
+4
source

, 'id' , . , "" - , . .

, MiniDumpWriteDump .

+3

Source: https://habr.com/ru/post/1773558/


All Articles