2009-08-09 01:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/win_prt.c
% Optimized out port name from port structure. 3KB runtime
space saving.
This commit is contained in:
@@ -17,6 +17,11 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-08-09 01:09 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbwin/win_prt.c
|
||||
% Optimized out port name from port structure. 3KB runtime
|
||||
space saving.
|
||||
|
||||
2009-08-09 01:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbwin/win_tprt.prg
|
||||
* contrib/hbwin/win_prt.c
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
static struct
|
||||
{
|
||||
HANDLE hPort;
|
||||
TCHAR szName[ 11 ];
|
||||
int iFunction;
|
||||
DWORD dwError;
|
||||
DCB OldDCB;
|
||||
@@ -85,19 +84,20 @@ HB_FUNC( WIN_PORTOPEN )
|
||||
int iStopBits = hb_parni( 5 );
|
||||
|
||||
char szName[ 11 ];
|
||||
TCHAR tszName[ 11 ];
|
||||
|
||||
HANDLE hCommPort;
|
||||
COMMTIMEOUTS NewTimeouts;
|
||||
DCB NewDCB;
|
||||
|
||||
hb_snprintf( szName, sizeof( szName ), "\\\\.\\COM%d", iPort + 1 );
|
||||
HB_TCHAR_SETTO( s_PortData[ iPort ].szName, szName, strlen( szName ) );
|
||||
HB_TCHAR_SETTO( tszName, szName, strlen( szName ) );
|
||||
|
||||
s_PortData[ iPort ].hPort = INVALID_HANDLE_VALUE;
|
||||
s_PortData[ iPort ].iFunction = FCNCREATEFILE;
|
||||
s_PortData[ iPort ].dwError = 0;
|
||||
|
||||
if( ( hCommPort = CreateFile( s_PortData[ iPort ].szName,
|
||||
if( ( hCommPort = CreateFile( tszName,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0,
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user