#include "conproc.h"
#include "direct.h"
-// LordHavoc: raised min to 64mb (was 8.5mb)
-#define MINIMUM_WIN_MEMORY 0x04000000
-// LordHavoc: raised max to 64mb (was 16mb)
-#define MAXIMUM_WIN_MEMORY 0x04000000
-
#define CONSOLE_ERROR_TIMEOUT 60.0 // # of seconds to wait on Sys_Error running
// dedicated before exiting
#define PAUSE_SLEEP 50 // sleep time on pause or minimization
int Sys_FileTime (char *path)
{
FILE *f;
- int retval;
-
+
f = fopen(path, "rb");
-
if (f)
{
fclose(f);
- retval = 1;
- }
- else
- {
- retval = -1;
+ return 1;
}
- return retval;
+ return -1;
}
void Sys_mkdir (char *path)
===============================================================================
*/
+#if NOTUSED
/*
================
Sys_MakeCodeWriteable
if (!VirtualProtect((LPVOID)startaddr, length, PAGE_READWRITE, &flOldProtect))
Sys_Error("Protection change failed\n");
}
+#endif
/*
void SleepUntilInput (int time)
{
- MsgWaitForMultipleObjects(1, &tevent, FALSE, time, QS_ALLINPUT);
+ MsgWaitForMultipleObjects(1, &tevent, false, time, QS_ALLINPUT);
}
if (cwd[strlen(cwd)-1] == '/')
cwd[strlen(cwd)-1] = 0;
+ memset(&host_parms, 0, sizeof(host_parms));
+
host_parms.basedir = cwd;
- host_parms.cachedir = NULL;
host_parms.argc = 1;
argv[0] = empty_string;
// take the greater of all the available memory or half the total memory,
// but at least 8 Mb and no more than 16 Mb, unless they explicitly
// request otherwise
+ /*
host_parms.memsize = lpBuffer.dwAvailPhys;
if (host_parms.memsize < MINIMUM_WIN_MEMORY)
if (host_parms.memsize > MAXIMUM_WIN_MEMORY)
host_parms.memsize = MAXIMUM_WIN_MEMORY;
-
- if ((t = COM_CheckParm("-heapsize")))
- {
- t++;
- if (t < com_argc)
- host_parms.memsize = atoi (com_argv[t]) * 1024;
- }
- else if ((t = COM_CheckParm("-mem")) || (t = COM_CheckParm("-winmem")))
- {
- t++;
- if (t < com_argc)
- host_parms.memsize = atoi (com_argv[t]) * 1048576;
- }
-
- host_parms.membase = qmalloc(host_parms.memsize);
-
- if (!host_parms.membase)
- Sys_Error ("Not enough memory free; check disk space\n");
+ */
// Sys_PageIn (parms.membase, parms.memsize);
- tevent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ tevent = CreateEvent(NULL, false, false, NULL);
if (!tevent)
Sys_Error ("Couldn't create event");
}
/* return success of application */
- return TRUE;
+ return true;
}