=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: ddraw: Cleanup ddraw7_GetAvailableVidMem().

Alexandre Julliard julliard at winehq.org
Wed Jan 25 13:18:52 CST 2017


Module: wine
Branch: master
Commit: d7b3ef0783f66a40421544e2fe43a6dce5f0d556
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=d7b3ef0783f66a40421544e2fe43a6dce5f0d556

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Mon Jan  2 10:44:39 2017 +0100

ddraw: Cleanup ddraw7_GetAvailableVidMem().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ddraw/ddraw.c | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 3b4c628..e313a75 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -1886,7 +1886,7 @@ static HRESULT WINAPI ddraw1_GetVerticalBlankStatus(IDirectDraw *iface, BOOL *st
  * Returns the total and free video memory
  *
  * Params:
- *  Caps: Specifies the memory type asked for
+ *  caps: Specifies the memory type asked for
  *  total: Pointer to a DWORD to be filled with the total memory
  *  free: Pointer to a DWORD to be filled with the free memory
  *
@@ -1895,7 +1895,7 @@ static HRESULT WINAPI ddraw1_GetVerticalBlankStatus(IDirectDraw *iface, BOOL *st
  *  DDERR_INVALIDPARAMS if free and total are NULL
  *
  *****************************************************************************/
-static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *Caps, DWORD *total,
+static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total,
         DWORD *free)
 {
     unsigned int framebuffer_size, total_vidmem, free_vidmem;
@@ -1903,12 +1903,15 @@ static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *C
     struct wined3d_display_mode mode;
     HRESULT hr = DD_OK;
 
-    TRACE("iface %p, caps %p, total %p, free %p.\n", iface, Caps, total, free);
+    TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
+
+    if (!total && !free)
+        return DDERR_INVALIDPARAMS;
 
     if (TRACE_ON(ddraw))
     {
         TRACE("Asked for memory with description: ");
-        DDRAW_dump_DDSCAPS2(Caps);
+        DDRAW_dump_DDSCAPS2(caps);
     }
     wined3d_mutex_lock();
 
@@ -1917,12 +1920,6 @@ static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *C
      * resources, but that's not important
      */
 
-    if( (!total) && (!free) )
-    {
-        wined3d_mutex_unlock();
-        return DDERR_INVALIDPARAMS;
-    }
-
     /* Some applications (e.g. 3DMark 2000) assume that the reported amount of
      * video memory doesn't include the memory used by the default framebuffer.
      */




More information about the wine-cvs mailing list