What should you do if somebody passes a null pointer for a parameter that should never be null? What if it’s a Windows Runtime class?
https://devblogs.microsoft.com/oldnewthing/20190613-00/?p=102590 [devblogs.microsoft.com]
2019-06-14 01:17
If you put the cases of in-process and out-of-process callers together, you see that the conclusion is “Go ahead and dereference those pointers.” If the caller is in-process, then it’s okay to crash because you are crashing the caller’s process (which happens to be the same process that you are in). If the caller is out-of-process, then the RPC layer will prevent invalid null pointers from getting through.
There’s an additional wrinkle to this general principle, however, for the case where you are implementing a Windows Runtime class.