mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
stubed Main_DirectDraw_SetCooperativeLevel
it need be rewrite svn path=/trunk/; revision=25008
This commit is contained in:
@@ -207,11 +207,15 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
}
|
||||
|
||||
DX_STUB_str("ok pUnkOuter == NULL");
|
||||
|
||||
if (sizeof(DDSURFACEDESC2)!=pDDSD->dwSize && sizeof(DDSURFACEDESC)!=pDDSD->dwSize)
|
||||
{
|
||||
return DDERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
DX_STUB_str("ok pDDSD->dwSize ok");
|
||||
|
||||
That = (LPDDRAWI_DDRAWSURFACE_INT)DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_INT));
|
||||
|
||||
if (That == NULL)
|
||||
@@ -219,12 +223,22 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
DX_STUB_str("That got memory");
|
||||
|
||||
|
||||
That->lpVtbl = &DirectDrawSurface7_Vtable;
|
||||
|
||||
DX_STUB_str("That->lpVtbl ok");
|
||||
|
||||
*ppSurf = (LPDIRECTDRAWSURFACE7)That;
|
||||
|
||||
DX_STUB_str("*ppSurf ok");
|
||||
|
||||
That->lpLcl->lpGbl = &ddSurfGbl;
|
||||
DX_STUB_str("ddSurfGbl ok");
|
||||
|
||||
That->lpLcl->lpGbl->lpDD = &ddgbl;
|
||||
DX_STUB_str("crash one line below : why ? to tried figout lpDD ok");
|
||||
|
||||
Main_DDrawSurface_AddRef((LPDIRECTDRAWSURFACE7)That);
|
||||
|
||||
@@ -248,18 +262,23 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
||||
pDDSD->ddsCaps.dwCaps = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY;
|
||||
}
|
||||
|
||||
|
||||
if (pDDSD->ddsCaps.dwCaps & DDSCAPS_ALLOCONLOAD)
|
||||
{
|
||||
/* If the surface is of the 'alloconload' type, ignore the LPSURFACE field */
|
||||
pDDSD->dwFlags &= ~DDSD_LPSURFACE;
|
||||
}
|
||||
|
||||
DX_STUB_str("pDDSD->ddsCaps.dwCaps ok");
|
||||
|
||||
if ((pDDSD->dwFlags & DDSD_LPSURFACE) && (pDDSD->lpSurface == NULL))
|
||||
{
|
||||
/* Frank Herbert's Dune specifies a null pointer for the surface, ignore the LPSURFACE field */
|
||||
pDDSD->dwFlags &= ~DDSD_LPSURFACE;
|
||||
}
|
||||
|
||||
DX_STUB_str("pDDSD->dwFlags ok");
|
||||
|
||||
/* own code now */
|
||||
|
||||
/* FIXME
|
||||
@@ -292,6 +311,7 @@ HRESULT WINAPI Main_DirectDraw_CreateSurface (LPDIRECTDRAW7 iface, LPDDSURFACEDE
|
||||
DX_STUB_str( "Can not create offscreenplain surface");
|
||||
}
|
||||
|
||||
DX_STUB_str("DDERR_INVALIDSURFACETYPE");
|
||||
return DDERR_INVALIDSURFACETYPE;
|
||||
|
||||
}
|
||||
@@ -726,48 +746,49 @@ Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD coopl
|
||||
|
||||
|
||||
|
||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode;
|
||||
// LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||
// DDHAL_SETEXCLUSIVEMODEDATA SetExclusiveMode;
|
||||
|
||||
DX_WINDBG_trace();
|
||||
|
||||
|
||||
// check the parameters
|
||||
if ((HWND)This->lpLcl->lpGbl->lpExclusiveOwner->hWnd == hwnd)
|
||||
return DD_OK;
|
||||
|
||||
|
||||
//DX_WINDBG_trace();
|
||||
//
|
||||
//
|
||||
// // check the parameters
|
||||
// if ((HWND)This->lpLcl->lpGbl->lpExclusiveOwner->hWnd == hwnd)
|
||||
// return DD_OK;
|
||||
//
|
||||
//
|
||||
|
||||
if ((cooplevel&DDSCL_EXCLUSIVE) && !(cooplevel&DDSCL_FULLSCREEN))
|
||||
return DDERR_INVALIDPARAMS;
|
||||
// if ((cooplevel&DDSCL_EXCLUSIVE) && !(cooplevel&DDSCL_FULLSCREEN))
|
||||
// return DDERR_INVALIDPARAMS;
|
||||
|
||||
if (cooplevel&DDSCL_NORMAL && cooplevel&DDSCL_FULLSCREEN)
|
||||
return DDERR_INVALIDPARAMS;
|
||||
// if (cooplevel&DDSCL_NORMAL && cooplevel&DDSCL_FULLSCREEN)
|
||||
// return DDERR_INVALIDPARAMS;
|
||||
|
||||
// set the data
|
||||
This->lpLcl->lpGbl->lpExclusiveOwner->hWnd = (ULONG_PTR) hwnd;
|
||||
This->lpLcl->lpGbl->lpExclusiveOwner->hDC = (ULONG_PTR)GetDC(hwnd);
|
||||
// // set the data
|
||||
// This->lpLcl->lpGbl->lpExclusiveOwner->hWnd = (ULONG_PTR) hwnd;
|
||||
// This->lpLcl->lpGbl->lpExclusiveOwner->hDC = (ULONG_PTR)GetDC(hwnd);
|
||||
|
||||
|
||||
/* FIXME : fill the mDDrawGlobal.lpExclusiveOwner->dwLocalFlags right */
|
||||
//mDDrawGlobal.lpExclusiveOwner->dwLocalFlags
|
||||
//
|
||||
///* FIXME : fill the mDDrawGlobal.lpExclusiveOwner->dwLocalFlags right */
|
||||
////mDDrawGlobal.lpExclusiveOwner->dwLocalFlags
|
||||
|
||||
|
||||
SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED;
|
||||
if ((This->lpLcl->lpGbl->lpDDCBtmp->cbDDCallbacks.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE))
|
||||
{
|
||||
|
||||
SetExclusiveMode.SetExclusiveMode = This->lpLcl->lpGbl->lpDDCBtmp->cbDDCallbacks.SetExclusiveMode;
|
||||
SetExclusiveMode.lpDD = This->lpLcl->lpGbl;
|
||||
SetExclusiveMode.dwEnterExcl = cooplevel;
|
||||
// SetExclusiveMode.ddRVal = DDERR_NOTPALETTIZED;
|
||||
//if ((This->lpLcl->lpGbl->lpDDCBtmp->cbDDCallbacks.dwFlags & DDHAL_CB32_SETEXCLUSIVEMODE))
|
||||
// {
|
||||
//
|
||||
// SetExclusiveMode.SetExclusiveMode = This->lpLcl->lpGbl->lpDDCBtmp->cbDDCallbacks.SetExclusiveMode;
|
||||
// SetExclusiveMode.lpDD = This->lpLcl->lpGbl;
|
||||
// SetExclusiveMode.dwEnterExcl = cooplevel;
|
||||
|
||||
if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
return DDERR_NODRIVERSUPPORT;
|
||||
}
|
||||
}
|
||||
|
||||
return SetExclusiveMode.ddRVal;
|
||||
// if (SetExclusiveMode.SetExclusiveMode(&SetExclusiveMode) != DDHAL_DRIVER_HANDLED)
|
||||
// {
|
||||
// return DDERR_NODRIVERSUPPORT;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return SetExclusiveMode.ddRVal;
|
||||
DX_STUB_DD_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user