From 61812d17f825c80b1b5adee82a499f0e9071c80e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 1 Mar 2010 14:01:28 +0100 Subject: [PATCH] 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 26064f4fc6d..0e8cff1a16c 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 7c4b14bcd4d..8748a6ade98 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(); -- 2.11.4.GIT