On Feb 7, 2016, at 4:25 AM, Nikolay Sivov bunglehead@gmail.com wrote:
Why do you need this?
So I can assert in Init.
This->hkeyProgID = This->hkeySource;
I know it's not something you introduced, but it's dirty and should be fixed, because it leads to double free on a same handle.
I’ll fix that in the next version.
Basically you remove everything, and tests don't show that you should do that. For example looking at Win7 registry I see HKCR.exe with default value of "exefile", then default value for HKCR\exefile is Application (and also there is a FriendlyTypeName key that's most likely localized). Current code will return "Application" and that seems like a better candidate for a friendly name.
In that case, hkeyProgID would refer to HKCR\exefile, and then I return the default value from that key which is “Application”. It used to start with hkeySource (would point to HKCR.exe) and do some digging, but my code does that work in Init.
A convincing test should create a custom extension key, and test all possible combinations of empty default values, missing keys with default value name etc.
Yes, more tests is always good. I’ll try and figure out how to test things on Windows and add some more tests in the next version.
~Theodore