🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.networks
Article #11

Re: NetBIOS Path Strings and Drive Letter Assignments

#11
From: Michael Washington
Date: Mon, 22 Jan 1996 08:26
51 lines
2646 bytes
> 
> NetBIOS Path Strings and Drive Letter Assignments
> 
> patrick@xiris.com (Patrick Whittle)
> Fri, 19 Jan 1996 23:06:52 GMT
> Xiris Incorporated
> Newsgroups:
> 
comp.os.ms-windows.programmer.networks,comp.os.ms-windows.programmer.mis
c,comp.lang.c,comp.lang.basic.visual.database
> 
> Hi:
> I am developing an application that accesses a share on our server 
> using a NetBIOS path string (i.e. \\SHARE\NAME\<path>\file.ext). 
> I want to use this path string because the share name will not change,
> whereas the drive letter assignment a given user uses could at any 
> time change. However, there is still a situation where I could make 
> use of an API call that returns a drive letter being used.
> Do you know of an API call that returns network drive letter 
> assignments?  Is there a way to find out what drive is connected to 
> \\SHARE\NAME for example, using the API interface??
> Please respond to patrick@xiris.com
> Thanks ......... PW
> ///////////////////////////////////////////
> Patrick Whittle        Tel: (905) 681-8107
>   Xiris Inc.           FAX: (905) 681-9844
> E-mail:                patrick@xiris.com
> Web Page:              http://www.hookup.net/~xiris/

If your network supports UNC you don't need to worry about finding the 
next available drive letter. If it does not try using the following 
function from the Microsoft knowledge base it uses the Win API 
GETDRIVETYPE.

Declare Function GetDriveType Lib "kernel" (ByVal nDrive As Integer) As 
Integer

Function Freedrv()
 Dim DriveNum As Integer, FirstFreeDrive As String
 Dim FirstDrive As Integer
 DriveNum = -1
 Do 
   DriveNum = DriveNum +1  'start at drive zero
   FirstDrive% = GetDriveType(DriveNum)
   'GetDriveType returns zero if it cannot determine drive
   'type or returns 1 if the specified drive does not exists
 Loop Until FirstDrive% = 0
 'DriveNum of 0 means Drive A, 1=B, 2=C, 3=D , and so on
 FirstFreeDrive = Chr$(DriveNum+65) & ":"
 FreeDrv = FristFreeDrive
End Function
Technical Details
Message-ID: <DLLCyB.3MC@bcstec.ca.boeing.com>
Path: arc1-ca.pugleaf.net!in1.uu.net!bcstec!ccmail
References: <4dp4l2$bcf@noc.tor.hookup.net>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.networks,comp.os.ms-windows.programmer.misc,comp.lang.c,comp.lang.basic.visual.database
Path: arc1-ca.pugleaf.net!in1.uu.net!bcstec!ccmail
From: wasmr600@ccmail.ca.boeing.com (Michael Washington)
Subject: Re: NetBIOS Path Strings and Drive Letter Assignments
X-Nntp-Posting-Host: e593668.evt.boeing.com
Message-ID: <DLLCyB.3MC@bcstec.ca.boeing.com>
Sender: nntp@bcstec.ca.boeing.com (NNTP News Access)
Reply-To: wasmr600@ccmail.ca.boeing.com (Michael Washington)
Organization: The Boeing Company
References: <4dp4l2$bcf@noc.tor.hookup.net>
Date: Mon, 22 Jan 1996 08:26:16 GMT