You determine the current diskchange number of a disk by passing an
ioexttd to the device with td_changenum set in io_command. for quick i/o,
you must set io_Flags to IOF_QUICK.
DiskIO->iotd_Req.io_Flags = IOF_QUICK;
DiskIO->iotd_Req.io_Command = TD_CHANGENUM;
BeginIO((struct IORequest *)DiskIO);
td_changenum returns the current value of the diskchange counter (as used
by the enhanced commands) in io_Actual. The disk change counter is
incremented each time the disk is inserted or removed.
ULONG change_count;
DiskIO->iotd_Req.io_Flags = IOF_QUICK;
DiskIO->iotd_Req.io_Command = TD_CHANGENUM;
BeginIO((struct IORequest *)DiskIO);
/* store current diskchange value */
change_count = DiskIO->iotd_Req.io_Actual;
DiskIO->iotd_Req.io_Length = 1; /* Turn on the drive motor */
DiskIO->iotd_Count = change_count;
DiskIO->iotd_Req.io_Command = ETD_MOTOR;
DoIO((struct IORequest *)DiskIO);