]> git.sesse.net Git - vlc/commitdiff
Atmo: port Win32 code to UNICODE friendly APIs
authorJean-Baptiste Kempf <jb@videolan.org>
Mon, 14 Jan 2013 23:13:34 +0000 (00:13 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Mon, 14 Jan 2013 23:33:24 +0000 (00:33 +0100)
This needs testing

modules/video_filter/atmo/AtmoClassicConnection.cpp
modules/video_filter/atmo/AtmoDmxSerialConnection.cpp
modules/video_filter/atmo/AtmoMultiConnection.cpp
modules/video_filter/atmo/FnordlichtConnection.cpp
modules/video_filter/atmo/MoMoConnection.cpp
modules/video_filter/atmo/atmo.cpp

index baba76fc9fa020fdeb1974b53960013c1226de8c..eb34582ab2a02e940c813f5a186b274b6bbe6433 100644 (file)
@@ -54,7 +54,7 @@ ATMO_BOOL CAtmoClassicConnection::OpenConnection() {
 
 #if defined(WIN32)
 
-     m_hComport = CreateFile(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+     m_hComport = CreateFileA(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
      if(m_hComport == INVALID_HANDLE_VALUE) {
 //      we have a problem here can't open com port... somebody else may use it?
 //         m_dwLastWin32Error = GetLastError();
index 51156a25febe471e8bcffe59d9e47e1fa8599c22..b1bbb774752dae41c4fe5770c4af9f1822250e8a 100644 (file)
@@ -69,7 +69,7 @@ ATMO_BOOL CAtmoDmxSerialConnection::OpenConnection() {
 
 #if defined(WIN32)
 
-     m_hComport = CreateFile(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+     m_hComport = CreateFileA(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
      if(m_hComport == INVALID_HANDLE_VALUE) {
 //      we have a problem here can't open com port... somebody else may use it?
 //         m_dwLastWin32Error = GetLastError();
index 01d1552397c6f04357f7d9e6024c21efa6b9edd4..4da3bb3fe2f8b957817bc769031b90c0282dd360 100644 (file)
@@ -50,7 +50,7 @@ HANDLE CAtmoMultiConnection::OpenDevice(char *devName)
 #endif
 
 #if defined(WIN32)
-     hComport = CreateFile(devName, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+     hComport = CreateFileA(devName, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
      if(hComport == INVALID_HANDLE_VALUE) {
 #if !defined(_ATMO_VLC_PLUGIN_)
            m_dwLastWin32Error = GetLastError();
index 92d6c2db6a02042b7daf9a509f3716dd5fcf3184..8c670fcbde26d5a54435e495d555eb37693295ad 100644 (file)
@@ -73,7 +73,7 @@ ATMO_BOOL CFnordlichtConnection::OpenConnection()
 
 #if defined(WIN32)
 
-    m_hComport = CreateFile(serdevice,
+    m_hComport = CreateFileA(serdevice,
                     GENERIC_WRITE, 0, NULL,
                     OPEN_EXISTING, 0, NULL);
     if ( m_hComport == INVALID_HANDLE_VALUE )
index 5cace6de2e0d0a0c3fcdfcfd1dfc19cf07a6d588..4bb7199b30d11149d48db6781cf80bbd413af487 100644 (file)
@@ -54,7 +54,7 @@ ATMO_BOOL CMoMoConnection::OpenConnection() {
 
 #if defined(WIN32)
 
-     m_hComport = CreateFile(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+     m_hComport = CreateFileA(serdevice, GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
      if(m_hComport == INVALID_HANDLE_VALUE) {
 //      we have a problem here can't open com port... somebody else may use it?
 //         m_dwLastWin32Error = GetLastError();
index 78f912944be8e920824e3149bffae036404d4e56..e430796ca6c0f3bfa16f01e87e7aa6dc2d3a0cac 100644 (file)
@@ -44,6 +44,7 @@
 #include <vlc_playlist.h>
 #include <vlc_filter.h>
 #include <vlc_atomic.h>
+#include <vlc_charset.h>
 
 #include "filter_picture.h"
 
@@ -1847,8 +1848,8 @@ static void Atmo_SetupParameters(filter_t *p_filter)
           COM Server for AtmoLight not running ?
           if the exe path is configured try to start the "userspace" driver
         */
-        char *psz_path = var_CreateGetStringCommand( p_filter,
-                                               CFG_PREFIX "atmowinexe" );
+        LPTSTR psz_path = ToT(var_CreateGetStringCommand( p_filter,
+                                               CFG_PREFIX "atmowinexe" ));
         if(psz_path != NULL)
         {
             STARTUPINFO startupinfo;
@@ -1858,7 +1859,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
             if(CreateProcess(psz_path, NULL, NULL, NULL,
                 FALSE, 0, NULL, NULL, &startupinfo, &pinfo) == TRUE)
             {
-                msg_Dbg(p_filter,"launched AtmoWin from %s",psz_path);
+                msg_Dbg(p_filter,"launched AtmoWin from %s", FromT(psz_path));
                 WaitForInputIdle(pinfo.hProcess, 5000);
                 /*
                   retry to initialize the library COM ... functionality
@@ -1866,7 +1867,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
                 */
                 i = AtmoInitialize(p_filter, false);
             } else {
-                msg_Err(p_filter,"failed to launch AtmoWin from %s", psz_path);
+                msg_Err(p_filter,"failed to launch AtmoWin from %s", FromT(psz_path));
             }
             free(psz_path);
         }