by default, don't attempt to start the aken driver

addresses security concerns
[http://www.wildfiregames.com/forum/index.php?showtopic=15482]

This was SVN commit r10858.
This commit is contained in:
janwas 2012-01-02 23:38:46 +00:00
parent c5cb50421f
commit 785b6efa4b
2 changed files with 16 additions and 0 deletions

View File

@ -80,4 +80,17 @@
# endif
#endif
// allow an attempt to start the Aken driver (i.e. service) at runtime.
// enable at your own risk on WinXP systems to allow access to
// better timers than Windows provides. on newer Windows versions,
// attempts to start the service from code fail unless the process
// is elevated, and definitely fail due to lack of cross-signing unless
// test-signing mode is active.
// if the user has taken explicit action to install and start the
// service via aken_install.bat, mahaf.cpp will be able to access it
// even if this is defined to 0.
#ifndef CONFIG2_MAHAF_ATTEMPT_DRIVER_START
# define CONFIG2_MAHAF_ATTEMPT_DRIVER_START 0
#endif
#endif // #ifndef INCLUDED_CONFIG2

View File

@ -27,6 +27,7 @@
#include "precompiled.h"
#include "lib/sysdep/os/win/mahaf.h"
#include "lib/config2.h"
#include "lib/module_init.h"
#include "lib/sysdep/os/win/wutil.h"
@ -347,10 +348,12 @@ static Status Init()
if(wutil_HasCommandLineArgument(L"-wNoMahaf"))
return ERR::NOT_SUPPORTED; // NOWARN
#if CONFIG2_MAHAF_ATTEMPT_DRIVER_START
{
const OsPath driverPathname = DriverPathname();
StartDriver(driverPathname);
}
#endif
{
const DWORD shareMode = 0;