Commit 013f8946 authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

Moved dosconf.c to winedos.

parent b830439b
...@@ -45,7 +45,6 @@ C_SRCS = \ ...@@ -45,7 +45,6 @@ C_SRCS = \
$(TOPOBJDIR)/misc/registry.c \ $(TOPOBJDIR)/misc/registry.c \
$(TOPOBJDIR)/misc/system.c \ $(TOPOBJDIR)/misc/system.c \
$(TOPOBJDIR)/misc/version.c \ $(TOPOBJDIR)/misc/version.c \
$(TOPOBJDIR)/msdos/dosconf.c \
$(TOPOBJDIR)/msdos/dosmem.c \ $(TOPOBJDIR)/msdos/dosmem.c \
$(TOPOBJDIR)/msdos/dpmi.c \ $(TOPOBJDIR)/msdos/dpmi.c \
$(TOPOBJDIR)/msdos/int21.c \ $(TOPOBJDIR)/msdos/int21.c \
...@@ -74,8 +73,8 @@ C_SRCS = \ ...@@ -74,8 +73,8 @@ C_SRCS = \
cdrom.c \ cdrom.c \
critsection.c \ critsection.c \
debugtools.c \ debugtools.c \
exception.c \
error.c \ error.c \
exception.c \
file.c \ file.c \
heap.c \ heap.c \
large_int.c \ large_int.c \
...@@ -86,17 +85,17 @@ C_SRCS = \ ...@@ -86,17 +85,17 @@ C_SRCS = \
path.c \ path.c \
reg.c \ reg.c \
rtl.c \ rtl.c \
rtlstr.c \
rtlbitmap.c \ rtlbitmap.c \
string.c \ rtlstr.c \
sec.c \ sec.c \
signal_i386.c \ signal_i386.c \
signal_powerpc.c \ signal_powerpc.c \
signal_sparc.c \ signal_sparc.c \
string.c \
sync.c \ sync.c \
thread.c \ thread.c \
virtual.c \
time.c \ time.c \
virtual.c \
wcstring.c wcstring.c
ASM_SRCS = \ ASM_SRCS = \
......
...@@ -13,6 +13,7 @@ C_SRCS = \ ...@@ -13,6 +13,7 @@ C_SRCS = \
devices.c \ devices.c \
dma.c \ dma.c \
dosaspi.c \ dosaspi.c \
dosconf.c \
dosvm.c \ dosvm.c \
fpu.c \ fpu.c \
himem.c \ himem.c \
......
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
#include <ctype.h> #include <ctype.h>
#include "winbase.h" #include "winbase.h"
#include "winreg.h"
#include "file.h" #include "file.h"
#include "miscemu.h" #include "dosexe.h"
#include "msdos.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h" #include "wine/unicode.h"
...@@ -58,7 +58,7 @@ static int DOSCONF_Stacks(char **confline); ...@@ -58,7 +58,7 @@ static int DOSCONF_Stacks(char **confline);
static int DOSCONF_Buffers(char **confline); static int DOSCONF_Buffers(char **confline);
static void DOSCONF_Parse(char *menuname); static void DOSCONF_Parse(char *menuname);
DOSCONF DOSCONF_config = static DOSCONF DOSCONF_config =
{ {
'E', /* lastdrive */ 'E', /* lastdrive */
0, /* brk_flag */ 0, /* brk_flag */
...@@ -73,6 +73,8 @@ DOSCONF DOSCONF_config = ...@@ -73,6 +73,8 @@ DOSCONF DOSCONF_config =
NULL /* country */ NULL /* country */
}; };
static BOOL DOSCONF_loaded = FALSE;
typedef struct { typedef struct {
const char *tag_name; const char *tag_name;
int (*tag_handler)(char **p); int (*tag_handler)(char **p);
...@@ -86,7 +88,7 @@ typedef struct { ...@@ -86,7 +88,7 @@ typedef struct {
* http://www.csulb.edu/~murdock/dosindex.html * http://www.csulb.edu/~murdock/dosindex.html
*/ */
static const TAG_ENTRY tag_entries[] = static const TAG_ENTRY DOSCONF_tag_entries[] =
{ {
{ ";", NULL }, { ";", NULL },
{ "REM ", NULL }, { "REM ", NULL },
...@@ -95,7 +97,6 @@ static const TAG_ENTRY tag_entries[] = ...@@ -95,7 +97,6 @@ static const TAG_ENTRY tag_entries[] =
{ "SUBMENU", NULL }, { "SUBMENU", NULL },
{ "MENUDEFAULT", DOSCONF_Menu }, { "MENUDEFAULT", DOSCONF_Menu },
{ "INCLUDE", DOSCONF_Include }, { "INCLUDE", DOSCONF_Include },
{ "INSTALL", DOSCONF_Install }, { "INSTALL", DOSCONF_Install },
{ "DOS", DOSCONF_Dos }, { "DOS", DOSCONF_Dos },
{ "FCBS", DOSCONF_Fcbs }, { "FCBS", DOSCONF_Fcbs },
...@@ -110,12 +111,11 @@ static const TAG_ENTRY tag_entries[] = ...@@ -110,12 +111,11 @@ static const TAG_ENTRY tag_entries[] =
{ "LASTDRIVE", DOSCONF_Lastdrive } { "LASTDRIVE", DOSCONF_Lastdrive }
}; };
static FILE *cfg_fd; static FILE *DOSCONF_fd = NULL;
static char *menu_default = NULL;
static int menu_in_listing = 0; /* we are in the [menu] section */
static int menu_skip = 0; /* the current menu gets skipped */
static char *DOSCONF_menu_default = NULL;
static int DOSCONF_menu_in_listing = 0; /* we are in the [menu] section */
static int DOSCONF_menu_skip = 0; /* the current menu gets skipped */
static void DOSCONF_skip(char **pconfline) static void DOSCONF_skip(char **pconfline)
{ {
...@@ -135,7 +135,8 @@ static int DOSCONF_JumpToEntry(char **pconfline, char separator) ...@@ -135,7 +135,8 @@ static int DOSCONF_JumpToEntry(char **pconfline, char separator)
if (*p != separator) if (*p != separator)
return 0; return 0;
else p++; else
p++;
while ( (*p == ' ') || (*p == '\t') ) p++; while ( (*p == ' ') || (*p == '\t') ) p++;
*pconfline = p; *pconfline = p;
...@@ -172,17 +173,21 @@ static int DOSCONF_Dos(char **confline) ...@@ -172,17 +173,21 @@ static int DOSCONF_Dos(char **confline)
DOSCONF_config.flags |= DOSCONF_MEM_HIGH; DOSCONF_config.flags |= DOSCONF_MEM_HIGH;
*confline += 4; *confline += 4;
} }
else else if (!(strncasecmp(*confline, "UMB", 3)))
if (!(strncasecmp(*confline, "UMB", 3)))
{ {
DOSCONF_config.flags |= DOSCONF_MEM_UMB; DOSCONF_config.flags |= DOSCONF_MEM_UMB;
*confline += 3; *confline += 3;
} }
else (*confline)++; else
{
(*confline)++;
}
DOSCONF_JumpToEntry(confline, ','); DOSCONF_JumpToEntry(confline, ',');
} }
TRACE("DOSCONF_Dos: HIGH is %d, UMB is %d\n", TRACE( "DOSCONF_Dos: HIGH is %d, UMB is %d\n",
(DOSCONF_config.flags & DOSCONF_MEM_HIGH) != 0, (DOSCONF_config.flags & DOSCONF_MEM_UMB) != 0); (DOSCONF_config.flags & DOSCONF_MEM_HIGH) != 0,
(DOSCONF_config.flags & DOSCONF_MEM_UMB) != 0 );
return 1; return 1;
} }
...@@ -193,10 +198,10 @@ static int DOSCONF_Fcbs(char **confline) ...@@ -193,10 +198,10 @@ static int DOSCONF_Fcbs(char **confline)
DOSCONF_config.fcbs = atoi(*confline); DOSCONF_config.fcbs = atoi(*confline);
if (DOSCONF_config.fcbs > 255) if (DOSCONF_config.fcbs > 255)
{ {
MESSAGE("The FCBS value in the config.sys file is too high ! Setting to 255.\n"); WARN( "The FCBS value in the config.sys file is too high! Setting to 255.\n" );
DOSCONF_config.fcbs = 255; DOSCONF_config.fcbs = 255;
} }
TRACE("DOSCONF_Fcbs returning %d\n", DOSCONF_config.fcbs); TRACE( "DOSCONF_Fcbs returning %d\n", DOSCONF_config.fcbs );
return 1; return 1;
} }
...@@ -206,7 +211,7 @@ static int DOSCONF_Break(char **confline) ...@@ -206,7 +211,7 @@ static int DOSCONF_Break(char **confline)
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
if (!(strcasecmp(*confline, "ON"))) if (!(strcasecmp(*confline, "ON")))
DOSCONF_config.brk_flag = 1; DOSCONF_config.brk_flag = 1;
TRACE("BREAK is %d\n", DOSCONF_config.brk_flag); TRACE( "BREAK is %d\n", DOSCONF_config.brk_flag );
return 1; return 1;
} }
...@@ -217,15 +222,15 @@ static int DOSCONF_Files(char **confline) ...@@ -217,15 +222,15 @@ static int DOSCONF_Files(char **confline)
DOSCONF_config.files = atoi(*confline); DOSCONF_config.files = atoi(*confline);
if (DOSCONF_config.files > 255) if (DOSCONF_config.files > 255)
{ {
MESSAGE("The FILES value in the config.sys file is too high ! Setting to 255.\n"); WARN( "The FILES value in the config.sys file is too high! Setting to 255.\n" );
DOSCONF_config.files = 255; DOSCONF_config.files = 255;
} }
if (DOSCONF_config.files < 8) if (DOSCONF_config.files < 8)
{ {
MESSAGE("The FILES value in the config.sys file is too low ! Setting to 8.\n"); WARN( "The FILES value in the config.sys file is too low! Setting to 8.\n" );
DOSCONF_config.files = 8; DOSCONF_config.files = 8;
} }
TRACE("DOSCONF_Files returning %d\n", DOSCONF_config.files); TRACE( "DOSCONF_Files returning %d\n", DOSCONF_config.files );
return 1; return 1;
} }
...@@ -237,7 +242,7 @@ static int DOSCONF_Install(char **confline) ...@@ -237,7 +242,7 @@ static int DOSCONF_Install(char **confline)
*confline += 7; /* strlen("INSTALL") */ *confline += 7; /* strlen("INSTALL") */
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
TRACE("Installing '%s'\n", *confline); TRACE( "Installing '%s'\n", *confline );
#if 0 #if 0
DOSMOD_Install(*confline, loadhigh); DOSMOD_Install(*confline, loadhigh);
#endif #endif
...@@ -249,7 +254,7 @@ static int DOSCONF_Lastdrive(char **confline) ...@@ -249,7 +254,7 @@ static int DOSCONF_Lastdrive(char **confline)
*confline += 9; /* strlen("LASTDRIVE") */ *confline += 9; /* strlen("LASTDRIVE") */
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
DOSCONF_config.lastdrive = toupper(**confline); DOSCONF_config.lastdrive = toupper(**confline);
TRACE("Lastdrive %c\n", DOSCONF_config.lastdrive); TRACE( "Lastdrive %c\n", DOSCONF_config.lastdrive );
return 1; return 1;
} }
...@@ -257,9 +262,9 @@ static int DOSCONF_Country(char **confline) ...@@ -257,9 +262,9 @@ static int DOSCONF_Country(char **confline)
{ {
*confline += 7; /* strlen("COUNTRY") */ *confline += 7; /* strlen("COUNTRY") */
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
TRACE("Country '%s'\n", *confline); TRACE( "Country '%s'\n", *confline );
if (DOSCONF_config.country == NULL) if (DOSCONF_config.country == NULL)
DOSCONF_config.country = malloc(strlen(*confline) + 1); DOSCONF_config.country = malloc(strlen(*confline) + 1);
strcpy(DOSCONF_config.country, *confline); strcpy(DOSCONF_config.country, *confline);
return 1; return 1;
} }
...@@ -270,7 +275,8 @@ static int DOSCONF_Numlock(char **confline) ...@@ -270,7 +275,8 @@ static int DOSCONF_Numlock(char **confline)
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
if (!(strcasecmp(*confline, "ON"))) if (!(strcasecmp(*confline, "ON")))
DOSCONF_config.flags |= DOSCONF_NUMLOCK; DOSCONF_config.flags |= DOSCONF_NUMLOCK;
TRACE("NUMLOCK is %d\n", (DOSCONF_config.flags & DOSCONF_NUMLOCK) != 0); TRACE( "NUMLOCK is %d\n",
(DOSCONF_config.flags & DOSCONF_NUMLOCK) != 0 );
return 1; return 1;
} }
...@@ -287,8 +293,8 @@ static int DOSCONF_Switches(char **confline) ...@@ -287,8 +293,8 @@ static int DOSCONF_Switches(char **confline)
DOSCONF_config.flags |= DOSCONF_KEYB_CONV; DOSCONF_config.flags |= DOSCONF_KEYB_CONV;
} }
while ((p = strtok(NULL, "/"))); while ((p = strtok(NULL, "/")));
TRACE("'Force conventional keyboard' is %d\n", TRACE( "'Force conventional keyboard' is %d\n",
(DOSCONF_config.flags & DOSCONF_KEYB_CONV) != 0); (DOSCONF_config.flags & DOSCONF_KEYB_CONV) != 0 );
return 1; return 1;
} }
...@@ -296,9 +302,9 @@ static int DOSCONF_Shell(char **confline) ...@@ -296,9 +302,9 @@ static int DOSCONF_Shell(char **confline)
{ {
*confline += 5; /* strlen("SHELL") */ *confline += 5; /* strlen("SHELL") */
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
TRACE("Shell '%s'\n", *confline); TRACE( "Shell '%s'\n", *confline );
if (DOSCONF_config.shell == NULL) if (DOSCONF_config.shell == NULL)
DOSCONF_config.shell = malloc(strlen(*confline) + 1); DOSCONF_config.shell = malloc(strlen(*confline) + 1);
strcpy(DOSCONF_config.shell, *confline); strcpy(DOSCONF_config.shell, *confline);
return 1; return 1;
} }
...@@ -310,8 +316,8 @@ static int DOSCONF_Stacks(char **confline) ...@@ -310,8 +316,8 @@ static int DOSCONF_Stacks(char **confline)
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
DOSCONF_config.stacks_nr = atoi(strtok(*confline, ",")); DOSCONF_config.stacks_nr = atoi(strtok(*confline, ","));
DOSCONF_config.stacks_sz = atoi((strtok(NULL, ","))); DOSCONF_config.stacks_sz = atoi((strtok(NULL, ",")));
TRACE("%d stacks of size %d\n", TRACE( "%d stacks of size %d\n",
DOSCONF_config.stacks_nr, DOSCONF_config.stacks_sz); DOSCONF_config.stacks_nr, DOSCONF_config.stacks_sz );
return 1; return 1;
} }
...@@ -325,42 +331,46 @@ static int DOSCONF_Buffers(char **confline) ...@@ -325,42 +331,46 @@ static int DOSCONF_Buffers(char **confline)
DOSCONF_config.buf = atoi(p); DOSCONF_config.buf = atoi(p);
if ((p = strtok(NULL, ","))) if ((p = strtok(NULL, ",")))
DOSCONF_config.buf2 = atoi(p); DOSCONF_config.buf2 = atoi(p);
TRACE("%d primary buffers, %d secondary buffers\n", TRACE( "%d primary buffers, %d secondary buffers\n",
DOSCONF_config.buf, DOSCONF_config.buf2); DOSCONF_config.buf, DOSCONF_config.buf2 );
return 1; return 1;
} }
static int DOSCONF_Menu(char **confline) static int DOSCONF_Menu(char **confline)
{ {
if (!(strncasecmp(*confline, "[MENU]", 6))) if (!(strncasecmp(*confline, "[MENU]", 6)))
menu_in_listing = 1;
else
if ((!(strncasecmp(*confline, "[COMMON]", 8)))
|| (!(strncasecmp(*confline, "[WINE]", 6))))
menu_skip = 0;
else
if (**confline == '[')
{ {
(*confline)++; DOSCONF_menu_in_listing = 1;
if ((menu_default) }
&& (!(strncasecmp(*confline, menu_default, strlen(menu_default))))) else if ((!(strncasecmp(*confline, "[COMMON]", 8)))
|| (!(strncasecmp(*confline, "[WINE]", 6))))
{ {
free(menu_default); DOSCONF_menu_skip = 0;
menu_default = NULL;
menu_skip = 0;
} }
else else if (**confline == '[')
menu_skip = 1; {
menu_in_listing = 0; (*confline)++;
if ((DOSCONF_menu_default)
&& (!(strncasecmp(*confline, DOSCONF_menu_default,
strlen(DOSCONF_menu_default)))))
{
free(DOSCONF_menu_default);
DOSCONF_menu_default = NULL;
DOSCONF_menu_skip = 0;
}
else
DOSCONF_menu_skip = 1;
DOSCONF_menu_in_listing = 0;
} }
else else if (!(strncasecmp(*confline, "menudefault", 11))
if (!(strncasecmp(*confline, "menudefault", 11)) && (menu_in_listing)) && (DOSCONF_menu_in_listing))
{ {
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
*confline = strtok(*confline, ","); *confline = strtok(*confline, ",");
menu_default = malloc(strlen(*confline) + 1); DOSCONF_menu_default = malloc(strlen(*confline) + 1);
strcpy(menu_default, *confline); strcpy(DOSCONF_menu_default, *confline);
} }
return 1; return 1;
} }
...@@ -371,26 +381,26 @@ static int DOSCONF_Include(char **confline) ...@@ -371,26 +381,26 @@ static int DOSCONF_Include(char **confline)
*confline += 7; /* strlen("INCLUDE") */ *confline += 7; /* strlen("INCLUDE") */
if (!(DOSCONF_JumpToEntry(confline, '='))) return 0; if (!(DOSCONF_JumpToEntry(confline, '='))) return 0;
fgetpos(cfg_fd, &oldpos); fgetpos(DOSCONF_fd, &oldpos);
fseek(cfg_fd, 0, SEEK_SET); fseek(DOSCONF_fd, 0, SEEK_SET);
TRACE("Including menu '%s'\n", *confline); TRACE( "Including menu '%s'\n", *confline );
temp = malloc(strlen(*confline) + 1); temp = malloc(strlen(*confline) + 1);
strcpy(temp, *confline); strcpy(temp, *confline);
DOSCONF_Parse(temp); DOSCONF_Parse(temp);
free(temp); free(temp);
fsetpos(cfg_fd, &oldpos); fsetpos(DOSCONF_fd, &oldpos);
return 1; return 1;
} }
static void DOSCONF_Parse(char *menuname) static void DOSCONF_Parse(char *menuname)
{ {
char confline[256]; char confline[256];
char *p, *trail; char *p, *trail;
int i; int i;
if (menuname != NULL) /* we need to jump to a certain sub menu */ if (menuname != NULL) /* we need to jump to a certain sub menu */
{ {
while (fgets(confline, 255, cfg_fd)) while (fgets(confline, 255, DOSCONF_fd))
{ {
p = confline; p = confline;
DOSCONF_skip(&p); DOSCONF_skip(&p);
...@@ -405,61 +415,86 @@ static void DOSCONF_Parse(char *menuname) ...@@ -405,61 +415,86 @@ static void DOSCONF_Parse(char *menuname)
} }
} }
while (fgets(confline, 255, cfg_fd)) while (fgets(confline, 255, DOSCONF_fd))
{ {
p = confline; p = confline;
DOSCONF_skip(&p); DOSCONF_skip(&p);
if ((menuname) && (*p == '[')) if ((menuname) && (*p == '['))
/* we were handling a specific sub menu, but now next menu begins */ /*
* we were handling a specific sub menu,
* but now next menu begins
*/
break; break;
if ((trail = strrchr(confline, '\n'))) if ((trail = strrchr(confline, '\n')))
*trail = '\0'; *trail = '\0';
if ((trail = strrchr(confline, '\r'))) if ((trail = strrchr(confline, '\r')))
*trail = '\0'; *trail = '\0';
if (!(menu_skip)) if (!(DOSCONF_menu_skip))
{ {
for (i = 0; i < sizeof(tag_entries) / sizeof(TAG_ENTRY); i++) for (i = 0; i < sizeof(DOSCONF_tag_entries) / sizeof(TAG_ENTRY);
if (!(strncasecmp(p, tag_entries[i].tag_name, i++)
strlen(tag_entries[i].tag_name)))) if (!(strncasecmp(p, DOSCONF_tag_entries[i].tag_name,
{ strlen(DOSCONF_tag_entries[i].tag_name))))
TRACE("tag '%s'\n", tag_entries[i].tag_name); {
if (tag_entries[i].tag_handler != NULL) TRACE( "tag '%s'\n", DOSCONF_tag_entries[i].tag_name );
tag_entries[i].tag_handler(&p); if (DOSCONF_tag_entries[i].tag_handler != NULL)
break; DOSCONF_tag_entries[i].tag_handler(&p);
break;
} }
} }
else /* the current menu gets skipped */ else
DOSCONF_Menu(&p); {
/* the current menu gets skipped */
DOSCONF_Menu(&p);
}
} }
} }
int DOSCONF_ReadConfig(void) DOSCONF *DOSCONF_GetConfig(void)
{ {
WCHAR filename[MAX_PATH]; HKEY hkey;
DOS_FULL_NAME fullname; CHAR filename[MAX_PATH];
WCHAR *p;
int ret = 1; if (DOSCONF_loaded)
static const WCHAR wineW[] = {'w','i','n','e',0}; return &DOSCONF_config;
static const WCHAR config_sysW[] = {'c','o','n','f','i','g','.','s','y','s',0};
static const WCHAR empty_strW[] = { 0 }; /* default value */
strcpy( filename, "*" );
PROFILE_GetWineIniString( wineW, config_sysW, empty_strW, filename, MAX_PATH );
if ((p = strchrW(filename, ','))) *p = 0; if (!RegOpenKeyA(HKEY_LOCAL_MACHINE,
if (!filename[0]) return ret; "Software\\Wine\\Wine\\Config\\wine",
&hkey))
DOSFS_GetFullName(filename, FALSE, &fullname);
if ((cfg_fd = fopen(fullname.long_name, "r")))
{ {
DOSCONF_Parse(NULL); DWORD type;
fclose(cfg_fd); DWORD count = sizeof(filename);
RegQueryValueExA(hkey, "config.sys", 0, &type, filename, &count);
RegCloseKey(hkey);
} }
else
if (strcmp(filename, "*") && *filename != '\0')
{ {
MESSAGE("Couldn't open config.sys file given as %s in" \ CHAR fullname[MAX_PATH];
" wine.conf or .winerc, section [wine] !\n", debugstr_w(filename));
ret = 0; if (wine_get_unix_file_name(filename, fullname, sizeof(fullname)))
DOSCONF_fd = fopen(fullname, "r");
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",
filename );
}
} }
return ret;
DOSCONF_loaded = TRUE;
return &DOSCONF_config;
} }
...@@ -52,6 +52,25 @@ typedef struct { ...@@ -52,6 +52,25 @@ typedef struct {
DWORD offset; DWORD offset;
} SEGPTR48, FARPROC48; } SEGPTR48, FARPROC48;
#define DOSCONF_MEM_HIGH 0x0001
#define DOSCONF_MEM_UMB 0x0002
#define DOSCONF_NUMLOCK 0x0004
#define DOSCONF_KEYB_CONV 0x0008
typedef struct {
char lastdrive;
int brk_flag;
int files;
int stacks_nr;
int stacks_sz;
int buf;
int buf2;
int fcbs;
int flags;
char *shell;
char *country;
} DOSCONF;
typedef void (*DOSRELAY)(CONTEXT86*,void*); typedef void (*DOSRELAY)(CONTEXT86*,void*);
typedef void (WINAPI *RMCBPROC)(CONTEXT86*); typedef void (WINAPI *RMCBPROC)(CONTEXT86*);
typedef void (WINAPI *INTPROC)(CONTEXT86*); typedef void (WINAPI *INTPROC)(CONTEXT86*);
...@@ -113,6 +132,9 @@ extern BYTE DMA_ioport_in( WORD port ); ...@@ -113,6 +132,9 @@ extern BYTE DMA_ioport_in( WORD port );
/* dosaspi.c */ /* dosaspi.c */
void WINAPI DOSVM_ASPIHandler(CONTEXT86*); void WINAPI DOSVM_ASPIHandler(CONTEXT86*);
/* dosconf.c */
DOSCONF *DOSCONF_GetConfig( void );
/* fpu.c */ /* fpu.c */
extern void WINAPI DOSVM_Int34Handler(CONTEXT86*); extern void WINAPI DOSVM_Int34Handler(CONTEXT86*);
extern void WINAPI DOSVM_Int35Handler(CONTEXT86*); extern void WINAPI DOSVM_Int35Handler(CONTEXT86*);
......
...@@ -1602,10 +1602,57 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context ) ...@@ -1602,10 +1602,57 @@ void WINAPI DOSVM_Int21Handler( CONTEXT86 *context )
break; break;
case 0x32: /* GET DOS DRIVE PARAMETER BLOCK FOR SPECIFIC DRIVE */ case 0x32: /* GET DOS DRIVE PARAMETER BLOCK FOR SPECIFIC DRIVE */
case 0x33: /* MULTIPLEXED */
INT_Int21Handler( context ); INT_Int21Handler( context );
break; break;
case 0x33: /* MULTIPLEXED */
switch (AL_reg(context))
{
case 0x00: /* GET CURRENT EXTENDED BREAK STATE */
TRACE("GET CURRENT EXTENDED BREAK STATE\n");
SET_DL( context, DOSCONF_GetConfig()->brk_flag );
break;
case 0x01: /* SET EXTENDED BREAK STATE */
TRACE("SET CURRENT EXTENDED BREAK STATE\n");
DOSCONF_GetConfig()->brk_flag = (DL_reg(context) > 0) ? 1 : 0;
break;
case 0x02: /* GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE*/
TRACE("GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE\n");
/* ugly coding in order to stay reentrant */
if (DL_reg(context))
{
SET_DL( context, DOSCONF_GetConfig()->brk_flag );
DOSCONF_GetConfig()->brk_flag = 1;
}
else
{
SET_DL( context, DOSCONF_GetConfig()->brk_flag );
DOSCONF_GetConfig()->brk_flag = 0;
}
break;
case 0x05: /* GET BOOT DRIVE */
TRACE("GET BOOT DRIVE\n");
SET_DL( context, 3 );
/* c: is Wine's bootdrive (a: is 1)*/
break;
case 0x06: /* GET TRUE VERSION NUMBER */
TRACE("GET TRUE VERSION NUMBER\n");
SET_BL( context, HIBYTE(HIWORD(GetVersion16())) ); /* major */
SET_BH( context, LOBYTE(HIWORD(GetVersion16())) ); /* minor */
SET_DL( context, 0x00 ); /* revision */
SET_DH( context, 0x08 ); /* DOS is in ROM */
break;
default:
INT_BARF( context, 0x21 );
break;
}
break;
case 0x34: /* GET ADDRESS OF INDOS FLAG */ case 0x34: /* GET ADDRESS OF INDOS FLAG */
TRACE( "GET ADDRESS OF INDOS FLAG\n" ); TRACE( "GET ADDRESS OF INDOS FLAG\n" );
context->SegEs = INT21_GetHeapSelector( context ); context->SegEs = INT21_GetHeapSelector( context );
......
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
#include "selectors.h" #include "selectors.h"
#include "wine/windef16.h" #include "wine/windef16.h"
/* msdos/dosconf.c */
extern int DOSCONF_ReadConfig(void);
/* msdos/dosmem.c */ /* msdos/dosmem.c */
#include "pshpack1.h" #include "pshpack1.h"
......
...@@ -211,25 +211,4 @@ typedef struct _DOS_LISTOFLISTS ...@@ -211,25 +211,4 @@ typedef struct _DOS_LISTOFLISTS
#define EL_Serial 0x04 #define EL_Serial 0x04
#define EL_Memory 0x05 #define EL_Memory 0x05
#define DOSCONF_MEM_HIGH 0x0001
#define DOSCONF_MEM_UMB 0x0002
#define DOSCONF_NUMLOCK 0x0004
#define DOSCONF_KEYB_CONV 0x0008
typedef struct {
char lastdrive;
int brk_flag;
int files;
int stacks_nr;
int stacks_sz;
int buf;
int buf2;
int fcbs;
int flags;
char *shell;
char *country;
} DOSCONF;
extern DOSCONF DOSCONF_config;
#endif /* __WINE_MSDOS_H */ #endif /* __WINE_MSDOS_H */
...@@ -133,13 +133,6 @@ static WORD DosHeapHandle; ...@@ -133,13 +133,6 @@ static WORD DosHeapHandle;
extern char TempDirectory[]; extern char TempDirectory[];
static void INT21_ReadConfigSys(void)
{
static int done;
if (!done) DOSCONF_ReadConfig();
done = 1;
}
static BOOL INT21_CreateHeap(void) static BOOL INT21_CreateHeap(void)
{ {
if (!(DosHeapHandle = GlobalAlloc16(GMEM_FIXED,sizeof(struct DosHeap)))) if (!(DosHeapHandle = GlobalAlloc16(GMEM_FIXED,sizeof(struct DosHeap))))
...@@ -965,55 +958,6 @@ void WINAPI INT_Int21Handler( CONTEXT86 *context ) ...@@ -965,55 +958,6 @@ void WINAPI INT_Int21Handler( CONTEXT86 *context )
GetDrivePB(context, DOS_GET_DRIVE( DL_reg(context) ) ); GetDrivePB(context, DOS_GET_DRIVE( DL_reg(context) ) );
break; break;
case 0x33: /* MULTIPLEXED */
switch (AL_reg(context))
{
case 0x00: /* GET CURRENT EXTENDED BREAK STATE */
TRACE("GET CURRENT EXTENDED BREAK STATE\n");
INT21_ReadConfigSys();
SET_DL( context, DOSCONF_config.brk_flag );
break;
case 0x01: /* SET EXTENDED BREAK STATE */
TRACE("SET CURRENT EXTENDED BREAK STATE\n");
INT21_ReadConfigSys();
DOSCONF_config.brk_flag = (DL_reg(context) > 0);
break;
case 0x02: /* GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE*/
TRACE("GET AND SET EXTENDED CONTROL-BREAK CHECKING STATE\n");
INT21_ReadConfigSys();
/* ugly coding in order to stay reentrant */
if (DL_reg(context))
{
SET_DL( context, DOSCONF_config.brk_flag );
DOSCONF_config.brk_flag = 1;
}
else
{
SET_DL( context, DOSCONF_config.brk_flag );
DOSCONF_config.brk_flag = 0;
}
break;
case 0x05: /* GET BOOT DRIVE */
TRACE("GET BOOT DRIVE\n");
SET_DL( context, 3 );
/* c: is Wine's bootdrive (a: is 1)*/
break;
case 0x06: /* GET TRUE VERSION NUMBER */
TRACE("GET TRUE VERSION NUMBER\n");
SET_BX( context, (HIWORD(GetVersion16() >> 8)) | (HIWORD(GetVersion16() << 8)) );
SET_DX( context, 0x00 );
break;
default:
INT_BARF( context, 0x21 );
break;
}
break;
case 0x36: /* GET FREE DISK SPACE */ case 0x36: /* GET FREE DISK SPACE */
TRACE("GET FREE DISK SPACE FOR DRIVE %s\n", TRACE("GET FREE DISK SPACE FOR DRIVE %s\n",
INT21_DriveName( DL_reg(context))); INT21_DriveName( DL_reg(context)));
......
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