Author: greatlrd Date: Sun Apr 22 23:59:44 2007 New Revision: 26468
URL: http://svn.reactos.org/svn/reactos?rev=26468&view=rev Log: Fixing a crash, fixed so Setcoparative pass the test, still some werid bugs after I delete all code in ddraw. anyone whant debuging this u are wellcome
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/main/ddraw_main.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/ddra... ============================================================================== --- trunk/reactos/dll/directx/ddraw/main/ddraw_main.c (original) +++ trunk/reactos/dll/directx/ddraw/main/ddraw_main.c Sun Apr 22 23:59:44 2007 @@ -34,10 +34,13 @@ else { *obj = NULL; + DX_STUB_str("E_NOINTERFACE"); return E_NOINTERFACE; }
+ Main_DirectDraw_AddRef(iface); + DX_STUB_str("DD_OK"); return DD_OK; }
Modified: trunk/reactos/dll/directx/ddraw/startup.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.c... ============================================================================== --- trunk/reactos/dll/directx/ddraw/startup.c (original) +++ trunk/reactos/dll/directx/ddraw/startup.c Sun Apr 22 23:59:44 2007 @@ -41,7 +41,10 @@ This = memThis; if (This == NULL) { - if (memThis != NULL) DxHeapMemFree(memThis); + if (memThis != NULL) + DxHeapMemFree(memThis); + + DX_STUB_str("DDERR_OUTOFMEMORY"); return DDERR_OUTOFMEMORY; } } @@ -51,13 +54,18 @@ LPDDRAWI_DIRECTDRAW_INT newThis; newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT)); if (newThis == NULL) + { + DX_STUB_str("DDERR_OUTOFMEMORY"); return DDERR_OUTOFMEMORY; + } + /* we need check the GUID lpGUID what type it is */ if (pGUID != (LPGUID)DDCREATE_HARDWAREONLY) { if (pGUID !=NULL) { This = newThis; + DX_STUB_str("DDERR_INVALIDDIRECTDRAWGUID"); return DDERR_INVALIDDIRECTDRAWGUID; } } @@ -68,15 +76,24 @@ /* Fixme release memory alloc if we fail */ This->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT)); if (This->lpLcl == NULL) + { + DX_STUB_str("DDERR_OUTOFMEMORY"); return DDERR_OUTOFMEMORY; + } + This->lpLcl->lpGbl = &ddgbl;
*pIface = (LPDIRECTDRAW)This;
/* Get right interface we whant */ - if (Main_DirectDraw_QueryInterface((LPDIRECTDRAW7)This, id, (void**)&pIface)) - { + if (Main_DirectDraw_QueryInterface((LPDIRECTDRAW7)This, id, (void**)&pIface) == DD_OK) + { + DX_STUB_str("Got iface"); + if (StartDirectDraw((LPDIRECTDRAW*)This, pGUID, FALSE) == DD_OK); { + DX_STUB_str("here"); + + /* RtlZeroMemory(&wnd_class, sizeof(wnd_class)); wnd_class.style = CS_HREDRAW | CS_VREDRAW; wnd_class.lpfnWndProc = DefWindowProcW; @@ -90,13 +107,17 @@ wnd_class.lpszClassName = classname; if(!RegisterClassW(&wnd_class)) { + DX_STUB_str("DDERR_GENERIC"); return DDERR_GENERIC; } - + */ + + DX_STUB_str("DD_OK"); return DD_OK; } }
+ DX_STUB_str("DDERR_INVALIDPARAMS"); return DDERR_INVALIDPARAMS; }
@@ -121,6 +142,7 @@ * devicetypes = 3 : both hel are enable * devicetypes = 4 :loading a guid drv from the register */ +
if (reenable == FALSE) @@ -141,6 +163,8 @@ } }
+ DX_STUB_str("here"); + if (reenable == FALSE) { if (lpGuid == NULL) @@ -248,7 +272,7 @@ This->lpLcl->hDD = This->lpLcl->lpGbl->hDD; ddgbl.hDD = This->lpLcl->lpGbl->hDD;
- + DX_STUB_str("DD_OK"); return DD_OK; }