function  Int13HasChangeLine(Drive: Byte): Boolean; 
{ Returnes true if drive is a floppy disk with change-line support.  } 

function  Int13DiskHasChanged(Drive: Byte): Boolean; 
{ Returnes true if the diskette in a floppy drive has been changed  since the last time the drive was accessed, or if change-line is not supported by the drive. Because this function only returns true if the diskette has changed since the last time the drive was accessed, it is important not to access the drive in any way before calling this function. Even chech to see if change-line is supported (HasChangeLine function) may clear the changed-flag. } 


function Int13HasChangeLine; 
{ int 13h, func 15h                                 } 
{ in  AH = 15h                                      } 
{     DL = drive (bit 7 set for hard disk)          } 
{ out CF set on error                               } 
{     AH = status                                   } 
{ out CF clear if successful                        } 
{     AH = 00h no such drive                        } 
{          01h floppy without change-line support   } 
{          02h floppy with change-line support      } 
{          03h hard disk                            } 
var 
 Registers: TDIOC_Registers; 
begin 
 VWIN32Error := ERROR_NON; 
 Result := false; 
 if Drive > 0 then Dec(Drive); 
 with Registers do begin 
   EAX := $1500; 
   EDX := Drive; 
   Flags := $00000000; 
   if VWIN32DIOC(VWIN32_DIOC_DOS_INT13,@Registers) then begin 
     if (Flags and FLAG_CARRY) = 0 then 
       Result := ((AX and $FF00) shr 8) = $02 
     else VWIN32Error := $10000 or ((AX and $FF00) shr 8); 
   end; 
 end; 
end; 

function Int13DiskHasChanged; 
{ int 13h, func 16h                                 } 
{ in  AH = 16h                                      } 
{     DL = drive (bit 7 set for hard disk)          } 
{ out CF set if change line active                  } 
{     AH = 06h change line active or not supported  } 
{          80h drive not ready or not present       } 
{ out CF clear if chage line inactive               } 
{     AH = 00h no drive change                      } 
var 
 Registers: TDIOC_Registers; 
begin 
 VWIN32Error := ERROR_NON; 
 Result := true; 
 if Drive > 0 then Dec(Drive); 
 with Registers do begin 
   EAX := $1600; 
   EDX := Drive; 
   Flags := $00000000; 
   if VWIN32DIOC(VWIN32_DIOC_DOS_INT13,@Registers) then begin 
     if (Flags and FLAG_CARRY) = 0 then 
       Result := ((AX and $FF00) shr 8) <> $00 
     else VWIN32Error := $10000 or ((AX and $FF00) shr 8); 
   end; 
 end; 
end; 