sw_common.c revision d1ac35c6e155849bedddd0fe2279b6123071e781
/* $Id$ */
/** @file
* VBox D3D8/9 dll switcher
*/
/*
* Copyright (C) 2009 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include <windows.h>
#include "switcher.h"
static char* gsBlackListExe[] = {"Dwm.exe", "java.exe", "javaw.exe", "javaws.exe"/*, "taskeng.exe"*/, NULL};
/* Checks if 3D is enabled for VM and it works on host machine */
BOOL isVBox3DEnabled(void)
{
#ifdef VBOX_WDDM_WOW64
#else
#endif
/* note: this isn't really needed as our library will refuse to load if it can't connect to host.
so it's in case we'd change it one day.
*/
if (pDrvValidateVersion)
{
result = pDrvValidateVersion(0);
}
return result;
}
BOOL checkOptionsDll(void)
{
int i;
for (i=0; gsBlackListDll[i]; ++i)
{
if (GetModuleHandleA(gsBlackListDll[i]))
return FALSE;
}
return TRUE;
}
BOOL checkOptionsExe(void)
{
char name[1000];
int i;
return TRUE;
/*Extract filename*/
{
switch (*pName)
{
case ':':
case '\\':
case '/':
break;
}
}
for (i=0; gsBlackListExe[i]; ++i)
{
return FALSE;
}
return TRUE;
}
BOOL checkOptions(void)
{
if (!checkOptionsDll())
return FALSE;
if (!checkOptionsExe())
return FALSE;
return TRUE;
}
{
const char *dllName;
if (isVBox3DEnabled() && checkOptions())
{
} else
{
}
}