Alexandre Julliard : kernel32: Create the hardware registry keys one at a time, and bail out if the main key already exists.

Alexandre Julliard julliard at winehq.org
Mon Mar 1 09:27:37 CST 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar  1 14:02:16 2010 +0100

kernel32: Create the hardware registry keys one at a time, and bail out if the main key already exists.

---

 dlls/kernel32/oldconfig.c |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/dlls/kernel32/oldconfig.c b/dlls/kernel32/oldconfig.c
index 0e8cff1..c77e7b2 100644
--- a/dlls/kernel32/oldconfig.c
+++ b/dlls/kernel32/oldconfig.c
@@ -90,6 +90,25 @@ static void create_scsi_entry( PSCSI_ADDRESS scsi_addr, LPCSTR lpDriver, UINT uD
     attr.SecurityDescriptor = NULL;
     attr.SecurityQualityOfService = NULL;
 
+    if (!RtlCreateUnicodeStringFromAsciiz( &nameW, "Machine\\HARDWARE" ) ||
+        NtCreateKey( &scsiKey, KEY_ALL_ACCESS, &attr, 0, NULL, REG_OPTION_VOLATILE, &disp ))
+    {
+        ERR("Cannot create HARDWARE registry key\n" );
+        return;
+    }
+    NtClose( scsiKey );
+    RtlFreeUnicodeString( &nameW );
+    if (disp == REG_OPENED_EXISTING_KEY) return;
+
+    if (!RtlCreateUnicodeStringFromAsciiz( &nameW, "Machine\\HARDWARE\\DEVICEMAP" ) ||
+        NtCreateKey( &scsiKey, KEY_ALL_ACCESS, &attr, 0, NULL, REG_OPTION_VOLATILE, &disp ))
+    {
+        ERR("Cannot create DEVICEMAP registry key\n" );
+        return;
+    }
+    NtClose( scsiKey );
+    RtlFreeUnicodeString( &nameW );
+
     /* Ensure there is Scsi key */
     if (!RtlCreateUnicodeStringFromAsciiz( &nameW, "Machine\\HARDWARE\\DEVICEMAP\\Scsi" ) ||
         NtCreateKey( &scsiKey, KEY_ALL_ACCESS, &attr, 0,




More information about the wine-cvs mailing list