
#define		CHAR	char

#define		INITdata
#include	"writmode.dat"
#include	"dpb/dph.dat"

#define		BELL	0x07


WM_Command( command, drive, dpb, fail_flag)
  int command;
  CHAR drive;
  struct DPB	*dpb;
  int fail_flag;	/* true = zabort if fail in writemode call. */
{
    WMparams.wmsend.wmcmd = WMCMD;
    WMparams.wmsend.WMcmd = command;
    WMparams.wmsend.WMvol = dpb->hd_volume;
    WMparams.wmsend.WMunit = dpb->unit;
    WMparams.wmsend.WMvalue = userno();
    WMparams.wmsend.WMuserno = userno();

    WMparams.logdrive = drive;


/* Do the net request	*/
    if ( writemode( &WMparams ) == 1 )
    {		/* try twice. */
	if ( writemode( &WMparams ) == 1 )
	{
	    if ( fail_flag )
	    {
		printf("%c\nNet Error.\n", BELL);
		zabort();
	    }
	}
    }

}/* WM_Command */

/*---------------------------------------------------------------------------*/
