VBoxDispDbg.cpp revision 6ff14916eae1a5211d0fd98247f489cc0bd0959b
/* $Id$ */
/** @file
* VBoxVideo Display D3D User mode dll
*/
/*
* 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.
*/
/* @todo: move this to VBoxDispD3DCmn.h ? */
# include <windows.h>
# pragma warning(default : 4163)
# else
# include <windows.h>
# endif
#include "VBoxDispD3DCmn.h"
#include <stdio.h>
#include <stdarg.h>
#ifdef VBOXWDDMDISP_DEBUG
bool g_bVBoxVDbgFDumpSetTexture = false;
bool g_bVBoxVDbgFDumpDrawPrim = false;
bool g_bVBoxVDbgFDumpTexBlt = false;
bool g_bVBoxVDbgFDumpBlt = false;
typedef enum
{
typedef struct VBOXDISPDBG
{
} VBOXDISPDBG, *PVBOXDISPDBG;
static VBOXDISPDBG g_VBoxDispDbg = {0};
{
if (ASMAtomicCmpXchgU32((volatile uint32_t *)&g_VBoxDispDbg.enmState, VBOXDISPDBG_STATE_INITIALIZING, VBOXDISPDBG_STATE_UNINITIALIZED))
{
{
return &g_VBoxDispDbg;
}
else
{
}
}
else if (ASMAtomicReadU32((volatile uint32_t *)&g_VBoxDispDbg.enmState) == VBOXDISPDBG_STATE_INITIALIZED)
{
return &g_VBoxDispDbg;
}
Assert(0);
return NULL;
}
void vboxDispLogDrv(char * szString)
{
#ifdef DEBUG_misha
#endif
if (!pDbg)
return;
{
if (pCmd)
{
D3DKMT_ESCAPE EscapeData = {0};
//EscapeData.hDevice = NULL;
// EscapeData.Flags.HardwareAccess = 1;
//EscapeData.hContext = NULL;
}
}
}
void vboxDispLogDrvF(char * szString, ...)
{
char szBuffer[4096] = {0};
}
void vboxDispLogDbgPrintF(char * szString, ...)
{
char szBuffer[4096] = {0};
}
VOID vboxVDbgDoDumpSurfRectByAlloc(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix)
{
}
VOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix)
{
if (pPrefix)
{
}
{
vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
if (pRect)
{
vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
}
Assert(0);
}
if (pSuffix)
{
}
}
VOID vboxVDbgDoDumpSurfRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, const char* pSuffix)
{
BOOL bReleaseSurf = false;
{
}
}
VOID vboxVDbgDoDumpSurfRect(const char * pPrefix, IDirect3DSurface9 *pSurf, const RECT *pRect, const char * pSuffix, bool bBreak)
{
if (pPrefix)
{
}
{
{
vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">surface info</exec>\n",
if (pRect)
{
vboxVDbgPrint(("<?dml?><exec cmd=\"!vbvdbg.ms 0x%p 0n%d 0n%d 0n%d 0n%d\">rect info</exec>\n",
}
if (bBreak)
{
Assert(0);
}
}
}
if (pSuffix)
{
}
}
{
}
#define VBOXVDBG_STRCASE(_t) \
#define VBOXVDBG_STRCASE_UNKNOWN() \
default: Assert(0); return "Unknown";
{
switch (enmFace)
{
}
}
VOID vboxVDbgDoDumpRcRect(const char * pPrefix, IDirect3DResource9 *pRc, const RECT *pRect, const char * pSuffix)
{
if (pPrefix)
{
}
{
case D3DRTYPE_TEXTURE:
{
vboxVDbgPrint(("this is a texture\n"));
{
}
break;
}
case D3DRTYPE_CUBETEXTURE:
{
vboxVDbgPrint(("this is a cube texture\n"));
{
{
}
else
{
Assert(0);
}
}
Assert(0);
{
apSurf[i]->UnlockRect();
}
break;
}
case D3DRTYPE_SURFACE:
{
vboxVDbgPrint(("this is a surface\n"));
}
default:
vboxVDbgPrint(("unsupported rc type\n"));
Assert(0);
}
if (pSuffix)
{
}
}
VOID vboxVDbgDoDumpRcRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, const RECT *pRect, const char* pSuffix)
{
}
{
}
{
{
}
else
{
}
}
void vboxVDbgDoPrintAlloc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const char * pSuffix)
{
if (bPrimary)
{
}
bPrimary ?
: "?Everage? Alloc",
pSuffix));
}
{
vboxVDbgPrint(("%s left(%d), top(%d), right(%d), bottom(%d) %s", pPrefix, pRect->left, pRect->top, pRect->right, pRect->bottom, pSuffix));
}
#endif
#ifdef VBOXWDDMDISP_DEBUG_VEHANDLER
{
switch (pExceptionRecord->ExceptionCode)
{
case 0x40010006: /* <- OutputDebugString exception, ignore */
case 0xe06d7363: /* <- ms compiler - generated exception related to C++ exception */
case 0x000006d9: /* <- RPC exception, ignore */
break;
default:
AssertRelease(0);
break;
}
return EXCEPTION_CONTINUE_SEARCH;
}
void vboxVDbgVEHandlerRegister()
{
}
void vboxVDbgVEHandlerUnregister()
{
}
#endif