Is there a way to find out the thread id in another process that throws an exception?

I am trying to use the MiniDumpWriteDump () API to reset a broken process B from another process A. I am doing this because MSDN said this:

MiniDumpWriteDump is called from a separate process, if at all possible, and not from within, the target process is reset.

MiniDumpWriteDump () is defined 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
);

In particular, ExceptionParam is of type PMINIDUMP_EXCEPTION_INFORMATION, which is defined below:

typedef struct _MINIDUMP_EXCEPTION_INFORMATION {
  DWORD               ThreadId;
  PEXCEPTION_POINTERS ExceptionPointers;
  BOOL                ClientPointers;
} MINIDUMP_EXCEPTION_INFORMATION, *PMINIDUMP_EXCEPTION_INFORMATION;

Now I am wondering how to prepare the following 2 parameters:

ThreadId Identifier of the thread that throws the exception.

ExceptionPointers EXCEPTION_POINTERS, - .

B A?

.

+5
2

MINIDUMP_EXCEPTION_INFORMATION, , minidump. NULL, minidump.

, __in, __in_opt, NULL. , .

A , - B? A B, WaitForDebugEvent EXCEPTION_DEBUG_EVENT, .

A B, , , B A - IPC ", , -". B , IPC mechansim A. , , MiniDumpWriteDump , , - , , , , , .

, A B, A, JIT, A B, API .

A - B, - , NULL .

, -

WaitForSingleObject(handleToProcessB, INFINITE);
MiniDumpWriteDump(handleToProcessB, ...)

. , , , -.

+2

, , DebugDiag AdPlus. ( !) , .

, B: MSDN , , , , ( ), , , ( ). , ( ++). . (. _set_se_translator) (. AddVectoredContinueHandler) GetExceptionInformation() EXCEPTION_RECORD ( , ).

A B , A, - . , , .

,

0

All Articles