RtlQueryRegistryValues and RtlCheckRegistryKey

Robert Shearman rob at codeweavers.com
Thu Jan 20 18:04:44 CST 2005


Ivan Leo Puoti wrote:

> Implement RtlQueryRegistryValues, RtlCheckRegistryKey is implemented in
> this patch as a free bonus. Thanks to the guys on IRC for their help.
>
> BTW when RtlCheckRegistryKey is called with the RTL_REGISTRY_HANDLE flag,
> it always returns STATUS_SUCCESS, even if called with NULL, an invalid 
> HKEY,
> a string containing rude words, a random number, and anything else I 
> could think of,
> so that's why STATUS_SUCCESS is always returned when 
> RTL_REGISTRY_HANDLE is set.


>+NTSTATUS WINAPI RtlCheckRegistryKey(IN ULONG  RelativeTo, IN PWSTR  Path)
>+{
>+    HKEY handle;
>+    NTSTATUS status = STATUS_SUCCESS;
>+    if((!RelativeTo) && Path == NULL)
>+        return STATUS_OBJECT_PATH_SYNTAX_BAD;
>+    if(RelativeTo & RTL_REGISTRY_HANDLE)
>+        return status;
>+    if ((RelativeTo & 0xff) <= 5)
>+    {
>+        if(RelativeTo & RTL_REGISTRY_HANDLE)
>+            handle = (HANDLE)Path;
>  
>

This test is redundant due to the test outside of this block.

>+        else
>+            status = RTL_GetKeyHandle(RelativeTo, Path, &handle);
>+        if(status==STATUS_INVALID_HANDLE)
>+            return STATUS_OBJECT_NAME_NOT_FOUND;
>+        if(status==STATUS_ACCESS_DENIED)
>+            return STATUS_ACCESS_DENIED;
>+        if(status!=STATUS_SUCCESS)
>+        return status;
>+    }
>+    else
>+        return STATUS_INVALID_PARAMETER;
>+    return status;
>+}
>  
>

Rob



More information about the wine-devel mailing list