Disk serial no - GPF under Windows 
Author Message
 Disk serial no - GPF under Windows

Quote:

>Compile and run under DOS with TurboPascal for DOS, the below routine works,
>but when compile and run under Windows gives GPF.  Some interrupt $21 cannot
>be used under Windows, it this correct?
 ...
>  with Reg do begin
>    AH := $44;
>    AL := $0D;
>    BL := DriveNo; { 0 = A, 1 = B, etc. }
>    CH := $08; { Disk drive category }
>    CL := $66; { Get media ID }
>    Intr($21,Reg);

The problem is that Intr() doesn't work properly under Windows,
because it doesn't issue a true INT $21.  You should program it in an
asm...end block, or use msdos().

Duncan Murdoch



Wed, 18 Jun 1902 08:00:00 GMT  
 Disk serial no - GPF under Windows
Compile and run under DOS with TurboPascal for DOS, the below routine works,
but when compile and run under Windows gives GPF.  Some interrupt $21 cannot
be used under Windows, it this correct?  Even under DOS, the compiled program
can only run by not being in the debugging session which means we cannot step
through the routine line by line in the IDE.  Anyone experience such thing?

Is there a way to get the disk serial no. under Windows?

function GetDiskSerialNo(DriveNo:byte):LongInt;
var  Reg :Registers; Serial :^LongInt;
begin
  with Reg do begin
    AH := $44;
    AL := $0D;
    BL := DriveNo; { 0 = A, 1 = B, etc. }
    CH := $08; { Disk drive category }
    CL := $66; { Get media ID }
    Intr($21,Reg);
    Serial := ptr(DS,DX+02);
  end;
end;

Compile and run under DOS with TurboPascal for DOS, the below routine works,
but when compile and run under Windows gives GPF.  Some interrupt $21 cannot
be used under Windows, it this correct?  Even under DOS, the compiled program
can only run by not being in the debugging session which means we cannot step
through the routine line by line in the IDE.  Anyone experience such thing?

Is there a way to get the disk serial no. under Windows?

function GetDiskSerialNo(DriveNo:byte):LongInt;
var  Reg :Registers; Serial :^LongInt;
begin
  with Reg do begin
    AH := $44;
    AL := $0D;
    BL := DriveNo; { 0 = A, 1 = B, etc. }
    CH := $08; { Disk drive category }
    CL := $66; { Get media ID }
    Intr($21,Reg);
    Serial := ptr(DS,DX+02);
  end;
end;



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. gpf with disk size > 1024 cylinders

2. HARD DISK - MODEL NO / SERIAL NO / FIRMWARE

3. Read serial # on floppy disk

4. Have all fixed disks serial numbers ?

5. Disk Serial Number

6. Disk serials

7. question: How do I change disk serial #

8. ***HELP*** Disk Serial Number

9. How to determine a disk serial number?

10. Reading disk serial numbe

11. Hard disk serial no.

12. BDECFG causes a GPF (Windows 95)

 

 
Powered by phpBB® Forum Software