Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!news From: tcs@mailer.jhuapl.edu (Carl Schelin) Newsgroups: comp.os.msdos.programmer Subject: Re: How to detect network drive? Message-ID: <1991Apr9.111047.24054@aplcen.apl.jhu.edu> Date: 9 Apr 91 11:10:47 GMT References: <1991Apr6.231902.5436@newross.Princeton.EDU> Sender: news@aplcen.apl.jhu.edu (USENET News System) Organization: Johns Hopkins University - Applied Physics Lab Lines: 40 In article <1991Apr6.231902.5436@newross.Princeton.EDU>, tr@samadams.princeton.edu (Tom Reingold) says: > > >I know how to read the boot sector of a disk. If the first byte is >0xf8, it's supposed to be a hard disk. But my networked disks (AT&T >Stargroup) have the same ID. How do I detect if a disk is a network >disk? >-- This was information taken from a few previous messages. Someone posted a routine from a program (called getpath I think) and someone else mentioned int 44. Since I couldn't get the int86 function to work nor could I get the getpath function to work, I combined them and called int 44 from the GetDiskInfo routine. The #define'd statements are just the codes for ?, n, , and s. This routine is from Free v1.3 which is coming on c.b.i.p in the next week or two. int GetDiskInfo(int drive) { union REGS r; struct SREGS s; int remote = 0; r.x.ax = 0x4409; r.x.bx = 0x0000 + drive; /* assuming near pointers: */ segread(&s); s.es = s.ds; intdosx(&r,&r,&s); remote = UNKNOWN; if (r.x.dx == 0x1756) remote = NETWORK; if (r.x.dx == 0x0840) remote = LOCAL; if (r.x.dx == 0x8840) remote = SUBST; return remote; } Carl Schelin tcs@mailer.jhuapl.edu