vboxext.c revision 3b5b00fc19a7b52f11075648a1b93d477137f4d3
/* $Id$ */
/** @file
*
* VBox extension to Wine D3D
*
* Copyright (C) 2011 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 "config.h"
#include "wined3d_private.h"
#include "vboxext.h"
typedef FNVBOXEXTWORKERCB *PFNVBOXEXTWORKERCB;
/*******************************/
typedef struct VBOXEXT_WORKER
{
/*******************************/
typedef struct VBOXEXT_GLOBAL
{
static VBOXEXT_GLOBAL g_VBoxExtGlobal;
typedef struct VBOXEXT_CALLPROC
{
void *pvCb;
{
NULL /* HWND hWnd */,
WM_USER /* UINT wMsgFilterMin */,
WM_USER /* UINT wMsgFilterMax */,
do
{
0 /*HWND hWnd*/,
0 /*UINT wMsgFilterMin*/,
0 /*UINT wMsgFilterMax*/
);
if(!bResult) /* WM_QUIT was posted */
break;
break;
{
case WM_VBOXEXT_CALLPROC:
{
break;
}
default:
}
} while (1);
return 0;
}
{
FALSE, /* BOOL bManualReset */
FALSE, /* BOOL bInitialState */
NULL /* LPCTSTR lpName */
);
{
NULL /* LPSECURITY_ATTRIBUTES lpThreadAttributes */,
0 /* SIZE_T dwStackSize */,
0 /* DWORD dwCreationFlags */,
{
if (WAIT_OBJECT_0 == dwResult)
return S_OK;
}
else
{
}
}
else
{
}
return E_FAIL;
}
{
if (!bResult)
{
return E_FAIL;
}
if (dwErr != WAIT_OBJECT_0)
{
return E_FAIL;
}
return S_OK;
}
{
/* need to serialize since vboxExtWorkerThread is using one pWorker->hEvent
* to signal job completion */
if (bResult)
{
if (dwErr == WAIT_OBJECT_0)
{
}
else
{
}
}
else
{
return E_FAIL;
}
return hr;
}
{
}
static HRESULT vboxExtInit()
{
return hr;
}
static HRESULT vboxExtTerm()
{
return hr;
}
static DWORD g_cVBoxExtInits = 0;
{
if (!g_cVBoxExtInits)
{
hr = vboxExtInit();
{
return hr;
}
}
return S_OK;
}
{
if (g_cVBoxExtInits == 1)
{
hr = vboxExtTerm();
{
return hr;
}
}
return S_OK;
}
{
}
typedef struct VBOXEXT_GETDC_CB
{
{
}
typedef struct VBOXEXT_RELEASEDC_CB
{
int ret;
{
}
{
VBOXEXT_GETDC_CB Data = {0};
{
return NULL;
}
#else
#endif
}
{
VBOXEXT_RELEASEDC_CB Data = {0};
{
return -1;
}
#else
#endif
}
/* window creation API */
)
{
switch(uMsg)
{
case WM_CLOSE:
return 0;
case WM_DESTROY:
return 0;
case WM_NCHITTEST:
return HTNOWHERE;
}
}
#define VBOXEXTWND_NAME "VboxDispD3DWineWnd"
{
/* Register the Window Class. */
{
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
if (!RegisterClass(&wc))
{
}
}
{
0, 0,
w, h,
NULL, //GetDesktopWindow() /* hWndParent */,
NULL /* hMenu */,
NULL /* lpParam */);
if (hWnd)
{
}
else
{
}
}
return hr;
}
{
if (bResult)
return S_OK;
winErr = GetLastError();
return E_FAIL;
}
typedef struct VBOXEXTWND_CREATE_INFO
{
int hr;
typedef struct VBOXEXTWND_DESTROY_INFO
{
int hr;
{
}
{
}
{
{
}
return hr;
}
{
{
}
return hr;
}