Reputation: 31815
I'm doing some work with registry hives, and I need to know if the file the user supplies the program with really is a registry hive. Short of attempting to mount it, how can I tell if the file really is a registry hive?
Upvotes: 2
Views: 303
Reputation: 1778
Very quick preliminary check: the file must start with "regf" signature.
Upvotes: 1
Reputation: 20175
Interesting question, upon digging around, there is a call that is part of the Offline Registry Library that will attempt to validate the hive and report back whether it was successful or not, but it's part of Win32/COM
Sounds like what you want to do, just no direct .NET implementation of it
Upvotes: 2