Author: greatlrd
Date: Fri Jun 15 13:54:52 2007
New Revision: 27183
URL:
http://svn.reactos.org/svn/reactos?rev=27183&view=rev
Log:
Fixing some bugs in startup.c
1. check for DDHALINFO_GETDRIVERINFOSET before using of
DdGetDriverInfo, it exists two diffent version of
DdGetDriverInfo2
2. Adding a fixme for fixing CreateSurfaceEx, GetDriverState
and DestroyDDLocal callbacks for HAL, and adding partly
code in the fixme.
Modified:
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Fri Jun 15 13:54:52 2007
@@ -532,22 +532,57 @@
// DxHeapMemFree( mpTextures);
/* FIXME D3D setup mD3dCallbacks and mD3dDriverData */
+
DDHAL_GETDRIVERINFODATA DdGetDriverInfo = { 0 };
- DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
- DdGetDriverInfo.guidInfo = GUID_MiscellaneousCallbacks;
-
- DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
-
- DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUSCALLBACKS);
-
- if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED ||
DdGetDriverInfo.ddRVal != DD_OK)
- {
- DxHeapMemFree(mpFourCC);
- DxHeapMemFree(mpTextures);
- DxHeapMemFree(ddgbl.lpDDCBtmp);
- // FIXME Close DX fristcall and second call
- return DD_FALSE;
- }
+
+
+ if (mHALInfo.dwFlags & DDHALINFO_GETDRIVERINFOSET)
+ {
+ DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
+ DdGetDriverInfo.guidInfo = GUID_MiscellaneousCallbacks;
+ DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
+ DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUSCALLBACKS);
+
+ if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED ||
DdGetDriverInfo.ddRVal != DD_OK)
+ {
+ DxHeapMemFree(mpFourCC);
+ DxHeapMemFree(mpTextures);
+ DxHeapMemFree(ddgbl.lpDDCBtmp);
+ // FIXME Close DX fristcall and second call
+ return DD_FALSE;
+ }
+
+ RtlZeroMemory(&DdGetDriverInfo, sizeof(DDHAL_GETDRIVERINFODATA));
+ DdGetDriverInfo.dwSize = sizeof (DDHAL_GETDRIVERINFODATA);
+ DdGetDriverInfo.guidInfo = GUID_Miscellaneous2Callbacks;
+
+ /* FIXME
+ DdGetDriverInfo.lpvData = (PVOID)&ddgbl.lpDDCBtmp->HALDDMiscellaneous;
+ DdGetDriverInfo.dwExpectedSize = sizeof (DDHAL_DDMISCELLANEOUS2CALLBACKS);
+
+ if(mHALInfo.GetDriverInfo (&DdGetDriverInfo) == DDHAL_DRIVER_NOTHANDLED ||
DdGetDriverInfo.ddRVal != DD_OK)
+ {
+ DxHeapMemFree(mpFourCC);
+ DxHeapMemFree(mpTextures);
+ DxHeapMemFree(ddgbl.lpDDCBtmp);
+ // FIXME Close DX fristcall and second call
+ return DD_FALSE;
+ }
+ DD_MISCELLANEOUS2CALLBACKS
+ {
+ DWORD dwSize;
+ DWORD dwFlags;
+ PDD_ALPHABLT AlphaBlt; // unsuse acoding msdn and always set to
NULL
+ PDD_CREATESURFACEEX CreateSurfaceEx;
+ PDD_GETDRIVERSTATE GetDriverState;
+ PDD_DESTROYDDLOCAL DestroyDDLocal;
+ }
+ DDHAL_MISC2CB32_CREATESURFACEEX
+ DDHAL_MISC2CB32_GETDRIVERSTATE
+ DDHAL_MISC2CB32_DESTROYDDLOCAL
+ */
+ }
+
return DD_OK;
}