Hooking code you don’t own is typically playing with fire. Because Microsoft wrote the code, they’re generally in a better position to understand when it is safe to do so.
It is perfectly safe to hook any code as long as you can guarantee no thread is currently executing the instructions you're replacing.
It is perfectly safe to hook any code as long as you can guarantee no thread is currently executing the instructions you're replacing.