Copyright: NWLib ® 1995 Devont Software Inc.


main
NWLib 1.3

by Devont Software Inc.

10407 Sand Pass Lane, Suite 2112
Houston, TX 77064
JimTyson@IX.NETCOM.COM
70421,1506 (Compuserve)
(713) 955-9867 (24 Hour BBS)

Table of Contents

Introduction

Ordering Information

Function Categories

Constants

Structures

Index

Glossary

NWLib is a trademark of Devont Software Inc.  Copyright 1995 by Devont Software Inc.  All rights reserved worldwide.


intro
Introduction

Welcome to NWLib - the first native Netware-aware VCL component for Borland's great new Delphi programming environment.

NWLib is a component which conveniently "wraps up" extremely complex Novell API calls and integrates them directly into the Delphi environment.  While NWLib publishes about 70 Netware specific functions, it actually contains over 200 Netware API calls, and dozens of internal structures.  By digesting and combining the API calls and structures into more comprehensible objects, NWLib makes it much easier to integrate full Netware functionality into your applications  - the Delphi way!

Sure, NWLib contains plenty of Novell Netware Bindery/NDS and connection information routines to make your network applications kick butt and take names. But even more, NWLib is the most compatible choice you can make in creating Netware functionality for your Delphi applications.  Since NWLib makes calls directly to the latest version of a DLL supplied by Novell, you are assured maximum functionality and compatibility across all Netware platforms.  Top that off with the fact that NWLib is pure optimized Delphi code, and you've got yourself a potent combination for speed, compatibility, ease of use and hard-to-beat functionality .

By simply dropping an icon onto a form, you instantly have access to familiar Netware commands such as WhoAmI, Map, Login, GetMemberList, Detach, SList, Salvage, etc. You get four separate component units in which to include in your applications:  File Server, Print Environment, Connection/Bindery/NDS and a general-purpose string manipulation toolkit.  NWLib lets you concentrate what's really important : your data and the flow of your application.

So, what'll all this great convenience cost you?  Amazingly, less than a buck for each Netware function, and we throw in the general purpose toolkit free!  Just think of how much time you'll save since you'll never have to crack the half-a-foot-thick Netware API manual set or try to decipher just what those guys up there in Utah burned into that goofy dynaText CD.  NWLib sets you back 70 bucks, and you can create as many applications as you want with it.  One programmer, one license.

Believe me, the Novell API spec is no cake walk - it's something you definitely want to avoid if you can. It's awesomely rich, complex, and above all else, huge.  I can't tell you how many late nights I've spent scratching my head only to find out a problem turned out to be "documentation omissions" or some other irritating item.    When you think about it, you'd be crazy NOT to let someone else who specializes in Netware (he even has red eyes!) take this burden from you.  For about the cost of an hour's worth of your time, you get peace of mind and all your applications get a rich new set of tools.  Good trade!

What about updates? One of the good things about dealing with a small shop is that we don't mess around when it comes to fixes, updates and suggestions.  You'll find a newer, registered version on our 24 hour BBS that you can download free for 90 days or more.  We only charge for an upgrade when a significant version changes with new features and capabilities that warrant a cost, and at such a price that you're willing and pleased to pay.  You'll never be charged for bug fixes or patches that are certain to occur in any complex software product.

How about source code?  NWLib's source code will be offered to registered users early in 1996, at a very reasonable price.

So what if you use NWLib and don't send any money?  The bad thing about that is that if you don't send in any money, you'll be using a version that displays an annoying little banner each time an instance of the library is created. At least your apps run without Delphi running....after all, you're writing network software that needs to be tested on multiple workstations, and Delphi is probably not installed on each of your network workstations.  Your customers will see this banner if you distribute apps with NWLib demo code, and they'll think you're a cheapskate.  Don't do that!

Above all else, enjoy yourself and have fun.  If you're not having fun programming with Delphi, you're in the wrong business!

Jim Tyson - President, Chief, Indian, Programmer, Writer, OrderFiller, etc.
Devont Software Inc.
JimTyson@IX.NetCom.Com
(713)955-9287 (24 Hour BBS)


ordering
Ordering NWLib

If you want a live version of NWLib, with all the annoying banners removed, choose one of the following payment methods::

1.  American Express:  You can call our BBS at (713)955-9867, and
    leave a message to SYSOP.  Leave your Card Number, Name and
    expiration date.  You will be charged $70.00, plus 5.00 (10.00
    overseas) shipping if we send anything to you, or shipping is free if
    sending via e-mail.

2.  Personal/Company Checks:
Devont Software Inc.
10407 Sand Pass
         	Houston TX 77064
 70.00+5.00 shipping in US funds.  American Banks only.                     	Each additional copy only 20.00.

3.  Internet:  JimTyson@IX.NETCOM.COM.  Leave your American Express information.  You will be charged 70.00 for the first copy, and 20.00 for each additional one.  Shipping is 5.00 per order if we send anything to you via US mail, 10.00 overseas.

4.  CompuServe:  go SWREG and use registration number 7641.  Total on US orders is $75.00, slighly higher overseas.  If you wish to order additional copies, you should contact us directly.

We will gladly ship your copy to your supplied e-mail address if you prefer (Make sure you have UUDECODE if using the Internet).  Be sure to provide your e-mail address if you would like us to send the product to you in this fashion.


libraries
Functions by Category

 TNWLib  -  Network Connection and Environment functions

TNWServer - Server statistical, query and operating functions

TNWPrint - CAPTURE and related functionality

TNWTools - General Purpose utilities


Constants

{ Data Types }
TNWDriveNum	= word
TNWDirHandle	= byte
TBroadcastMode	= word
TNWLocalMode	= word
TNWLocalScope	= word
TNWNumber	= word
TNWNum	= longint
TNNumBytes	= longint
TNWFlag	= byte
TNWFlags	= byte
TNWTab	= byte
TNWPrintFlags	= word
TNWFormType	= longint
TNWTime	= longint
TNWLpt	= byte
TNWSegment	= byte
TNWStructSize	= word
TNWConnHandle	= word
TNWLength	= word
TNWConnNumber	= word
TNWCount	= longint
TNWError	= integer
TObjID	= longint
TObjType	= word
TNWDirEntry	= longint
TNWNameSpace	= byte
TNWNameLen	= byte
TNWAttributes	= longint
TNWSearchAttrs	= word
TNWRightsMask	= word
TNWDirID	= byte
TNWDirSpace	= longint
TNWFileLen	= longint
TNWAccessRights	= byte
TObjName	= array[0..47]  of Char
TRetBuff	= array[0..128] of Char
TConnList	= array[0..49]  of TNWConnHandle
TSendToList	= array[0..49]  of word
TNWPassword	= array[0..47]  of char
TNWBanner	= array[0..12]  of char
TNWPath	= array[0..1024] of char
TNWVolName	= array[0..15] of char
TNWName	= array[0..255] of char
TNWAddress	= array[0..11] of byte
TNWFileName	= array[0..11] of byte
TNWUtilization	= longint
TNWSysTime	= longint
TNWVol	= longint
TNWVolNum	= byte
TNWSequence	= longint
TNWVConsoleRev	= byte
TNWVConsoleVer	= byte
TNWNumPackets	= longint
TNWNumBuffers	= word
TNWServiceVer	= byte
TNWSupportLevel	= byte

{ Bindery Object Types }
nw_user       	= $0100 ;
nw_group     	= $0200 ;
nw_printq     	= $0300 ;
nw_server	= $0400 ;
nw_jobServer	= $0500 ;
nw_gateway	= $0600 ;
nw_printServer	= $0700 ;

{ Broadcast Modes }
nw_caston	= $00 ;
nw_castoff	= $01 ;
nw_castserver	= $03 ;


Structures

TNWConnectInfo  :  NWLIB

General connection information interface structure.  Passed by reference in function GetConnectInfo.

  type
    TNWConnectInfo = record
      serverConnID  : TNWConnHandle ;
      loginDateTime : TDateTime     ;
      internet      : string        ;
      sessionID     : word          ;
      ConnectID     : TNWConnNumber ;
      userID        : string        ;
      serverName    : string        ;
  end;

TNWFileInfo   :  NWServer

General File System structure.  When displaying information about a Netware-based file with GetFileInfo, you'll pass along this strucure by reference so Netware can fill it up for you.

    type
      TNWFileInfo = record
        name              : string        ;
        updatedBy         : string        ;
        ownerID           : string        ;
        lastArchivedBy    : string        ;
        creationdate      : TDateTime     ;
        lastArchiveDate   : TDateTime     ;
        lastAccessDate    : TDateTime     ;
        lastModified      : TDateTime     ;
        updateDateTime    : TDateTime     ;
        fileSize          : longint       ;
        inheritedRights   : TNWRightsMask ;
        maximumSpace      : TNWDirSpace   ;
        attributes        : TNWAttributes ;
        flags             : TNWFlags      ;
        nameSpace         : TNWNameSpace  ;
        nameLength        : TNWNameLen    ;
    end;

TNWConnStats   :  NWServer

GetUserStats uses this structure to obtain connection-status information about any particular user on the network.

    type
      TNWConnStats = record
        loginTime      : TDateTime     ;
        bytesRead      : TNWNumBytes   ;
        bytesWritten   : TNWNumBytes   ;
        totalRequests  : TNWNumPackets ;
        recordLocks    : TNWNumPackets ;
        fileLocks      : TNWNumPackets ;
        expirationTime : TDateTime   ;
    end;

