Author: greatlrd
Date: Thu Mar 8 22:18:06 2007
New Revision: 26035
URL:
http://svn.reactos.org/svn/reactos?rev=26035&view=rev
Log:
fixing minior bugs in DdQueryDirectDrawObject
some data was not fill in
Modified:
trunk/reactos/dll/win32/gdi32/misc/gdientry.c
Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/gdien…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/gdientry.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c Thu Mar 8 22:18:06 2007
@@ -412,7 +412,7 @@
ghDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
/* Delete our DC */
- NtGdiDeleteObjectApp(hdc);
+ NtGdiDeleteObjectApp(hdc);
}
}
@@ -465,17 +465,8 @@
D3DNTHAL_GLOBALDRIVERDATA D3dDriverData;
DD_D3DBUFCALLBACKS D3dBufferCallbacks;
DWORD CallbackFlags[3];
- DWORD dwNumHeaps=0, FourCCs;
+ DWORD dwNumHeaps=0, FourCCs=0;
DWORD Flags;
-
- /* Check if we got a list pointer */
- if (pvmList)
- {
- /* Allocate memory for it */
- VidMemList = LocalAlloc(LMEM_ZEROINIT,
- sizeof(VIDEOMEMORY) *
- pHalInfo->vmiData.dwNumHeaps);
- }
/* Clear the structures */
RtlZeroMemory(&HalInfo, sizeof(DD_HALINFO));
@@ -483,7 +474,16 @@
RtlZeroMemory(&D3dDriverData, sizeof(D3DNTHAL_GLOBALDRIVERDATA));
RtlZeroMemory(&D3dBufferCallbacks, sizeof(DD_D3DBUFCALLBACKS));
- //* Do the query */
+ /* Check if we got a list pointer */
+ if (pvmList)
+ {
+ /* Allocate memory for it */
+ VidMemList = LocalAlloc(LMEM_ZEROINIT,
+ sizeof(VIDEOMEMORY) *
+ pHalInfo->vmiData.dwNumHeaps);
+ }
+
+ /* Do the query */
if (!NtGdiDdQueryDirectDrawObject(GetDdHandle(pDirectDrawGlobal->hDD),
&HalInfo,
CallbackFlags,
@@ -531,7 +531,11 @@
pHalInfo->vmiData.dwDisplayHeight = HalInfo.vmiData.dwDisplayHeight;
pHalInfo->vmiData.lDisplayPitch = HalInfo.vmiData.lDisplayPitch;
pHalInfo->vmiData.fpPrimary = 0;
- pHalInfo->vmiData.ddpfDisplay = HalInfo.vmiData.ddpfDisplay;
+
+ RtlCopyMemory( &pHalInfo->vmiData.ddpfDisplay,
+ &HalInfo.vmiData.ddpfDisplay,
+ sizeof(DDPIXELFORMAT));
+
pHalInfo->vmiData.dwOffscreenAlign = HalInfo.vmiData.dwOffscreenAlign;
pHalInfo->vmiData.dwOverlayAlign = HalInfo.vmiData.dwOverlayAlign;
pHalInfo->vmiData.dwTextureAlign = HalInfo.vmiData.dwTextureAlign;
@@ -539,11 +543,15 @@
pHalInfo->vmiData.dwAlphaAlign = HalInfo.vmiData.dwAlphaAlign;
pHalInfo->vmiData.dwNumHeaps = dwNumHeaps;
pHalInfo->vmiData.pvmList = pvmList;
- // pHalInfo->ddCaps = HalInfo.ddCaps;
- // pHalInfo->ddCaps.dwNumFourCCCodes = FourCCs;
+
+ RtlCopyMemory( &pHalInfo->ddCaps, &HalInfo.ddCaps,sizeof(DDCORECAPS ));
+
+ pHalInfo->ddCaps.dwNumFourCCCodes = FourCCs;
pHalInfo->lpdwFourCC = pdwFourCC;
pHalInfo->ddCaps.dwRops[6] = 0x1000;
- pHalInfo->dwFlags = HalInfo.dwFlags | DDHALINFO_GETDRIVERINFOSET;
+
+ /* FIXME implement DdGetDriverInfo */
+ // pHalInfo->dwFlags = HalInfo.dwFlags | DDHALINFO_GETDRIVERINFOSET;
// pHalInfo->GetDriverInfo = DdGetDriverInfo;
/* Now check if we got any DD callbacks */
@@ -557,8 +565,8 @@
/* Write the header */
pDDCallbacks->dwSize = sizeof(DDHAL_DDCALLBACKS);
- pDDCallbacks->dwFlags = Flags;
-
+ pDDCallbacks->dwFlags = Flags;
+
/* Now write the pointers, if applicable */
if (Flags & DDHAL_CB32_CREATESURFACE)
{
@@ -586,13 +594,12 @@
/* Set the flags for this one */
Flags = CallbackFlags[1];
-
/* Write the header, note that some functions are always exposed */
pDDSurfaceCallbacks->dwSize = sizeof(DDHAL_DDSURFACECALLBACKS);
-
- pDDSurfaceCallbacks->dwFlags = Flags;
- /*
+
+ pDDSurfaceCallbacks->dwFlags = Flags;
+ /*
pDDSurfaceCallBacks->dwFlags = (DDHAL_SURFCB32_LOCK |
DDHAL_SURFCB32_UNLOCK |
DDHAL_SURFCB32_SETCOLORKEY |
@@ -652,7 +659,7 @@
/* Check for D3D Callbacks */
if (pD3dCallbacks)
- {
+ {
/* Zero the struct */
RtlZeroMemory(pD3dCallbacks, sizeof(D3DHAL_CALLBACKS));
@@ -665,9 +672,9 @@
/* Now check for each callback */
if (D3dCallbacks.ContextCreate)
{
- /* FIXME
+ /* FIXME
pD3dCallbacks->ContextCreate = D3dContextCreate;
- */
+ */
}
if (D3dCallbacks.ContextDestroy)
{
@@ -675,9 +682,9 @@
}
if (D3dCallbacks.ContextDestroyAll)
{
- /* FIXME
+ /* FIXME
pD3dCallbacks->ContextDestroyAll = (LPD3DHAL_CONTEXTDESTROYALLCB)
NtGdiD3dContextDestroyAll;
- */
+ */
}
}
}