Commit 59f746f6 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Atmo: port Win32 code to UNICODE friendly APIs

This needs testing
parent deb6cf93
...@@ -54,7 +54,7 @@ ATMO_BOOL CAtmoClassicConnection::OpenConnection() { ...@@ -54,7 +54,7 @@ ATMO_BOOL CAtmoClassicConnection::OpenConnection() {
#if defined(WIN32) #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) { if(m_hComport == INVALID_HANDLE_VALUE) {
// we have a problem here can't open com port... somebody else may use it? // we have a problem here can't open com port... somebody else may use it?
// m_dwLastWin32Error = GetLastError(); // m_dwLastWin32Error = GetLastError();
......
...@@ -69,7 +69,7 @@ ATMO_BOOL CAtmoDmxSerialConnection::OpenConnection() { ...@@ -69,7 +69,7 @@ ATMO_BOOL CAtmoDmxSerialConnection::OpenConnection() {
#if defined(WIN32) #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) { if(m_hComport == INVALID_HANDLE_VALUE) {
// we have a problem here can't open com port... somebody else may use it? // we have a problem here can't open com port... somebody else may use it?
// m_dwLastWin32Error = GetLastError(); // m_dwLastWin32Error = GetLastError();
......
...@@ -50,7 +50,7 @@ HANDLE CAtmoMultiConnection::OpenDevice(char *devName) ...@@ -50,7 +50,7 @@ HANDLE CAtmoMultiConnection::OpenDevice(char *devName)
#endif #endif
#if defined(WIN32) #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(hComport == INVALID_HANDLE_VALUE) {
#if !defined(_ATMO_VLC_PLUGIN_) #if !defined(_ATMO_VLC_PLUGIN_)
m_dwLastWin32Error = GetLastError(); m_dwLastWin32Error = GetLastError();
......
...@@ -73,7 +73,7 @@ ATMO_BOOL CFnordlichtConnection::OpenConnection() ...@@ -73,7 +73,7 @@ ATMO_BOOL CFnordlichtConnection::OpenConnection()
#if defined(WIN32) #if defined(WIN32)
m_hComport = CreateFile(serdevice, m_hComport = CreateFileA(serdevice,
GENERIC_WRITE, 0, NULL, GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, 0, NULL); OPEN_EXISTING, 0, NULL);
if ( m_hComport == INVALID_HANDLE_VALUE ) if ( m_hComport == INVALID_HANDLE_VALUE )
......
...@@ -54,7 +54,7 @@ ATMO_BOOL CMoMoConnection::OpenConnection() { ...@@ -54,7 +54,7 @@ ATMO_BOOL CMoMoConnection::OpenConnection() {
#if defined(WIN32) #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) { if(m_hComport == INVALID_HANDLE_VALUE) {
// we have a problem here can't open com port... somebody else may use it? // we have a problem here can't open com port... somebody else may use it?
// m_dwLastWin32Error = GetLastError(); // m_dwLastWin32Error = GetLastError();
......
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include <vlc_playlist.h> #include <vlc_playlist.h>
#include <vlc_filter.h> #include <vlc_filter.h>
#include <vlc_atomic.h> #include <vlc_atomic.h>
#include <vlc_charset.h>
#include "filter_picture.h" #include "filter_picture.h"
...@@ -1847,8 +1848,8 @@ static void Atmo_SetupParameters(filter_t *p_filter) ...@@ -1847,8 +1848,8 @@ static void Atmo_SetupParameters(filter_t *p_filter)
COM Server for AtmoLight not running ? COM Server for AtmoLight not running ?
if the exe path is configured try to start the "userspace" driver if the exe path is configured try to start the "userspace" driver
*/ */
char *psz_path = var_CreateGetStringCommand( p_filter, LPTSTR psz_path = ToT(var_CreateGetStringCommand( p_filter,
CFG_PREFIX "atmowinexe" ); CFG_PREFIX "atmowinexe" ));
if(psz_path != NULL) if(psz_path != NULL)
{ {
STARTUPINFO startupinfo; STARTUPINFO startupinfo;
...@@ -1858,7 +1859,7 @@ static void Atmo_SetupParameters(filter_t *p_filter) ...@@ -1858,7 +1859,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
if(CreateProcess(psz_path, NULL, NULL, NULL, if(CreateProcess(psz_path, NULL, NULL, NULL,
FALSE, 0, NULL, NULL, &startupinfo, &pinfo) == TRUE) 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); WaitForInputIdle(pinfo.hProcess, 5000);
/* /*
retry to initialize the library COM ... functionality retry to initialize the library COM ... functionality
...@@ -1866,7 +1867,7 @@ static void Atmo_SetupParameters(filter_t *p_filter) ...@@ -1866,7 +1867,7 @@ static void Atmo_SetupParameters(filter_t *p_filter)
*/ */
i = AtmoInitialize(p_filter, false); i = AtmoInitialize(p_filter, false);
} else { } 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); free(psz_path);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment