Adding two new debuger macro and debocument each debug macro I am using in windows and why you should use one of them

with time the debug macro will be compelete remove. 

svn path=/trunk/; revision=25013
This commit is contained in:
Magnus Olsen 2006-12-02 08:30:16 +00:00
parent 817dba67ef
commit 17e88e019f
3 changed files with 50 additions and 9 deletions

View file

@ -15,6 +15,7 @@
<library>ole32</library>
<library>user32</library>
<library>advapi32</library>
<library>msvcrt</library>
<file>ddraw.rc</file>
<file>main.c</file>

View file

@ -596,6 +596,45 @@ DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLay
/*********** Macros ***********/
/*
use this macro to close
down the debuger text complete
no debuging at all, it will
crash ms debuger in VS
*/
//#define DX_WINDBG_trace()
//#define DX_STUB
//#define DX_STUB_DD_OK return DD_OK;
//#define DX_STUB_str(x)
//#define DX_WINDBG_trace_res
/*
Use this macro if you want deboug in visual studio or
if you have a program to look at the _INT struct from
ReactOS ddraw.dll or ms ddraw.dll, so you can see what
value ms are being setup.
This macro will create allot warings and can not be help when you compile
*/
//#define DX_WINDBG_trace()
//#define DX_STUB
//#define DX_STUB_DD_OK return DD_OK;
//#define DX_STUB_str(x) printf("%s",x);
//#define DX_WINDBG_trace_res
/*
use this if want doing a trace from a program
like a game and ReactOS ddraw.dll in windows
so you can figout what going wrong and what
api are being call or if it hel or is it hal
This marco does not create warings when you compile
*/
#define DX_STUB \
{ \
static BOOL firstcall = TRUE; \
@ -630,10 +669,6 @@ DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLay
OutputDebugStringA(buffer); \
}
//#define DX_WINDBG_trace()
#define DX_WINDBG_trace() \
static BOOL firstcallx = TRUE; \
if (firstcallx) \
@ -644,7 +679,6 @@ DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLay
firstcallx = TRUE; \
}
#define DX_WINDBG_trace_res(width,height,bpp) \
static BOOL firstcallxx = TRUE; \
if (firstcallxx) \

View file

@ -40,7 +40,7 @@ StartDirectDraw(LPDIRECTDRAW* iface, LPGUID lpGuid)
{
DX_STUB_str("Out of memmory");
return DD_FALSE;
}
}
This->lpLcl->lpDDCB = ddgbl.lpDDCBtmp;
@ -158,9 +158,13 @@ StartDirectDraw(LPDIRECTDRAW* iface, LPGUID lpGuid)
This->lpLcl->dwProcessId = GetCurrentProcessId();
hel_ret = StartDirectDrawHel(iface);
hal_ret = StartDirectDrawHal(iface);
hal_ret = StartDirectDrawHal(iface);
hel_ret = StartDirectDrawHel(iface);
if ((hal_ret!=DD_OK) && (hel_ret!=DD_OK))
{
DX_STUB_str("DDERR_NODIRECTDRAWSUPPORT");
@ -641,6 +645,8 @@ StartDirectDrawHal(LPDIRECTDRAW* iface)
DeleteDC((HDC)This->lpLcl->hDC);
return DD_FALSE;
}
return DD_OK;
// Do not relase HDC it have been map in kernel mode
// DeleteDC(hdc);
@ -901,7 +907,7 @@ Create_DirectDraw (LPGUID pGUID,
{
return DDERR_INVALIDPARAMS;
}
if (StartDirectDraw((LPDIRECTDRAW*)This, pGUID) == DD_OK);
{