msvfw32: Trace only what matters in MCIWNDM_GETDEVICE

Bruno Jesus 00cpxxx at gmail.com
Wed Sep 9 11:48:05 CDT 2015


Instead of:
trace:mci:MCIWndProc MCIWNDM_GETDEVICEW:
L"MPEGVIDEO\0000\0001\0000\00c2\0000R\0000\033e\0000\0000\0000\00bf\0000<\0000\0341\0000\021c\0000\3ef8\7ed6\0000\16ca\a7fc\0000\c858{\a788\001f\140a?\c71c{\c
   748{\3ef8\7ed6\c950{\a7fc\0000\c718{\1736\7ec8`\0001\fff4\ffff\0004\0000\0001\0000\c950{\a7fc\0000\c748{\feb1\7ece`\0001\fff4\ffff\c748{\8b77\7ed1"...

Get:
trace:mci:MCIWndProc MCIWNDM_GETDEVICEW: L"MPEGVIDEO"
-------------- next part --------------
diff --git a/dlls/msvfw32/mciwnd.c b/dlls/msvfw32/mciwnd.c
index e561b14..fc49973 100644
--- a/dlls/msvfw32/mciwnd.c
+++ b/dlls/msvfw32/mciwnd.c
@@ -1070,27 +1070,33 @@ end_of_mci_open:
 
     case MCIWNDM_GETDEVICEA:
         {
+            int len = 0;
+            char *str = (char *)lParam;
             MCI_SYSINFO_PARMSA mci_sysinfo;
 
-            mci_sysinfo.lpstrReturn = (LPSTR)lParam;
+            mci_sysinfo.lpstrReturn = str;
             mci_sysinfo.dwRetSize = wParam;
             mwi->lasterror = mciSendCommandA(mwi->mci, MCI_SYSINFO,
                                              MCI_SYSINFO_INSTALLNAME,
                                              (DWORD_PTR)&mci_sysinfo);
-            TRACE("MCIWNDM_GETDEVICEA: %s\n", debugstr_an((LPSTR)lParam, wParam));
+            while(len < wParam && str[len]) len++;
+            TRACE("MCIWNDM_GETDEVICEA: %s\n", debugstr_an(str, len));
             return 0;
         }
 
     case MCIWNDM_GETDEVICEW:
         {
+            int len = 0;
+            WCHAR *str = (WCHAR *)lParam;
             MCI_SYSINFO_PARMSW mci_sysinfo;
 
-            mci_sysinfo.lpstrReturn = (LPWSTR)lParam;
+            mci_sysinfo.lpstrReturn = str;
             mci_sysinfo.dwRetSize = wParam;
             mwi->lasterror = mciSendCommandW(mwi->mci, MCI_SYSINFO,
                                              MCI_SYSINFO_INSTALLNAME,
                                              (DWORD_PTR)&mci_sysinfo);
-            TRACE("MCIWNDM_GETDEVICEW: %s\n", debugstr_wn((LPWSTR)lParam, wParam));
+            while(len < wParam && str[len]) len++;
+            TRACE("MCIWNDM_GETDEVICEW: %s\n", debugstr_wn(str, len));
             return 0;
         }
 


More information about the wine-patches mailing list