[comp.sys.novell] Novell mapped drives

stevew@tureen.Berkeley.EDU (Stephen Williams) (03/19/91)

I've written a DOS shell/file manager in C that needs to search all of a
computer's hard drives for common applications to install.  I've been using
the Turbo C 2.0 setdisk() function to find out how many drives are in use,
but this only works in a standalone environment.

Recently, I've tried using my program in a Novell network environment,
which causes trouble because of Novell's mapped drives.  My program sees
multiple copies of many applications because of mapped drives.  For example,
WordPerfect is actually on drive D:\WP, but is also mapped to W:.  Thus, my
program finds two copies of WordPerfect when looking for programs to install.

How then, can I differentiate between actual physical drives and Novell's
mapped drives?  I'd like to be able to do this from Turbo C, of course.  Will
I need some kind of Novell library, or can I figure it out some other way?

__________________________________________________________________________
Stephen Williams				stevew@tureen.Berkeley.EDU
						uunet!ucbvax!tureen!stevew
__________________________________________________________________________

valley@uchicago (Doug Dougherty) (03/19/91)

stevew@tureen.Berkeley.EDU (Stephen Williams) writes:

>Recently, I've tried using my program in a Novell network environment,
>which causes trouble because of Novell's mapped drives.  My program sees
>multiple copies of many applications because of mapped drives.  For example,
>WordPerfect is actually on drive D:\WP, but is also mapped to W:.  Thus, my
>program finds two copies of WordPerfect when looking for programs to install.

>How then, can I differentiate between actual physical drives and Novell's
>mapped drives?  I'd like to be able to do this from Turbo C, of course.  Will

Use DOS function 60h (Convert Filename to Cannonical Form) and look at
the string returned.  If it starts with \\, it is a network drive.
Admittedly, this method is Novell specific; I have no experience with
non-Novell-like networks, and hence don't know for sure what they would
return.  You might also say that if it doesn't start with "X:", it can't
be a physical drive...

E.g.,	(This is A86 syntax)
(.RADIX 16)
	mov ah,60
	lea si,drive		; (Assume CS = DS = ES)
	lea di,outbuff
	int 21
	cmp word [di],"\\"
	jz net
	...
drive	db "X:",0
outbuff	db 50 dup 0		; 50 hex = 80 dec = MAXPATH

jims@svcs1.UUCP (Jim Serwer) (03/23/91)

In article <12106@pasteur.Berkeley.EDU> stevew@tureen.Berkeley.EDU (Stephen Williams) writes:
    (stuff deleted)
>How then, can I differentiate between actual physical drives and Novell's
>mapped drives?  I'd like to be able to do this from Turbo C, of course.  Will
>I need some kind of Novell library, or can I figure it out some other way?
>__________________________________________________________________________
>Stephen Williams				stevew@tureen.Berkeley.EDU
>						uunet!ucbvax!tureen!stevew

The Novell library you need is called NetWare C Interface for DOS (CID).
It works with Turbo C.  Unfortunately the area of Directory Services
has bugs.  The book, "NetWare Programmer's Guide" by Ralph Davis
gives a fix for one of the more serious bugs in this area.

CID has many functions calls including GetDriveInformation(),
GetSearchDriveVector(), and IsSearchDrive().  But you may have to
debug some of Novell's code.

Jim Serwer
408-296-4763
jims%svcs1@mips.com  or  ..!uunet!mips!svcs1!jims
CIS 72607,3144