Hardcode the location of config.sys, no need for a config parameter

for that.
This commit is contained in:
Alexandre Julliard 2005-06-14 11:48:57 +00:00
parent 48a8f520f5
commit c913efa244
1 changed files with 12 additions and 34 deletions

View File

@ -32,7 +32,6 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
#include "dosexe.h"
@ -455,31 +454,16 @@ static void DOSCONF_Parse(char *menuname)
DOSCONF *DOSCONF_GetConfig(void)
{
HKEY hkey;
char *fullname;
WCHAR filename[MAX_PATH];
static const WCHAR configW[] = {'c','o','n','f','i','g','.','s','y','s',0};
if (DOSCONF_loaded)
return &DOSCONF_config;
/* default value */
filename[0] = '*'; filename[1] = '\0';
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\wine */
if (!RegOpenKeyA(HKEY_LOCAL_MACHINE,
"Software\\Wine\\Wine\\Config\\wine",
&hkey))
{
DWORD type;
DWORD count = sizeof(filename);
RegQueryValueExW(hkey, configW, 0, &type, (LPBYTE)filename, &count);
RegCloseKey(hkey);
}
if ((filename[0] != '*' || filename[1] != '\0') && *filename != '\0')
{
char *fullname;
/* look for config.sys at the root of the drive containing the windows dir */
GetWindowsDirectoryW( filename, MAX_PATH );
strcpyW( filename + 3, configW );
if ((fullname = wine_get_unix_file_name(filename)))
{
@ -493,13 +477,7 @@ DOSCONF *DOSCONF_GetConfig(void)
fclose(DOSCONF_fd);
DOSCONF_fd = NULL;
}
else
{
WARN( "Couldn't open config.sys file given as %s in"
" configuration file, section [wine]!\n",
debugstr_w(filename) );
}
}
else WARN( "Couldn't open %s\n", debugstr_w(filename) );
DOSCONF_loaded = TRUE;
return &DOSCONF_config;