mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 15:26:02 +00:00
Fixing allot of werid bugs + cleanup debug nsg that we do not need any longer.
svn path=/trunk/; revision=27271
This commit is contained in:
parent
e3d3cf7171
commit
67f892011c
4 changed files with 47 additions and 64 deletions
|
@ -26,7 +26,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
|
||||
_SEH_TRY
|
||||
{
|
||||
DX_STUB_str("here\n");
|
||||
|
||||
if
|
||||
((!IsBadReadPtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2))) ||
|
||||
|
@ -39,8 +38,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
else
|
||||
{
|
||||
|
||||
DX_STUB_str("here\n");
|
||||
|
||||
DevMode.dmSize = sizeof(DEVMODE);
|
||||
DevMode.dmDriverExtra = 0;
|
||||
|
||||
|
@ -48,8 +45,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
{
|
||||
DDSURFACEDESC2 SurfaceDesc;
|
||||
|
||||
DX_STUB_str("here\n");
|
||||
|
||||
iMode++;
|
||||
|
||||
SurfaceDesc.dwSize = sizeof (DDSURFACEDESC2);
|
||||
|
@ -70,8 +65,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
*/
|
||||
SurfaceDesc.ddpfPixelFormat.dwRGBBitCount = DevMode.dmBitsPerPel;
|
||||
|
||||
DX_STUB_str("here\n");
|
||||
|
||||
// FIXME1: This->lpLcl->lpGbl->dwMonitorFrequency is not set !
|
||||
if(dwFlags & DDEDM_REFRESHRATES && SurfaceDesc.dwRefreshRate != This->lpLcl->lpGbl->dwMonitorFrequency)
|
||||
{
|
||||
|
@ -82,7 +75,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
|
||||
if(pDDSD)
|
||||
{
|
||||
DX_STUB_str("here\n");
|
||||
if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwHeight != SurfaceDesc.dwHeight)
|
||||
continue;
|
||||
|
||||
|
@ -110,8 +102,6 @@ Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
|
|||
}
|
||||
_SEH_END;
|
||||
|
||||
DX_STUB_str("here\n");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -120,8 +110,7 @@ Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWO
|
|||
DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
||||
{
|
||||
HRESULT ret = DD_OK;
|
||||
|
||||
DX_STUB_str("here\n");
|
||||
DX_WINDBG_trace();
|
||||
|
||||
_SEH_TRY
|
||||
{
|
||||
|
|
|
@ -196,7 +196,6 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
|
||||
/* FIXME add a check see if lock suport or not */
|
||||
|
||||
DX_STUB_str("test\n");
|
||||
if (prect!=NULL)
|
||||
{
|
||||
mdLock.bHasRect = TRUE;
|
||||
|
@ -208,7 +207,7 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
}
|
||||
|
||||
//This->lpLcl->lpSurfMore->slist[0]->hDC = This->lpLcl->lpSurfMore->lpDD_lcl->hDC;
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
mdLock.ddRVal = DDERR_NOTPALETTIZED;
|
||||
mdLock.Lock = This->lpLcl->lpSurfMore->lpDD_lcl->lpDDCB->HALDDSurface.Lock;
|
||||
mdLock.dwFlags = flags;
|
||||
|
@ -216,14 +215,14 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
mdLock.lpDD = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl;
|
||||
mdLock.lpSurfData = NULL;
|
||||
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
if (!DdResetVisrgn(This->lpLcl->lpSurfMore->slist[0], NULL))
|
||||
{
|
||||
DX_STUB_str("Here DdResetVisrgn lock");
|
||||
return DDERR_UNSUPPORTED;
|
||||
}
|
||||
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
if (mdLock.Lock(&mdLock)!= DDHAL_DRIVER_HANDLED)
|
||||
{
|
||||
DX_STUB_str("Here DDHAL_DRIVER_HANDLED lock");
|
||||
|
@ -231,7 +230,7 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
}
|
||||
|
||||
// FIXME ??? is this right ??
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
if (pDDSD != NULL)
|
||||
{
|
||||
ZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
|
||||
|
@ -251,21 +250,21 @@ HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
|
|||
// pDDSD->dwSize = sizeof(DDSURFACEDESC);
|
||||
//}
|
||||
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
pDDSD->lpSurface = (LPVOID) mdLock.lpSurfData;
|
||||
|
||||
pDDSD->dwHeight =This->lpLcl->lpGbl->wHeight;
|
||||
pDDSD->dwWidth = This->lpLcl->lpGbl->wWidth;
|
||||
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
|
||||
|
||||
pDDSD->ddpfPixelFormat.dwRGBBitCount = This->lpLcl->lpGbl->lPitch/ 8;
|
||||
pDDSD->lPitch = This->lpLcl->lpGbl->lPitch;
|
||||
pDDSD->dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH;
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
}
|
||||
DX_STUB_str("test\n");
|
||||
|
||||
return mdLock.ddRVal;
|
||||
}
|
||||
|
||||
|
|
|
@ -234,7 +234,7 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
|
|||
return DD_OK;
|
||||
|
||||
|
||||
/*
|
||||
#if 0
|
||||
#define DX_STUB_str(x) \
|
||||
{ \
|
||||
char buffer[1024]; \
|
||||
|
@ -253,13 +253,22 @@ VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
|
|||
firstcallx = TRUE; \
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#define DX_WINDBG_trace_res(width,height,bpp, freq) \
|
||||
static BOOL firstcallxx = TRUE; \
|
||||
if (firstcallxx) \
|
||||
{ \
|
||||
char buffer[1024]; \
|
||||
sprintf ( buffer, "Setmode have been req width=%d, height=%d bpp=%d freq = %d\n",width,height,bpp, freq); \
|
||||
OutputDebugStringA(buffer); \
|
||||
firstcallxx = FALSE; \
|
||||
}
|
||||
#else
|
||||
#define DX_WINDBG_trace() //
|
||||
#define DX_WINDBG_trace_res(width,height,bpp, freq) \\
|
||||
|
||||
#define DX_STUB_str(x) //
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* __DDRAW_PRIVATE */
|
||||
|
|
|
@ -174,10 +174,11 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
DWORD hel_ret = DD_FALSE;
|
||||
DWORD devicetypes = 0;
|
||||
DWORD dwFlags = 0;
|
||||
DEVMODE devmode;
|
||||
|
||||
|
||||
DX_WINDBG_trace();
|
||||
|
||||
|
||||
/*
|
||||
* ddgbl.dwPDevice is not longer in use in windows 2000 and higher
|
||||
* I am using it for device type
|
||||
|
@ -190,6 +191,9 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
ddgbl.lpDriverHandle = &ddgbl;
|
||||
ddgbl.hDDVxd = -1;
|
||||
|
||||
|
||||
|
||||
|
||||
if (reenable == FALSE)
|
||||
{
|
||||
if ((!IsBadReadPtr(This->lpLink,sizeof(LPDIRECTDRAW))) && (This->lpLink == NULL))
|
||||
|
@ -207,6 +211,13 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
DxHeapMemAlloc(ddgbl.lpModeInfo, sizeof(DDHALMODEINFO));
|
||||
if (!ddgbl.lpModeInfo)
|
||||
{
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
}
|
||||
/* Windows handler are by set of SetCooperLevel
|
||||
* so do not set it
|
||||
|
@ -216,7 +227,6 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
{
|
||||
if (lpGuid == NULL)
|
||||
{
|
||||
DX_STUB_str("lpGuid == NULL\n");
|
||||
devicetypes= 1;
|
||||
|
||||
/* Create HDC for default, hal and hel driver */
|
||||
|
@ -298,8 +308,6 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
hel_ret = StartDirectDrawHel(iface, reenable);
|
||||
}
|
||||
|
||||
DX_STUB_str("return\n");
|
||||
|
||||
if (hal_ret!=DD_OK)
|
||||
{
|
||||
if (hel_ret!=DD_OK)
|
||||
|
@ -335,33 +343,21 @@ StartDirectDraw(LPDIRECTDRAW iface, LPGUID lpGuid, BOOL reenable)
|
|||
ddgbl.rectDesktop.right = ddgbl.vmiData.dwDisplayWidth;
|
||||
ddgbl.rectDesktop.right = ddgbl.vmiData.dwDisplayHeight;
|
||||
|
||||
|
||||
/* HALINFO always returen false for lpModeInfo */
|
||||
DxHeapMemAlloc(ddgbl.lpModeInfo, sizeof(DDHALMODEINFO));
|
||||
if (!ddgbl.lpModeInfo)
|
||||
{
|
||||
return DDERR_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
|
||||
EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &devmode);
|
||||
ddgbl.lpModeInfo->dwWidth = devmode.dmPelsWidth;
|
||||
ddgbl.lpModeInfo->dwHeight = devmode.dmPelsHeight;
|
||||
ddgbl.lpModeInfo->dwBPP = devmode.dmBitsPerPel;
|
||||
ddgbl.dwMonitorFrequency = GetDeviceCaps(GetWindowDC(NULL),VREFRESH);
|
||||
ddgbl.lpModeInfo->dwWidth = ddgbl.vmiData.dwDisplayWidth;
|
||||
ddgbl.lpModeInfo->dwHeight = ddgbl.vmiData.dwDisplayHeight;
|
||||
ddgbl.lpModeInfo->dwBPP = ddgbl.vmiData.ddpfDisplay.dwRGBBitCount;
|
||||
ddgbl.lpModeInfo->lPitch = ddgbl.vmiData.lDisplayPitch;
|
||||
ddgbl.lpModeInfo->wRefreshRate = (WORD)devmode.dmDisplayFrequency;
|
||||
ddgbl.lpModeInfo->wRefreshRate = ddgbl.dwMonitorFrequency;
|
||||
ddgbl.lpModeInfo->dwRBitMask = ddgbl.vmiData.ddpfDisplay.dwRBitMask;
|
||||
ddgbl.lpModeInfo->dwGBitMask = ddgbl.vmiData.ddpfDisplay.dwGBitMask;
|
||||
ddgbl.lpModeInfo->dwBBitMask = ddgbl.vmiData.ddpfDisplay.dwBBitMask;
|
||||
ddgbl.lpModeInfo->dwAlphaBitMask = ddgbl.vmiData.ddpfDisplay.dwRGBAlphaBitMask;
|
||||
ddgbl.dwMonitorFrequency = ddgbl.lpModeInfo->wRefreshRate;
|
||||
ddgbl.dwNumModes = 1;
|
||||
ddgbl.dwSaveNumModes = 1;
|
||||
|
||||
DX_STUB_str("DD_OK\n");
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
|
||||
HRESULT WINAPI
|
||||
StartDirectDrawHel(LPDIRECTDRAW iface, BOOL reenable)
|
||||
{
|
||||
|
@ -512,8 +508,6 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
|||
return DD_FALSE;
|
||||
}
|
||||
|
||||
DX_STUB_str("Trying alloc FourCCC \n");
|
||||
|
||||
/* Alloc mpFourCC */
|
||||
if (This->lpLcl->lpGbl->lpdwFourCC != NULL)
|
||||
{
|
||||
|
@ -533,27 +527,19 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
|||
}
|
||||
}
|
||||
|
||||
DX_STUB_str("End Trying alloc FourCCC\n");
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Alloc mpTextures */
|
||||
|
||||
#if 0
|
||||
DX_STUB_str("1 Here\n");
|
||||
|
||||
/*
|
||||
if (This->lpLcl->lpGbl->texture != NULL)
|
||||
{
|
||||
DxHeapMemFree(This->lpLcl->lpGbl->);
|
||||
DxHeapMemFree(This->lpLcl->lpGbl->texture;
|
||||
}
|
||||
*/
|
||||
|
||||
mpTextures = NULL;
|
||||
if (mD3dDriverData.dwNumTextureFormats > 0)
|
||||
{
|
||||
DxHeapMemAlloc(mpTextures, sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
|
||||
mpTextures = (DDSURFACEDESC*) DxHeapMemAlloc(sizeof(DDSURFACEDESC) * mD3dDriverData.dwNumTextureFormats);
|
||||
if (mpTextures == NULL)
|
||||
{
|
||||
DxHeapMemFree(mpFourCC);
|
||||
|
@ -564,7 +550,9 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
|||
|
||||
DX_STUB_str("2 Here\n");
|
||||
|
||||
|
||||
#else
|
||||
mpTextures = NULL;
|
||||
#endif
|
||||
|
||||
|
||||
/* Get all basic data from the driver */
|
||||
|
@ -600,8 +588,6 @@ StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
|
|||
// This->lpLcl->lpGbl->dwNumModes = mHALInfo.dwNumModes;
|
||||
// This->lpLcl->lpGbl->lpModeInfo = mHALInfo.lpModeInfo;
|
||||
|
||||
DX_STUB_str("Here\n");
|
||||
|
||||
/* FIXME convert mpTextures to DDHALMODEINFO */
|
||||
// DxHeapMemFree( mpTextures);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue