Place it just before the final return:
I would suggest to write a Harbour wrapper for it and there you can issue the warning or simply generate a Harbour error:
#include <windows.h>
...
if( ! bResult )
MessageBox( 0, "error", "can't ejec't the volume", 0 );
return bResult;HB_FUNC( EJECTVOLUME )
{
BOOL bResult = EjectVolume( ... );
if( ! bResult )
MessageBox( ... );
hb_retl( bResult );
}