Small hack for Getting monitor freq right.
authorMagnus Olsen <magnus@greatlord.com>
Sat, 5 Nov 2005 15:32:23 +0000 (15:32 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sat, 5 Nov 2005 15:32:23 +0000 (15:32 +0000)
svn path=/trunk/; revision=19016

reactos/lib/ddraw/hal/surface_hal.c
reactos/lib/ddraw/main/ddraw_main.c

index 992e683..1622a27 100644 (file)
@@ -77,7 +77,7 @@ HRESULT Hal_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pD
        This->More.dmiDDrawReserved7.wWidth = This->Global.wWidth;
        This->More.dmiDDrawReserved7.wHeight = This->Global.wHeight;
        This->More.dmiDDrawReserved7.wBPP = This->owner->Bpp;
-       //This->More.dmiDDrawReserved7.wRefreshRate = ;
+       This->More.dmiDDrawReserved7.wRefreshRate = This->owner->DirectDrawGlobal.dwMonitorFrequency;
        //This->More.dmiDDrawReserved7.wMonitorsAttachedToDesktop = 2;
        /* ToDo: fill ddsCapsEx */
  
@@ -86,7 +86,7 @@ HRESULT Hal_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pD
        This->Local.lpGbl = &This->Global;
        This->Local.lpSurfMore = &This->More;
        This->Local.ddsCaps.dwCaps = pDDSD2->ddsCaps.dwCaps;
-       This->Local.dwProcessId = GetCurrentProcessId();
+       This->Local.dwProcessId = This->owner->ExclusiveOwner.dwProcessId;
  
        /* for the double pointer below */      
        This->pLocal[0] = &This->Local; 
index 16a0f6d..756c100 100644 (file)
@@ -37,7 +37,7 @@ HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
                 
     This->Height = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , VERTRES);
     This->Width = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , HORZRES);
-    This->Bpp = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , BITSPIXEL);
+    This->Bpp = GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , BITSPIXEL);  
 
     // call software first
     if((ret = Hal_DirectDraw_Initialize (iface)) != DD_OK)
@@ -46,6 +46,10 @@ HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
     // ... then overwrite with hal
     if((ret = Hel_DirectDraw_Initialize (iface)) != DD_OK)
         return ret;
+
+       /* Hack to set right freq */
+       
+       This->DirectDrawGlobal.dwMonitorFrequency =  GetDeviceCaps((HDC)This->DirectDrawGlobal.lpExclusiveOwner->hDC , VREFRESH);    
    
     return DD_OK;
 }