• They/Them

Trite, contrived, mediocre, milquetoast, amateurish, infantile, cliche-and-gonorrhea-ridden paean to conformism, eye-fucked me, affront to humanity, war crime, should literally be tried for war crimes, resolutely shit, lacking in imagination, uninformed reimagining of, limp-wristed, premature, ill-informed attempt at, talentless fuckfest, recidivistic shitpeddler, pedantic, listless, savagely boring, just one repulsive laugh after another.


My homepage
mxsd.ca/
Telegram
@Mx_Self_Destruct
Signal
MxSelfDestruct.42
Soulseek
MxSelfDestruct

I assume that most of the people reading this post are at least vaguely aware of what the Windows Registry is, if not necessarily its function.

The Windows Registry (which I'll just call the "WR" from here onwards) is basically a big global configuration database for Windows. The OS uses it to store important configuration, and different applications can also create and manage their own sub-registries to store their own configuration data. This summary is a little oversimplified and not quite correct, but it's close enough for our purposes.

The database structure is pretty simple. The WR is pretty much just a Key:Value dictionary; Keys are strings of text, and Values can be other strings, integers, bitmasks, or other sub-dictionaries. It's not super complicated; all the data in the WR can easily be represented as text. Regedit allows users to easily and safely interact with this database, but it can also be edited by hand (or script, if you've got other things to do) with the editor of your choice. It's all just text, after all.

Oh dude you fucking wish.


I lied. To anyone who has had the displeasure of mucking around with the registry, and hoped for a brief moment that there was a better way, I apologize for leading you on. There is no safe way to interact with a WR without using the official, proprietary Windows APIs. None at all! Even reading from the WR without Regedit is an arduous task!

Despite the fact that the WR is just a lot of text and numbers, it is not stored as such. That would be too simple. The WR is instead stored in an undocumented, bespoke, proprietary binary blob format. Text editors and parsers are useless against it. Interacting with it without the Official Tools is, by design, basically impossible.

Granted, this kind of makes sense. It would be pretty bad if programs could access the entire registry and edit it at will, given that it's used by Windows and other programs. Firefox doesn't need to muck with Photoshop's settings. However, this problem is also solved by simply… not using a centralized database for configuration. Seriously. There is no good reason to do this. There was not, at any point, a good reason to do this. Why would you do this. Forget global state, we're programming with galactic state.

The use of a global store for individual application configuration introduces an incredible number of problems. Nearly all of the "features" of the WR are simply ways to account for its shortcomings. What if the WR becomes corrupted? How do you decide which programs can access which parts? What if many programs need to access it at once? What if you need to access a WR on a system without the proper API1? What if you want to port your application to a different OS? Et cetera. Most of these problems have been solved. None of them should exist in the first place.

As for the benefits? Well... raw binary data can be faster to parse and deal with, I suppose. Sure, computers have been fast enough for that speed difference not to matter since before I was born but… I suppose that's technically something. Not enough, though. Most software barely bothers with the WR, if at all. Why? Because there's no fucking reason to use it. A text file is fine.

Everything in Windows is like this.

Every god damn thing. It's all archaic, obfuscated bullshit that can only be touched by saying pleeeease and going fifteen sub-menus deep into some grody GUI that hasn't even received a bug-fix since 2008. There's zero cohesion. Knowing how to do x won't help you a bit trying to figure out how to deal with y or, god forbid, z. Every piece of shit Manager and Viewer and Editor could just as easily be fucking Notepad.exe and it would be a trillion times better.

I'm getting tired and my writing ability is degrading rapidly, so I'll just leave on this: I think they do it on purpose. I think that Microsoft wants dealing with Windows to be as miserable and confusing as possible. They own tech. They have every business that uses computers by the balls. Everyone depends on their products and services. You wanna know what's going on under the hood? Good luck figuring this shit out on your own. Pay up.


  1. Trying to extract information from a WR on Linux is like pulling teeth. Ask how I know.


You must log in to comment.

in reply to @MxSelfDestruct's post: