Hi, please, can anybody help?
This function occasional causes GPF
and occurs sporadic only on some xp/vista machines
>
> >> Application Internal Error ...
> >> Terminated at: ....
> >> Info: Harbour MiniGUI 1.7 Extended Edition (Build 74) - 2009.09.30
> >> Unrecoverable error 9023: hb_xgrab requested to allocate zero bytes
> >> Called from SOCKETRECEIVE(0)
regards, Mitja
HB_FUNC( SOCKETRECEIVE )
{
SOCKET m_hSocket = INVALID_SOCKET;
if( bInit && hb_parclen(1) == sizeof(m_hSocket) && ISCHAR(2) && ISBYREF(2) )
{
/* Copy m_hSocket from caller method */
strncpy( ( char * ) &m_hSocket, hb_parc(1), sizeof(m_hSocket) );
if( m_hSocket != INVALID_SOCKET )
{
int nLen = hb_parclen( 2 );
if ( nLen > 0 )
{
char *pRead = ( char * ) hb_xgrab( nLen + 1 );
if( ISNUM(3) )
{
int recvtimeout = hb_parni( 3 );
if( recvtimeout != -1 )
{
setsockopt( m_hSocket, SOL_SOCKET, SO_RCVTIMEO, ( char * )
&recvtimeout, sizeof(recvtimeout) );
}
}
nLen = recv( m_hSocket, pRead, nLen, 0 );
hb_storclen( pRead, nLen, 2 );
hb_xfree( pRead );
hb_retni( nLen );
}
else
{
hb_retni( 0 );
}
}
else
{
hb_retni( 0 );
}
}
else
{
hb_retni( 0 );
}
}
_______________________________________________
Harbour mailing list
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour