[ros-diffs] [greatlrd] 27271: Fixing allot of werid bugs + cleanup debug nsg that we do not need any longer.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sun Jun 24 19:29:03 CEST 2007


Author: greatlrd
Date: Sun Jun 24 21:29:03 2007
New Revision: 27271

URL: http://svn.reactos.org/svn/reactos?rev=27271&view=rev
Log:
Fixing allot of werid bugs + cleanup debug nsg that we do not need any longer. 

Modified:
    trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
    trunk/reactos/dll/directx/ddraw/Surface/surface_main.c
    trunk/reactos/dll/directx/ddraw/rosdraw.h
    trunk/reactos/dll/directx/ddraw/startup.c

Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c?rev=27271&r1=27270&r2=27271&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c Sun Jun 24 21:29:03 2007
@@ -26,7 +26,6 @@
 
     _SEH_TRY
     {
-        DX_STUB_str("here\n");
 
         if 
         ((!IsBadReadPtr(pCallback,sizeof(LPDDENUMMODESCALLBACK2)))  ||
@@ -39,16 +38,12 @@
         else
         {
 
-            DX_STUB_str("here\n");
-
             DevMode.dmSize = sizeof(DEVMODE);
             DevMode.dmDriverExtra = 0;
 
             while (EnumDisplaySettingsEx(NULL, iMode, &DevMode, 0) == TRUE)
             {
                 DDSURFACEDESC2 SurfaceDesc; 
-
-                DX_STUB_str("here\n");
 
                 iMode++;
 
@@ -70,8 +65,6 @@
                 */
                 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 @@
 
                 if(pDDSD)
                 {
-                    DX_STUB_str("here\n");
                     if(pDDSD->dwFlags & DDSD_HEIGHT && pDDSD->dwHeight != SurfaceDesc.dwHeight)
                         continue;
 
@@ -110,8 +102,6 @@
     }
     _SEH_END;
 
-    DX_STUB_str("here\n");
-
     return ret;
 }
 
@@ -120,8 +110,7 @@
                                                                 DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
 {
     HRESULT ret = DD_OK;
-
-    DX_STUB_str("here\n");
+    DX_WINDBG_trace();
 
     _SEH_TRY
     {

Modified: trunk/reactos/dll/directx/ddraw/Surface/surface_main.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/surface_main.c?rev=27271&r1=27270&r2=27271&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/surface_main.c Sun Jun 24 21:29:03 2007
@@ -196,7 +196,6 @@
 
 	/* 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 @@
     }
 	
 	//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 @@
 	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 @@
     }       
    
     // FIXME ??? is this right ?? 
-    DX_STUB_str("test\n");
+
     if (pDDSD != NULL)
     {
 		ZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
@@ -251,21 +250,21 @@
         //    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;
 }
 

Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.h?rev=27271&r1=27270&r2=27271&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sun Jun 24 21:29:03 2007
@@ -234,7 +234,7 @@
 	return DD_OK;
 
 
-/*
+#if 0
     #define DX_STUB_str(x) \
     { \
         char buffer[1024]; \
@@ -253,13 +253,22 @@
             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 */

Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.c?rev=27271&r1=27270&r2=27271&view=diff
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sun Jun 24 21:29:03 2007
@@ -174,9 +174,10 @@
     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
@@ -189,6 +190,9 @@
 
     ddgbl.lpDriverHandle = &ddgbl;
     ddgbl.hDDVxd = -1;
+
+
+
 
     if (reenable == FALSE)
     {
@@ -207,6 +211,13 @@
                 }
             }
         }
+
+        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 @@
     {
         if (lpGuid == NULL)
         {
-            DX_STUB_str("lpGuid == NULL\n");
             devicetypes= 1;
 
             /* Create HDC for default, hal and hel driver */
@@ -298,8 +308,6 @@
               hel_ret = StartDirectDrawHel(iface, reenable);
     }
 
-    DX_STUB_str("return\n");
-
     if (hal_ret!=DD_OK)
     {
         if (hel_ret!=DD_OK)
@@ -335,32 +343,20 @@
     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 @@
       return DD_FALSE;
     }
 
-     DX_STUB_str("Trying alloc FourCCC \n");
-
     /* Alloc mpFourCC */
     if (This->lpLcl->lpGbl->lpdwFourCC != NULL)
     {
@@ -533,27 +527,19 @@
         }
     }
 
-    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 @@
 
     DX_STUB_str("2 Here\n");
 
-
+#else
+      mpTextures = NULL;
+#endif
 
 
     /* Get all basic data from the driver */
@@ -600,8 +588,6 @@
     // This->lpLcl->lpGbl->dwNumModes         = mHALInfo.dwNumModes;
     // This->lpLcl->lpGbl->lpModeInfo         = mHALInfo.lpModeInfo;
 
-    DX_STUB_str("Here\n");
-
     /* FIXME convert mpTextures to DDHALMODEINFO */
     // DxHeapMemFree( mpTextures);
 




More information about the Ros-diffs mailing list