TNWServerInfo  : TNWServer

GetServerStats uses this structure to provide detailed information about the file server and it's operating environment.

Note that some of the values are valid in a Netware 4.x environment only.   The Novell Client SDK does not include functions to obtain this information on any other platform.

    type
      TNWServerInfo = record
        serverName        : string ;
        serverUpTime      : TNWSysTime  ;    {4.x only}
        processor         : byte ;
        numprocs          : byte ;
        utilization       : byte ;           {4.x only}
        PacketsIn         : TNWNumPackets ;  {4.x only}
        packetsOut        : TNWNumPackets ;  {4.x only}
        version           : string ;
        maxConns          : TNWNumber ;
        ConnsInUse        : TNWNumber ;
        maxConnsUsed      : TNWNumber ;
        numVolumes        : TNWNumber ;
        sftLevel          : TNWSupportLevel ;
        ttsLevel          : TNWSupportLevel ;
    end;

TNWVolInfo   : TNWServer

VolInfo fills this stucture with information regarding a particular server volume.  The Novell Client SDK provides this functionality only on a Netware 2.2 platform only.

    type
      TNWVolumeInfo = record
        sysUpTime         : TNWSysTime  ;
        volumeNumber      : TNWVolNum   ;
        logicalDriveNum   : TNWDriveNum ;
        sectorsPerBlock   : TNWNumber   ;
        startingBlock     : TNWNumber   ;
        totalBlocks       : TNWNumber   ;
        availableBlocks   : TNWNumber   ;
        totalDirSlots     : TNWNumber   ;
        availableDirSlots : TNWNumber   ;
        maxDirSlotsUsed   : TNWNumber   ;
        isHashing         : TNWFlags    ;
        isCaching         : TNWFlags    ;
        isRemovable       : TNWFlags    ;
        isMounted         : TNWFlags    ;
        volName           : TNWVolName  ;
    end;

TNWDiskCacheInfo   :   TNWServer

Use GetCacheInfo along with this structure to obtain detailed information about your server's disk caching environemtn.   The Novell Client SDK provides this functionality only on Netware 2.2 platforms.

    type
      TNWDiskCacheInfo = record
        serverUpTime              : TNWSysTime ;
        cacheBufferCount          : TNWNumber ;
        cacheBufferSize           : TNWNumber ;
        dirtyCacheBuffers         : TNWNumber ;
        cacheReadRequests         : TNWNum ;
        cacheWriteRequests        : TNWNum ;
        cacheHits                 : TNWNum ;
        cacheMisses               : TNWNum ;
        diskReadRequests          : TNWNum ;
        diskWriteRequests         : TNWNum ;
        diskReadErrors            : TNWNumber ;
        diskWriteErrors           : TNWNumber ;
        cacheGetRequests          : TNWNum    ;
        cacheFullWriteRequests    : TNWNum    ;
        cachePartialWriteRequests : TNWNum    ;
        backgroundDirtyWrites     : TNWNum    ;
        backgroundAgedWrites      : TNWNum    ;
        totalCacheWrites          : TNWNum    ;
        cacheAllocations          : TNWNum    ;
        thrashingCount            : TNWNumber ;
        LRUDirtyBlockCount        : TNWNumber ;
        readBeyondWriteCount      : TNWNumber ;
        fragmentedWriteCount      : TNWNumber ;
        cacheHitOnUnavailableCount: TNWNumber ;
        cacheBlockScrappedCount   : TNWNumber ;
    end;

TNWFileSysInfo    :   TNWServer

GetFileSysStats uses this structure to return information about the server's file i/o activity.  The Novell Client SDK provides this functionality only on Netware 2.2 platforms.

    type
      TNWFileSysInfo = record
        serverUpTime              : TNWSysTime ;
        maxOpenFiles              : TNWNumber  ;
        maxFilesOpened            : TNWNumber  ;
        currOpenFiles             : TNWNumber  ;
        totalFilesOpened          : TNWNum     ;
        totalReadRequests         : TNWNum     ;
        totalWriteRequests        : TNWNum     ;
        currChangedFatSectors     : TNWNumber  ;
        totalChangedFatSectors    : TNWNum     ;
        fatWriteErrors            : TNWNumber  ;
        fatalFatWriteErrors       : TNWNumber  ;
        fatScanErrors             : TNWNumber  ;
        maxIndexFilesOpen         : TNWNumber  ;
        currOpenIndexedFiles      : TNWNumber  ;
        attachedIndexFiles        : TNWNumber  ;
        availableIndexFiles       : TNWNumber  ;
    end;

TNWMemCacheInfo      :   TNWServer

GetCacheInfo fills this structure with information regarding a file server's caching activities in a Netware 4.x environment.  GetCacheInfo has no effect on any other Netware release.

    type TNWMemCacheInfo = record
       serverUpTime               : TNWSysTime ;
       writeBlockCount            : longint ;
       diskWriteCount             : longint ;
       writeErrorCount            : longint ;
       numCacheHits               : longint ;
       numDirtyCacheHits          : longint ;
       cacheDirtyWaitTime         : longint ;
       cacheMaxConcurrentWrites   : longint ;
       maxDirtyTime               : longint ;
       DirCacheBuffers            : longint ;
       maxByteCount               : longint ;
       minCacheBuffers            : longint ;
    end;

TNWDeletedFileInfo     :   TNWServer

GetFileInfo uses this structure to obtain information on files stored on Netware volumes.

    type
      TNWDeletedFileInfo = record
        attributes       : TNWAttributes ;
        flags            : TNWFlags      ;
        nameSpace        : TNWNameSpace  ;
        nameLength       : TNWNameLen    ;
        name             : string        ;
        creationdate     : TDateTime     ;
        ownerID          : string        ;
        lastArchiveDate  : TDateTime     ;
        lastArchivedBy   : string        ;
        updateDateTime   : TDateTime     ;
        updatedBy        : string        ;
        fileSize         : longint       ;
        inheritedRights  : TNWRightsMask ;
        lastAccessDate   : TDateTime     ;
        deletedDateTime  : TDateTime     ;
        deletedBy        : string        ;
    end;


Index

C

Capture

Constants

D

disableLogins

downServer

E

enableLogins

endCap

F

fullName

G

getBannerUserName

getBindeyList

getBroadcastMode

getCacheInfo

getCaptureFlags

getConnectedServerList

getConnectID

getConnectInfo

getDeletedFileInfo

getDeletedFiles

getDiskCacheStats

getFileInfo

getFileSysStats

getFirstNetDrive

getMaxPrinters

getMemberList

getMyGroups

getNextNetDrive

getObjectNumber

getObjID

getObjName

getObjType

getPrimaryServerID

getServerDate

getServerHandle

getServerName

getServerSerial

getServerStats

getServerTime

getUserConnList

getUserStats

getVolFileList

getVolumes

Glossary

I

Index

intro

isCaptured

isConsoleOperator

isInList

isLoggedIn

isMember

isNWManager

L

libraries

M

main

Map

mapDelete

mapShow

maxConns

N

nCopy

nwInit

NWLogin

NWLogOut

nwPassCheck

O

ordering

P

purgeAllFiles

S

salvage

SecureEquiv

sendLineMessage

setBannerUserName

setCaptureFlags

setCastMode

SetPreferredServer

setServerDateTime

sList

structures

T

TNWCaptureFlags

TNWLib

TNWPrint

TNWServer

TNWTools

TNWTools

V

volinfo

W

whoAmI


Glossary

B

Bindery Object Types


Capture
Capture : boolean

In a Netware environment, as you probably already know, you use the CAPTURE utility to redirect printing to shared network devices.  NWLib's Capture function performs the same function as the Netware command-line utility, except you can call this function internally within your own applications.

There are a few differences in how to call the API function vs. the command-line utility that Netware provides:  whereas the Netware CAPTURE utility requires that you place the capture settings on the command line, such as "/nb /nff" etc., NWLib requires that you first create the capture environment, then apply the properties to the environment.

In the example below, the following events occur to create a valid capture environment:

1.  A TNWCaptureFlagss record structure and integer type variable are declared.
2.  The CaptureFlags record structure is filled with current Capture environment settings if they exist.  Otherwise, it is filled with default capture data.
3.  Changes are made to the CaptureFlags environment.
4.  The Capture statement is executed.
5.  The CaptureFlags environment was applied to the capture environment.
6.  End of function.

Parameters

nServer : TNWConnHandle.  The server in which you want to handle print jobs.

cQueueName : String.  The name of the Netware Print Queue you want to redirect.

nPort : TNWLpt.  The port number.  IPX/NETX networks can handle LPT1 to LPT3.  A VLM Environment can handle up to LPT9.

Returns

Boolean.  True if the capture was successful.

Example

var
  captureFlags : TNWCaptureFlags ;
  nLPT : TNWLpt ;
  oldqueue : string ;
