Making it foolproof
We already saw that we can use WMI to intercept unwanted removal of devices. USB cables can be removed from a machine easily. One of their selling points is how easy it is to plug devices in and remove them again. From a user’s standpoint, that is great. But from a developer’s perspective, it is not so great.
And even if the user (or your cat) doesn’t fiddle around with the cable, many things can get in the way of a reliable data stream.
Reasons things go haywire
If your software fails, you can easily look up what happened. Well, not really easily – debugging software, especially low-level, multithreaded software, can be challenging. But it is doable.
Dealing with issues from other hardware is much harder to solve. There are so many reasons things can go wrong. Let’s go through some of them.
- Interference: The cables used for serial communication are simple – several copper wires carry the electrical signal...