[PATCH 1/4] reg.exe: Add path_get_key() to remove boilerplate

Hugh McMaster hugh.mcmaster at outlook.com
Thu Sep 4 07:36:12 CDT 2014


On Wed,  3 Sep 2014 14:54:44 +0200, Jonathan Vollebregt wrote:

> +    if (path[0] == '\\')
> +    {
> +            path++;
> +    }
> +    if (path[0] == '\\')
> +    {
> +            reg_message(STRING_NO_REMOTE);
> +            return NULL;
> +    }

This would be valid if the path was something like \\remote-machine\HKLM.

But if the first if block was true and the second block was false, the registry path is invalid. Windows does not accept registry paths such as \HKLM.

In summary:

True + True = valid path, but not supported in Wine.
True + False = invalid path
False + True = impossible
False + False = valid path

The original check was better:
if (key_name[0] == '\\' && key_name[1] == '\\')
{
    reg_message(STRING_NO_REMOTE);
    return 1;
}
It was also unclear why you perform the path[0] == '\\' check in path_get_key() and path_get_rootkey_name(). One common check should be enough. The original version of this patch did this (now superseded). But I see you made some changes around the reg_delete() function.
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20140904/e57cf508/attachment.html>


More information about the wine-devel mailing list