From 17e88e019fe2b8f28dc1d9040529311ac71018c5 Mon Sep 17 00:00:00 2001 From: Magnus Olsen Date: Sat, 2 Dec 2006 08:30:16 +0000 Subject: [PATCH] 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 --- reactos/dll/directx/ddraw/ddraw.rbuild | 1 + reactos/dll/directx/ddraw/rosdraw.h | 44 +++++++++++++++++++++++--- reactos/dll/directx/ddraw/startup.c | 14 +++++--- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/reactos/dll/directx/ddraw/ddraw.rbuild b/reactos/dll/directx/ddraw/ddraw.rbuild index 69a7390650f..68fab10bbe7 100644 --- a/reactos/dll/directx/ddraw/ddraw.rbuild +++ b/reactos/dll/directx/ddraw/ddraw.rbuild @@ -15,6 +15,7 @@ ole32 user32 advapi32 + msvcrt ddraw.rc main.c diff --git a/reactos/dll/directx/ddraw/rosdraw.h b/reactos/dll/directx/ddraw/rosdraw.h index 34254e03bf8..4efcbce35f2 100644 --- a/reactos/dll/directx/ddraw/rosdraw.h +++ b/reactos/dll/directx/ddraw/rosdraw.h @@ -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) \ diff --git a/reactos/dll/directx/ddraw/startup.c b/reactos/dll/directx/ddraw/startup.c index 96c74452ffe..40912e5bca0 100644 --- a/reactos/dll/directx/ddraw/startup.c +++ b/reactos/dll/directx/ddraw/startup.c @@ -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); {