public static Boolean RegistryLoad(structenums.RegistryLocation where, string name, string file)
{
if (where != structenums.RegistryLocation.HKEY_LOCAL_MACHINE && where != structenums.RegistryLocation.HKEY_USERS)
{
LibraryLogging.Error("unable to load regfile at {0}", where);
return false;
}
if (!SafeNativeMethods.RegistryLoadPrivilegeSet)
{
if (!RegistryLoadSetPrivilege())
return false;
}
int ret = SafeNativeMethods.RegLoadKey((uint)Enum.Parse(typeof(structenums.baseKey), where.ToString()), name, file);
if (ret != 0)
{
LibraryLogging.Error("Unable to load regfile {0} error:{1} {2}", file, ret, LastError(ret));
return false;
}
return true;
}