Seg,Off,Msdos ??

Below is code of a function that returns serial number of a floppy

disk. But it is not working in delphi. I think the problem is in assigning

the segment and offset values of a "mid" - result structure to DOS registers

Could somebody please tell me how to handle that staff in Windows ?

Piotr Wypych

w...@ikp.atm.com.pl

uses Windos;

function vlabel(disk:Integer):Longint;

var

 mid:record

  level:Integer;

  serial:Longint;

  lbel: array [0..10] of char;

  typ:array [0..7] of char;

 end;

 r:TRegisters;

begin

 vlabel:=0;

 r.bx:=disk;

 r.cx:=$0866;

 r.ds:=SEG(mid);

 r.dx:=OFS(mid); {----Problem ??}

 r.es:=r.ds;

 r.ax:=$440d;

 msdos(r);

 if (r.flags and $0001)<>0 then vlabel:=0

 else vlabel:=mid.serial;

end;