Function GetHDSer(Var Ser:String;HD:String):boolean;
var SerialNum : pdword;
a, b : dword;
Buffer : array [0..255] of char;
begin
New(SerialNum);
Result:=GetVolumeInformation(PCHAR(HD),Buffer, SizeOf(Buffer), SerialNum, a, b, nil, 0);
if Result then Ser:=Format('%X',[SerialNum^]);
FreeMem(SerialNum);
end;