Author: greatlrd
Date: Sat Jun 2 18:42:43 2007
New Revision: 26967
URL:
http://svn.reactos.org/svn/reactos?rev=26967&view=rev
Log:
sorry startup.c are bit messy but I change heapalloc to malloc and guess what all our
weird problem are gone.
Modified:
trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/Surface/createsurface.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/createsurface.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/createsurface.c Sat Jun 2 18:42:43 2007
@@ -106,7 +106,7 @@
DDHAL_CREATESURFACEDATA mDdCreateSurface;
- That[0]->lpLcl->lpSurfMore =
DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_MORE));
+ DxHeapMemAlloc( That[0]->lpLcl->lpSurfMore, sizeof(DDRAWI_DDRAWSURFACE_MORE));
if (That[0]->lpLcl->lpSurfMore == NULL)
{
DxHeapMemFree(That);
@@ -198,7 +198,7 @@
{
- That[t]->lpLcl->lpSurfMore =
DxHeapMemAlloc(sizeof(DDRAWI_DDRAWSURFACE_MORE));
+ DxHeapMemAlloc(That[t]->lpLcl->lpSurfMore, sizeof(DDRAWI_DDRAWSURFACE_MORE));
if (That[t]->lpLcl->lpSurfMore == NULL)
{
DxHeapMemFree(That);
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sat Jun 2 18:42:43 2007
@@ -35,8 +35,14 @@
VOID Cleanup(LPDIRECTDRAW7 iface);
/* own macro to alloc memmory */
+
+/*
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p); \
+ p = NULL;
+*/
+#define DxHeapMemAlloc(p, m) p = malloc(m)
+#define DxHeapMemFree(p) free(p); \
p = NULL;
/******** Main Object ********/
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 Sat Jun 2 18:42:43 2007
@@ -106,7 +106,7 @@
/* FIXME HACK linking does not working we need figout why */
LPDDRAWI_DIRECTDRAW_INT memThis;
- memThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
+ DxHeapMemAlloc(memThis, sizeof(DDRAWI_DIRECTDRAW_INT));
This = memThis;
if (This == NULL)
{
@@ -118,7 +118,7 @@
}
/* Fixme release memory alloc if we fail */
- This->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
+ DxHeapMemAlloc(This->lpLcl, sizeof(DDRAWI_DIRECTDRAW_INT));
if (This->lpLcl == NULL)
{
DX_STUB_str("DDERR_OUTOFMEMORY");
@@ -194,7 +194,8 @@
This->lpLcl->lpGbl->dwRefCnt++;
if (ddgbl.lpDDCBtmp == NULL)
{
- ddgbl.lpDDCBtmp = (LPDDHAL_CALLBACKS)
DxHeapMemAlloc(sizeof(DDHAL_CALLBACKS));
+ // LPDDHAL_CALLBACKS
+ DxHeapMemAlloc( ddgbl.lpDDCBtmp , sizeof(DDHAL_CALLBACKS));
if (ddgbl.lpDDCBtmp == NULL)
{
DX_STUB_str("Out of memmory\n");
@@ -403,7 +404,7 @@
HRESULT WINAPI
StartDirectDrawHal(LPDIRECTDRAW iface, BOOL reenable)
{
- LPDWORD mpFourCC;
+ LPDWORD mpFourCC = NULL;
DDHALINFO mHALInfo;
BOOL newmode = FALSE;
LPDDSURFACEDESC mpTextures;
@@ -411,6 +412,7 @@
D3DHAL_GLOBALDRIVERDATA mD3dDriverData;
DDHAL_DDEXEBUFCALLBACKS mD3dBufferCallbacks;
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+ INT count;
DX_WINDBG_trace();
@@ -423,7 +425,7 @@
{
if (ddgbl.lpDDCBtmp == NULL)
{
- ddgbl.lpDDCBtmp = DxHeapMemAlloc(sizeof(DDHAL_CALLBACKS));
+ DxHeapMemAlloc(ddgbl.lpDDCBtmp, sizeof(DDHAL_CALLBACKS));
if ( ddgbl.lpDDCBtmp == NULL)
{
return DD_FALSE;
@@ -462,7 +464,7 @@
&mD3dDriverData,
&mD3dBufferCallbacks,
NULL,
- NULL,
+ mpFourCC,
NULL))
{
DxHeapMemFree(This->lpLcl->lpGbl->lpModeInfo);
@@ -471,24 +473,44 @@
return DD_FALSE;
}
+
+ {
+ char buffer[2048];
+ sprintf ( buffer, "test %d %d\n", mpFourCC,
mHALInfo.ddCaps.dwNumFourCCCodes);
+ OutputDebugStringA(buffer);
+ }
+
+ // count = mHALInfo.ddCaps.dwNumFourCCCodes;
+
DX_STUB_str("Here\n");
-#if 0
+
/* Alloc mpFourCC */
- mpFourCC = NULL;
- if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
- {
- mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) *
mHALInfo.ddCaps.dwNumFourCCCodes);
+
+ //if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
+ {
+ //mpFourCC = (DWORD *) DxHeapMemAlloc( sizeof(DWORD) * 21);
+ // DxHeapMemAlloc(mpFourCC, sizeof(DWORD) * 21);
+
+ // mpFourCC = (DWORD *) DxHeapMemAlloc(sizeof(DWORD) *
(mHALInfo.ddCaps.dwNumFourCCCodes + 2));
+ /*
if (mpFourCC == NULL)
{
DxHeapMemFree(ddgbl.lpDDCBtmp);
// FIXME Close DX fristcall and second call
return DD_FALSE;
}
- }
- DX_STUB_str("Here\n");
-#else
- mpFourCC = NULL;
-#endif
+ */
+ }
+
+ DX_STUB_str("Here\n");
+
+ {
+ char buffer[2048];
+ sprintf ( buffer, "test %d %d\n", mpFourCC,
mHALInfo.ddCaps.dwNumFourCCCodes);
+ OutputDebugStringA(buffer);
+ }
+
+
/* Alloc mpTextures */
#if 0
mpTextures = NULL;
@@ -529,6 +551,12 @@
return DD_FALSE;
}
+ {
+ char buffer[2048];
+ sprintf ( buffer, "test %d %d\n", mpFourCC,
mHALInfo.ddCaps.dwNumFourCCCodes);
+ OutputDebugStringA(buffer);
+ }
+
memcpy(&ddgbl.vmiData, &mHALInfo.vmiData,sizeof(VIDMEMINFO));