begin
    nLPT := 1 ;
    if getCaptureFlags(nLPT,captureFlags) then
       begin
         captureFlags.formfeeds := False ;   { /nff }
         captureFlags.banner  := '' ;             { /nb }
         captureFlags.tabSize := 0 ;            { /nt  }
         oldqueue := captureFlags.qname ;   { i.e. Save old Capture, if you need }
         Capture('fs1','printer1',nLPT) ) then
           begin
                setCaptureFlags(GetPrimaryServerID,nLPT,captureFlags) ;
                okBox('Print Redirected to FS1/Printer1') ;
           end;
       end;
end ;

Hint

Note there are two read-only elements in the TNWCaptureFlags record structure. If a Capture environment is already in place and you fill the TNWCaptureFlags structure using NWLib's getCaptureFlags function, you can read two additional items: the name of the print queue currently in use, and the server name to which it belongs, in addition to all the other print attributes currently in use.

You can use these elements to restore print environments to their original state once you have completed whatever task you need in your programs.  Simply go back to the record structure, read the elements, then perform another Capture/setCaptureFlags call, and viola, back we go.   The old queue name and server are stored until you call another getCaptureFlags function call using the same TNWCaptureFlags record structure.

See Also

endCap, setCaptureFlags, getCaptureFlags, isCaptured, getBannerUserName, setBannerUserName, getMaxPrinters


disableLogins
disableLogins : boolean

Use DisableLogins when you need to be sure no one logs into a file server.  For instance, you may be performing a VREPAIR or something, and want to make sure that no one gets lost in lotus-land while this is occurring.

Users which are currently logged in are not affected by this function.

Be careful!  if you disable logins, logout and then leave the network with no active Console Operators in which to re-enable logins, you'll have no recourse but to use the physical file server console in which to type in the 'Enable Logins' command.  That might sound easy, but what if we're dealing with a server accessible only over a T1 connection 2500 miles away?  "Uh, yes...this is Jim from Houston.  Do you have anyone over there that can enable logins to the file server for me?  I accidentally locked everyone out.  Yeah.  Uh-huh.  OK, press Alt Esc...................[tickitytickitytypinginthebackground].....Try Holding down the alt key.  It says A-L-T on it..."

Parameters

nServer:  TNWConnHandle.  The server connection handle in which to disable logins.

Returns

Boolean.  True if the server logins were actually disabled.   If users try to attach to the server, the Netware shell returns an error message and refuses attachment to the server.

Example

if disableLogins(getPrimaryServerID) then
   OKBox('Server Logins Disabled!') ;

See Also

enableLogins, NWLogout, NWLogin


downServer
DownServer  : Boolean

DownServer immediately brings down a Netware File Server without any warnings or confirmations.  Any open files are immediately closed by the Netware operating system, but any unsaved changes still at the workstation will not be saved.

You must be a Console Operator to bring a file server down using this function.

Parameters

nServer:  TNWConnHandle ;

Returns

Boolean.  True if the file server was actually brought down.

Example

var
  cserver: string ;
