[MSVFW32] Sync with Wine Staging 3.3. CORE-14434
[reactos.git] / dll / win32 / msvfw32 / mciwnd.c
index b221e8a..fc49973 100644 (file)
  * Add support for MCIWNDF_RECORD.
  */
 
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
-
 #include <stdarg.h>
 
-#include <windef.h>
-#include <winbase.h>
-//#include "winnls.h"
-#include <wingdi.h>
-//#include "winuser.h"
-#include <winternl.h>
-#include <vfw.h>
-#include <digitalv.h>
-#include <commctrl.h>
-#include <wine/unicode.h>
-#include <wine/debug.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "wingdi.h"
+#include "winuser.h"
+#include "winternl.h"
+#include "vfw.h"
+#include "digitalv.h"
+#include "commctrl.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(mci);
 
@@ -90,7 +86,7 @@ BOOL VFWAPIV MCIWndRegisterClass(void)
     wc.cbWndExtra = sizeof(MCIWndInfo*);
     wc.hInstance = MSVFW32_hModule;
     wc.hIcon = 0;
-    wc.hCursor = LoadCursorW(0, MAKEINTRESOURCEW(IDC_ARROW));
+    wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
     wc.lpszMenuName = NULL;
     wc.lpszClassName = mciWndClassW;
@@ -1074,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;
         }