Subversion Repositories Programming Utils

Compare Revisions

Ignore whitespace Rev 74 → Rev 75

/branches/JavaSerial/0.3/NativeCode/SerialPortImpl.c
427,7 → 427,7
#ifdef _WIN32
{
//GOD DAMN IT WINDOWS http://support.microsoft.com/kb/115831
char* special_port = malloc( strlen( port_to_open + 5 ) );
char* special_port = malloc( strlen( port_to_open ) + 5 );
memcpy( special_port, "\\\\.\\", 4 );
memcpy( special_port + 4, port_to_open, strlen( port_to_open ) + 1 );
new_port->port = CreateFile( special_port, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0 );
590,7 → 590,7
//Now, let's get to the actual opening of our port
#ifdef _WIN32
{
char* special_port = malloc( strlen( port_to_open + 5 ) );
char* special_port = malloc( strlen( port_to_open ) + 5 );
memcpy( special_port, "\\\\.\\", 4 );
memcpy( special_port + 4, port_to_open, strlen( port_to_open ) + 1 );
new_port->port = CreateFile( special_port, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0 );