Path: utzoo!attcan!uunet!samsung!emory!mephisto!psuvax1!psuvm!cunyvm!mtus5!tomiii From: TOMIII@MTUS5.BITNET (Thomas Dwyer III) Newsgroups: comp.os.msdos.programmer Subject: Re: Identifying the max. number of drives. Message-ID: <90213.085250TOMIII@MTUS5.BITNET> Date: 1 Aug 90 13:52:50 GMT References: <3102@murtoa.cs.mu.oz.au> Organization: Computing Technology Services, Michigan Technological Univ. Lines: 24 You can get gobs of neat information from INT 21, AH=52. To find the number of block devices (drives) in a system, look at offset 20h from the pointer returned by ES:BX. Example: #include main() { union REGS regs; struct SREGS sregs; unsigned char far *ptr; regs.h.ah = 0x52; intdosx(®s, ®s, &sregs); ptr = (unsigned char far *) (((unsigned long) sregs.es<<16)+regs.x.bx); printf("Number of block devices: %d\n", (int) *(ptr+0x20)); printf("Value of LASTDRIVE: %d\n", (int) *(ptr+0x21)); return(0); }