How to intentionally crash a COM object

Perhaps a strange question, but I need to check the stability and error procedures of the host process (the caller) that accesses the COM objects. Therefore, I need some simple / short methods that allow the COM object itself to be reset.

Appendix 1: With a crash, I mean the type of failure that can also cause the caller.

Addition 2: I have the code of the caller as a COM server.

+4
source share
3 answers

What do you mean by crash? What language do you use on your COM server

  • If you mean to throw an exception through COM , then just explicitly throw an exception or raise an error. Or you can intentionally divide by zero if you want.
  • If you mean to freeze and never return , deliberately encode an infinite loop. For instance. for(;;);
  • If you mean a raw access violation , it depends on the language you use on your COM server. You can try to access the NULL memory location.
+4
source

Do communities have wikis on how to crash programs?

A couple from the head:

  • The reason is massive :)
  • Throw an exception
0
source

If you use COM to communicate with another executable file (as opposed to loading the dll in your own process space), you can taskkill execute another process from the command line.

0
source

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


All Articles