VBoxDispDbg.h revision 40bd0fc692d21a6d579862d7ccdc20c2ccf361a5
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * VBoxVideo Display D3D User mode dll
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * Copyright (C) 2011 Oracle Corporation
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * This file is part of VirtualBox Open Source Edition (OSE), as
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * available from http://www.virtualbox.org. This file is free software;
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * you can redistribute it and/or modify it under the terms of the GNU
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * General Public License (GPL) as published by the Free Software
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * Foundation, in version 2 as it comes in the "COPYING" file of the
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper/* debugging configuration flags */
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper/* generic debugging facilities & extra data checks */
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper/* for some reason when debugging with VirtualKD, user-mode DbgPrint's are discarded
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * the workaround so far is to pass the log info to the kernel driver and DbgPrint'ed from there,
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper * which is enabled by this define */
be8ae89dc821957bb97b37f72b55e70677b19e61sachiko/* use OutputDebugString */
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper/* adds vectored exception handler to be able to catch non-debug UM exceptions in kernel debugger */
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper/* disable shared resource creation with wine */
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper//# define VBOXWDDMDISP_DEBUG_NOSHARED
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define AssertBreakpoint() do{}while(0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define AssertFailed() do{}while(0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define DbgPrintDrv(_m) do { vboxDispLogDrvF _m; } while (0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define DbgPrintDrvRel(_m) do { vboxDispLogDrvF _m; } while (0)
8050adad93f1618eec6be88e39b822bea18a62a5Peter Major# define DbgPrintUsr(_m) do { vboxDispLogDbgPrintF _m; } while (0)
8050adad93f1618eec6be88e39b822bea18a62a5Peter Major# define DbgPrintUsrRel(_m) do { vboxDispLogDbgPrintF _m; } while (0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define WARN_BREAK() do { AssertFailed(); } while (0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reeper# define WARN_BREAK() do { } while (0)
be8ae89dc821957bb97b37f72b55e70677b19e61sachiko } while (0)
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reepervoid vboxDispLogDbgPrintF(char * szString, ...);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reepertypedef struct VBOXWDDMDISP_ALLOCATION *PVBOXWDDMDISP_ALLOCATION;
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de Reepertypedef struct VBOXWDDMDISP_RESOURCE *PVBOXWDDMDISP_RESOURCE;
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpSurfRectByAlloc(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpAllocRect(const char * pPrefix, PVBOXWDDMDISP_ALLOCATION pAlloc, const RECT *pRect, const char* pSuffix);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpSurfRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const RECT *pRect, const char* pSuffix);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpSurfRect(const char * pPrefix, IDirect3DSurface9 *pSurf, const RECT *pRect, const char * pSuffix, bool bBreak);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpSurf(const char * pPrefix, IDirect3DSurface9 *pSurf, const char * pSuffix);
7fadb5ee267a4d808110b0c3e704de440902cb83Mark de ReeperVOID vboxVDbgDoDumpRcRect(const char * pPrefix, IDirect3DResource9 *pRc, const RECT *pRect, const char * pSuffix);
VOID vboxVDbgDoDumpRcRectByRc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, const RECT *pRect, const char* pSuffix);
VOID vboxVDbgDoDumpRcRectByAlloc(const char * pPrefix, const PVBOXWDDMDISP_ALLOCATION pAlloc, IDirect3DResource9 *pD3DIf, const RECT *pRect, const char* pSuffix);
VOID vboxVDbgDoDumpTex(const char * pPrefix, IDirect3DBaseTexture9 *pTexBase, const char * pSuffix);
VOID vboxVDbgDoDumpRt(const char * pPrefix, struct VBOXWDDMDISP_DEVICE *pDevice, const char * pSuffix);
void vboxVDbgDoPrintAlloc(const char * pPrefix, const PVBOXWDDMDISP_RESOURCE pRc, uint32_t iAlloc, const char * pSuffix);
VOID vboxVDbgDoDumpLockSurfTex(const char * pPrefix, const D3DDDIARG_LOCK* pData, const char * pSuffix, bool fBreak);
VOID vboxVDbgDoDumpUnlockSurfTex(const char * pPrefix, const D3DDDIARG_UNLOCK* pData, const char * pSuffix, bool fBreak);
#define VBOXVDBG_IS_PID(_pid) ((_pid) == (g_VBoxVDbgPid ? g_VBoxVDbgPid : (g_VBoxVDbgPid = GetCurrentProcessId())))
#define VBOXVDBG_IS_DUMP_ALLOWED_PID(_pid) (((int)(_pid)) > 0 ? VBOXVDBG_IS_PID(_pid) : !VBOXVDBG_IS_PID(-((int)(_pid))))
vboxVDbgPrint(("Break on shared access: Rc(0x%p), SharedHandle(0x%p)\n", (_pRc), (_pRc)->aAllocations[0].hSharedHandle)); \
AssertFailed(); \
#define VBOXVDBG_DUMP_BLT_ENTER(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
vboxVDbgDoDumpRcRectByAlloc("==>"__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
#define VBOXVDBG_DUMP_BLT_LEAVE(_pSrcAlloc, _pSrcSurf, _pSrcRect, _pDstAlloc, _pDstSurf, _pDstRect) do { \
vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Src: ", (_pSrcAlloc), (_pSrcSurf), (_pSrcRect), "\n"); \
vboxVDbgDoDumpRcRectByAlloc("<=="__FUNCTION__" Dst: ", (_pDstAlloc), (_pDstSurf), (_pDstRect), "\n"); \
#define VBOXVDBG_DUMP_BLT_ENTER(_pSrcRc, _pSrcSurf, _pSrcRect, _pDstRc, _pDstSurf, _pDstRect) do { } while (0)