Tested with xBuilder beta 11 on Windows XP Pro SP3 and Vista.
In a console test program I've started an executable asynchronously using
nHand := hb_openprocess( "C:\test\myprocess.exe", .F. )
The executable works as it should, but I'm not able to find out, when it
terminates, because
hb_processvalue( nHand, .F. )
does not return any value in my environment.
I suppose this is a bug in /rtl/filesys.c and it happens because the
iRetStatus variable is not initialized.
Microsoft's documentation states that when the _cwait function is called
with the first argument being NULL, the return code of the process is not
stored in it.
Below is the relevant code sequence.
Ella
............
int hb_fsProcessValue( HB_FHANDLE fhProc, BOOL bWait )
{
HB_THREAD_STUB
int iRetStatus;
.............
#elif defined( HB_OS_WIN ) && ! defined( HB_WIN32_IO )
{
int iPid;
HB_SYMBOL_UNUSED( bWait );
hb_vmUnlock();
#ifdef __BORLANDC__
iPid = cwait( &iRetStatus, (int) fhProc, 0 );
#else
iPid = _cwait( &iRetStatus, (int) fhProc, 0 );
#endif
hb_vmLock();
if ( iPid != (int) fhProc )
{
iRetStatus = -1;
}
}
#else
HB_SYMBOL_UNUSED( fhProc );
HB_SYMBOL_UNUSED( bWait );
hb_fsSetError( (USHORT) FS_ERROR );
iRetStatus = -1;
#endif
return iRetStatus;
}
......................
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
xHarbour-developers mailing list
xHarbour-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xharbour-developers