The system registry records all the information of your system software, hardware and user accounts.
All your mouse and keyboard operations are ultimately recorded through it. For example, if you manually modify your computer name with the mouse, it will also be recorded and modified accordingly in the registry.
It is a firewall. It is located in the outer layer of the registry. If you want to modify the registry, you need to get permission from the housekeeper, who certainly knows your family situation (registry) ... If the firewall (housekeeper) decides that you are a bad person (virus), then it has the right to prevent you from entering (writing into the registry).
As for whether it can be implemented in VB, I'm not sure. But one thing is that many functions of the system are through VB. Firewalls are also written in language programs, including Microsoft systems.