Commit 4a334aed authored by Alexandre Julliard's avatar Alexandre Julliard

Move all the old config conversion code to a new oldconfig.c file, and

get rid of misc/registry.c and the misc directory.
parent 3ef8c51c
...@@ -247,7 +247,6 @@ Miscellaneous: ...@@ -247,7 +247,6 @@ Miscellaneous:
Note: these directories will ultimately get moved into their Note: these directories will ultimately get moved into their
respective dlls. respective dlls.
misc/ - KERNEL registry
windows/ - USER window management windows/ - USER window management
......
...@@ -20032,8 +20032,6 @@ esac ...@@ -20032,8 +20032,6 @@ esac
ac_config_commands="$ac_config_commands include/wine" ac_config_commands="$ac_config_commands include/wine"
ac_config_commands="$ac_config_commands misc"
ac_config_commands="$ac_config_commands programs/regedit/tests" ac_config_commands="$ac_config_commands programs/regedit/tests"
ac_config_commands="$ac_config_commands windows" ac_config_commands="$ac_config_commands windows"
...@@ -20854,7 +20852,6 @@ do ...@@ -20854,7 +20852,6 @@ do
"dlls/user/resources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/resources" ;; "dlls/user/resources" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/user/resources" ;;
"dlls/wineps/data" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps/data" ;; "dlls/wineps/data" ) CONFIG_COMMANDS="$CONFIG_COMMANDS dlls/wineps/data" ;;
"include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;; "include/wine" ) CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;;
"misc" ) CONFIG_COMMANDS="$CONFIG_COMMANDS misc" ;;
"programs/regedit/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regedit/tests" ;; "programs/regedit/tests" ) CONFIG_COMMANDS="$CONFIG_COMMANDS programs/regedit/tests" ;;
"windows" ) CONFIG_COMMANDS="$CONFIG_COMMANDS windows" ;; "windows" ) CONFIG_COMMANDS="$CONFIG_COMMANDS windows" ;;
"include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
...@@ -21668,8 +21665,6 @@ echo "$as_me: creating dlls/user/resources" >&6;} && mkdir "dlls/user/resources" ...@@ -21668,8 +21665,6 @@ echo "$as_me: creating dlls/user/resources" >&6;} && mkdir "dlls/user/resources"
echo "$as_me: creating dlls/wineps/data" >&6;} && mkdir "dlls/wineps/data") ;; echo "$as_me: creating dlls/wineps/data" >&6;} && mkdir "dlls/wineps/data") ;;
include/wine ) test -d "include/wine" || ({ echo "$as_me:$LINENO: creating include/wine" >&5 include/wine ) test -d "include/wine" || ({ echo "$as_me:$LINENO: creating include/wine" >&5
echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;; echo "$as_me: creating include/wine" >&6;} && mkdir "include/wine") ;;
misc ) test -d "misc" || ({ echo "$as_me:$LINENO: creating misc" >&5
echo "$as_me: creating misc" >&6;} && mkdir "misc") ;;
programs/regedit/tests ) test -d "programs/regedit/tests" || ({ echo "$as_me:$LINENO: creating programs/regedit/tests" >&5 programs/regedit/tests ) test -d "programs/regedit/tests" || ({ echo "$as_me:$LINENO: creating programs/regedit/tests" >&5
echo "$as_me: creating programs/regedit/tests" >&6;} && mkdir "programs/regedit/tests") ;; echo "$as_me: creating programs/regedit/tests" >&6;} && mkdir "programs/regedit/tests") ;;
windows ) test -d "windows" || ({ echo "$as_me:$LINENO: creating windows" >&5 windows ) test -d "windows" || ({ echo "$as_me:$LINENO: creating windows" >&5
......
...@@ -1484,7 +1484,6 @@ WINE_CONFIG_EXTRA_DIR(dlls/user/dde) ...@@ -1484,7 +1484,6 @@ WINE_CONFIG_EXTRA_DIR(dlls/user/dde)
WINE_CONFIG_EXTRA_DIR(dlls/user/resources) WINE_CONFIG_EXTRA_DIR(dlls/user/resources)
WINE_CONFIG_EXTRA_DIR(dlls/wineps/data) WINE_CONFIG_EXTRA_DIR(dlls/wineps/data)
WINE_CONFIG_EXTRA_DIR(include/wine) WINE_CONFIG_EXTRA_DIR(include/wine)
WINE_CONFIG_EXTRA_DIR(misc)
WINE_CONFIG_EXTRA_DIR(programs/regedit/tests) WINE_CONFIG_EXTRA_DIR(programs/regedit/tests)
WINE_CONFIG_EXTRA_DIR(windows) WINE_CONFIG_EXTRA_DIR(windows)
......
...@@ -17,7 +17,6 @@ SPEC_SRCS16 = \ ...@@ -17,7 +17,6 @@ SPEC_SRCS16 = \
windebug.spec windebug.spec
C_SRCS = \ C_SRCS = \
$(TOPOBJDIR)/misc/registry.c \
actctx.c \ actctx.c \
atom.c \ atom.c \
change.c \ change.c \
...@@ -44,6 +43,7 @@ C_SRCS = \ ...@@ -44,6 +43,7 @@ C_SRCS = \
module.c \ module.c \
ne_module.c \ ne_module.c \
ne_segment.c \ ne_segment.c \
oldconfig.c \
path.c \ path.c \
powermgnt.c \ powermgnt.c \
process.c \ process.c \
...@@ -91,10 +91,7 @@ MC_SRCS = \ ...@@ -91,10 +91,7 @@ MC_SRCS = \
EXTRA_OBJS = $(ASM_SRCS:.s=.o) EXTRA_OBJS = $(ASM_SRCS:.s=.o)
SUBDIRS = tests SUBDIRS = tests
EXTRASUBDIRS = \ EXTRASUBDIRS = messages nls
$(TOPOBJDIR)/misc \
messages \
nls
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
......
...@@ -86,7 +86,7 @@ static const WCHAR pifW[] = {'.','p','i','f',0}; ...@@ -86,7 +86,7 @@ static const WCHAR pifW[] = {'.','p','i','f',0};
static const WCHAR winevdmW[] = {'w','i','n','e','v','d','m','.','e','x','e',0}; static const WCHAR winevdmW[] = {'w','i','n','e','v','d','m','.','e','x','e',0};
extern void SHELL_LoadRegistry(void); extern void SHELL_LoadRegistry(void);
extern void VOLUME_CreateDevices(void); extern void convert_old_config(void);
extern void VERSION_Init( const WCHAR *appname ); extern void VERSION_Init( const WCHAR *appname );
extern void LOCALE_Init(void); extern void LOCALE_Init(void);
...@@ -995,11 +995,8 @@ static BOOL process_init(void) ...@@ -995,11 +995,8 @@ static BOOL process_init(void)
/* Copy the parent environment */ /* Copy the parent environment */
if (!build_initial_environment( __wine_main_environ )) return FALSE; if (!build_initial_environment( __wine_main_environ )) return FALSE;
/* Create device symlinks */ /* convert old configuration to new format */
VOLUME_CreateDevices(); convert_old_config();
/* registry initialisation */
SHELL_LoadRegistry();
/* global boot finished, the rest is process-local */ /* global boot finished, the rest is process-local */
SERVER_START_REQ( boot_done ) SERVER_START_REQ( boot_done )
......
...@@ -215,237 +215,6 @@ static UINT get_registry_drive_type( const WCHAR *root ) ...@@ -215,237 +215,6 @@ static UINT get_registry_drive_type( const WCHAR *root )
} }
/* create symlinks for the DOS drives; helper for VOLUME_CreateDevices */
static int create_drives( int devices_only )
{
static const WCHAR PathW[] = {'P','a','t','h',0};
static const WCHAR DeviceW[] = {'D','e','v','i','c','e',0};
WCHAR driveW[] = {'M','a','c','h','i','n','e','\\','S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','W','i','n','e','\\',
'C','o','n','f','i','g','\\','D','r','i','v','e',' ','A',0};
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
char tmp[1024*sizeof(WCHAR) + sizeof(KEY_VALUE_PARTIAL_INFORMATION)];
char dest[1024];
WCHAR *p, name[3];
HKEY hkey;
DWORD dummy;
int i, count = 0;
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.ObjectName = &nameW;
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
/* create symlinks for the drive roots */
if (!devices_only) for (i = 0; i < 26; i++)
{
RtlInitUnicodeString( &nameW, driveW );
nameW.Buffer[(nameW.Length / sizeof(WCHAR)) - 1] = 'A' + i;
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ) != STATUS_SUCCESS) continue;
RtlInitUnicodeString( &nameW, PathW );
if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy ))
{
WCHAR path[1024];
WCHAR *data = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data;
ExpandEnvironmentStringsW( data, path, sizeof(path)/sizeof(WCHAR) );
p = path + strlenW(path) - 1;
while ((p > path) && (*p == '/')) *p-- = '\0';
name[0] = 'a' + i;
name[1] = ':';
name[2] = 0;
if (path[0] != '/')
{
/* relative paths are relative to config dir */
memmove( path + 3, path, (strlenW(path) + 1) * sizeof(WCHAR) );
path[0] = '.';
path[1] = '.';
path[2] = '/';
}
if (DefineDosDeviceW( DDD_RAW_TARGET_PATH, name, path ))
{
WideCharToMultiByte(CP_UNIXCP, 0, path, -1, dest, sizeof(dest), NULL, NULL);
MESSAGE( "Created symlink %s/dosdevices/%c: -> %s\n",
wine_get_config_dir(), 'a' + i, dest );
count++;
}
}
NtClose( hkey );
}
/* create symlinks for the drive devices */
for (i = 0; i < 26; i++)
{
RtlInitUnicodeString( &nameW, driveW );
nameW.Buffer[(nameW.Length / sizeof(WCHAR)) - 1] = 'A' + i;
if (NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ) != STATUS_SUCCESS) continue;
RtlInitUnicodeString( &nameW, DeviceW );
if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation, tmp, sizeof(tmp), &dummy ))
{
char *path, *p;
WCHAR devname[] = {'A',':',':',0 };
WCHAR *data = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data;
WideCharToMultiByte(CP_UNIXCP, 0, data, -1, dest, sizeof(dest), NULL, NULL);
path = get_dos_device_path( devname );
p = path + strlen(path);
p[-3] = 'a' + i;
if (!symlink( dest, path ))
{
MESSAGE( "Created symlink %s/dosdevices/%c:: -> %s\n",
wine_get_config_dir(), 'a' + i, dest );
count++;
}
HeapFree( GetProcessHeap(), 0, path );
}
NtClose( hkey );
}
return count;
}
/***********************************************************************
* VOLUME_CreateDevices
*
* Create the device files for the new device naming scheme.
* Should go away after a transition period.
*/
void VOLUME_CreateDevices(void)
{
const char *config_dir = wine_get_config_dir();
char *buffer;
int i, count = 0;
if (!(buffer = HeapAlloc( GetProcessHeap(), 0,
strlen(config_dir) + sizeof("/dosdevices/a::") )))
return;
strcpy( buffer, config_dir );
strcat( buffer, "/dosdevices" );
if (!mkdir( buffer, 0777 )) /* we created it, so now create the devices */
{
HKEY hkey;
DWORD dummy;
OBJECT_ATTRIBUTES attr;
UNICODE_STRING nameW;
WCHAR *p, *devnameW;
char tmp[128];
WCHAR com[5] = {'C','O','M','1',0};
WCHAR lpt[5] = {'L','P','T','1',0};
static const WCHAR serialportsW[] = {'M','a','c','h','i','n','e','\\',
'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','W','i','n','e','\\',
'C','o','n','f','i','g','\\',
'S','e','r','i','a','l','P','o','r','t','s',0};
static const WCHAR parallelportsW[] = {'M','a','c','h','i','n','e','\\',
'S','o','f','t','w','a','r','e','\\',
'W','i','n','e','\\','W','i','n','e','\\',
'C','o','n','f','i','g','\\',
'P','a','r','a','l','l','e','l','P','o','r','t','s',0};
attr.Length = sizeof(attr);
attr.RootDirectory = 0;
attr.ObjectName = &nameW;
attr.Attributes = 0;
attr.SecurityDescriptor = NULL;
attr.SecurityQualityOfService = NULL;
RtlInitUnicodeString( &nameW, serialportsW );
if (!NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ))
{
RtlInitUnicodeString( &nameW, com );
for (i = 1; i <= 9; i++)
{
com[3] = '0' + i;
if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation,
tmp, sizeof(tmp), &dummy ))
{
devnameW = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data;
if ((p = strchrW( devnameW, ',' ))) *p = 0;
if (DefineDosDeviceW( DDD_RAW_TARGET_PATH, com, devnameW ))
{
char devname[32];
WideCharToMultiByte(CP_UNIXCP, 0, devnameW, -1,
devname, sizeof(devname), NULL, NULL);
MESSAGE( "Created symlink %s/dosdevices/com%d -> %s\n", config_dir, i, devname );
count++;
}
}
}
NtClose( hkey );
}
RtlInitUnicodeString( &nameW, parallelportsW );
if (!NtOpenKey( &hkey, KEY_ALL_ACCESS, &attr ))
{
RtlInitUnicodeString( &nameW, lpt );
for (i = 1; i <= 9; i++)
{
lpt[3] = '0' + i;
if (!NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation,
tmp, sizeof(tmp), &dummy ))
{
devnameW = (WCHAR *)((KEY_VALUE_PARTIAL_INFORMATION *)tmp)->Data;
if ((p = strchrW( devnameW, ',' ))) *p = 0;
if (DefineDosDeviceW( DDD_RAW_TARGET_PATH, lpt, devnameW ))
{
char devname[32];
WideCharToMultiByte(CP_UNIXCP, 0, devnameW, -1,
devname, sizeof(devname), NULL, NULL);
MESSAGE( "Created symlink %s/dosdevices/lpt%d -> %s\n", config_dir, i, devname );
count++;
}
}
}
NtClose( hkey );
}
count += create_drives( FALSE );
}
else
{
struct stat st;
int i;
/* it is possible that the serial/parallel devices have been created but */
/* not the drives; check for at least one drive symlink to catch that case */
strcat( buffer, "/a:" );
for (i = 0; i < 26; i++)
{
buffer[strlen(buffer)-2] = 'a' + i;
if (!lstat( buffer, &st )) break;
}
if (i == 26) count += create_drives( FALSE );
else
{
strcat( buffer, ":" );
for (i = 0; i < 26; i++)
{
buffer[strlen(buffer)-3] = 'a' + i;
if (!lstat( buffer, &st )) break;
}
if (i == 26) count += create_drives( TRUE );
}
}
if (count)
MESSAGE( "\nYou can now remove the [SerialPorts], [ParallelPorts], and [Drive] sections\n"
"in your configuration file, they are replaced by the above symlinks.\n\n" );
HeapFree( GetProcessHeap(), 0, buffer );
}
/****************************************************************** /******************************************************************
* VOLUME_FindCdRomDataBestVoldesc * VOLUME_FindCdRomDataBestVoldesc
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment