Author: greatlrd
Date: Sat Jun 2 19:09:52 2007
New Revision: 26968
URL:
http://svn.reactos.org/svn/reactos?rev=26968&view=rev
Log:
commited bugfix if we got if (my) dxallocfree and so on, also fixed the alloc macro it
always zero the memory buffer
Modified:
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/startup.c
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 19:09:52 2007
@@ -41,9 +41,17 @@
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p); \
p = NULL;
*/
-#define DxHeapMemAlloc(p, m) p = malloc(m)
-#define DxHeapMemFree(p) free(p); \
- p = NULL;
+#define DxHeapMemAlloc(p, m) { \
+ p = malloc(m); \
+ if (p != NULL) \
+ { \
+ ZeroMemory(p,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 19:09:52 2007
@@ -486,8 +486,8 @@
/* Alloc mpFourCC */
- //if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
- {
+ // if (mHALInfo.ddCaps.dwNumFourCCCodes > 0 )
+ // {
//mpFourCC = (DWORD *) DxHeapMemAlloc( sizeof(DWORD) * 21);
// DxHeapMemAlloc(mpFourCC, sizeof(DWORD) * 21);
@@ -500,7 +500,7 @@
return DD_FALSE;
}
*/
- }
+ // }
DX_STUB_str("Here\n");
@@ -553,7 +553,7 @@
{
char buffer[2048];
- sprintf ( buffer, "test %d %d\n", mpFourCC,
mHALInfo.ddCaps.dwNumFourCCCodes);
+ sprintf ( buffer, "3 test %d %d\n", mpFourCC,
mHALInfo.ddCaps.dwNumFourCCCodes);
OutputDebugStringA(buffer);
}