unit Subst;
{
API for work with substitution device (see dos command "subst").
Win 9x/NT/2000/XP compatible
ver. 1.2 Last rev. 25 Feb 2002
Freware with source.
Copyright (c) 2000-2002, SoftLab MIL-TEC Ltd
Web: http://www.softcomplete.com
Email: support@softcomplete.com
THIS SOFTWARE AND THE ACCOMPANYING FILES ARE DISTRIBUTED
"AS IS" AND WITHOUT WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR
ANY OTHER WARRANTIES WHETHER EXPRESSED OR IMPLIED.
NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
THE USER MUST ASSUME THE ENTIRE RISK OF USING THE ACCOMPANYING CODE.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented, you must
not claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. Original copyright may not be removed or altered from any source
distribution.
}
interface
uses Windows, SysUtils;
function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
// create subst device. Path must be a real folder.
function SubstRemove(DriveLetter: Char): Boolean;
// destroy subst device.
function SubstQuery(DriveLetter: Char): string;
// get Path for subst device.
// return empty string if DriveLetter is not subst-device
implementation
procedure VxDCall; external kernel32 index 1;
function SubstCreate(DriveLetter: Char; const Path: string): Boolean;
var drvno: byte;
buff: array[0..256] of char;
FPath: string;
function AddSlash(const Path: string): string; {漕徉怆