Alexandre Julliard : advapi32: Don't try to create the registry root.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Nov 20 07:48:47 CST 2015


Module: wine
Branch: master
Commit: eafdbdd13b19d9f0ddfa3309eb38d7ec2a22986f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=eafdbdd13b19d9f0ddfa3309eb38d7ec2a22986f

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Fri Nov 20 19:56:40 2015 +0900

advapi32: Don't try to create the registry root.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/advapi32/registry.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
index 798f93d..4f33fe6 100644
--- a/dlls/advapi32/registry.c
+++ b/dlls/advapi32/registry.c
@@ -141,10 +141,16 @@ static NTSTATUS create_key( HKEY *retkey, ACCESS_MASK access, OBJECT_ATTRIBUTES
 
     if (status == STATUS_OBJECT_NAME_NOT_FOUND)
     {
+        static const WCHAR registry_root[] = {'\\','R','e','g','i','s','t','r','y','\\'};
         WCHAR *buffer = attr->ObjectName->Buffer;
         DWORD attrs, pos = 0, i = 0, len = attr->ObjectName->Length / sizeof(WCHAR);
         UNICODE_STRING str;
 
+        /* don't try to create registry root */
+        if (!attr->RootDirectory && len > sizeof(registry_root)/sizeof(WCHAR) &&
+            !memicmpW( buffer, registry_root, sizeof(registry_root)/sizeof(WCHAR)))
+            i += sizeof(registry_root)/sizeof(WCHAR);
+
         while (i < len && buffer[i] != '\\') i++;
         if (i == len && !force_wow32) return status;
 




More information about the wine-cvs mailing list