I'd recommend reducing the scope of this MR; it's just too much to review. Start with just adding some advapi tests. On that note, try to make the tests simpler so that they actually work on Windows 7 without all the `broken()`s. You don't need to probe everything, just write the bare minimum to start with.