begin
  cserver :=  getServerName(getPrimaryServerID)) ;
  if YesNoBox('Bringing Down Server ' + cserver) and
     downServer(getPrimaryServerID) then
         okBox('File Server ' + cserver + ' Downed!) ;
end;

Sub Heading

Paragraph


enableLogins
enableLogins : boolean

Perform this command to enable logins to the file server, if they had previously been disabled via the NWLib disableLogin function, or through the standard netware console command.

You must be a console operator in order to enable logins to a file server.

Parameters

nServer : TNWConnHandle.  The server connection handle in which to enable logins.

Returns

Boolean.

Example

if enableLogins(getPrimaryServerID) then
   okBox('Server Logins Enabled!') ;

See Also

disableLogins, NWLogin


endCap
endCap : boolean

Use the endCap function when you want to terminate a Capture environment already in place on the workstation.  The specified port is returned to non-redirected mode, so if any print data arrives at the port, it will be directed to the local device.

Parameters

nPort : TNWLpt.  The LPT port number.

Returns

Boolean.  True if the endCap was successful.    False means the port is not valid on the workstation.

Example

if endCap then
  okBox('Local Print Mode Restored') ;

See Also

Capture, setCaptureFlags, getCaptureFlags


fullName
fullName : string

Use this function to query the Netware Bindery or NDS system and return the full name of any user logged in at the current server.

If you need to retreive a user's full name on a different server, make that server the default by calling the SetPreferredServer function first.

Returns

String:  The full name of the specified user on the current server.  The full name can be specified in Netware using the SysCon or NetAdmin programs.

Parameters

cUserID : string.  The name of the user you want to query.

Example

begin
  OKBox('Hello, ' + FullName(WhoAmI) + '!') ;
end;


getBannerUserName
getBannerUserName : string

Use getBannerUserName to return a string containing the workstation's current Capture environment Banner User Name.

Parameters

none.

Returns

String.  The current Banner User Name.

Example

var
  cbanner : string ;
begin
  cbanner := getBAnnerUserName ;
  okBox('Name Printed on Banners: ' + cBanner) ;
end;

See Also

setBannerUserName, Capture, setCaptureFlags


getBindeyList
getBindeyList : TStringList

Create a listbox or StringGrid, then call this function once and instantly fill up your list with all network users, the names of the print queues on the current server, group names, etc.  The return value is a TStringList, so you can use the output directly, without any fuss or re-entrant calls to the Netware API.  NWLib takes care of all the messy details for you.

Parameters

nServer: TNWConnHandle.  The server connection handle.  You must be logged into a server to obtain a connection handle to it.

nObjType : TObjType.  The type of object to return.  Use nw_user, nw_group, nw_printq or nw_server.

Returns

A TStringList full of the objects you want.  All neatly lined up and ready to be placed into an object, or acted upon iterively in your programs.

Example

var
  myList : TStringList;
  ntemp : word ;
begin
  myList := TStringList.Create ;
  mylist := GetBinderyList(GetPrimaryServerID,nw_user);
  for ntemp := 1 to myList.Count do begin
     OKBox(mylist[ntemp-1] + ' is a User on this Network') ;
  end;
  winSuper.userList.AddStrings(mylist) ;
end;


getBroadcastMode
getBroadcastMode : boolean

getBroadcastMode tells you if the workstation has disabled network broadcast notification messages using the CASTOFF command or other means (such as NWLib's own setBroadcastMode function).

Each server stores it's own setting for a user's preference for broadcast mode.

Parameters

nServer : TNWConnHandle.  The server connection handle.

Returns

Boolean:  True if the user can receive network broadcasts, and False if they have been disabled.

Example

if getBroadcastMode then
  caston.checked := True ;


getCacheInfo
getCacheInfo : boolean  (Netware 4.x)

When you need to check out a server's memory cache statistics, create a timer object, then have it grab them by making a call to getCacheInfo every 1 or 2 seconds.  A rich set of statistics is returned in your referenced structure.

This function can only be used on connections to Netware servers 4.x and higher.

Parameters

nServer : TNWConnHandle
The server connection handle to query.  Must be a 4.x server.

var cacheInfo: TNWMemCacheInfo
Your referenced record structure.  If the call is successful, it is
filled with cache statistics.

Returns

Boolean.  True if the call is successful and the referenced data structure is populated with information.

Example

var
  memCacheInfo : TNWMemCacheInfo ;
begin
  if getCacheInfo(getPrimaryServerID,memCacheInfo) then
    okBox('Server Write Count: ' + intToStr(memCacheInfo.diskWriteCount)) ;
end;

See Also

getDiskCacheStats, getServerStats, getUserStats


getCaptureFlags
getCaptureFlags : boolean

Use getCaptureFlags to initialize a TNWCaptureFlags record structure with current capture environment settings, such as the print queue name, number of copies, etc.   You can use this record structure to pass to a new Capture environment to set that Capture environment up just like the old one, or make changes to the structure, then pass it along to another Capture environment to adjust the settings any way you desire.

Parameters

nPort : TNWLpt.   The local LPT port number.  Usually 1 to 3.

VAR CaptureFlags : TNWCaptureFlags.  The record structure, passed by reference, which will contain the various capture environment settings.

Returns

Boolean.  True if the record structure was properly filled.  Note that if a capture environment is not in place on the specified port, default information is placed into the record structure, but the queue name will be empty and the server connection handle value will be 0.  You can test for these conditions, or use the isCaptured function to test for a non-captured port.

Example

var
  captureFlags : TNWCaptureFlags ;
  nLPT : TNWLpt ;
  oldqueue : string ;
begin
    nLPT := 1 ;
    if getCaptureFlags(nLPT,captureFlags) then
       begin
         captureFlags.formfeeds := False ;   { /nff }
         captureFlags.banner  := '' ;             { /nb }
         captureFlags.tabSize := 0 ;            { /nt  }
         oldqueue := captureFlags.qname ;   { i.e. Save old Capture, if you need }
         Capture('fs1','printer1',nLPT) ) then
           begin
                setCaptureFlags(GetPrimaryServerID,nLPT,captureFlags) ;
                okBox('Print Redirected to FS1/Printer1') ;
           end;
       end;
end;

Sub Heading

Paragraph


getConnectedServerList
getConnectedServerList : TStringList

When you need to get a listing of servers in which the current workstation is currently logged in, drop in this function.  You'll get back a TStringList in which you can use as the foundation of a visual control, or loop through and do custom processing on each element.

Parameters

None

Returns

TStringList:  A complete listing of servers in which the current workstation is logged into.

Example

var
  templist : TStringlist ;
  nloop : byte
begin
  templist := TStringList.Create ;
  tempList.AddStrings(getConnectedServerList) ;
  for nloop := to templist.Count do begin
      okBox('Server Name: ' + templist[nloop-1]) ;
  end;
end;


getConnectID
getConnectID : TNWConnHandle

getConnectID returns a workstation's connection number to the default file server. This can range from 1 to the maximum number of Novell workstation connection licenses you own.  For example, a 250 user Netware system's workstation connection numbers can range from 1 to 250.  You need to pass a workstation connection number when attempting to obtain information about the workstation.

Parameters

nServer:  TNWConnHandle.  The connection number of the server in which to query.

Returns

nConnHandle : TNWConnHandle.  The workstation connection handle to the default file server.

Example

myConnHandle := GetConnectID ;


getConnectInfo
getConnectInfo : boolean ;

Use this function to obtain general-purpose information about an active connection on a file server.

Parameters

nServer : TNWConnHandle.  The host server in which to make the function call.

nConn:  TNWConnNumber.  The user's connection number to the server you want to query.

var connectInfo : TNWConnectInfo.  A referenced structure that contains general purpose information about the desired connection.

Returns

Boolean.  True if the referenced structure is filled with general purpose connection information.

Example

var
  connectinfo : TNWConnectinfo ;
  nConns: word ;
  connList : TConnList ;
  nloop : word ;
begin
  getUserConnList(getPrimaryServerID,'JIM',nconns,connList) ;
  for nloop := 1 to nconns do begin
     if getConnectInfo(getPrimaryServerID,connList[nloop-1],connectinfo) then
        okBox('Found Net Address: ' + connectInfo.internet) ;
  end;
end;

See Also

getUSerConnList


getDeletedFileInfo
getDeletedFileInfo : boolean ;

You'll use getDeletedFileInfo when you want to return information about a file that has been deleted from a network volume.  Important information, such as the file deletor, size, and delete date/time is obtained from a referenced structure by making this single function call.

Of course, the calling workstation must have sufficient rights to see any directory's deleted file information.  If not, False is returned and the referenced  structure is not filled with information.

Parameters

cfile: string
The complete path and filename of the deleted entry.
The file must have been deleted from a network volume.

deletedFileInfo :TNWDeletedFileInfo
A predefined structure passed by reference.  On
successful return, this structure is passed back to you filled with
all kinds of interesting information about the file.

Returns

Boolean.   True if the call found the file and obtained information.

Example

var
  deletedFileInfo : TNWDeletedFileInfo ;
begin
  if getDeletedFileInfo('z:\help.nfo',deletedFileInfo) then
     okbox('File: ' + deletedFileInfo.name) ;
end;

See Also

Paragraph


getDeletedFiles
getDeletedFiles : boolean ;

You send getDeletedFiles a server connection handle and a path specification, and you get back a TStringList of all deleted files that are still recovereable.  Very handy if you are writing a Salvage interface utility, for instance.

Parameters

nServer : TNWConnHandle.  The server that contains the deleted file list.
cPath: string.  The complete path and file specification.  Wildcards OK.

Returns

TStringList:  The result of the search using the path and file specification.  Since this return value is a TStringList, you can easily incorporate the information into your listBoxes and stringGrids.

Example

begin
  listbox1.addStrings(getDeletedFiles(getPrimaryServerID,'z:\*.*')) ;
end;

See Also

getDeletedFileInfo, getVolFileList, getFileInfo, getVolumes


getDiskCacheStats
getDiskCacheStats ; boolean

If you are connected to a Netware 2.2 server, you can call this function to obtain detailed information about the server's disk caching activities.

Parameters

nServer : TNWConnHandle.  The connection handle of the Netware 2.2 server.

var diskCacheInfo : TNWDiskCacheInfo.  A referenced structure that holds the statistical information if the call is successfully performed.

Returns

Boolean.  True if the referenced array is filled with disk caching information.

Example

var
  diskCacheInfo : TNWDiskCacheInfo ;
begin
  if getDiskCacheStats(getPrimaryServerID, diskCacheInfo) then
     okBox('Disk Writes: ' + intToStr(diskCacheInfo.diskWriteRequests)) ;
end;

See Also

getServerStats, getFileSysStats, getVolinfo


getFileInfo
getFileInfo : boolean ;

getFileInfo can give you details about a file that exists on a Netware volume.   Some file information, such as the file's Owner and archiver Object Name, can only be obtained by making a call to this function.

Parameters

cfile : string
The complete pathname to the desired file.  Wildcard are
NOT allowed.

fileInfo : TNWFileInfo
A structure passed by reference which contains the details
about the file.  If the call is successful, you can obtain data
from the fields of this structure.

Returns

boolean.  True if the call is successful and elements are written into the referenced data structure.

Example

var
  fileInfo : TNWFileinfo
begin
  if getFileInfo('z:\public\net$log.dat',fileInfo) then
     okbox('I got: ' + fileInfo.name) ;
end;

See Also

getDeletedFileInfo, getVolFileList, getVolumes


getFileSysStats
getFileSysStats : boolean

If you are connected to a Netware 2.2 server, you can use this function to obtain detailed information about a file server's file system activities.

Parameters

nServer : TNWConnHandle.  The server to query.

var fileSysInfo : TNWFileSysInfo.  A referenced array that holds all statistical information if the call is successful.

Returns

Boolean.  True if the call is successful and the referenced array is filled with the server's file system statistical information.

Example

var
  fileSysInfo : TNWFileSysInfo ;
begin
  if getFileSysStats(getPrimaryServerID, fileSysInfo) then
     okbox('Server Read Requests: ' +
                intToStr(fileSysInfo.totalReadRequests)) ;
end;

See Also

getServerStats, getUserStats


getFirstNetDrive
getFirstNetDrive : char

getFirstNetDrive simply returns the first Netware drive letter encountered.  You can use this to determine where to place a user after a logout command is executed.

Parameters

None.

Returns

Char:  the first drive letter encountered.  This can vary, depending on the workstation's LASTDRIVE setting (config.sys) and parameters specified in the NET.CFG file.

Example

var
  chtemp : char ;
begin
  chtemp := getFirstNetDrive;
  if map(chtemp,'fs1/sys:') then
    OKBox('Good Job!') ;
end;


getMaxPrinters
getMaxPrinters : byte

getMaxPrinters simply returns the maximum number of printer ports supported by the current version of the Netware shell.  IPX/NETX networks support LPT1 to LPT3, and most VLM environments support ports up to LPT9.

Parameters

none.

Returns

Byte.  The maximum number of ports available on the workstation.

Example

var
  nports : byte
begin
  nports := getMaxPrinters ;
  if (nports > 0) then
      okBox('You have ports!;;I'd have that looked at if I were you.') ;
end;

See Also

Capture, setCaptureFlags, getCaptureFlags, isCaptured


getMemberList
getMemberList : TStringList

In one simple function call, you can get the complete contents of a Novell Group into a TStringList.  You can use this list as a source for a TListbox or TStringGrid, or you can create a loop and process each of the items in the list.

Parameters

nServer : TNWConnHandle.  The connection handle of the server which contains the group in which you want to return a list.  You must be logged into the server in question, and have sufficient rights to obtain a list of members.

cGroupName: string.  The name of the group you want to list.  EVERYONE is a common group name in Netware.

Returns

TStringList.  A listing of the group.  One member on each line of the TStringList.

Example

var
  myList : TStringList ;
  ntemp : word ;
begin
   mylist := TStringList.Create;
   myList := GetMemberList(GetPrimaryServerID, 'EVERYONE') ;
   for ntemp := 1 to myList.count do begin
     okbox(myList[ntemp-1] + ' is an EVERYONE Member') ;
   end;
end;


getMyGroups
getMyGroups :  TStringList ;

Returns a listing of groups in which a user is a member.  You must have console operator rights to return the names of groups a user belongs to other than yourself.

Since the return value of this function is in TStringList format, it's very easy to incorporate its output into onscreen objects such as Listboxes, StringGrids, etc.

Parameters

nServer : TNWConnHandle.  The host server in which to make the call.

cUserID : string.  The user who's groups to obtain.  You must be a console operator if this cUserID is not you.

Returns

TStringList. The complete contents of the user's group membership list.

Example

begin
  listbox1.addStrings(getMyGroups(GetPrimaryServerID,'JIM')) ;
end;

See Also

isConsoleOperator, isMember


getNextNetDrive
getNextNetDrive : char

getNextNetDrive returns the next free non-local drive letter.  You can use this to obtain a drive letter which is not already mapped.

Parameters

None.

Returns

char:  The drive letter of the first non-local network drive.  Any local devices are skipped.

Example

var
  chtemp : char ;
begin
  chtemp := GetNextNetDrive;
  if Map(chTemp,'fs1/sys:') then
     okBox('Way to Go!') ;
end;


getObjectNumber
getObjectNumber : TObjID

getObjNumber is a basic building block function which the native Netware Object ID number, as it is stored in the Bindery/NDS.   For the most part, you'll probably use this function only in conjunction with GetObjName, which requires the output of this function as a parameter.  NWLib calls this function frequently to obtain data handles to specific objects in the Bindery/NDS.

Parameters

cUserID   : string.   The UserID you want to query.  Like SUPERVISOR or JOE.
nObjType : TObjType.  nw_user, nw_group, nw_printq or nw_server.

Returns

TObjID, a long integer, as it is stored in the Netware Bindery/NDS.

Example

ntemp := NWGetObjNumber('SUPERVISOR',nw_user) ;
if ntemp > 0 then
  OKBox('Supervisor is a valid Netware User') ;


getObjID
getObjID : string

You pass a UserID, like SUPERVISOR or SLICKWILLY, and NWLib gives you back their corresponding hexidecimal Object ID obtained from the Bindery or NDS.

Netware automatically creates a directory for each user in the SYS:MAIL directory.  The name of those directories directly corresponds to the numbers that you receive back from this function.

It's important to note that Object ID's are not syncronized between servers, except the SUPERVISOR user in the Netware 3.x world always has an Object ID of '1' ... for whatever that's worth.  If your code relies on Object ID numbers in a multi-server environment, make sure you connect to the desired server using the SetPreferredServer function to the desired server before making a call such as getObjID.  Otherwise, you're likely to return an incorrect ObjectID and do all kinda wieird things to your data.

Parameters

cUserID : string    The UserID you want to query.

Returns

String:  The user's Object ID, represented in hexidecial string format.  Common examples of the returned value are;  600001, 5000001, B7200046. etc.  The number is guaranteed unique to each user on a single server.

Example

var
  cfile : string
begin
  cfile := 'f:\mail\' + GetObjID('NEIL') + '\2112.PEW' ;
  if FileExists(cfile) then
    OKBox('TaDa!') ;
end;


getObjName
getObjName : string

You pass a numeric Netware object ID to the GetObjName function, and it returns a UserID (like SUPERVISOR) back to you.

Unless you are reading Netware properties directly, you'll probably never need to use this function.  NWLib automatically calls this function internally to convert data from the Bindery/NDS into a more human-readable format.

Returns

String:  a UserID, like SUPERVISOR, JIMT or DEBRA.

Parameters

nObjID : TObjID.  This is a longint number, in lo-hi bit order.  This is the native format Novell uses to store Object information.

Example

var
  ntemp : longInt ;
  ctemp : string ;
begin
  ntemp := 1029384;
  ctemp := getObjName(ntemp) ;  {'Billy' or something, if valid }
end;


getObjType
getObjType : TObjType

Use this function to determine a Netware object's data type, such as a User, Group, Print Queue or File Server.

Parameters

cUserID : string   The UserID you need to query, such as SUPERVISOR.

Returns

The type of the user, such as nw_user, nw_group, nw_printQ or nw_server.

Example

if GetObjType('SUPERVISOR') = nw_user then
  OKBox('This Network Has a Guy Named SUPERVISOR on it') ;


getPrimaryServerID
getPrimaryServerID : TNWConnHandle

GetPrimaryServerID returns the workstation's connection handle to the default network server.  A lot of Netware function calls are 'server centric' and can return different information from server to server.  So, when you call these functions, you need to pass the server connection handle so NWLib knows which server you intend to query for the results.  Use this function when you simply want the action to be performed on the default calling server, and do not want to call a server specifically.

On login, the server in which the login executes is considered the 'default' or 'preferred server' connection.  You can specify a preferred server in the boot-up NET.CFG or SHELL.CFG file.  See your network documentation for more information on these configuration files.

Parameters

None

Returns

TNWConnHandle:  The connection handle to the default server.  While there's not much you can do with a server connection handle, there are plenty of other NWLib functions that can.

Example

myServerHandle := GetPrimaryServerID;


getServerDate
getServerDate : TDateTime

When you need to ensure a standardized date, use the getServerDate function.  The return value of this function is not affected by the workstation's date.  Good uses for this function are writing dates to time-sensitive data files that could be forged by changing the workstation's date using DOS' DATE command.

Parameters

nServer : TNWConnHandle.  The connection handle of the server you want to query.  You must be logged into the file server to perform this function.

Returns

TDateTime.  The date of the file server.  You can use any standard Delphi date functions to parse the return value.

Example

if getServerDate <> date then
  okBox('Please Stop Resetting Your PC Clock!') ;

See Also

getServerTime, setServerDateTime


getServerHandle
getServerHandle : TNWConnHandle

Use getServerHandle when you know the physical name of a file server, and wish to retrieve it's connection handle.  Server connection handles are used quite frequently in NWLib, because they define precisely which server on the network to perform various function calls.

 A handy use for this function is iterating though a getConnectedServerList return list to perform actions on the various servers.

Parameters

cServer : String.  The name of the server you want to inspect.

Returns

TNWConnHandle.  The connection handle to the specified server.   0 if the server name is not valid.

Example

var
   nServer : TNWConnHandle ;
begin
  nServer := getServerHandle('FS1') ;
  if nServer > 0 then
    begin
       OKBox('You Are Logged Into FS1 Properly') ;
    end;
end;

See Also

getServerName, getConnectedServerList, sList, isLoggedIn, NWLogin


getServerName
getServerName : string

Use GetServerName to retrieve the name of a file server.  The calling workstation must be logged into the file server to be able to perform this function.

Parameters

nServer: TNWConnHandle.  The connection handle to the file server.

Returns

string:  The name of the file server.

Example

var
  cserver: string
begin
  cserver := getServerName(getPrimaryServerID) ;
  okBox('You Are Connected to Server ' + cserver) ;
end;

See Also

sList, getConnectedServerList, getPrimaryServerID, getServerHandle


getServerSerial
getServerSerial : longInt

Each file server on your network has it's own unique serial number.  getServerSerial simply retrieves this number for you.  Good uses for this number are encryption keys, security, and copy protection schemes.

a Netware serial number is obtained from the Netware System1 diskette in a standard Netware 3.1 installation, or from the CDROM in a Netware 4.x installation.  You cannot change a file server's serial number.

Parameters

cServer : string.   The name of the file server you wish to query.  You can query any file server in which you have an active login.

Returns

longint:  The file server serial number.

Example

var
  nserial : longint ;
begin
  nserial := getServerSerial('FS1') ;
  if nserial <> 39847763 then
    okBox('This is an Invalid Copy of WidgetWare!') ;
end;

See Also

getServerHandle, getServerName, getConnectedServerList, sList, NWLogin


getServerStats
getServerStats : boolean ;

With getServerStats, you're able to retrieve statistical information about any particular Netware 4.x server on your network.   With a little imagination and a few hours work, you can create network server monitoring and threshold alert systems.

Note:  Some of the returned values in the reference structure are only applicable for Netware 4.x servers.

Parameters

nServer : TNWConnHandle.  The server in which to query.

Returns

Boolean.  True if the call was successful, and the referenced structure is filled with desired information.

Example

var
  serverInfo : TNWServerInfo
begin
  if getServerStats(getPrimaryServerID,serverInfo) then
      okBox('Server Ticks: ' + intToStr(serverInfo.serverUpTime)) ;
end;

See Also

getUserStats


getServerTime
getServerTime : TDateTime

Use the getServerTime function to retrieve a file server's time.  You can use this function to ensure a synchronized time is used throughout your program.

Parameters

nServer : TNWConnHandle.  The server connection to query.  You must be logged into the specified server to make this call.

Returns

TDateTime.  A standard Delphi TDateTime return value, which can be parsed, decoded or any other time-related function.

Example

var
  nHour : word;
  nMin  : word ;
  nSec  : word ;
  nMsec : word ;
  ntime : TDateTime;
begin
  ntime := getServerTime(getPrimaryServerID) ;
  DecodeTime(nTime,nHour,nMin,nSec,nMsec) ;
  if nHour = 7 then
    begin
       MessageBeep(mb_Exclamation) ;
       OKBox('Wake Up!  It's 7am You SleepyHead!') ;
    end;
end;

See Also

Paragraph


getUserConnList
getUserConnList : boolean ;

When you need to find out how many times a user is logged in, and the logical connection numbers, getUserConnList is the function you'll use to get the information.

Parameters

nServer : TNWConnHandle.  The server in which to query.

cUserID : string.  The name of the user whose connection status you are obtaining.

var nConns:  word.  The number of connections in use by the specified cUserID is returned in this referenced variable upon successful completion of the function call.

var connList : TConnList.  The connection numbers in use by the specified cUserID is returned in this referenced array of connection IDs.  Each element in the returned list is of type TNWConnNumber.

Returns

Boolean. True if the call is successful and the referenced items are filled properly.

Example

var
  nconns   : word ;
  connList : TConnList ;
  nloop      : word ;
begin
  if getUserConnList(getPrimaryServerID,'JIM',nconns,connList) then
      begin
         for nloop := 1 to nconns do begin
             okbox('Found Connection Number: ' + intToStr(connList[nloop-1])) ;
         end;
      end;
end;

See Also

getUserStats


getUserStats
getUserStats : boolean ;

Under Netware 4.x, you can call getUserStats to return user input/output statistics and other connection information.  You must be a console operator to view statistical information about a connection.

Parameters

nServer : TNWConnHandle.  The host server connection handle.

nConn:  TNWConnNumber.  The user's connection ID.  Obtain it using GetUserConnList..

var connStats : TNWConnStats.  A referenced structure filled with values on successful completion of the call.

Returns

Boolean.  True if the call is completed successfully.

Example

var
  connStats : TNWConnStats ;
  connList   : TConnList ;
  nconns     :  word ;
  nloop        : word;
begin
  connList := getUserConnList(getPrimaryServerID,'JIM',nConns,connList) ;
  for nloop := 1 to nConns do begin
       if getUserStats(getPrimaryServerID,connList[nloop-1],connStats) then
           okBox('Bytes Read: ' + intToStr(connStats.bytesRead)) ;
  end;
end;

See Also

getServerStats, getUserConnList


getVolFileList
getVolFileList : TStringList ;

Use getVolFileList to retrieve the contents of a network volume.

Parameters

srchText : string.  The full path and file specification in which to search.   Wildcards are allowed.

Returns

TStringlist.  The contents of the specified path and file specification.  You can easily incoprorate the output of this function into your listbox and stringGrid objects.

Example

var
  tempList : TStringList ;
begin
  templist := TStringList.create ;
  templist := getVolFileList('z:\public\*.*') ;
  listbox1.items.addStrings(templist) ;
end;

See Also

getFileInfo, getDeleteFiles, getVolumes


getVolumes
getVolumes: TStringList ;

getVolumes is a convenient method to obtain a listing of available server drive volumes.  Since the return value of this function is a TStringList, you can easily incorporate the information into your ListBoxes or StringGrids.

Parameters

nServer: TNWConnHandle.  The server connection ID.

Returns

TStringList.  The listing of available mounted volumes on the specified server.

Example

begin
  listbox1.items.addStrings(getVolumes(getPrimaryServerID)) ;
end;

See Also

Volinfo, getVolFileList, getFileInfo, getDeletedFiles


isCaptured
isCaptured : boolean

isCaptured can tell you if a particular LPT port on the workstation has been redirected to a network print device.

Parameters

nPort : TNLpt.  The LPT Port to check.

Returns

Boolean.  True if the port is redirected somewhere on the network.

Example

menuEndcap.enabled := isCaptured(1) ;

See Also

Capture, EndCap, setCaptureFlags, endCaptureFlags


isConsoleOperator
isConsoleOperator : boolean

Query logged-in user's status to see if they have Console Operator rights.  You might call this before attempting such functions as File Server statistics, LAN I/O information, or anything else that a regular Joe user should not be able to see.

Parameters

nServer : TNWConnHandle.   The Connection Handle to the file server you want to test.  You must be logged into the server to obtain this handle.  Use GetFileServerHandle if you know the server name to obtain a valid handle.

Returns

Boolean value.  True if the logged in User is a console operator.

Example

menuStats.enabled := isConsoleOperator(GetPrimaryServerID) ;


isInList
isInList : boolean

isInList simply checks to see if a particular user exists within a comma-delimited string.  isInList is a lot like IsMember.  However, IsMember checks only one user against one group at a time, and isInList compares a user against many users and/or groups in a comma-delimited string all at once.  It's just like if you created your own loop and called IsMember on each element of a comma-delimted list, skippnig anything that was not a group or did not equal the userID itself (which in fact is exactly what IsInList does!).

Parameters

cUserID : string.   The UserID you want to test
GroupList : string.  A comma-delimited list of users and/or groups that serve as the source data to test against.

Returns

True if cUserID exists anywhere in GroupList, including membership in one or more of any specified groups.

Example

menuLotus.enabled := isInList(WhoAmI,'BOB,JOE,ACCOUNTING,LOTUS') ;


isLoggedIn
isLoggedIn : boolean

IsLoggedIn can tell you if a particular user is logged into the current file server.  This is handy when you'd like to build a UserList of only those users that are actually logged into the network.

Call the SetPreferredServer function before isLoggedIn when you need to find out if a user is logged in on a file server other than the current one.

Parameters

cUserID : string.  The UserID you want to test, like SUPERVISOR or JOE.

Returns

Boolean.  True if the specified user is logged into the network.

Example

if isLoggedIn('SUPERVISOR') then
  SendLineMessage('SUPERVISOR','You Are a Nerd!') ;


isMember
isMember : boolean

Use this function when you need to know if a user is a member of a particular group.  For instance, you may have a need to restrict certain menu items to those users that are members of a particular group.  This function can be called directly to set a menu item's .enabled property, thereby disabling the item for users which are not members of the specified group.

Parameters

cUserID : string.  The UserID you want to test.  Like SUPERVISOR.

cGroup:  string.  The Group Name you want to validate against.  Like EVERYONE.

Returns

Boolean.  If cUserID is a member of the group specified in cGroup, TRUE is returned, FALSE if not.  If the UserID or Group is invalid, False is returned.

Example

menuPack.enabled := IsMember(WhoAmI,'SUPERDUPER') ;


isNWManager
isNWManager : boolean

Use IsNWManager to find out if a user has been defined as a Netware Manager.   You can specify users as managers in the Novell SysCon and NetAdmin programs.

Parameters

nServer : TNWConnHandle.  The server connection to test.  The workstation must be properly connected to the server in order to perform the function, of course.

Returns

Boolean:  True if the logged in user is a Netware Manager.  False if not.

Example

menuSuper.enabled := isNWManager ;


Map
Map : boolean

Use the Map function when you want to create a drive mapping 'on the fly' within your application.   You pass along a drive letter and complete netware-compatible path string, and NWLib allocates the drive for you and adds it to the available system drives.  You can then access the data contained in the path as if you had mapped the drive using standard Netware commands.

Parameters

cDrive : char.  The drive letter you want to create.
cPath : string.  The complete path specification, including server if desired.

Returns

boolean: True if the operation was successful and the drive mapping is properly created.

Example

if map('g','fs1/sys:mail') then
  okbox('Drive Map Created Successfully');

See Also

GetNextNetDrive


mapDelete
mapDelete : boolean

Use the mapDelete function when you need to complete remove a Netware drive mapping for the system table of available drives.

No error checking or validation is performed, so your application should provide the means to close any open data files that may exist on the removed drive.

Parameters

cDrive : char.  The drive letter to remove.

Returns

Boolean:  True if the drive is removed successfully.

Example

if MapDelete('g') then
  OKBox('Drive G Removed') ;

See Also

Map, MapShow, GetFirstNetDrive


mapShow
mapShow : TStringList

Use mapShow when you need to create a parseable listing of all available drives on the workstation.

Parameters

None.

Returns

TStringList:  A parseable listing of all available network and local drives.  The first two characters in each stringlist element represent the drive letter and colon.  The remainder of the data represents the complete path.

Example

var
  tempList : TStringList ;
begin
  templist := TStringList.Create ;
  tempList.Addstrings(mapShow) ;
end;


maxConns
maxConns : TNWNumber

This function returns the maximum number of configured server connections on the workstation.  By default, Netware allows up to 8 server connections under an IPX/ODI Driver setup.  Under VLMs, up to 32 server connections can be configured by modifications to the NET.CFG file.

See your network documentation for more information about your NET.CFG file.

Parameters

None

Returns

TNWNumber:  The total number of connections supported on the workstation.

Example

var
  tempList : TStringList ;
begin
  for nloop := 1 to maxConns do begin
      tempList.Add('Server Entry') ;
  end;
end;


nCopy
nCopy : boolean

nCopy is actually a high-level interface to two seperate functions.  The first of which is an ultra-high-speed server-to-server copy function which works only on files that exist on the same file server.  The next is for all other files, and is not quite as fast as the first, especially if the files in question reside over network connections vs. completely local storage.

nCopy first checks to see if the source and target files exist on the same file server,  If so, the function simple informs Netware the file needs to be copied, then returns the API calls returns value.  Since the file is copied mostly into memory, and the file contents never travel down the network wire, the copy is usually instantaneous on average performing networks.

nCopy automatically reverts to the standard copy routine if either of the two input files do not reside on the same physical file server storage.

Parameters

cSourcefile : String.  The full DOS pathname of the file you want to copy.

cTargetFile : String.  The complete DOS target path of the destination file.  The
directory must already exist.   If the file already exists, it will be overwritten without warning.

Returns

Boolean.  True if the file was copied successfully.

Example

if nCopy('g:\home\giant.xls','h:\excel\data\giant.xls') then
  OKBox('File Copied OK!') ;


nwInit
nwInit : boolean

NWInit should be the first NWLib call that your programs make.  You call this function to initialize the Netware DLL.  You get back a boolean value which indicates whether or not the user has a valid Netware shell loaded.

If the user does not have a valid Netware Shell environment, you should not make any network environment calls, for obvious reasons.

Returns

Boolean value.  True means network initialization occurred properly, and you can make network function calls.   False means you should not make any network calls.

Parameters

none

Example

begin
  if not NWInit then
     begin
         AlertBox('Netware Not Loaded!') ;
         close
     end;
end;


NWLogin
NWLogin : boolean

To establish a valid connection to a file server, you need to first make a connection to it with the NWLogin function.  You pass the server and user name, along with a password, and Netware validates the password and logs the workstation into the specified server if all data is correct.

Parameters

cServer : String.  The name of the server in which to perform the login.  This server becomes the default server if a successful login is made.
cUserID : String.  The UserID in which to log in.  Like SUPERVISOR or JULIE.
cPassword : String. The Password to use.  NWLib encrypts the password down the wire if encrypted passwords are enabled.

Returns

Boolean.  True if the login was successful.

Example

if NWLogin('FS1','SUPERVISOR','HELLO') then
  OkBox('Login OK!  Way to Go!') ;


NWLogOut
NWLogOut : Boolean

Use NWLogOut when you want to completely sever a workstation's connection to a particular file server.  The workstation is completely logged out, and the server connection handle is freed, making room for others if needed.

Use NWLogin if you want to re-attach to the file server and log in again.

Parameters

nServer: TNWConnHandle.  The server handle you want to disconnect.  No prompts or confirmations are displayed, so it's up to you to provide the necessary user interface/safety checks to assure the proper closing and saving of open data files.

Returns

Boolean.  True if the logout was successful.

Example

if YesNoBox('Log Out of Server ' + GetServerName(getPrimaryServerID)) then
    NWLogout(GetPrimaryServerID) ;


nwPassCheck
nwPassCheck : boolean

nwPassCheck allows you to safely verify a user's Netware password. You simply pass a userID and password string, and NWLib checks it against the Netware Bindery/NDS to see if a match is made.

Netware stores it's password information for each user in an encrypted fashion.  You can never retrieve the actual password from the Novell operating environment, only verify a password's validity.  So, unless you have a user's password to start with, you cannot find out the password, even if you are a SUPERVISOR.

A common use for this function is password-protecting menu items or creating screen blankers or other security devices.

Parameters

cUserID : string.  The UserID who's password we want to verify.
cPassword : string.  The password to validate.

Returns

Boolean:  If cUserID's password really is cPassword, then True is returned.

False is returned if cCuserID is not a valid network user or the password is not correct.

•	Note that Netware counts the number of attempts to validate a password, and may disable the login ID if too many incorrect attempts are made to try to validate a password.    If your User account is disabled because of this 'intruder lockout,' you'll need to use your SysCon or NetAdmin utility to re-activate the account, or wait until the disarm time expires.

Sub Heading

Paragraph


purgeAllFiles
purgeAllFiles  : boolean ;

Completely wipes out all recoverable files on a particular server without any confirmation or warning at all.

Once executed by a user with Console Operator rights, all deleted files are completely wiped out by the server.

Parameters

nServer : TNWConnHandle.  The server connection handle in which to wipe out the deleted files.

Returns

Boolean.  True if the operation was a success.

Example

if purgeAllFiles(getPrimaryServerID) then
    okbox('Purge Completed!') ;

See Also

Salvage, getDeletedFiles, getDeletedFileInfo


salvage
salvage : boolean ;

Use Salvage when you need to recover a file that's been deleted from a Netware volume.

Parameters

nServer : TNWConnHandle.  The server handle in which to recover the deleted file.

deletedFile : string.  The complete path specification and name of  the erased file.

outputFile: string.  The final output designation filename.  The file is written into the original file location.

Returns

Boolean.  True if the file is properly salvaged.

Example

if Salvage(getPrimaryServerID,'z:\public\deleted.doc','output.doc') then
  okbox('File Salvaged!') ;

See also

getDeletedFileInfo, getDeletedFiles, purgeAllFiles


SecureEquiv
SecureEquiv : boolean

Use SecureEquiv when you want to see if a user has a security level equal to or greater than another user on the network.  A common use for this function is for SUPERVISOR security checks, ie, to enable certain menu items and such for those users which have SUPERVISOR equivalency.

Parameters

cUserID : string.  The UserID you want to test.
cEquiv: string.  The entity to be tested against.

Returns

 If UserID's security level is equal to or greater than cEquiv, True is returned.  False otherwise.

Example

menuSuper.enabled := secureEquiv(WhoAmi,'SUPERVISOR') ;


sendLineMessage
sendLineMessage : boolean

Use sendLineMessage when you want to send a broadcast message to another user on the network.  The target user must be logged into the network at the time, must not have Broadcast messages disabled, and must not have more than two messages already waiting in the server's broadcast queue (note:  some third party  utilities increase this 2 message limit by buffering the server's broadcast messages elsewhere other than the server's internal queue).

Parameters

cUserID : string.  The target user in which to send the message.  This user must be logged into the current server.  If the user resides on a different server, make that server the default by using the SetPreferredServer function before calling sendLineMessage.
cMessageText: string.   The text you want to send to the user.  Note NWLib does not automatically pre-pend [Sender_UserID] to the front of the string.  If you choose to leave this portion off the message, you in effect are sending anonymous messages.

Returns

Boolean:  True if the message was delivered to the workstation successfully.  False could mean a variety of things, including the user not being logged into the network, or having more than 2 messages already waiting at the file server.

Example

if SendLineMessage('Jim','[' + WhoAmI + ']  ' + Hello There!') then
  OKBox('Message sent to Jim!') ;


setBannerUserName
setBannerUserName : boolean

If you need to change the UserName that appears on those print job banner pages, use this function.  This is a seperate string from the banner text.

A Banner will not print at all if the Capture environment's BannerText is empty.

Parameters

cBannerName : String.  The UserName you wish to have printed on banners.

Returns

Boolean.  Successful if the Banner UserName was changed.

Example

setBannerUserName('JIMT') ;

See Also

getBannerUserName, Capture, setCaptureFlags, getCaptureFlags


setCaptureFlags
setCaptureFlags : boolean

After a Capture has been performed on the workstation, you can use the setCaptureFlags function to change attributes about the capture environment already in place.  This change can happen right after a new NWLib Capture function call, or independently to leave the current Capture in place and just change it's attributes.

Parameters

nPort : TNWLpt.  The port number to alter.  Usually 1 to 3.

CaptureFlags : TNWCaptureFlags.  The predefined record structure containing the attributes that you want to change.

Returns

Boolean.  True if the Capture environment was changed to the new attributes specified in the the CaptureFlags record structure.

Example

var
  captureFlags : TNWCaptureFlags ;
  nLPT : TNWLpt ;
  oldqueue : string ;
begin
    nLPT := 1 ;
    if getCaptureFlags(nLPT,captureFlags) then
       begin
         captureFlags.formfeeds := False ;   { /nff }
         captureFlags.banner  := '' ;             { /nb }
         captureFlags.tabSize := 0 ;            { /nt  }
         oldqueue := captureFlags.qname ;   { i.e. Save old Capture, if you need }
         Capture('fs1','printer1',nLPT) ) then
           begin
                setCaptureFlags(GetPrimaryServerID,nLPT,captureFlags) ;
                okBox('Print Redirected to FS1/Printer1') ;
           end;
       end;
end;

See Also

getCaptureFlags, Capture, isCaptured


setCastMode
procedure setCastMode

This procedure attempts to change the broadcast mode at the current file server.  This affects the way Netware broadcast messages are handled by the network shell (NETX or other VLM).

Parameters

nMode :   specify one of the following predefined constants:
               nw_caston :  enable all broadcasts; displayed immediately.
               nw_castOff:  disable all broadcasts; discard them.
               nw_castserver  :  hold messages at server.

Returns

Nothing...it's a procedure, after all!

Example

if castoff.checked then
  setCastMode(nw_castOff) ;


SetPreferredServer
SetPreferredServer : boolean

Since Netware sometimes returns different information depending on which server is currently 'default,' you can use this function to change the active server.  After this change,  Print Capture, file server environment, bindery calls and other NWLib function calls start referring to this server connection.

Parameters

cServer : string.   Name of the server you want to make default.
VAR nServer : TNWConnHandle.  Passed by reference, NWLib returns back to you the server handle of the new default server.  You might store this variable for future needs to call the current server handle.

Returns

Boolean.  True if the change to the new server was successful.  False if not.  Maybe the cServer name is not valid?

Example

var
  templist : TStringList ;
  nloop : byte
  nConnhandle : TNWConnHandle ;
begin
  templist := TStringList.Create;
  templist.AddStrings(getConnectedServerList) ;
  for nloop := 1 to templist.Count do begin
     if setPreferredServer(templist[nloop-1],nconnHandle) then
       okBox('Connected To Server: ' + templist[nloop-1]) ;
  end;
end;


setServerDateTime
setServerDateTime : Boolean

Pass setServer a server connection handle and a valid TDateTime value, and you'll instantly set the file server's date and time.

You must have console operator rights on the specified server in order to perform this function.

Parameters

nServer : TNWConnHandle.  The server whose time clock you wish to reset.

dt: TDateTime.  The new Date and Time.

Returns

Boolean.  True if the function was successful.  Next time you log into the file server (not attach), your PC Clock will be synchronized to this new time, unless you disabled that feature through a NET.CFG setting.

Example

var
  dt : TDateTime
begin
   dt := strToDateTime('12/25/95 12:00:01 am') ;
   if setServerDateTime(dt) then
     OKBox('Ho Ho Ho!  Merry Christmas!') ;
end;

See Also

Paragraph


sList
sList : TStringList

Use the sList function when you need to fill up a TStringList with the names of the servers that are visible at the current workstation.  You can use this TStringList as the foundation for a listbox or create a loop and act on each of the server names independently.

Parameters

None

Returns

TStringList:  The complete list of file servers advertising on your network.

Example

var
  templist : TStringList ;
  nloop : byte;
begin
  templist := TStringList.Create ;
  templist.AddStrings(sList) ;
  for nloop := 1 to tempList.count do begin
    okBox('Found Server: ' + templist[nloop-1]) ;
  end;
end;


TNWCaptureFlags

Copies	: longint    ;	 # of Copies
TabSize	: longint    ;	Tab Conversion (0=No Tabs)
formType	: longint    ;	Form Number
timeOut	: longint    ;	Time Out Value
description	: string     ;	Job Name (For Queue Display)
formName	: string     ;	Form Name
banner	: string     ;	Banner Text (Empty=/NB)
qname	: string     ;	RO : Queue Name
nServer	: TNWConnHandle ;RO:  Server Name
autoEndCap	: boolean       ;	Auto-EndCap job on exit
formFeed	: boolean       ;	Enable FormFeeds?
JobNotify	: boolean       ;	Enable Job Notification?


TNWLib

NWInit

whoAmI

fullName

getObjName

getObjType

getObjID

getObjNumber

getPrimaryServerID

getConnectID

maxConns

sendLineMessage

getBinderyList

getMemberList

setCastMode

getBroadcastMode

isMember

isLoggedIn

isConsoleOperator

isNWManager

secureEquiv

nCopy

isinList

getFirstNetDrive

getNextNetDrive

map

mapDelete

mapShow

getServerName

getServerDate

getserverTime

getConnectedServerList

setPreferredServer

NWPassCheck

sList

getMyGroups

getConnectInfo


whoAmI
whoAmI : string

Just like Novell's own command line utility of the same name, WhoAmI allows you to fetch the current user's Login Name at the preferred server.

If you need a user's login name on a different server, you should make that server the default server by calling the SetPreferredServer function.

Returns

String:  The name of the user logged in on the current server.

Parameters

None.

Example

begin
  footer.caption := whoAmI;
  if fileExists('m:\home\' + whoAmI + '\zofo.zep') then
     AlertBox('Cool.') ;
end;


TNWPrint

Capture

EndCap

isCaptured

setCaptureFlags

getCaptureFlags

getMaxPrinters

setBannerUserName

getBannerUserName


TNWServer

disableLogins (console operators only)

enableLogins (console operators only)

downServer (console operators only)

NWLogin

NWLogout

getServerHandle

getVolumes

getVolFileList

volinfo (Netware 2.2 only)

salvage

getDeletedFiles

getDeletedFileInfo

purgeAllFiles (console operators only)

getCacheInfo     (Netware 4.x only)

getFileSysStats      (Netware 2.2 only)

getDiskCacheStats    (Netware 2.2 only)

getServerStats (some items Netware 4.x only)

getUserStats    (Netware 4.x only with console operator rights)

getUserConnList


volinfo
volinfo : boolean ;

To obtain physical information about a Netware 2.2 server volume, use this function.

Parameters

nServer ; TNWConnHandle .  The Netware 2.2 server handle containing the volume in which to obtain physical information.

volName : string.  The physical volume name to query, such as 'SYS:' or 'VOL1:'

var volumeInfo : TNWVolumeInfo.  A referenced structure filled with all sorts of handy information.

Returns

Boolean.  True if the referenced structure is properly filled with physical volume information.

Example

var
  volumeinfo : TNWVolumeInfo ;
begin
   if volinfo(getPrimaryServerID,'SYS:',volumeInfo) then
      okBox('Total Blocks: ' + intToStr(volumeInfo.totalBlocks)) ;
end.

See Also

getServerStats


TNWTools

String Manipulation

allTrim(ctext : string) : string ;

Removes all leading and trailing white space from a pascal-style string.

LTrim(ctext ; string) : string ;

Removes leading white space from a pascal-style string.

RTrim(ctext : string) : string ;

Removes trailing white space from a pascal-style string.

left(ctext : string) : string ;

Returns the left-most portion of a pascal-style string.

right(ctext : string; nLength: integer) : string ;

Returns the right-most portion of a pascal-style string .

padC(ctext : string ; nLength : integer ; cChar : char) : string ;

Add white space to both sides of a pascal-style string until it is x number of bytes in length.

Longer strings are truncated to the maximum length specified in nLength.

padL(ctext : string ; nLength : integer ; cChar : char) : string ;

Add white space to the left side of a pascal-style string until it is x number of bytes in length.

Longer strings are truncated to the maximum length specified in nLength.

padR(ctext : string ; nLength : integer ; cChar : char) : string ;

Add white space to the right side of a pascal-string until it is x number of bytes in length.

Longer strings are truncated to the maximum length specified  in nLength.

Rat(ctoken : char ;  ctext : string) : integer ;

Return the right-most ordinal position of a particular character within a pascal-style string.

strExtract(ctext : string ; cToken : char ; nPos : integer) : string ;

Extracts a delimited substring of a string.    For example, you could use this function to extract out the 4th element of a comma-delimted string.   You specify the sournce string, the characters which make up the delimiters, and finally, which sub-element you want extracted.

strTran(ctext, cFor, cWith : string) : string ;

Converts a all instances of a particular character in a string to any other character.

iif(Expression : boolean; cReturn1, cReturn2 : string) : string ;

Returns one of two strings, depending on boolean value.  Very handy for button captions and dynamic string handling functions.  For instance, you can build an expression that says "Yes" if the value is True, or "No" if the value is false.

Dialogs

procedure alertBox(cMessage : string) ;

Diaplay a standard modal Windows "Stopsign" dialog box.

procedure okBox(cMessage : string) ;

Displays a standard modal Windows "Information" dialog box.

yesNoBox(cMessage : string) : integer ;

Displays a standard modal Windows "Question" dialog box.

YNCBox(cMessage : string) : boolean ;

Displays a standard modal Windows "Yes/No/Cancel" dialog box.

Calculators

charCount(ctext : string; ctoken : char) : integer ;

Counts the occurences of a character within a string.

minLong(nval1, nval2 : Longint) : Longint ;

Returns the lower of two values.

maxLong(nval1, nval2 : Longint) : Longint ;

Returns the higher of two values.

delim2strList(ctext : string) : TStringList ;

Converts a comma-delimited string list into a TStringList object, filled with the values wthin the string.  Great for converting data records into listboxes and such.

strEmpty(ctext : string) : boolean ;

True if the specified pascal-style's string length is less than 1.

aSub(atemp : array of char ; nstart, nend : word) : string ;

Returns a substring of a zero-based character array.  You specify the starting and ending positions, and a pascal-style string is returned.  Very handy for scanning large memos/pChars and displaying the contents in a button or other screen object.

stringListPos(strList : TStringList ; ctext : string ; var index : word) : boolean ;

Returns the ordinal position of a substring with a TStringList object.  The value returned is the row in which the substring exists.

space(nlength : word) : string ;

Returns a string containing x number of white spaces.

between(nVal, nMin, nMax : longint) : longint ;

Tests to see if a value is between two other values.

File Functions

setPath(cpath : string) : string ;

Returns a nicely formatted path specification.  It ensures the path contains a trailing backslash, the drive letter and colon are present within the string and it satisfies standard DOS naming conventions.

canOpen(cfile : string) : boolean ;

Tests to see if any particular file can be opened for read by your workstation.  It's a good idea to do this before trying to open any file that may result in an undesired error message or situation.

funique(cpath : string) : string ;

Creates a guaranteed unique file name in the path you specify, and returns to you the name of the file that was created.

sizeofFile(cfile : string) : longint ;

Gives you the size of the specified file.

isDBF(cfile : string) : boolean ;

Looks at the first few bytes of a file and determines if it contains a dBase signature.

Date/Time Functions

timeTextInc(ctime : string; nway : integer) : string ;

Rounds time string up or down to the nearest 15 minutes.  For instance, when incrementing a time string, 11:28 becomes 11:30 and 11:30 becomes 11:45.

dateTextInc(ctime : string; nway : integer) : string ;

Moves date string up or down by one day, honoring all standard leap year and last-day-of-month conventions.

formTime(cdate : TDateTime) : string ;

Returns a nicely formatted time string based on a TDateTime variable.

formDate(cdate : TDateTime) : string ;

Returns a nicely formatted date string based on a TDateTime variable.

year(ctime : TDateTime) : byte ;

Extracts the year portion from a TDateTime variable.

month(cdate : TDateTime) : byte ;

Returns the month number from a date variable.

day(cdate : TDateTime) : byte ;

Returns the day portion of a TDateTime variable.

second(ctime : TDateTime) : byte ;

Returns the second portion of a TDateTime variable.

minute(cdate : TDateTime) : byte ;

Retuns the minute portion of a TDateTime variable.

hour(ctime : TDateTime) : byte ;

Take a guess.

I'm tired of writing.


Bindery Object Types

NWLib defines many Netware object types, including nw_user, nw_group, nw_printq, nw_server, etc.


TNWConnectInfo

<structures>


TNWConnStats

<structures>


TNWDeletedFileInfo

<structures>


TNWDiskCacheInfo

<structures>


TNWFileInfo

<structures>


TNWFileSysInfo

<structures>


TNWLib

<TNWLib>


TNWMemCacheInfo

<structures>


TNWPrint

<TNWPrint>


TNWServer

<TNWServer>


TNWServerInfo

<structures>


TNWTools

<TNWTools>


TNWVolInfo

<structures>