@@ -120,10 +120,10 rs232port_t rs232open(char* psPortName) | |||||
120 | rs232port_t fd; |
|
120 | rs232port_t fd; | |
121 | /* Char to Wchar conversion*/ |
|
121 | /* Char to Wchar conversion*/ | |
122 | int neededSize = MultiByteToWideChar(CP_ACP, 0, psPortName, -1, 0, 0); |
|
122 | int neededSize = MultiByteToWideChar(CP_ACP, 0, psPortName, -1, 0, 0); | |
123 |
wchar_t* wcstr = |
|
123 | wchar_t* wcstr = (wchar_t*)malloc(sizeof(wchar_t)*neededSize); | |
124 |
MultiByteToWideChar(CP_ACP, 0, |
|
124 | MultiByteToWideChar(CP_ACP, 0, psPortName, -1, wcstr, neededSize); | |
125 | fd = (rs232port_t)CreateFile(wcstr,GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); |
|
125 | fd = (rs232port_t)CreateFile(wcstr,GENERIC_READ | GENERIC_WRITE,0,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,0); | |
126 |
|
|
126 | free(wcstr); | |
127 | #ifdef RS232_debug |
|
127 | #ifdef RS232_debug | |
128 | if(fd==(rs232port_t)INVALID_HANDLE_VALUE) |
|
128 | if(fd==(rs232port_t)INVALID_HANDLE_VALUE) | |
129 | { |
|
129 | { |
General Comments 0
You need to be logged in to leave comments.
Login now