Alexandre Julliard : kernel32: Moved creation of the DynData registry keys to wineboot.

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


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

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

kernel32: Moved creation of the DynData registry keys to wineboot.

---

 dlls/kernel32/oldconfig.c    |   36 ------------------------------------
 programs/wineboot/wineboot.c |   17 +++++++++++++++++
 2 files changed, 17 insertions(+), 36 deletions(-)

diff --git a/dlls/kernel32/oldconfig.c b/dlls/kernel32/oldconfig.c
index 26064f4..0e8cff1 100644
--- a/dlls/kernel32/oldconfig.c
+++ b/dlls/kernel32/oldconfig.c
@@ -55,39 +55,6 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(reg);
 
-
-/* registry initialisation, allocates some default keys. */
-static ULONG allocate_default_keys(void)
-{
-    static const WCHAR StatDataW[] = {'D','y','n','D','a','t','a','\\',
-                                      'P','e','r','f','S','t','a','t','s','\\',
-                                      'S','t','a','t','D','a','t','a',0};
-    static const WCHAR ConfigManagerW[] = {'D','y','n','D','a','t','a','\\',
-                                           'C','o','n','f','i','g',' ','M','a','n','a','g','e','r','\\',
-                                            'E','n','u','m',0};
-    HANDLE hkey;
-    ULONG dispos;
-    OBJECT_ATTRIBUTES attr;
-    UNICODE_STRING nameW;
-
-    attr.Length = sizeof(attr);
-    attr.RootDirectory = 0;
-    attr.ObjectName = &nameW;
-    attr.Attributes = 0;
-    attr.SecurityDescriptor = NULL;
-    attr.SecurityQualityOfService = NULL;
-
-    RtlInitUnicodeString( &nameW, StatDataW );
-    if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, &dispos )) NtClose( hkey );
-    if (dispos == REG_OPENED_EXISTING_KEY)
-        return dispos; /* someone else already loaded the registry */
-
-    RtlInitUnicodeString( &nameW, ConfigManagerW );
-    if (!NtCreateKey( &hkey, KEY_ALL_ACCESS, &attr, 0, NULL, 0, NULL )) NtClose( hkey );
-
-    return dispos;
-}
-
 /******************************************************************
  *		create_scsi_entry
  *
@@ -459,9 +426,6 @@ static void create_hardware_branch(void)
  */
 void convert_old_config(void)
 {
-    if (allocate_default_keys() == REG_OPENED_EXISTING_KEY)
-        return; /* someone else already loaded the registry */
-
     /* create some hardware keys (FIXME: should not be done here) */
     create_hardware_branch();
 }
diff --git a/programs/wineboot/wineboot.c b/programs/wineboot/wineboot.c
index 7c4b14b..8748a6a 100644
--- a/programs/wineboot/wineboot.c
+++ b/programs/wineboot/wineboot.c
@@ -233,6 +233,22 @@ static void create_hardware_registry_keys(void)
     RegCloseKey( system_key );
 }
 
+
+/* create the DynData registry keys */
+static void create_dynamic_registry_keys(void)
+{
+    static const WCHAR StatDataW[] = {'P','e','r','f','S','t','a','t','s','\\',
+                                      'S','t','a','t','D','a','t','a',0};
+    static const WCHAR ConfigManagerW[] = {'C','o','n','f','i','g',' ','M','a','n','a','g','e','r','\\',
+                                           'E','n','u','m',0};
+    HKEY key;
+
+    if (!RegCreateKeyExW( HKEY_DYN_DATA, StatDataW, 0, NULL, 0, KEY_WRITE, NULL, &key, NULL ))
+        RegCloseKey( key );
+    if (!RegCreateKeyExW( HKEY_DYN_DATA, ConfigManagerW, 0, NULL, 0, KEY_WRITE, NULL, &key, NULL ))
+        RegCloseKey( key );
+}
+
 /* create the platform-specific environment registry keys */
 static void create_environment_registry_keys( void )
 {
@@ -1049,6 +1065,7 @@ int main( int argc, char *argv[] )
     ResetEvent( event );  /* in case this is a restart */
 
     create_hardware_registry_keys();
+    create_dynamic_registry_keys();
     create_environment_registry_keys();
     wininit();
     pendingRename();




More information about the wine-cvs mailing list