Hardcode the location of config.sys, no need for a config parameter
for that.
This commit is contained in:
parent
48a8f520f5
commit
c913efa244
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include "windef.h"
|
#include "windef.h"
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "winreg.h"
|
|
||||||
|
|
||||||
#include "dosexe.h"
|
#include "dosexe.h"
|
||||||
|
|
||||||
@ -455,51 +454,30 @@ static void DOSCONF_Parse(char *menuname)
|
|||||||
|
|
||||||
DOSCONF *DOSCONF_GetConfig(void)
|
DOSCONF *DOSCONF_GetConfig(void)
|
||||||
{
|
{
|
||||||
HKEY hkey;
|
char *fullname;
|
||||||
WCHAR filename[MAX_PATH];
|
WCHAR filename[MAX_PATH];
|
||||||
static const WCHAR configW[] = {'c','o','n','f','i','g','.','s','y','s',0};
|
static const WCHAR configW[] = {'c','o','n','f','i','g','.','s','y','s',0};
|
||||||
|
|
||||||
if (DOSCONF_loaded)
|
if (DOSCONF_loaded)
|
||||||
return &DOSCONF_config;
|
return &DOSCONF_config;
|
||||||
|
|
||||||
/* default value */
|
/* look for config.sys at the root of the drive containing the windows dir */
|
||||||
filename[0] = '*'; filename[1] = '\0';
|
GetWindowsDirectoryW( filename, MAX_PATH );
|
||||||
|
strcpyW( filename + 3, configW );
|
||||||
|
|
||||||
/* @@ Wine registry key: HKLM\Software\Wine\Wine\Config\wine */
|
if ((fullname = wine_get_unix_file_name(filename)))
|
||||||
if (!RegOpenKeyA(HKEY_LOCAL_MACHINE,
|
|
||||||
"Software\\Wine\\Wine\\Config\\wine",
|
|
||||||
&hkey))
|
|
||||||
{
|
{
|
||||||
DWORD type;
|
DOSCONF_fd = fopen(fullname, "r");
|
||||||
DWORD count = sizeof(filename);
|
HeapFree( GetProcessHeap(), 0, fullname );
|
||||||
|
|
||||||
RegQueryValueExW(hkey, configW, 0, &type, (LPBYTE)filename, &count);
|
|
||||||
RegCloseKey(hkey);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((filename[0] != '*' || filename[1] != '\0') && *filename != '\0')
|
if (DOSCONF_fd)
|
||||||
{
|
{
|
||||||
char *fullname;
|
DOSCONF_Parse(NULL);
|
||||||
|
fclose(DOSCONF_fd);
|
||||||
if ((fullname = wine_get_unix_file_name(filename)))
|
DOSCONF_fd = NULL;
|
||||||
{
|
|
||||||
DOSCONF_fd = fopen(fullname, "r");
|
|
||||||
HeapFree( GetProcessHeap(), 0, fullname );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (DOSCONF_fd)
|
|
||||||
{
|
|
||||||
DOSCONF_Parse(NULL);
|
|
||||||
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;
|
DOSCONF_loaded = TRUE;
|
||||||
return &DOSCONF_config;
|
return &DOSCONF_config;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user