[PATCH 5/5] mciqtz32: Fix mciWhere

Maarten Lankhorst m.b.lankhorst at gmail.com
Fri May 21 15:14:56 CDT 2010


---
 dlls/mciqtz32/mciqtz.c |   29 ++++++++---------------------
 1 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c
index af2e5dd..314ac82 100644
--- a/dlls/mciqtz32/mciqtz.c
+++ b/dlls/mciqtz32/mciqtz.c
@@ -726,23 +726,14 @@ static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lp
     if (dwFlags & MCI_DGV_WHERE_SOURCE) {
         if (dwFlags & MCI_DGV_WHERE_MAX)
             FIXME("MCI_DGV_WHERE_SOURCE_MAX stub %s\n", wine_dbgstr_rect(&rc));
-        IBasicVideo_get_SourceLeft(pBasicVideo, &rc.left);
-        IBasicVideo_get_SourceTop(pBasicVideo, &rc.top);
-        IBasicVideo_get_SourceWidth(pBasicVideo, &rc.right);
-        IBasicVideo_get_SourceHeight(pBasicVideo, &rc.bottom);
-        /* Undo conversion done below */
-        rc.right += rc.left;
-        rc.bottom += rc.top;
         TRACE("MCI_DGV_WHERE_SOURCE %s\n", wine_dbgstr_rect(&rc));
+        IBasicVideo_GetSourcePosition(pBasicVideo, &rc.left, &rc.top, &rc.right, &rc.bottom);
     }
     if (dwFlags & MCI_DGV_WHERE_DESTINATION) {
-        if (dwFlags & MCI_DGV_WHERE_MAX) {
-            GetClientRect(hWnd, &rc);
-            TRACE("MCI_DGV_WHERE_DESTINATION_MAX %s\n", wine_dbgstr_rect(&rc));
-        } else {
-            FIXME("MCI_DGV_WHERE_DESTINATION not supported yet\n");
-            goto out;
-        }
+        if (dwFlags & MCI_DGV_WHERE_MAX)
+            FIXME("MCI_DGV_WHERE_DESTINATION_MAX stub %s\n", wine_dbgstr_rect(&rc));
+        TRACE("MCI_DGV_WHERE_DESTINATION %s\n", wine_dbgstr_rect(&rc));
+        IBasicVideo_GetDestinationPosition(pBasicVideo, &rc.left, &rc.top, &rc.right, &rc.bottom);
     }
     if (dwFlags & MCI_DGV_WHERE_FRAME) {
         if (dwFlags & MCI_DGV_WHERE_MAX)
@@ -766,18 +757,14 @@ static DWORD MCIQTZ_mciWhere(UINT wDevID, DWORD dwFlags, LPMCI_DGV_RECT_PARMS lp
             GetWindowRect(hWnd, &rc);
             TRACE("MCI_DGV_WHERE_WINDOW %s\n", wine_dbgstr_rect(&rc));
         }
+        rc.right -= rc.left;
+        rc.bottom -= rc.top;
     }
     ret = 0;
-
 out:
-    /* In MCI, RECT structure is used differently: rc.right = width & rc.bottom = height
-     * So convert the normal RECT into a MCI RECT before returning */
+    lpParms->rc = rc;
     IVideoWindow_Release(pVideoWindow);
     IBasicVideo_Release(pBasicVideo);
-    lpParms->rc.left = rc.left;
-    lpParms->rc.top = rc.top;
-    lpParms->rc.right = rc.right - rc.left;
-    lpParms->rc.bottom = rc.bottom - rc.top;
 
     return ret;
 }
-- 
1.7.0.4




More information about the wine-patches mailing list