© 1983-2012 Novell. See COPYRIGHT file for details.

File System NCPs


File System NCPs enable developers to perform many tasks all of which fall into two broad categories. First, developers can obtain information about files, volumes and directories. For example, developers can get a file's size, get file or subdirectory information, get directory rights, get name space information, get a volume name or number, and so on and so on.

Second, File System NCPs enable developers to manipulate files and directories. For example, using File NCPs, developers can create, open, read, write, close, delete, and rename files. They can also manipulate extended file attributes, restore erased files, purge deleted files, set and scan file information, and copy files between directories on the same file server. Using Directory NCPs developers can create, rename, and delete directories. They can also modify a directory's maximum rights mask, add and delete directory trustees, allocate and deallocate directory handles, and so on and so on. This introduction is divided into the following sections:


File Security

The server strictly enforces file access security to ensure that clients are allowed access only to files for which they have been granted rights. In addition, the server coordinates file access among clients so that file data integrity can be maintained in the distributed multiuser environment created by multiple clients contending for the same information.

A client's access to files in a directory area is controlled by the effective rights the client has in the directory. These rights are specified later in this Introduction in section 5.3 Directory Access Rights. In addition, each file has four file attribute bytes (bytes 0-3) that control access to the file. The bits of each of the four file attribute bytes are defined as follows:

Byte 0 Bit Definition
7654 3210 Definition
x






Shareable Bit

x





Execute Confirm Bit


x




Archive Bit



x



Subdirectory Bit




x


Excute Only Bit





x

System Bit






x
Hidden Bit







x Read Only Bit

BitNameBit Description
0 Read Only File can be read but not written to.
1 Hidden File will not be shown in a normal directory listing.
2 System File will not be shown in a normal directory listing.
3 Execute Only File can be loaded for execution only; once this Bit has been set, it cannot be cleared.
4 Subdirectory Entry is a subdirectory, not a file.
5 Archive Bit is set if the file has been changed since it was last backed up.
6 Execute Confirm
7 Shareable Bit is set if file can be simultaneously accessed by more than one user.

Byte 1 Bit Definition
15141312 111098 Definition
x






Write Audit Bit

x





Read Audit Bit


x




Indexed Bit (old)



x



Transaction Bit




x


No Suballoc Bit





x

Search Bit






x
Search Bit







x Search Bit

BitNameBit Description
8-10 Search Mode The Search Mode, which is comprised of the first three bits, is only valid with NetWare v2.0a and above. The possible values of the Search Mode are listed in the following table.
11 Indexed If set, the OS will index the file's sectors in the File Allocation Tables (FATs) thereby reducing the time it takes to access the file.
12 Transactional If set, the Transaction Tracking System (TTS) will track all writes to the file during a transaction. A transaction file cannot be deleted or renamed. (See the chapter on the Transaction Tracking System.)
13 Reserved
14 Read Audit Set only by users with supervisor security equivalence.
15 Write Audit Bit Set only by users with supervisor security equivalence.

Bit OffsetDecimal
Equivalent
Search Mode
10
9
8


0 0 0 0 Search On All Read Only Opens
0 0 1 1 Search On Read Only Opens With No Path
0 1 0 2 Shell Default Search Mode
0 1 1 3 Search On All Opens With No Path
1 0 0 4 Do Not Search
1 0 1 5 Reserved-Do Not Use
1 1 0 6 Search On All Opens
1 1 1 7 Reserved-Do Not Use

Clients can access files by name when files are being created, deleted, renamed, searched for, and opened. When a file is opened, the server gives the client a 6-byte file handle that the client must supply to the server when the client accesses the file for reading, writing, or closing. To a client, a file is a logical byte stream. The client can read or write "records" of varying sizes starting at any byte offset within the file.

A client must specify the search attributes when making requests to open a file, rename a file, erase a file, search for a file, set a file's attribute byte, or get or set a file's extended attribute byte. The bits of the search attributes byte correspond to the bits in the file attributes byte. However, the only bits that are significant in the search attribute byte are the "hidden" and "system" bits. A normal file is a file whose system and hidden bits are clear in its file attributes byte.

A system file is a file whose system bit is set; a hidden file is a file whose hidden bit is set. For functions that require the search attributes, the following table applies:

Hidden BitSystem BitFiles Recognized by File Server
0 0 Normal files only
0 1 Normal files and system files only
1 0 Normal files and hidden files only
1 1 All files

Byte 2

Byte 2 Bit Definition
23222120 19181716 Definition
x






Inhibit Data Migration Bit

x





Data Migrated Bit


x




reserved



x



File Auditing Bit




x


Copy Inhibit Bit





x

Delete Inhibit Bit






x
Rename Inhibit Bit







x Immediate Purge Bit

Byte 3

Byte 3 Bit Definition
31302928 27262524 Definition
x






reserved

x





Attributes Archive Bit


x




Can't Compress Data Bit



x



reserved




x


Compression Inhibit Bit





x

Data Stream Compressed Bit






x
Compress Immediate Bit







x Data Migration Save Key Bit


File Names

In each function that requires a filename, a client must provide a directory handle and a path/file name. The path/file name can contain directories down to any level, but the last part of the string must be the name of the desired file. The path specified in the path/file name specification is interpreted as a path that begins at the directory pointed to by the client's directory handle. If a client wishes, a full path/file name of the form "<F29>volume:directory/.../directory/filename<F0>" and a directory handle of zero (0) can be used.

Filenames can be up to 14 characters long. Filenames can contain any characters greater than 0x20 (ASCII space), except the following:

Periods are legal characters in a filename and are treated like any other character.


Directory Access Rights

Several protocols have an Access Rights Mask field, which is used for either retrieving or setting security information about directories. This section discusses such fields.

Disk space on a file server is divided into one or more named logical volumes, with each volume having its own separate hierarchical directory structure. Each directory has a list of trustees and trustee access rights; a trustee in the trustee list is represented by the object ID of some object (user or group) that is given certain access privileges to the directory. Trustee access privileges are represented by a 1-byte mask, with the bits yielding the following function:

BitFunction
0Set if trustee can read from files in this directory.
1Set if trustee can write to files in this directory.
2Set if trustee can open existing files in this directory.
3Set if trustee can create files in this directory.
4Set if trustee can delete files in this directory.
5Set if trustee has parental rights in this directory (Parental rights include the ability to create and delete subdirectories, and the right to make other objects trustees of this directory or its subdirectories).
6Set if trustee can search this directory.
7Set if trustee can modify the status flags of files in this directory and rename files.

The access rights granted to an object in a directory within a directory tree are inherited by that object in all subdirectories below that directory. The inherited rights are effective only down to a subdirectory in which other access rights have been granted.

In addition to the rights granted to each trustee individually, each directory has associated with it a maximum access rights mask, that indicates which access actions can occur in the directory. A trustee is allowed only the rights that appear in both the trustee's access rights mask and the directory's maximum access rights mask (logical AND of the trustee's access rights mask and the directory's maximum access rights mask).

The NetWare implementation of the file service protocols allows a client to claim security equivalence to as many as 33 trustees (user or group objects) at once. If object A is made "security equivalent" to object B, object B's object ID is added to the SECURITY_EQUALS property of object A. An object that is security equivalent to another object has the access rights of both objects combined. For example, object JOE (a user object) might be security equivalent to one or more other user or group objects (no more than 33). If JOE is a trustee in a directory and JOE is given Read, Open, and Search access rights in that directory, JOE can search for, open, and read files in that directory and all its subdirectories if the maximum access rights of the directory and subdirectories include Read, Open, and Search rights. Later, JOE is made security equivalent to the SUPERVISOR object. JOE now has all rights of JOE as a trustee and JOE as a security equivalent of SUPERVISOR. Therefore, JOE can do anything that the object JOE is granted as a trustee of the directory, and JOE can do anything that the SUPERVISOR object can do in the directory. In other words, JOE's actual access rights in a given directory are computed by combining (logically ORing) JOE's access rights with the rights of the other trustees to which JOE is security equivalent and then logically ANDing these rights with the directory's maximum access rights mask.

NOTE: A client's trustee number (also known as the Object ID) is determined when the client calls Login Object (function 23, subfunction 20).


Directory Handle Table

The following sections discuss the NetWare implementation of the workstation shell and the file server operating system. Both the NetWare file server and the workstation maintain several tables used for directory services. A particular implementation must comply with the following design if it is to remain compatible with NetWare v2.x.

Each workstation attached to a given file server can allocate up to 256 directory handles on that file server. A directory handle is a number (00h to FFh) that points to a volume or a directory path. A file server maintains a Directory Handle Table for each attached workstation. A Directory Handle Table consists of 256 slots. Each slot represents a directory handle. For example, the first slot represents directory handle 1, the second slot represents directory handle 2, and so on. Each slot contains a volume name or a directory path. For example, slot 5 represents directory handle 05h, which points to the volume or directory path contained in slot 5.

A developer can use Directory Services system calls to access up to 256 directory handles for the workstation on which an application is running. Once a directory handle is set, the directory handle can be used to specify a volume or a directory path on a file server.

Frequently, when making a Directory Services system call, a programmer must target a particular directory in the request buffer using one of the following three methods:

Directory Services system calls do not specify the file server. (Volume names and directory paths do not include file server names.) Before a Directory Services system call is made, the target file server should be the current file server.


Workstation Tables

A workstation maintains three tables that correspond to each other and relate to the file server's Directory Handle Table: a Drive Handle Table, a Drive Flag Table, and a Drive Connection ID Table. Each table consists of 32 1-byte entries. The first 26 slots of each table represent the permanent drive letters A to Z. The last 6 slots represent the temporary drive letters in the order listed below:

Each slot in the Drive Handle Table contains a directory handle number. For example, if slot 6 in the table contains the value 02h, then drive letter F (the sixth letter in the alphabet) points to the volume or directory path contained in slot 2 of the file server's corresponding Directory Handle Table.

Each slot in the Drive Flag Table contains one of the following values:

0x00The drive is unallocated.
0x01The drive is a permanent network drive.
0x02The drive is a temporary network drive.
0x80The drive is a local drive.
0x81The drive is a local drive allocated as a permanent network drive.
0x82The drive is a local drive allocated as a temporary network drive.

Each slot in the Drive Connection ID Table contains a value (00h to 08h) identifying the server to which the drive letter is mapped. The value represents the position (slot 1 to slot 8) of the file server in the workstation's Server Name Table and Connection ID Table. (For more information about the Server Name Table and the Connection ID Table see Introduction to Connection Services.)

An application can only allocate the first 26 drive letters (A to Z) as permanent network drives. An application can allocate any of the 32 drive letters as temporary drives. A temporary drive remains allocated only as long as the application remains active.

Directory Services system calls that allocate and deallocate directory handles map (or assign) workstation drives to directory handles by accessing these three workstation tables.


Directory Table

To record information about directories, a file server maintains a Directory Table. The Directory Table consists of several kinds of 32-byte entries, including directory nodes, file nodes, and trustee nodes.

A directory node includes the following information about a directory: directory name, attribute byte, maximum rights mask, creation date, creator's object ID, a link to the parent directory, and a link to a trustee node (if one exists).

A file node includes the following information about a file: file name, attribute byte, extended attribute byte, file size, creation date, last-accessed date, last-updated date and time, and a link to a directory.

A trustee node includes the following information: the object IDs of one to five trustees of a directory linked to the trustee node, one to five corresponding trustee rights masks, a link to a directory, and a link to the next trustee node (if one exists).

Directory Services system calls that return directory information and manipulate rights access the Directory Table.


Volume Table

To record information about volumes, a file server maintains a Volume Table that includes the number of volumes mounted in the file server, the names and sizes of each volume, and other information pertaining to each volume. System calls that return information about volumes access the Volume Table.

NOTE: Scanning directories is accomplished with File Search Initialize (function 62) and File Search Continue (function 63). These calls are found in the File Services section.


Information About NetWare v3.1 and Above NCPs

This section illustrates and explains the bit masks and structures that enable client-server communication using NetWare v3.1 and above NCPs. These NCPs are provided to allow the NetWare v3.1 and above operating system to become independent of the client workstation, no matter which operating system the workstation is using. Name Space modules will still be required, but internal hooks for each client will not be required in the network operating system.

Typically, clients request information from the server by setting selected bits or by filling fields of a particular structure with information. The server responds by returning information in the fields of a particular structure.

The bit masks and structures explained in this section are referenced by fields in the Request and Reply Formats of the NCP calls. As developers use the NCP calls, they can refer back to this section as needed for further information about particular fields. The following structures and bit masks are explained:

NetWareInformationStructure Definition

The NetWareInformationStructure encompasses both the way a client requests information from a server and the way a server responds to a client's request. The client-request and server-response process works as follows.

When, in a client's request packet, a particular bit in the ReturnInfoMask field (LONG) is set, the server uses the corresponding structure in the NetWareInformationStructure to return the requested information in a reply packet. For example, if the Rights Information bit of the ReturnInfoMask field is set, the server uses the RightsInfoStruct field of the NetWareInformationStructure to return information about a specified file's rights.

Note: The server always returns a full NetWareInformationStructure regardless of the bit or bits a client sets; however, the NetWareInformationStructure contains valid information ONLY for those field or fields that have been set, and only upon successful completion of the NCP call.

This discussion of the NetWareInformationStructure is divided into the following parts:

ReturnInfoMask Field

To request information from a server, a client sets the appropriate bit or bits of the ReturnInfoMask field and sends a request packet to the server. To return information when a particular bit in the ReturnInfoMask field is set, the server uses the particular structure in the NetWareInformationStructure that corresponds to the bit or bits that have been set. More information on the bits in the ReturnInfoMask field are given in the discussion of the NetWareInformationStructure.

Note the Include File Name Structure bit in the ReturnInfoMask. When this bit is set, the server returns a file name and a file name length in a NetWareFileNameStruct structure. Since this structure is not a field of the NetWareInformationStructure, it is discussed under the heading "NetWareFileNameStruct Definition." The ReturnInfoMask is defined below. (Note that only bits 0-11 are defined in v3.11, while all other bits are defined in v4.x. Also, the NetWare Compress Information Flag bit must be set to get this 4.x information.)

Return Info Mask Bits
15141312111098 76543210 Variable (Structures)
0














reserved

0













reserved


0












reserved



0











reserved




x










Rights Information





x









Directory Information






x








Name Space Information







x







Creation Information








x






Modify Information









x





Archive Information










x




Extended Attributes Information











x



Total Space Allocated For All Data Streams












x


Data Stream Size Information













x

Attributes Information














x
Data Stream Space Allocated Information















x Include File Name Structure

NetWare Info Structure Additions for NetWare 4.10 and NetWare 4.11

Several new pieces of information are available in the NetWareInfoStruct in v4.10 or greater, that are not available in previous version of NetWare. First, to better facilitate the space usage in a reply packet the following bit was in the ReturnInfoMask field, so that only the information requested by the caller will be returned instead of the complete structure as in previous version of NetWare:

#define RNewStyle 0x80000000

The new information bits available to the caller (only when the RNewStyle bit is set) are shown below, followed by explanations.

Extended Return Info Mask Bit Definitions
3130292827262524 2322212019181716 15141312 Definition
x


















New Style (Compress Reply Info)

0

















Reserved


0
















Reserved



0















Reserved




0














Reserved





x













64 bit file sizes(NW v6.sp2 or greater )






0












Reserved







x











Last Accessed Time(NW v5.00 or greater )








x










MAC Date & Time ( NW v4.11 or greater )









x









Effective Rights ( NW v4.11 or greater )










x








Sibling Count ( NW v4.11 or greater )











x







MAC Finder Info ( NW v4.11 or greater )












x






Parent Base ID ( NW v4.11 or greater )













x





Flush Time ( NW v4.11 or greater )














x




DOS Name ( NW v4.11 or greater )















x



Last Updated In Seconds ( NW v4.11 or greater )
















x


Data Stream Logical

















x

Data Stream Actual


















x
Name Space Attribute



















x Reference ID

RReferenceID bit is used to get the change count on a file, directory, or the volume. This can be used to tell if something has changed. The following structure is returned when this bit is enabled:

	typedef struct 
	{
		WORD CurrentReferenceID;
	} ReferenceIDStruct;

RNSAttribute bit is used to get the file attribute value of the entry requested, the following structure is returned when this information is requested:

	typedef struct
	{
		LONG FileAttributes;
	} NSAttributeStruct;

RDataStreamActual bit is used to get a list of data streams and the number of FAT blocks associated on a file, the following structure is returned when this information is requested:

	typedef struct
	{
		LONG DataStreamNumber;
		LONG DataStreamFATBlockSize;
	} DataStreamFATInfo;

	typedef struct
	{
		LONG NumberOfDataStreams;
		DataStreamFATInfo ds[NumberOfDataStreams];
	} DStreamActual;

RDataStreamLogical bit is used to get a list of data streams and their sizes on a file, the following structure is returned when this information is requested:

	typedef struct
	{
		LONG DataStreamNumber;
		LONG DataStreamSize;
	} DataStreamSizeInfo;

	typedef struct
	{
		LONG NumberOfDataStreams;
		DataStreamSizeInfo ds[NumberOfDataStreams];
	} DStreamLogical;

RLastUpdatedInSeconds bit is used to get the last time a file or directory was updated in the Number of Seconds relative to the year 2000, the following structure is returned when this information is requested:

	typedef struct
	{
		LONG SecondsRelativeToTheYear2000;
	} LastUpdatedInSecondsStruct;

RDOSName bit is used to return the DOS name of a file or directory independent of the caller specified name space value, the following structure will be returned when this information is requested:

	typedef struct
	{
		BYTE DOSNameLength;
		BYTE DOSName[DOSNameLength];
	} DOSNameStruct;

RFlushTime bit is used to return the flush time on a file, the following structure will be returned when this information is requested:

	typedef struct
	{
		LONG FlushTime;
	} FlushTimeStruct;

RParentBaseID bit is used to return the Parent (father) Directory Base number on a file or subdirectory, the following structure will be returned when this information is requested:

	typedef struct
	(
		LONG ParentBaseID;
	} ParentBaseIDStruct;

RMACFinderInfo bit is used to return the Macintosh Finder information on a file or subdirectory (this is only valid information when the MAC Name Space is loaded on the specified volume), the following structure will be returned when this information is requested:

	typedef struct
	(
		BYTE MacFinderInformatio[32];
	} MacFinderInfoStruct;

RSiblingCount bit is used to return the number of siblings (children) in a subdirectory (only subdirectories can have siblings), the following structure will be returned when this information is requested:

	typedef struct
	(
		LONG SiblingCount;
	} SiblingCountStruct;

NOTE: The SiblingCount (mask 0x20000000) is always zero for a subdirectory.

REffectiveRights bit is used to return the Effective Rights of a specified path, the following structure will be returned when this information is requested:

	typedef struct
	(
		LONG EffectiveRights;
	} EffectiveRightsStruct;

RMACDateAndTime bit is used to return the Macintosh Date & Time fields (this is only valid information when the MAC Name Space is loaded on the specified volume), the following structure will be returned when this information is requested:

	typedef struct
	(
		int	MACCreateTime;
		int	MACBackupTime;
	} MacTimeStruct;

The MACCreateTime field specifies the time the Macintosh entry was created.

The MACBackupTime field specifies the time that the Macintosh entry was last backed up.

RLastAccessedTime bit is used to get from a file the last time it was accessed. The Time format is the same as the DOS Time field. The following structure is returned when this bit is enabled:

	typedef struct 
	{
		WORD LastAccessedTime;
	} LastAccessedTimeStruct;

The LastAccessedTime field specifies the last time a file was accessed, which includes being opened, written to, or having it's time/date stamp changed.

R64BitFileSize bit is used to get the 64 bit file size of a file on an NSS Volume. If the request is made on a traditional volume, then a 32 bit file size is returned with the upper 4 bytes zeroed:

	typedef struct 
	{
		UINT64 FileSize;
	} 64BitFileSizeStruct;

NetWareInformationStructure

The NetWareInformationStructure is a composite structure comprised of many small structures of information. Each small structure corresponds to a particular bit of the ReturnInfoMask field. Hence, the server returns valid information in a particular structure only when the client specifically requests that information by setting the appropriate bit of the ReturnInfoMask field, and only when the server returns a SUCCESSFUL completion code.

Note: The server always returns a full NetWareInformationStructure regardless of the bit or bits a client sets; however, the NetWareInformationStructure contains valid information ONLY for those field or fields that have been set, and only upon successful completion of the NCP call.

When the server gathers information for the NetWareInformationStructure, naturally the more information a client has requested the longer the reply takes. Because of this, the client should request only information needed.

Furthermore, the server requires extremely large amounts of time to collect information for some pieces than from others. For example, the server requires an unusually longer time to collect the DataStreamSpaceAllocatedInformation piece.

The layout of the NetWareInformationStructure and the smaller structures of which it is composed follows. Each field in the structure is a smaller structure that corresponds to a bit of the ReturnInfoMask field.

OffsetContentType
0DSSpaceAllocateStruct (Data Stream Alloc Bit)STRUCTURE
+AttributesStruct (Attributes Bit)STRUCTURE
+DataStreamSizeStruct (Data Stream Size Bit)STRUCTURE
+TotalStreamSizeStruct (Total Stream Size Bit)STRUCTURE
+CreationInfoStruct (Creation Bit)STRUCTURE
+ModifyInfoStruct (Modify Bit)STRUCTURE
+ArchiveInfoStruct (Archive Bit)STRUCTURE
+RightsInfoStruct (Rights Bit)STRUCTURE
+DirEntryStruct (Directory Entry Bit)STRUCTURE
+EAInfoStruct (Extended Attribute Bit)STRUCTURE
+NSInfoStruct (Name Space Bit)STRUCTURE

Data Stream Space Allocated Information Structure

	Offset	Content					Type
	0	DataStreamSpaceAlloc	(variable) 	LONG (Lo-Hi)

Attributes Information Structure

	Offset	Content				Type
	0	Attributes	(variable)	LONG (Lo-Hi)
	4	Flags		(variable)	WORD (Lo-Hi)

Data Stream Size Information Structure

	Offset	Content				Type
	0	DataStreamSize	(variable)	LONG (Lo-Hi)

(The DataStreamSizeStruct field is synonymous to file size in the DOS name space.)

Total Streams Data Size Information Structure

	Offset	Content					Type
	0	TtlDSDskSpaceAlloc	(variable)	LONG (Lo-Hi)
	4	NumberOfDataStreams	(variable)	WORD (Lo-Hi)

(The TtlDSDskSpaceAlloc field is the number of 4K blocks that the given file is using.)

Extended Attributes Information Structure

	Offset	Content				Type
	0	ExtAttrDataSize	(variable)	LONG (Lo-Hi)
	4	ExtAttrCount	(variable)	LONG (Lo-Hi)
	8	ExtAttrKeySize	(variable)	LONG (Lo-Hi)

Archive Information Structure

	Offset	Content				Type
	0	ArchivedTime	(variable)	WORD (Lo-Hi)
	2	ArchivedDate	(variable)	WORD (Lo-Hi)
	4	ArchiverID	(variable)	LONG (Hi-Lo)

Modify Information Structure

	Offset	Content				Type
	0	ModifiedTime	(variable)	WORD (Lo-Hi)
	2	ModifiedDate	(variable)	WORD (Lo-Hi)
	4	ModifierID	(variable)	LONG (Hi-Lo)
	8	LastAccessDate	(variable)	WORD (Lo-Hi)

Creation Information Structure

	Offset	Content				Type
	0	CreationTime	(variable)	WORD (Lo-Hi)
	2	CreationDate	(variable)	WORD (Lo-Hi)
	4	CreatorID	(variable)	LONG (Hi-Lo)

Name Space Information Structure

	Offset	Content				Type
	0	CreatorNameSpaceNumber		LONG (Lo-Hi)

Dir Entry Information Structure

	Offset	Content				Type
	0	DirectoryEntryNumber		LONG (Lo-Hi)
	4	DOSDirectoryEntryNumber		LONG (Lo-Hi)
	8	VolumeNumber			LONG (Lo-Hi)

Rights Information Structure

	Offset	Content					Type
	0	InheritedRightsMask	(variable)	WORD (Lo-Hi)

NetwareFileNameStruct Definition

The NetWareFileNameStruct structure is used to pass a filename back to the client. It consists of a byte length field and a filename field. The filename is limited to a maximum of 255 characters.

Note: The server always returns the NetWareFileNameStruct for the following NCPs: Search For File or Subdirectory (0x2222 87 20) and (0x2222 89 20). For all other NCPs, the NetWareFileNameStruct is returned to the client only when the IncludeFileNameStructure bit is set in the ReturnInfoMask field.

File Name Information Structure

	Offset	Content				Type 
	0	FileNameLength	(variable)	BYTE
	1	FileName[]	(variable)	BYTE

NetWare Handle and Path Structure Definition

The NetWareHandlePathStruct is a multi-definition structure that clients can use to pass a Handle or Path to the server. The client can pass a handle or path by using the Volume Number field, the Dirctory Base field, or the Directory Handle field.

The first part of the Handle\Path structure is used to pass to the server either a 1-byte Directory Handle (v2.15 Style Short Directory Handle) or a 4-Byte Directory Base (v3.1 Style). The layout of the handle portion of the structure is as follows:

	BYTE	Volume Number;
	LONG	Directory Base or Short Directory Handle; (Lo-Hi)
	BYTE	Handle Flag;
	BYTE	Path Component Count;    /* Count for each directory and subdirectory. For
						example, SYS:TEST\NLM_TEST would be a path
						component count of 3. */

The client can pass a Short Directory Handle (with or without a path) a Directory Base (with or without a path), or a fully qualified path.

The server always checks the Handle Flag field to see if the handle is a Short Directory Handle (0), a Directory Base (1), or No Handle Present (FF). It performs the appropriate action based on the Handle Flag.

If the server checks the Handle Flag and finds that the client has passed a Short Directory Handle or a Directory Base, the server can use the Path Component.

If the server checks the Handle Flag and finds that the client has passed no handle, the server expects the first path component to contain the Volume Name. If there are additional components, the server handles them after generating a Volume Number.

The second portion of the Handle\Path structure is used to pass a qualified NetWare Path (Len, String) in component form (Path Component Count is used for the number of Components). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:

		struct
		{
			BYTE PathNameLen;
			BYTE PathName[];
		} Pcomponent[];

The following structure is a complete definition of the Handle/Path structure. Following it is a pseudo code definition:

	BYTE	VolumeNumber;
	LONG	DirectoryBaseOrShortHandle; (Lo-Hi)
	BYTE	HandleFlag;
	BYTE	PathComponentCount;
	STRUCT	Pcomponent [PathComponentCount];

The Handle/Path structure totals 307 bytes. If you have other structures or data that follow this structure, that data will start after the 307 bytes reserved for Handle/Path.

HandleFlag

	#define ShortDirectoryHandle	0x00
	#define DirectoryBase	0x01
	#define NoHandlePresent	0xFF
	if (Handle Flag == Directory Base)
	{
		/* Client passed in Volume Number and Directory Base */
		/* Set Path Base from Directory Base */
	}
	else
	{
		if (Handle Flag == No Handle Present)
		{
		     /* Generate Volume Number from the first Path Component */
		     /* Set path base to 0, & subtract 1 from Path Count */
		}
		if (Handle Flag == Short Directory Handle)
		{
		     /* Get path base from allocated short directory handle */
                 /* Get Volume Number from Directory Handle table entry */
		}
		/* check to see if more components present */
		if ( Path Count > 1)
		{
		     /* find last component */
		     /* Map path to last component */
		     /* Set the Path Base */
		}
	}
	/* return updated Volume Number, Path Base */

NOTE: The Rename File/SubDir NCP uses a slightly modified NetWareHandlePathStruct.


NetWare Trustee Structure Definition

The Trustee structure is only applicable to the following v3.1 NCPs:

	Add Trustee Set To File or SubDirectory
	Delete Trustee Set From File or SubDirectory
	Scan File or SubDirectory For Trustees

The trustee structure is shown below, the structure consists of a Object ID and the Trustee Rights. The number of structure items is determined by the value of the ObjectIDCount field in the packet.

	LONG	ObjectID; (Hi-Lo)
	WORD	TrusteeRights; (Lo-Hi)

Name Space Information Bit Mask

The NSInfoBitMask is used to get Name Space information from or set Name Space information to a requested Name Space module. The client determines which bits of the NSInfoBitMask are valid by calling the Query NS Information Format NCP (0x2222 87 23) and passing in a requested volume and name space. The NCP returns information from the following set of bit masks to indicate the size and arrangement of name space specific information:

	Offset	Field								Type
	0	FixedBitMask (fixed length--sized)				long
	4	VariableBitMask (variable length--byte length preceded string)	long
	8	HugeBitMask (huge length--word length preceded string)		long
	12	FixedBitsDefined (number of fixed bits defined)			word
	14	VariableBitsDefined (number of variable bits defined)		word
	16	HugeBitsDefined (number of huge bits defined)			word
	18	NSFieldsLengthTable (length of name space fields)		long[32]

As listed above, this NCP returns bits defined in the three masks: FixedBitMask, VariableBitMask, and HugeBitMask. However, as the NCP examines each bit position, although there are three masks, only one mask can have that bit position set. Also shown above, this NCP returns a count of how many bits are set for each bit mask. The NSFieldsLengthTable contains the length of the information relative to any of the tree masks. As shown below, the name space information bit mask is produced by combining information from the three masks.

	Fixed Bit Mask
	       
	    x  x  x  x  x  x  x   ...   x  x  x  x  x  x  x  >
	           
	                                                                         
	Variable Bit Mask                                                        
	           
	    x  x  x  x  x  x  x   ...   x  x  x  x  x  x  x  >
	           
	                                                                         
	Huge Bit Mask                                                            
	           
	    x  x  x  x  x  x  x   ...   x  x  x  x  x  x  x  >
	           
	                                                                          
	NSInfoBitMask                                                            
	.OR.                                                                     
	            
	    x  x  x  x  x  x  x   ...   x  x  x  x  x  x  x  <
	      

By using the NSInfoBitMask, the client can request the information needed by setting the appropriate bit to a 1. If the information is not needed, the bit is set to 0.

Note also that the bit position zero is defined to be a fixed length field containing the File Name (byte length preceded). This is true for all name spaces, the fixed length width will change between names space.

Example of NSInfoBitMask retrieving DOS information

The following is an example of information from the server returned in the QueryNSInformationFormat for the DOS name space.

Fixed Bit Mask
Bit 31. . .Bit 0
01 1 1 1 1 1 1 1 1 1 1 1 10

Variable Bit Mask
Bit 31. . .Bit 0
00 0 0 0 0 0 ... 0 0 0 0 0 01

Huge Bit Mask
Bit 31. . .Bit 0
00 0 0 0 0 0 ... 0 0 0 0 0 00

DOS Name Space FieldsLengthTable Definition (BYTES[ ])
12,4,2,2,4,2,2,4,2,2,4,2,4,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Definition of the DOS Name Space NSInfoBitMask (Know only by Client & Name Space Module):

Bits
31 .. 141312111098 76543210 Definition















reserved

x












Maximum Space Bit


x











Inheritance Bit



x










Last Accessed Date Bit




x









Modify ID Bit





x








Modify Time Bit






x







Modify Date Bit







x






Archive ID Bit








x





Archive Time Bit









x




Archive Date Bit










x



Owner ID Bit











x


Create Time Bit












x

Create Date Bit













x
File Attributes Bit














x Modify Name Bit

By passing this NSInfoBitMask, a client can get information about a DOS Name space entry or set the information via the appropriate NCP.

Example of GetNSInformation Reply Packet

		.
		. Reply Control
		.
                   BYTE FileName&LengthByte[13];
                   LONG FileAttributes; (Lo-Hi)
                   WORD CreateDate; (Lo-Hi)
                   WORD CreateTime; (Lo-Hi)
                   LONG OwnerID; (Hi-Lo)
                   WORD ArchiveDate; (Lo-Hi)
                   WORD ArchiveTime; (Lo-Hi)
                   LONG ArchiveID; (Hi-Lo)
                   WORD ModifyDate; (Lo-Hi)
                   WORD ModifyTime; (Lo-Hi)
                   LONG ModifyID; (Hi-Lo)
                   WORD LastAccessDate; (Lo-Hi)
                   LONG InheritanceRightsMask; (Lo-Hi)
                   LONG MaximumSpace; (Lo-Hi)

Search Attributes Definition
1514 - 54 3210 Attribute
x





All Files and SubDirectories Bit

0




reserved


x



SubDirectories Only Bit



0


reserved




x

System Bit





x
Hidden Bit






0 reserved

Attributes Definition
23 - 2019181716 15141312111098 76543210 Definition
0



















reserved

x


















Copy Inhibit Bit


x

















Delete Inhibit Bit



x
















Rename Inhibit Bit




x















Immediate Purge Bit





x














Write Audit Bit






x













Read Audit Bit







0












reserved








x











Transaction Bit









0










reserved










0









reserved











0








reserved












0







reserved













x






Sharable Bit (File Only)
Old Private Bit (SubDir Only)














0





reserved















x




Archive Bit
















x



Subdirectories Only Bit

















x


Execute Bit


















x

System Bit



















x
Hidden Bit




















x Read Only Bit

Inherited Rights Mask Definition
15141312111098 76543210 Bit Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







x







Supervisor Privileges Bit








x






Modify Entry Bit









x





See Files Bit










x




Change Access Control Bit











x



Delete Existing Bit












x


Create New Entry Bit













x

Old Open Existing File Bit














x
Write Existing File Bit















x Read Existing File Bit

Modifying DOS Files or SubDirectories

This section illustrates the ModifyDOSInfoMask and the ModifyDOSInfoStructure. The ModifyDOSInfoMask tells the server what information in the ModifyDOSInfoStructure is valid. The ModifyDOSInfoStructure structure is used to set DOS specific information in files or subdirectories when the default Name Space is not DOS.

ModifyDosInfoMask
31 - 16141312111098 76543210 Bit Definition
0














reserved

0













reserved


x












Max Space Bit



x











Inheritance Bit




x










Last Access Bit





x









Modifer ID Bit






x








Modify Time Bit







x







Modify Date Bit








x






Archiver ID Bit









x





Archive Time Bit










x




Archive Date Bit











x



Creator ID Bit












x


Creation Time Bit













x

Creation Date Bit














x
Attributes Bit















x Unused Bit

ModifyDOSInfoStructure

	struct	{
		WORD FileAttributes; (Lo-Hi)
		BYTE FileMode;
		BYTE FileXAttributes;
		WORD CreationDate; (Lo-Hi)
		WORD CreationTime; (Lo-Hi)
		LONG CreatorsID; (Hi-Lo)
		WORD ModifiedDate; (Lo-Hi)
		WORD ModifiedTime; (Lo-Hi)
		LONG ModifiersID; (Hi-Lo)
		WORD ArchivedDate; (Lo-Hi)
		WORD ArchivedTime; (Lo-Hi)
		LONG ArchiversID; (Hi-Lo)
		WORD LastAcessDate; (Lo-Hi)
		WORD InheritanceGrantMask; (Lo-Hi)
		WORD InheritanceRevokeMask; (Lo-Hi)
		LONG MaximumSpace; (Lo-Hi)
	};

Remarks

MaximumSpace: This field specifies the user disk space restriction that may have been enabled by an administrator and might be in place for a given user.


Add Extended Trustee to Directory or File 0x2222 22 39

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (8+PathLen) word (Hi-Lo) 9 SubFunctionCode (39) byte 10 DirHandle byte 11 ObjectID long (Hi-Lo) 15 TrusteeRights word 17 PathLen byte 18 Path byte[PathLen]

Reply Format

	Offset	Content				Type
	(reply header)

Completion Code

	0	0x00	Successful
	144	0x90	Volume Is Read Only

Remarks

This function adds a trustee and sets the trustee rights for a file or directory.

See Also
Add Trustee to Directory (0x2222 22 13)
Delete Trustee from Directory (0x2222 22 14)


Add Trustee to Directory 0x2222 22 13

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (8+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (13) byte 10 DirectoryHandle byte 11 TrusteeID long (Hi-Lo) 15 TrusteeAccessMask byte 16 DirectoryPathLen byte 17 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	252	0xFC	No Such Object
	253	0xFD	Bad Station Number
	255	0xFF	Hard Failure, Failure

Remarks

This call allows a client to add a new trustee to a directory's trustee list.

The Trustee ID number must be the valid ID of an object in the server's bindery; normally this ID number is retrieved from the server using the bindery functions.

The Trustee Access Mask indicates the access rights to be given to the specified object at the target directory.

This call replaces the access mask of the listed trustee if the trustee already appears in the directory's trustee list; otherwise, the trustee is added to the directory's trustee list.

Directory Path is the path relative to the specified Directory Handle. The Directory Path must follow the same convention as NetWare filenames. See the introduction to the File Services chapter.

Only a client with access control rights to either the target directory or its parent directory can make this call.

See Also
Add Extended Trustee to Directory or File (0x2222 22 39)
Delete Trustee from Directory (0x2222 22 14)


Add Trustee Set to File or SubDirectory 0x2222 87 10

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (10) byte 8 NameSpace byte 9 reserved (0) byte 10 SearchAttributes word (Lo-Hi) 12 TrusteeRightsMask (See below) word (Lo-Hi) 14 ObjectIDCount word (Lo-Hi) 16 NWHandlePathStruct structure xx TrusteeStruct[] structure

Reply Format

Offset Content Type (reply header)

Completion Code

0 SUCCESSFUL

Remarks

The SearchAttributes field is explained in more detail in the Introduction to File System NCPs.

If the TrusteeRightsMask field is set to -1, the individual TrusteeRights should be set to the appropriate rights for each entry in the Trustee Structure.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct. The NWHandlePathStruct totals 307 bytes in length. The TrusteeStruct starts after the 307 bytes. See the "NetWare Handle and Path Structure Definition" explanation in the File System NCPs" section.


Add User Disk Space Restriction

0x2222 22 33

NetWare Linux
v2.x v3.x v4.x v5.x v6.x OES 1 OES 2 OES 11 OES 2015
 

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (10) word (Hi-Lo) 9 SubFunctionCode (33) byte 10 VolumeNumber byte 11 ObjectID long (Lo-Hi) 15 DiskSpaceLimit long (Lo-Hi)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out of Memory
	152	0x98	Invalid Volume

Remarks

This function sets an object's volume disk space restriction. All restrictions are in 4K blocks. Valid restrictions are 0 to 0x40000000.

See Also
0x2222 22 54Add User Disk Space Restriction (64Bit Aware)

Get Directory Disk Space Restrictions (0x2222 22 35)
Remove User Disk Space Restriction (0x2222 22 34)
Get Object Disk Usage and Restrictions (0x2222 22 41)
Scan Volume's User Disk Restrictions (0x2222 22 32)
Set Directory Disk Space Restriction (0x2222 22 36)
Scan Directory Disk Space (0x2222 22 40)


Alloc Permanent Directory Handle 0x2222 22 18

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (18) byte 10 SourceDirectoryHandle byte 11 HandleName byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 NewDirectoryHandle byte 9 AccessRightsMask byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This NCP creates a new permanent directory handle for the client and points the handle to the specified directory. The New Directory Handle is returned to the client together with the client's effective Access Rights Mask in the specified directory. The client can specify the complete Directory Path name and give a Source Directory Handle of zero, if desired.

The client must assign unique names to each directory handle it creates. If the client creates a permanent directory handle with the same name as a previously created permanent directory handle, the file server automatically deallocates the previous permanent directory handle.

Permanent directory handles outlive the client processes that created them. Such handles are maintained by the file server until they are overwritten by a new Allocate Permanent Directory Handle call with the same handle name, until they are explicitly deleted using Deallocate Directory Handle (0x2222 22 20), or until the client releases its service connection privileges (logs out or destroys its service connection).

A client can have up to 255 directory handles in any combination of permanent and temporary handles.

See Also
Alloc Temporary Directory Handle (0x2222 22 19)
Alloc Special Temporary Directory Handle (0x2222 22 22)
Deallocate Directory Handle (0x2222 22 20)
Set Directory Handle (0x2222 22 0)


Allocate Short Directory Handle 0x2222 87 12

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (12) byte 8 NameSpace byte 9 DstNameSpace byte 10 AllocateMode word (Lo-Hi) 12 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 DirectoryHandle byte 9 VolumeNumber byte 10 reserved[4] (0) byte

Completion Code

0 SUCCESSFUL

Remarks

The DstNameSpace parameter is ignored unless the high bit in the AllocateMode field is set (0x8000). If the DstNameSpace field is ignored, then the NameSpace field indicates what name space the allocation will take place in. The DstNameSpace parameter allows calling this NCP in one name space and doing the actual allocation in another.

The AllocateMode field can be set as shown below:

AllocateMode Bits (type of handle)
15141312111098 76543210 Definition
X














Activates DstNameSpace input parameter

X













Activates Reply level 2


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







0







reserved








0






reserved









0





reserved










0




reserved











0



reserved












0


reserved













0

reserved














X
Special Temporary Handle















X Temporary Handle















0 Permanent Handle

AllocateMode bits may have the following values:

0x00 Permanent Handle
0x01 Temporary Handle
0x02 Special Temporary Handle
0x4000 Use Reply Level 2 format (See Below)
0x8000 Use DstNameSpace input parameter

NOTE: If the AllocateMode bit 0x4000 is set, then the following reply format will be used:

Reply level 2 Format

Offset Content Type (reply header) 8 Volume long 12 DirectoryBase long 16 DOSDirectoryBase long 20 NameSpace long 24 DirectoryHandle byte

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

See Also

Set Short Directory Handle (0x2222 87 09)


Alloc Special Temporary Directory Handle 0x2222 22 22

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (22) byte 10 SourceDirectoryHandle byte 11 HandleName byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 NewDirectoryHandle byte 9 AccessRightsMask byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call creates a temporary directory handle that cannot be remapped to another place. This call is functionally similar to Alloc Temporary Directory Handle (0x2222 22 19), except that with this call the handle cannot be remapped using Set Directory Handle (0x2222 22 0).

See Also

Alloc Permanent Directory Handle (0x2222 22 18)

Alloc Temporary Directory Handle (0x2222 22 19)

Deallocate Directory Handle (0x2222 22 20)

Set Directory Handle (0x2222 22 0)


Alloc Temporary Directory Handle 0x2222 22 19

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type

(request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (19) byte 10 SourceDirectoryHandle byte 11 HandleName byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 NewDirectoryHandle byte 9 AccessRightsMask byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call creates a new temporary directory handle for the client. A client can have up to 255 directory handles in any combination of permanent and temporary handles. When the client signals that the task is completed, the file server automatically deallocates any temporary directory handles associated with the task.

Temporary directory handles do not need different handle names. Each separate call will create a new handle unless the 255 handle maximum has already been reached.

See Also

Alloc Permanent Directory Handle (0x2222 22 18)

Alloc Special Temporary Directory Handle (0x2222 22 22)

Deallocate Directory Handle (0x2222 22 20)

Set Directory Handle (0x2222 22 0)


Close File 0x2222 66 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (66) byte 7 Reserved byte 8 FileHandle byte[6] (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	255	0xFF	Unlock Error

Remarks

This NCP closes a file. FileHandle must be the handle returned to the client by an Open File or Create File request. After a file is closed, the file handle is no longer valid. File access requests to an invalid file handle will be disregarded by the server.

A file handle must be closed before a file can be made available to other clients. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.


Commit File 0x2222 59 --

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (59) byte 7 Reserved byte[1] 10 FileHandle byte[6] (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	152	0x98	Disk Map Error
	255	0xFF	Failure

Remarks

This NCP assures a client that all data previously written to a file has been written to the server's disk. Because files must be stored on the physical storage medium before certain actions are attempted, this call provides a checkpoint that guarantees that the file has been flushed from cache and written to disk.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.


Convert Path to Dir Entry 0x2222 23 244

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (23) byte 7 SubFuncStrucLen (3+PathStringLen) word (Hi-Lo) 9 SubFunctionCode (244) byte 10 DirectoryHandle byte (Lo-Hi) 11 PathStringLen byte 12 PathString byte[PathStringLen]

Reply Format

Offset Content Type (reply header) 8 VolumeNumber byte 9 DirectoryNumber long (Lo-Hi)

Completion Code

Remarks

This NCP converts a given path name to a directory entry.

See Also

Map Directory Number to Path (0x2222 23 243)


Copy from One File to Another 0x2222 74 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (74) byte 7 Reserved byte 8 SourceFileHandle byte[6] (Hi-Lo) 14 TargetFileHandle byte[6] (Hi-Lo) 20 SourceFileOffset long (Hi-Lo) 24 TargetFileOffset long (Hi-Lo) 28 BytesToCopy long (Hi-Lo)

Reply Format

Offset Content Type (reply header) 8 BytesActuallyTransferred long (Hi-Lo)

Completion Code

	0	0x00	Successful
	1	0x01	Out Of Disk Space
	131	0x83	Hard I/O Error
	136	0x88	Invalid File Handle
	147	0x93	No Read Privileges
	148	0x94	No Write Privileges
	149	0x95	File Detached
	150	0x96	Server Out Of Memory
	162	0xA2	IO Lock Error

Remarks

This NCP allows data from one file on a file server to be transferred rapidly to another file on the same file server. This removes the need for a client to copy data from one file to another by reading the data from the file server across the network to the client's workstation and then writing the same data back to the file server across the network.

The client must have previously opened both files and must have file Read privileges for the source file and file Write privileges for the destination file. The server transfers the specified amount of information from the source to the destination file starting at the offsets given by the client. If the end of the source file is encountered before the specified number of bytes have been transferred, the transfer stops with a Successful Completion Code, but the number of bytes actually transferred will be less than the number of bytes the client requested transferred.

The SourceFileHandle and TargetFileHandle parameters require the left-most or most significant 4 bytes in Hi-Lo order.


Create Directory 0x2222 22 10

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (10) byte 10 DirectoryHandle byte 11 DirectoryAccessMask byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	132	0x84	No Create Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	158	0x9E	Bad File Name
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call allows a client to create a directory. The Directory Path string must contain at least one element. The last element of this string will be used as the name of the newly created directory. Wildcard characters are not allowed in the new directory name. Directory names are restricted to the DOS "8.3" names; longer names will be truncated.

For this call to be successful, the client must have creation privileges in the directory that will become the parent directory of the newly created directory.

See Also

Delete Directory (0x2222 22 11)


Create File 0x2222 67 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (67) byte 7 DirectoryHandle byte 8 FileAttributes byte 9 FileNameLen byte 10 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[6] (Hi-Lo) 14 Reserved word (Hi-Lo) 16 FileName byte[14] 30 FileAttributes byte 31 FileExecuteType byte 32 FileLen long (Hi-Lo) 36 CreationDate word (Hi-Lo) 38 LastAccessDate word (Hi-Lo) 40 LastUpdateDate word (Hi-Lo) 42 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	132	0x84	No Create Privileges
	133	0x85	No Create/Delete Privileges
	135	0x87	Create Filename Error
	141	0x8D	Some Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call creates a new file for the calling client in the indicated directory. The client must at least have file creation privileges in the directory or this request will be rejected. If the client has file deletion privileges in the indicated directory and a file with the same name already exists in the directory, the existing file will be erased before the new file is created. If the client does not have file deletion privileges in the indicated directory and a file with the same name already exists in the directory, this request will fail.

The newly created file will be stamped with the date and time of its creation. The file attributes byte will be set to the attributes specified by the client. When it is created, the new file will be opened as an exclusive file with both read and write access requested. The actual access rights granted will depend on the client's file access privileges in the specified directory.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

This call is replaced by the NetWare 386 v3.11 call Open Create File or Subdirectory (0x2222 87 01).

See Also

Create New File (0x2222 77 --)

Erase File (0x2222 68 --)

Open/Create File (0x2222 84 --)

Open Create File or Subdirectory (0x2222 87 01)


Create New File 0x2222 77 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (77) byte 7 DirectoryHandle byte 8 FileAttributes byte 9 FileNameLen byte 10 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[6] (Hi-Lo) 14 Reserved word (Hi-Lo) 16 FileName byte[14] 30 FileAttributes byte 31 FileExecuteType byte 32 FileLen long (Hi-Lo) 36 CreationDate word (Hi-Lo) 38 LastAccessDate word (Hi-Lo) 40 LastUpdateDate word (Hi-Lo) 42 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	132	0x84	No Create Privileges
	133	0x85	No Create/Delete Privileges
	135	0x87	Create Filename Error
	141	0x8D	Some Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call is the same as Create File (0x2222 67 --), except that this request will always fail if a file with the same name already exists.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

See Also

Create File (0x2222 67 --)

Erase File (0x2222 68 --)

Open/Create File (0x2222 84 --)

Open Create File or Subdirectory (0x2222 87 01)


Deallocate Directory Handle 0x2222 22 20

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (20) byte 10 DirectoryHandle byte

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	155	0x9B	Bad Directory Handle

Remarks

This NCP deallocates the specified directory handle, whether the handle is temporary or permanent.


Delete Directory 0x2222 22 11

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (11) byte 10 DirectoryHandle byte 11 Reserved byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	138	0x8A	No Delete Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	159	0x9F	Directory Active
	160	0xA0	Directory Not Empty
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call attempts to delete the specified directory. If the directory does not exist or if it contains one or more files (including subdirectories), the call will fail.

This call will not be successful if the client does not have access control and erase privileges to the targeted directory. This request will also fail if any other client has a directory handle pointing to the targeted directory. Volume directory roots cannot be deleted.

If the requesting client has directory handles pointing to the targeted directory and the directory is deleted, the associated handles are automatically deallocated.

See Also

Create Directory (0x2222 22 10)


Delete a File or SubDirectory 0x2222 87 08

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (08) byte 8 NameSpace byte 9 reserved (0) byte 10 SearchAttributes word (Lo-Hi) 12 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header)

Completion Code

	0	SUCCESSFUL

Remarks

The SearchAttributes field is explained in more detail in the Introduction to File System NCPs.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Delete Trustee from Directory 0x2222 22 14

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (8+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (14) byte 10 DirectoryHandle byte 11 TrusteeID long (Hi-Lo) 15 Reserved byte 16 DirectoryPathLen byte 17 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	252	0xFC	No Such Object
	253	0xFD	Bad Station Number
	254	0xFE	Directory Locked
	255	0xFF	Hard Failure, Failure

Remarks

This call deletes the specified Trustee ID from the trustee list of the specified directory. This call will succeed only if the client has access control rights to the target directory or its parent directory.

See Also

Add Trustee to Directory (0x2222 22 13)

Add Extended Trustee to Directory or File (0x2222 22 39)


Delete Trustee Set from File or SubDirectory 0x2222 87 11

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (11) byte 8 NameSpace byte 9 reserved (0) byte 10 ObjectIDCount word (Lo-Hi) 12 NWHandlePathStruct structure xx TrusteeStruct structure

Reply Format

Offset Content Type (reply header)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP deletes a trustee set from a file or from a subdirectory.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct. The NWHandlePathStruct totals 307 bytes in length. The TrusteeStruct starts after the 307 bytes. See the "NetWare Handle and Path Structure Definition" explanation in the "File System NCPs" section.


Erase File 0x2222 68 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (68) byte 7 DirectoryHandle byte 8 SearchAttributes byte 9 FileNameLen byte 10 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	138	0x8A	No Delete Privileges
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to delete files from the target directory. The client must have file deletion privileges in the target directory or this request will fail. This request will also fail if another client is using the targeted file(s).

This call supports wildcards.

See Also

Create File (0x2222 67 --)


Extract a Base Handle 0x2222 22 23

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 8 SubFuncStrucLen (2) word (Hi-Lo) 10 SubFunctionCode (23) byte 11 DirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 ServerNetworkAddress byte[10] 9 DirectoryHandle byte[4]

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	155	0x9B	Bad Directory Handle

Remarks

This NCP is used to obtain the server's internal form of the directory address for a workstation. DirectoryHandle (in the request) must have been previously obtained using the NCP, Alloc Permanent Directory Handle (0x2222 22 18). The base Handle ID returned can be used with the NCP, Restore an Extracted Base Handle (0x2222 22 24), to set a handle to the directory.

See Also

Restore an Extracted Base Handle (0x2222 22 24)

File Migration Request 0x2222 90 150

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (90) byte 7 SubFuncStrucLen (13) word (Hi-Lo) 9 SubFuncCode (150) byte 10 Volume long (Lo-Hi) 14 DOSDirectoryEntry long (Lo-Hi) 16 FileMigrationState long (Lo-Hi)

ReplyFormat

Offset Content Type (reply header)

CompletionCode

	0	0x00	Successful
	126	0x7E	Invalid Length
	251	0xFB	No Such Property

Remarks

This NCP is used to set/reset file migration attributes of a file.

FileMigrationState

Where the following values represent what state action to take.

0Mark file ineligible for File Migration.
1Mark file as eligible for File Migration.
2Mark file as migrated, & delete fat chains.
3Reset file status back to normal.
4Get file data back, & reset file status back to normal.

File Search Continue 0x2222 63 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (63) byte 7 VolumeNumber byte 8 DirectoryID word (Hi-Lo) 10 SearchSequence word (Hi-Lo) 12 SearchAttributes byte 13 SearchPathLen byte 14 SearchPath byte[SearchPathLen]

Reply Format (file instance)

Offset Content Type (reply header) 8 SearchSequence word (Hi-Lo) 10 DirectoryID word (Hi-Lo) 12 Reserved word (Hi-Lo) 14 FileName byte[14] 28 FileAttributes byte 29 FileMode byte 30 FileLen long (Hi-Lo) 34 FileCreationDate word (Hi-Lo) 36 FileAccessDate word (Hi-Lo) 38 FileUpdateDate word (Hi-Lo) 40 FileUpdateTime word (Hi-Lo)

Reply Format (directory instance)

Offset Content Type (reply header) 8 SearchSequence word (Hi-Lo) 10 DirectoryID word (Hi-Lo) 12 Reserved word (Hi-Lo) 14 DirectoryName byte[14] 28 DirectoryAttributes byte 29 DirectoryAccessRights byte 30 DirectoryCreationDate word (Hi-Lo) 32 DirectoryCreationTime word (Hi-Lo) 34 OwningObjectIdentifier long (Hi-Lo) 38 Reserved word (Hi-Lo) 40 DirectoryStamp (0xD1D1)word (Hi-Lo)

Completion Code

	0	0x00	Successful
	255	0xFF	No Files Found

Remarks

This call returns information about a file or a directory. It is called iteratively after a call is made to File Search Initialize (function 62). If the client sets the Subdirectory bit of the SearchAttributes byte, directory information will be returned. Otherwise, file information will be returned.

The information returned is a direct copy of a Novell server's internal file header. This call does not return the ID of the file owner.

The SearchSequence in the request and in the reply is the file offset in the directory file. The file server increments this number by one in the reply. Setting this field to "-1" will restart the search. When SearchSequence is set to -1, SearchAttributes can be modified to alter the search mask.

The DOS "DIR" command is accomplished in NetWare using this call. First, all of the non-directory files are obtained. To do so, File Search Init is called, followed by repeated calls to File Search Continue with SearchAttributes set to return normal, non-directory files.

When all of the non-directory files have been obtained, the server returns a reply message with a No Files Found Completion Code and SearchSequence set to -1; the client (NetWare shell) then calls File Search Continue with Sequence Number set to -1 and with SearchAttributes set to return directory files. Then, File Search Continue is repeatedly called to obtain all of the subdirectories.

See Also

Scan Directory Information (0x2222 22 2)

File Search Initialize (0x2222 62 --)


File Search Initialize 0x2222 62 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (62) byte 7 DirectoryHandle byte 8 PathLen byte 9 Path byte[PathLen]

Reply Format

Offset Content Type (reply header) 8 VolumeNumber byte 9 DirectoryID word (Hi-Lo) 11 SearchSequenceNumber (-1)word (Hi-Lo) 13 DirectoryAccessRights byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	No Files Found

Remarks

This NCP initiates a search for files in a directory. It returns the Directory ID and Directory Access Rights of the directory specified by Directory Handle and Path. The Volume Number and Directory ID can then be used with File Search Continue (0x2222 63 --) to locate files or subdirectories.

Beginning with NetWare v2.0a, the workstation shell uses this NCP, in conjunction with File Search Continue (0x2222 63 --), to perform file and directory searches. Prior to this, other NCPs were used for file and directory searches.

This NCP and File Search Continue were added to accommodate a problem with the DOS operating system. The older NCPs relied on the server to keep a search context associated with a directory handle. When an End Of Task message was received from the workstation, the directory handle was deleted, causing the loss of the search context. Since DOS sends repeated "pseudo" End Of Task messages in a loop of a command file, directory handles were deleted, causing the older NCPs to fail.

With this call, the Search Context is the file identifier in the Novell server file system; the context is no longer based on directory handles. Consequently, Novell's server implementation does not maintain a context block for searches made with this call.

This call is replaced by the NetWare 386 v3.11 call Initialize Search (0x2222 87 02)

See Also

File Search Continue (0x2222 63 --)

Initialize Search (0x2222 87 02)


Generate Directory Base and Volume Number 0x2222 87 22

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (22) byte 8 srcNameSpace byte 9 dstNameSpace (0) byte 10 dstNSIndicator word 12 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NSDirectoryBase long (Lo-Hi) 12 DOSDirectoryBase long (Lo-Hi) 16 VolumeNumber byte

Completion Code

	0	SUCCESSFUL

Remarks

This NCP generates a directory base and a volume number.

The srcNameSpace is the source name space used to parse pathInfo

The dstNameSpace specifies the name space for the returned directory base and volume number information if dstNSIndicator is set to 'Jn'; otherwise, this parameter is ignored.

The dstNSIndicator specifies to return the directory base and volume number in the name space specified by dstNameSpace if this parameter is set to 'Jn'; otherwise, the directory base and volume number information will be returned in the name space specified by srcNameSpace.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Get Current Size of File 0x2222 71 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (71) byte 7 Reserved byte 8 FileHandle byte[6] (Hi-Lo)

Reply Format

Offset Content Type (reply header) 8 CurrentFileSize long (Hi-Lo)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle

Remarks

This NCP allows a client to determine the current length of a file that the client has open. It can be used by clients cooperatively sharing a file that might need to be extended.

When a shared file needs to be extended, the client extending the file needs to lock the area of the file that will be affected for its exclusive use. This can be done by locking the entire file or by locking the section of the file that is beyond the current known end-of-file.

After locking the file, the client extending the file must make this call to determine the current file length. If the file has already been extended by some other client, this call will reveal the length of the extension to the current client so that the file can be extended further, if needed. The file can then be unlocked.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

Only by using this method of extending a shared file can a client properly lock the current end of a file for exclusive access; otherwise, another client could extend the file at any time.

See Also

Locking calls in Synchronization Section


Get Directory Disk Space Restriction 0x2222 22 35

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (35) byte 10 DirHandle byte

Reply Format

Offset Content Type (reply header) 8 NumberOfEntries byte (for each entry) 9 Level byte 10 Max long (Lo-Hi) 14 Current long (Lo-Hi)

Completion Code

	0	0x00	Successful

Remarks

This function scans for the amount of disk space assigned to all directories between the current directory and the root directory. The return buffer contains information about the restrictions along the directory path.

LEVEL refers to the distance from the directory to the root.

MAX refers to the maximum amount of space assigned to a directory.

CURRENT refers to the amount of space assigned to a directory minus the amount of space used by a directory and its subdirectories.

To find the actual amount of space available to a directory, scan all the current entries and use the smallest one. Directories which have no restrictions will not return any information. If no entries are returned, no space restrictions exist for the specified directory. All restrictions are in 4K blocks.

When the MAX field is 0x7fffffff, there is no restriction on the entry; however, you can still calculate the space in use by subtracting the CURRENT from the MAX entry. When the MAX field is negative, the limit is zero. When the CURRENT field is negative, CURRENT is really zero. These are allowed to go negative so you can still generate a valid "IN USE" value.

See Also

Add User Disk Space Restriction (0x2222 22 33)

Remove User Disk Space Restriction (0x2222 22 34)

Get Object Disk Usage and Restrictions (0x2222 22 41)

Scan Volume's User Disk Restrictions (0x2222 22 32)

Set Directory Disk Space Restriction (0x2222 22 36)

Scan Directory Disk Space (0x2222 22 40)


Get Directory Entry 0x2222 22 31

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFunctionCode (31) byte 10 DirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 Subdirectory long (Lo-Hi) 12 Attributes long (Lo-Hi) 13 UniqueID byte 14 Flags byte 15 NameSpace byte 16 DirectoryNameLen byte 17 DirectoryName byte[12] 29 CreationDateAndTime long (Lo-Hi) 33 OwnerID long (Hi-Lo) 37 LastArchivedDateAndTime long (Lo-Hi) 41 LastArchivedID long (Hi-Lo) 45 LastModifiedDateAndTime long (Lo-Hi) 49 NextTrusteeEntry long (Hi-Lo) 53 Reserved byte[48] 101 MaximumSpace word (Lo-Hi) 103 InheritedRightsMask word (Lo-Hi) 105 Undefined byte[28]

Completion Code

	0	0x00	Successful
	137	0x89	No Search Privileges
	191	0xBF	Invalid Name Space
	251	0xFB	386 File Structure Not Supported On Server

Remarks

This function gets the directory entry that is pointed to by the directory handle. This is useful for getting information about the volume root entry.

See Also

Set Directory Handle (0x2222 22 0)

Scan Directory Disk Space (0x2222 22 40)


Get Directory Information

0x2222 22 45

NetWare Linux
v2.x v3.x v4.x v5.x v6.x OES 1 OES 2 OES 11 OES 2015
 

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFunctionCode (45) byte 10 DirHandle byte

Reply Format

Offset Content Type (reply header) 8 TotalBlocks long (Lo-Hi) 12 AvailableBlocks long (Lo-Hi) 16 TotalDirEntries long (Lo-Hi) 20 AvailableDirEntries long (Lo-Hi) 24 Reserved byte[4] 28 SectorsPerBlock byte 29 VolumeNameLen byte 30 VolumeName byte[VolumeNameLen]

Completion Code

	0	0x00	Successful
	155	0x9B	Bad Directory Handle

Remarks

This function returns the real size information for a 386 directory. The old NCP calls cannot handle volumes bigger than 256 Megabytes. This function also includes space limitations on the user and volume when calculating the space available.

See Also
0x2222 22 58Get Directory Information (64Bit Aware)

Set Directory Information (0x2222 22 25)

Get Volume and Purge Information (0x2222 22 44)


Get Directory Path 0x2222 22 01

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (1) byte 10 TargetDirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 DirectoryPathLen byte 9 DirectoryPath byte[DirectoryPathLen]

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error

Remarks

This call allows a client to retrieve the full Directory Path of the directory pointed to by one of its directory handles. The Directory Path string returned will contain a path name in the following format:

volume name:directory/subdirectory/ . . .

The returned string will not contain the file server's name and will be no longer than 255 bytes.

See Also

Set Directory Handle (0x2222 22 00)


Get Effective Directory Rights 0x2222 22 03

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (3+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (3) byte 10 DirectoryHandle byte 11 DirectoryPathLen byte 12 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 EffectiveRightsMask byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call allows a client to determine the access rights the client has for a specified directory. The Effective Rights Mask returned to the client indicates which of the eight possible directory rights the client has in the targeted directory. An Effective Rights Mask of zero (0) indicates that the client has no rights in the target directory.

See Also

Get Effective Rights for Directory Entry (0x2222 22 42)


Get Effective Directory Rights 0x2222 87 29

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (29) byte 8 NameSpace byte 9 DestNameSpace byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 MyEffectiveRights word (Lo-Hi) 10 NetWareInfoStruct structure xx NetWareFileNameStruct structure

Completion Code

	0	SUCCESSFUL

Remarks

The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Get Effective Rights for Directory Entry 0x2222 22 42

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (3+PathLen)word (Hi-Lo) 9 SubFunctionCode (42) byte 10 DirHandle byte 11 PathLen byte 12 Path byte[PathLen]

Reply Format

Offset Content Type (reply header) 8 AccessRights word (Lo-Hi)

Completion Code

	0	0x00	Successful
	156	0x9C	Invalid Path

Remarks

This function gets the calling object's effective access rights to the specified entry. This call works for directories and files.

See Also

Get Effective Directory Rights (0x2222 22 03)

Get Object Effective Rights for Directory Entry (0x2222 22 50)


Get Extended Volume Information 0x2222 22 51

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFuncCode (51) byte 10 VolumeNumber byte

ReplyFormat

Offset Content Type (reply header) 8 VolInfoReplyLen word (Lo-Hi) 10 VolumeInfo structure 10+VolInfoReplyLen VolNameLen byte 11+VolInfoReplyLen VolumeName byte[VolNameLen]

CompletionCode

	0	0x00	Successful
	126	0x7E	Invalid Length
	152	0x98	Disk Map Error (Invalid volume)

Remarks

This NCP will get full volume information about a mounted volume.

VolumeInfo

	struct	VolInfoStructure
	{
		LONG VolumeType; (Lo-Hi)
		LONG StatusFlagBits; (Lo-Hi)
		LONG SectorSize; (Lo-Hi)
		LONG SectorsPerCluster; (Lo-Hi)
		LONG VolumeSizeInClusters; (Lo-Hi)
		LONG FreedClusters; (Lo-Hi)
		LONG SubAllocFreeableClusters; (Lo-Hi)
		LONG FreeableLimboSectors; (Lo-Hi)
		LONG NonFreeableLimboSectors; (Lo-Hi)
		LONG NonFreeableAvailableSubAllocSectors; (Lo-Hi)
		LONG NotUsableSubAllocSectors; (Lo-Hi)
		LONG SubAllocClusters; (Lo-Hi)
		LONG DataStreamsCount; (Lo-Hi)
		LONG LimboDataStreamsCount; (Lo-Hi)
		LONG OldestDeletedFileAgeInTicks; (Lo-Hi)
		LONG CompressedDataStreamsCount; (Lo-Hi)
		LONG CompressedLimboDataStreamsCount; (Lo-Hi)
		LONG UnCompressableDataStreamsCount; (Lo-Hi)
		LONG PreCompressedSectors; (Lo-Hi)
		LONG CompressedSectors; (Lo-Hi)
		LONG MigratedFiles; (Lo-Hi)
		LONG MigratedSectors; (Lo-Hi)
		LONG ClustersUsedByFAT; (Lo-Hi)
		LONG ClustersUsedByDirectories; (Lo-Hi)
		LONG ClustersUsedByExtendedDirectories; (Lo-Hi)
		LONG TotalDirectoryEntries; (Lo-Hi)
		LONG UnUsedDirectoryEntries; (Lo-Hi)
		LONG TotalExtendedDirectoryExtants; (Lo-Hi)
		LONG UnUsedExtendedDirectoryExtants; (Lo-Hi)
		LONG ExtendedAttributesDefined; (Lo-Hi)
		LONG ExtendedAttributeExtantsUsed; (Lo-Hi)
		LONG DirectoryServicesObjectID; (Lo-Hi)
		LONG VolumeLastModifiedDateAndTime; (Lo-Hi)
	};

Completion Code


	0	0x00	Successful
	126	0x7E	Invalid Length
	152	0x98	Disk Map Error or Invalid Volume
	255	0xFF	Failure


Remarks


This NCP returns volume information. The following request format parameters are
defined:

The volumeNumber parameter specifies the volume number to start with.

The following reply format parameters are defined:

The VolInfoReplyLen field is the size of the VolInfoStructure.
										
The volume information is returned in the VolInfoStructure defined below.

                         VolInfoStructure

VolumeType - Specifies the defined type of the current volume.
   NOTE: VolumeType may contain one of the following values:
   0   VINetWare386
   1   VINetWare286
   2   VINetWare386x30
   3   VINetWare386v31

StatusFlagBits - Specifies the options that are currently available on the volume.
   NOTE: StatusFlagbits may contain one or more of the following values:
   0x01   SubAllocEnableBit
   0x02   CompressionEnabledBit
   0x04   MigrationEnableBit
   0x08   AuditingEnabledBit
   0x10   ReadOnlyEnableBit
   0x20   ImmediatePurgeBit
   0x40   64BitFileOffsetsEnabledBit
   0x80   UTF8NCPStringsEnabledBit
   0x80000000   NSSVolumeBit

SectorSize - Specifies the sector size (in bytes).

SectorsPerCluster - Specifies the number of sectors per cluster or block.

VolumeSizeInClusters - Specifies the size of the volume (in clusters or blocks).

FreedClusters - Specifies the number of clusters or blocks that are currently free 
for allocation (does not include space that is currently available from deleted or 
limbo files, nor space that could be reclaimed from the suballocation file system).

SubAllocFreeableClusters - Specifies the space that can be reclaimed from the suballocation 
file system.

FreeableLimboSectors - Specifies the disk space (in sectors) that can be 
freed from deleted files.

NonFreeableLimboSectors - Specifies the disk space (in sectors) that is 
currently in deleted files and is not aged enough to be classified as 
freeableLimboClusters.

NonFreeableAvailSubAllocSectors - Specifies the space available to the suballocation 
file system, but not freeable to return as clusters or blocks.

NotUsableSubAllocSectors - Specifies the disk space that is wasted by the suballocation 
file system. These clusters cannot be allocated by the suballocation system or used a 
regular clusters or blocks.

SubAllocClusters - Specifies the disk space being used by the suballocation file system.

DataStreamsCount - Specifies the number of data streams for real files that have data 
allocated to them.

LimboDataStreamsCount - Specifies the number of data streams for deleted files that have 
data allocated to them.

OldestDeletedFileAgeInTicks - Specifies the current age of the oldest file (in ticks).

CompressedDataStreamsCount - Specifies the number of data streams for compressed real files.

CompressedLimboDataStreamsCount - Specifies the number of data streams for compressed deleted 
files.

UnCompressableDataStreamsCount - Specifies the number of data streams that are not compressable 
(real and deleted).

PreCompressedSectors - Specifies the amount of disk space that was allocated to all files 
before they were compressed (includes "hole" space).

CompressedSectors - Specifies the amount of disk space that is used by all compressed files.

MigratedFiles - Specifies the number of migrated files.

MigratedSectors - Specifies the amount of migrated disk space (in sectors).

ClustersUsedByFAT - Specifies the amount of disk space (in clusters or blocks) being used 
by the FAT table.

ClustersUsedByDirectories - Specifies the amount of disk space (in clusters or blocks) being 
used by directories.

ClustersUsedbyExtendedDirs - Specifies the amount of disk space (in clusters or blocks) being 
used by the extended directory space.

TotalDirectoryEntries - Specifies the total number of directories that are available on the 
volume.

UnUsedDirectoryEntries - Specifies the total number of directory entries that are not in use 
on the volume.

TotalExtendedDirectoryExtants - Specifies the amount of extended directory space extants 
(128 bytes each) that are available on the volume.

UnUsedExtendedDirectoryExtants - Specifies the amount of extended directory space extants 
(128 bytes each) that are not in use on the volume.

ExtendedAttributesDefined - Specifies the number of extended attributes that are defined 
on the volume.

ExtendedAttributeExtantsUsed - Specifies the number of extended directory extants that are 
used by the extended attributes.

DirectoryServicesObjectID - Specifies the NDS ID for the volume.

VolumeLastModifiedDateAndTime - Specifies the last time any file or subdirectory on the 
volume was modified (as tracked by the OS).

Get File Information 0x2222 87 31

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (31) byte 8 FileOrDirHandle byte[6] (Hi-Lo) 15 HandleInfoLevel byte 16 NameSpace byte

ReplyFormat

HandleInfoLevel
Value
Description of FunctionReply Format Syntax
0Get Limited Information from a File Handle

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DataStream long (Lo-Hi)

1Get Limited Information from a File Handle Using a Name Space

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DataStream long (Lo-Hi)

2Get Information from a File Handle

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DOSDirectoryBase long (Lo-Hi) 20 NameSpace long (Lo-Hi) 24 DataStream long (Lo-Hi)

3Get Information from a Directory Handle

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DOSDirectoryBase long (Lo-Hi) 20 NameSpace long (Lo-Hi)

4Get Complete Information from a Directory Handle

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DOSDirectoryBase long (Lo-Hi) 20 NameSpace long (Lo-Hi) 24 ParentDirectoryBase long (Lo-Hi) 28 ParentDOSDirectoryBase long (Lo-Hi)

5Get Complete Information from a File Handle

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DOSDirectoryBase long (Lo-Hi) 20 NameSpace long (Lo-Hi) 24 DataStream long (Lo-Hi) 28 ParentDirectoryBase long (Lo-Hi) 32 ParentDOSDirectoryBase long (Lo-Hi)

Remarks

This NCP allows you to obtain various sets of information about a file from a NetWare file handle, or about a directory from a 1 byte directory handle.

The following request parameters are defined:

The FileOrDirHandle is either a file handle from which you want information from, or a directory handle from which you want information from. The FileHandle parameter requires ehe left-most or most significant 4 bytes in Hi-Lo order.

The HandleInfoLevel allows you to specify which type of information to be returned.

The NameSpace is only used when HandleInfoLevel is set to 1.

The following reply parameters are defined:

The Volume is the volume of the file handle.

The DirectoryBase is the Directory entry number.

The DOSDirectoryBase is the DOS Directory entry number.

The NameSpace is the NameSpace associated with the DirectoryBase field and is based on the file or dir handle passed in in the request.

The DataStream contains the data stream number if the name space is Macintosh. A value of 0 is the resource fork and a value of 1 is the data fork. If DOS, the value is always 0.

The ParentDirectoryBase is the parent Directory entry number of the file or directory.

The ParentDOSDirectoryBase is the DOS parent Directory entry number of the file or directory.


Get Full Path String 0x2222 87 28

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (28) byte 8 SrcNameSpace byte 9 DstNameSpace byte 10 PathCookie (See below) structure 20 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 PathCookie structure 18 PathComponentSize word (Lo-Hi) 20 PathComponentCount (See below) word (Lo-Hi) 22 PathComponents[] (See below) structure

Completion Code

	0	SUCCESSFUL

Remarks

The PathCookie field is used to sequence path components that are too long to fit in a reply packet.

Initially, Cookie1 & Cookie2 are set to -1. When Cookie2 comes back in the reply as -1, the path components have been completely transferred over.

	struct PathCookie
	{
	       word Flags;  (Lo-Hi)
	       long Cookie1; (Lo-Hi)
	       long Cookie2; (Lo-Hi)
	};

The PathCookie Flags field is defined as follows. The following bit has been defined in the flags field of the path cookie, where if bit 0 is set to a 1, then the last component is a file name.

The PathComponentSize field contains the total byte size of the Path Components in the reply packet.

The PathComponentCount field contains the number of components in the reply packet.

The PathComponent Structure is defined as follows:

		struct PathComponent
		{
		       byte  pathLength;
		       byte  string[];
		};

Note that the path returned by this call will be returned in reverse order, with the root being the last component, the current directory being the first.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Get Huge NS Information 0x2222 87 26

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (26) byte 8 NameSpace byte 9 VolumeNumber byte 10 DirectoryBase long (Lo-Hi) 14 HugeMask (See below) long (Lo-Hi) 18 HugeStateInfo (See below) structure

Reply Format

	Offset	Content			Type
	(reply header)
	8	NextHugeStateInfo (See below) structure
	24	HugeDataLen		long (Lo-Hi)
	28	HugeData[] 		byte

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used to get huge NS information; however, it is used only when the NS has indicated that there is huge information available via the Query NS Information Format NCP (0x2222 87 23).

The Huge State Info field is a 16-byte structure that contains information used to help the NS in transferring Huge NS info across the wire. On the initial call, all 16 bytes are set to zero, but subsquent calls will set the HugeStateInfo field using information from the NextStateInfo field in the reply.

HugeStateInfo - This parameter is used only by the NFS name space.

HugeDataLen - This parameter specifies the length of the data that will be returned in the reply buffer.

See Also

Set Huge NS Information (0x2222 87 27)


Get Mount Volume List 0x2222 22 52

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (13) word (Hi-Lo) 9 SubFuncCode (52) byte 10 StartVolumeNumber long (Lo-Hi) 14 VolumeRequestFlags long (Lo-Hi) 18 NameSpace long (Lo-Hi)

ReplyFormat

Offset Content Type (reply header) 8 ItemsInPacket long 12 NextVolumeNumber long 16+ VolMntStruc (see below) structure[ItemsInPacket]

CompletionCode

	0	Successful

Remarks

This NCP returns a list of mounted volumes.

The following request parameters are defined:

The StartVolumeNumber is the starting volume number. The initial value is zero (0).

The NameSpace is the name space number for which you want to get mounted volumes. This NCP returns mounted volumes only for the desired Name Space loaded.

The NextVolumeNumber is the next starting volume number. If this value is zero (0), the list is complete.

The VolumeRequestFlags allows you to specify whether to return the volume name with the volume number as shown in the bit below:

BitDescription
0Return Volume Name with Volume Number

The VolMntStruc is defined below according to the setting of the VolumeRequestFlags bit.

If the volume name request bit was set in the VolumeRequestFlags, the following structure will be returned:

	struct	VolMntStrucWithName
	{
		LONG VolumeNumber;
		BYTE VolumeNameLength;
		BYTE VolumeName[VolumeNameLength];
	};

If the volume name request bit was cleared in the VolumeRequestFlags, the following structure will be returned:

	struct VolMntStuct
	{
		LONG VolumeNumber;
	};

Get Volume Capabilities 0x2222 22 53

v2.xv3.xv4.xv5.xOES Linux





Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (9) word (Hi-Lo) 9 SubFuncCode (53) byte 10 VolumeNumber long (Lo-Hi) 14 Version (0) long (Lo-Hi)

ReplyFormat

Offset Content Type (reply header) 8 VolumeCapabilities long 12 reserved[7] long 40 VolumeName[64] UTF8 104 VolumeGuid[128] BYTE 212 PoolName[256] BYTE 468 VolumeMountPoint UTF8

CompletionCode

	0			Successful
	ERR_INVALID_VOLUME	Invalid volume number or volume not mounted.
	ERR_BUFFER_TOO_SMALL	Mount point too large for reply packet.

Remarks

This NCP returns the capabilities of the mounted volume specified by volume number. Also if the caller has admin privileges, the Volume mount point path is returned, also if volume is a NSS volume and the caller has admin privileges the pool name and volume guid will be returned also.

The following request parameters are defined:

The VolumeNumber parameter is the volume number for which to get the capabilities of.

The Version parameter is must be set to 0. This field is reserved for future revisions.

The following reply parameters are defined:

The VolumeCapabilities parameter is returned with the following bit set for each capabilites that is allowed on the specified volume:

VOLUME_CAP_USER_SPACE_RESTRICTIONS (0x00000001)NetWare User space restrictions supported
VOLUME_CAP_DIR_QUOTAS (0x00000002)NetWare directory quotas supported
VOLUME_CAP_DFS_AWARE (0x00000004)DFS is active on volume
VOLUME_CAP_SALVAGE_AWARE (0x00000008)NetWare Salvage/Purge operation supported
VOLUME_CAP_COMPRESSION_AWARE (0x00000010)NetWare Compression supported
VOLUME_CAP_CLUSTER_RESOURCE (0x00000020)Volume is a Cluster resource
VOLUME_CAP_NSS_ADMIN_VOLUME (0x00000040)Volume is the NSS Admin volume
VOLUME_CAP_NSS_VOLUME (0x00000080)Volume is mounted by NSS
VOLUME_CAP_EA_AWARE (0x00000100)OS2 style EA's supported
VOLUME_CAP_ARCHIVE_BIT_AWARE (0x00000200)NetWare Archive bit supported
VOLUME_CAP_ALL_FILE_ATTR_BITS_AWARE (0x00000400)Full NetWare file attributes supported

The reserved parameter is reserved for future use.

The VolumeName parameter is returns the VolumeName as an UTF8 null terminated string.

The VolumeGuid parameter is set to zero unless caller has admin privileges and the volume is an NSS volume, the NSS guid for this volume is returned.

The PoolName parameter is set to zero unless caller has admin privileges and the volume is an NSS volume, the the pool name this volume resides on is returned.

The VolumeMountPoint parameter is set to zero unless caller has admin privileges, in which an UTF8 null terminated string detailing the mount point path is returned.


Get NS Information 0x2222 87 19

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (19) byte 8 SrcNameSpace byte 9 DstNameSpace byte 10 reserved (0) byte 11 VolumeNumber byte 12 DirectoryBase long (Lo-Hi) 16 NSInfoBitMask (See Intro) long (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 NSSpecificInfo[512] (See Intro) byte

Completion Code

	0	SUCCESSFUL

Remarks

This NCP gets specific name space information. Note also that 1) this call is passed to the name space NLM and 2) this call is an expensive time user on the server.

The NSInfoBitMask and the NSSpecificInfo structure are explained in more detail in the Introduction to File System NCPs.

See Also

Set NS Information (0x2222 87 25)


Get Name Space Directory Entry 0x2222 22 48

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (48) byte 10 VolumeNumber byte 11 DOS Sequence long 15 NameSpace byte

Reply Format

Offset Content Type (reply header) 8 SequenceNumber long (DOS File Entry) 12 Subdirectory long 16 Attributes long 20 UniqueID byte 21 Flags byte 22 NameSpace byte 23 NameLen byte 24 Name byte[12] 36 CreationDateAndTime long 40 OwnerID long (Hi-Lo) 44 LastArchivedDateAndTime long 48 LastArchivedID long (Hi-Lo) 52 LastUpdatedDateAndTime long 56 LastUpdatedID long (Hi-Lo) 60 FileSize long 64 Reserved byte[44] 108 InheritedRightsMask word 110 LastAccessedDate word 112 Reserved byte[28]

	(DOS Subdirectory Entry)
	12	Subdirectory		long
	16	Attributes		long
	20	UniqueID		byte
	21	Flags			byte
	22	NameSpace		byte
	23	DirectoryNameLen	byte
	24	DirectoryName	 	byte[12]
	36	CreateDateAndTime	long
	40	OwnerID			long (Hi-Lo)
	44	LastArchivedDateAndTime	long
	48	LastArchivedID		long (Hi-Lo)
	52	LastModifiedDateAndTime	long
	56	NextTrusteeEntry	long
	60	Reserved		byte[48]
	108	MaximumSpace		long
	112	InheritedRightsMask	word
	112	Undefined		byte[26]
	(Macintosh Name Space Entry)
	12	Subdirectory		long
	16	MACFileAttributes	long
	20	MACUniqueID		byte
	21	MACFlags		byte
	22	MACMyNameSpace		byte
	23	MACFileNameLen		byte
	24	MACFileName	  	byte[32]
	56	ResourceFork  		long
	60	ResourceForkSize	long
	64	FinderInfo		byte[32]
	96	ProDosInfo		byte[6]
	102	Reserved		byte[38]

Completion Code

	0	0x00	Successful
	137	0x89	No Search Privileges
	152	0x98	Invalid Volume
	191	0xBF	Invalid Name Space

Remarks

This NCP gets a directory entry associated with any name space supported on the volume. Typically you would get the entry's sequence number by scanning for it in the DOS name space. Currently defined name spaces are DOS (0) and Macintosh (1).

Note that the DOS Sequence field in the Request Buffer at offset 11 and the SequenceNumber field in the ReplyBuffer at offset 8 are referred to as either a DirectoryBase or a DirectoryHandle in NetWare 386 parlance. This clarification of terms is important to developers who are implementing APIs which use the terms DirectoryBase or DirectoryHandle rather than DOS Sequence or SequenceNumber.

See Also

Get Name Space Information (0x2222 22 47)


Get Name Space Information 0x2222 22 47

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFunctionCode (47) byte 10 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 DefinedNameSpaces byte (for each Name Space) 9 NSNameLen byte 10 NameSpaceName byte[NSNameLen] 10+DefinedNameSpaces+NSNameLen DefinedDataStreams byte (for each Data Stream) 11+DefinedNameSpaces+NSNameLen AssociatedNameSpace byte 12+DefinedNameSpaces+NSNameLen DSNameLen byte 13+DefinedNameSpaces+NSNameLen DataStreamName byte[DSNameLen] 13+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams) +DSNameLens LoadedNameSpaces byte 14+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams) +DSNameLens IndexNumber byte[LoadedNameSpaces] 14+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams)+DSNameLens +LoadedNameSpaces VolumesNameSpaces byte 15+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams)+DSNameLens +LoadedNameSpaces IndexNumber byte[VolumeNameSpaces] 15+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams)+DSNameLens+LoadedNameSpaces +VolumeNameSpaces VolumesDataStreams byte 16+DefinedNameSpaces+NSNameLens+(2*DefinedDataStreams)+DSNameLens+LoadedNameSpaces +VolumeNameSpaces IndexNumber byte[VolumeDataStreams]

Completion Code

	0	0x00	Successful

Remarks

This NCP returns name space and data stream information for the file server and its volumes.

The IndexNumber vector associated with LoadedNameSpaces is a list of the possible Name Spaces that are actually loaded.

The IndexNumber vector associated with VolumeNameSpaces is a list of the name spaces that are being used on the specified volume.

The IndexNumber vector associated with VolumeDataStreams is a list of the data streams that are being used on the specified volume.

See Also

Get Name Space Directory Entry (0x2222 22 48)


Get Name Spaces Loaded List from Volume Number 0x2222 87 24

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (24) byte 8 reserved (0) word (Lo-Hi) 10 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 NumberOfNSLoaded word (Lo-Hi) 10 NSLoadList[] (See below) byte

Completion Code 0 SUCCESSFUL

Remarks

This NCP allows the client to query the server by volume and find which name spaces are loaded on that volume.

The NSLoadList field consists of a byte array with NumberOfNSLoaded elements, each element being the Name Space value (DOS, MACINTOSH, ...) that is loaded.


Get Object Disk Usage and Restrictions

0x2222 22 41

NetWare Linux
v2.x v3.x v4.x v5.x v6.x OES 1 OES 2 OES 11 OES 2015
 

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (41) byte 10 VolumeNumber byte 11 ObjectID long (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 Restriction long (Lo-Hi) 12 InUse long (Lo-Hi)

Completion Code

	0	0x00	Successful
	152	0x98	Invalid Volume

Remarks

This function scans a user's disk restrictions for a volume and returns the amount of space currently being used. The space values are in 4K blocks. If the restriction is 0x40000000 then there is no restriction for the object. Note that this call succeeds if the object ID is invalid--returning no restrictions and no space being used.

See Also
0x2222 22 55Get Object Disk Usage and Restrictions (64Bit Aware)
Add User Disk Space Restriction (0x2222 22 33)

Remove User Disk Space Restriction (0x2222 22 34)

Scan Volume's User Disk Restrictions (0x2222 22 32)

Set Directory Disk Space Restriction (0x2222 22 36)

Scan Directory Disk Space (0x2222 22 40)


Get Object Effective Rights for Directory Entry 0x2222 22 50

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (7+PathLen) word (Hi-Lo) 9 SubFunctionCode (50) byte 10 ObjectID long (Hi-Lo) 14 DirHandle byte 15 PathLen byte 16 Path byte[PathLen]

Reply Format

Offset Content Type (reply header) 8 AccessRights word (Lo-Hi)

Completion Code

	0	0x00	Successful
	126	0x7E	Invalid Length
	155	0x9B	Invalid Directory Error
	156	0x9C	Invalid Path

Remarks

This NCP gets an object's effective access rights to a specified directory or file. The caller must be either a supervisor, a manager of the object for which rights to the specified directory or file are requested, or the object itself. This call is similar to Get Effective Rights for Directory Entry (0x2222 22 42); however, this call allows you to specify an object (ObjectID parameter) for which rights are returned.

See Also

Get Effective Directory Rights for Directory Entry (0x2222 22 42)


Get Path Name of a Volume-Directory Number Pair 0x2222 22 26

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4) word (Hi-Lo) 9 SubFunctionCode (26) byte 10 VolumeNumber byte 11 DirectoryEntryNumber word

Reply Format

Offset Content Type (reply header) 8 DirectoryPathLen byte 9 DirectoryPath byte[DirectoryPathLen]

Completion Code

	  0	0x00	Successful
	152	0x98	Disk Map Error
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error

Remarks

This call returns the Directory Path for a Volume Number/Directory Entry Number pair. This call does not work under NetWare 386.


Get Path String from Short Directory Handle 0x2222 87 21

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (21) byte 8 NameSpace byte 9 ShortDirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 PathLen byte 9 Path[] byte

Completion Code

	0	SUCCESSFUL

Remarks

This NCP gets a path string from a short directory handle.


Get Reference Count from Dir Entry Number 0x2222 90 10

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (90) byte 7 SubFuncStrucLen (13) word (Hi-Lo) 9 SubFuncCode (10) byte 10 Volume long (Lo-Hi) 14 DirBase long (Lo-Hi) 18 NameSpace long (Lo-Hi)

ReplyFormat

Offset Content Type (reply header) 8 ReferenceCount long (Lo-Hi)

CompletionCode

	0	0x00	Successful
	126	0x7E	Invalid Length
	152	0x98	Disk Map Error (Invalid volume)
	156	0x9C	Invalid Path

Remarks

This NCP returns a reference count for a particular directory entry number.


Get Reference Count from Dir Handle 0x2222 90 11

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (90) byte 7 SubFuncStrucLen (5) word (Hi-Lo) 9 SubFuncCode (11) byte 10 DirectoryHandle long (Lo-Hi)

ReplyFormat

Offset Content Type (reply header) 8 ReferenceCount long (Lo-Hi)

CompletionCode

	0	0x00	Successful
	126	0x7E	Invalid Length
	136	0x88	Invalid Directory Handle

Remarks

This NCP returns a reference count for a particular directory handle.


Get Sparse File Data Block Bit Map 0x2222 85 --

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (85) byte 7 SubFuncStrucLen (10) word (Hi-Lo) 9 Handle byte[6] 15 StartingOffset long (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 AllocationBlockSize long (Lo-Hi) 12 Reserved byte[4] 16 BitMap (1 bit for each block) byte[512]

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle

Remarks

This function returns a bit map that shows which blocks contain data and which do not. There is one bit for each block in the sparse file. A one (1) means that there is data in that block and a zero (0) means that there is no data in that block.


Get Volume Info with Handle 0x2222 22 21

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (21) byte 10 DirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 SectorsPerCluster word (Hi-Lo) 10 TotalVolumeClusters word (Hi-Lo) 12 AvailableClusters word (Hi-Lo) 14 TotalDirectorySlots word (Hi-Lo) 16 AvailableDirectorySlots word (Hi-Lo) 18 VolumeName byte[16] 34 RemovableFlag word (Hi-Lo)

Completion Code

	0	0x00	Successful
	255	0xFF	Failure

Remarks

This NCP obtains information about the physical limitations of one of the server's volumes. Volumes use logical sector sizes of 512 bytes per sector. If the physical media uses a different sector size, the server must perform appropriate mappings. Volume space is allocated in groups of sectors called clusters.

Sectors Per Cluster indicates how many 512-byte sectors are contained in each cluster.

Total Volume Clusters indicates how many clusters make up the server volume.

Available Clusters indicates how many clusters are not currently in use.

Total Directory Slots indicates how many physical directory entries the volume contains. If this information is meaningless under a given server's implementation, Total Directory Slots should be set to 0xFFFF.

Available Directory Slots indicates how many of the total directory entries on the volume are still available for use. If this information is meaningless under a given server implementation, Available Directory Slots should be set to 0xFFFF.

Volume Name contains the name of the volume whose statistics are being reported. This field will be null padded.

Removable Flag is zero if the volume is on a fixed media and 0xFFFF if the volume is on a removable (mountable) media.

See Also

Get Volume Info With Number (0x2222 18 --)


Get Volume Info with Number 0x2222 18 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (18) byte 7 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 SectorsPerCluster word (Hi-Lo) 10 TotalVolumeClusters word (Hi-Lo) 12 AvailableClusters word (Hi-Lo) 14 TotalDirectorySlots word (Hi-Lo) 16 AvailableDirectorySlots word (Hi-Lo) 18 VolumeName byte[16] 34 RemovableFlag word (Hi-Lo)

Completion Code

	0	0x00	Successful
	152	0x98	Disk Map Error

Remarks

This NCP returns the same information as Get Volume Info With Handle

(0x2222 22 21). This call allows a client to check the physical space available on a volume without having to determine which mounted volume number the client's directory handle points to.

See Also

Get Volume Info With Handle (0x2222 22 21)


Get Volume Name 0x2222 22 06

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (6) byte 10 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 VolumeNameLen byte 9 VolumeName byte[VolumeNameLen]

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	255	0xFF	Failure

Remarks

This call allows a client to use a Volume Number to retrieve a Volume Name. A client can also use this call to scan volumes and determine the Volume (mount) Numbers and Volume Names of all volumes currently mounted on the file server. If the client wants to scan the file server for such information, the client should start with Volume Number zero (0) and scan upward until a Failure error (0xFF) is returned. If a volume that corresponds to the Volume Number has not been mounted, this call will still return Successful (0), but the Volume Name Length field returned by the server will be zero, indicating that no corresponding volume is currently mounted but that the volume mount slot is (potentially) valid.

See Also

Get Volume Number (0x2222 22 05)


Get Volume Number 0x2222 22 05

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2+VolumeNameLen) word (Hi-Lo) 9 SubFunctionCode (5) byte 10 VolumeNameLen byte 11 VolumeName byte[VolumeNameLen]

Reply Format

Offset Content Type (reply header) 8 VolumeNumber byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error

Remarks

This call allows a client to use a Volume Name to retrieve a Volume Number. Volume Numbers are required by several calls, including the calls to get a volume's usage statistics and the calls to get an object's trustee directory paths.

See Also

Get Volume Name (0x2222 22 06)


Get Volume and Purge Information 0x2222 22 44

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (2) word (Hi-Lo) 9 SubFunctionCode (44) byte 10 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 TotalBlocks long (Hi-Lo) 12 FreeBlocks long (Lo-Hi) 16 PurgeableBlocks long (Lo-Hi) 20 NotYetPurgeableBlocks long (Lo-Hi) 24 TotalDirEntries long (Lo-Hi) 28 AvailableDirEntries long (Lo-Hi) 32 Reserved byte[4] 36 SectorsPerBlock byte 37 VolumeNameLen byte 38 VolumeName byte[VolumeNameLen]

Completion Code

	0	0x00	Successful

Remarks

This function returns the real volume information for a 386 volume. The old NCP calls cannot handle a volume that is bigger than 256 Megabytes. It also returns information about deleted files.

If the volume number specified in the request buffer is not mounted, a successful completion code is returned, but all data fields in the reply buffer are set to zero.


Initialize Search 0x2222 87 02

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (02) byte 8 NameSpace byte 9 reserved (0) byte 10 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 VolumeNumber byte 9 DirectoryNumber long (Lo-Hi) 13 EntryNumber long (Lo-Hi)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP will initialize the search for a file or subdirectory, this search function is a stateless search.

The SearchSequence Definition field is a 9 byte field, consisting of a 1 byte Volume number, a 4 byte Directory Number, and a 4 byte Current Directory Number. The Search Sequence is generated only by the Server on each completed Search call.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Map Directory Number to Path 0x2222 23 243

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (23) byte 7 SubFuncStrucLen (7) word (Hi-Lo) 9 SubFunctionCode (243) byte 10 VolumeNumber byte 11 DirectoryNumber long (Lo-Hi) 15 NameSpace byte

Reply Format

Offset Content Type (reply header) 8 Path byte[]

Completion Code

	0	0x00	Successful

Remarks

This NCP maps a given directory number to a path.

The path is returned as a group of components. Each directory, subdirectory, or file in the path is considered to be a component. Each component is length preceeded and is followed by the next component. For example, pathName returns the users/jdoe/working directory as:

     5users4jdoe6working

The volume name is NOT returned as a component in the path.

See Also

Convert Path to Dir Entry (0x2222 23 244)


Modify DOS Attributes on a File or Subdirectory 0x2222 87 35

v2.xv3.xv4.xv5.x



Request

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (35) byte 8 NameSpace byte 9 Flags byte 10 SearchAttributes word (Lo-Hi) 12 AttributeMask long (Lo-Hi) 16 Attributes long (Lo-Hi) 20 NWHandlePathStruct structure

Reply

Offset Content Type (reply header) 8 ItemsChecked long (Lo-Hi) 12 ItemsChanged long (Lo-Hi) 16 AttributeValidFlag long (Lo-Hi) 20 NewAttributes long (Lo-Hi)

Completion Code

	0	0x00	Successful

Remarks

This NCP allows a client to set the DOS attributes field on an entry with the use of an apply mask. In this way, a client does not have to get the old attributes first, to which the new attributes would be applied before setting the name space attribute field.

This NCP is similar to the NCP Modify File or Subdirectory DOS Information (0x2222 87 07), but with the additional capability to modify files with a wild card.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

Flags

If the following bit is set, then Wild Cards in the NWHandlePathStruct structure will be honored:

#define AllowWildCardsBit 0x00000001

Please be aware that if AllowWildCardsBit is used, only the first entry match when changing attributes, new attribute value will be returned in the reply packet.

ItemsChecked

Number of items scanned, according to input criteria.

ItemsChanged

Number of items that attributes were changed on.

AttributeValidFlag

If this flag is zero, then the returned NewAttributes is not valid. For some reason we were unable to get, even though we changed the attributes of the entry.

NewAttributes

New value of the attributes of an entry.

See Also

Modify File or Subdirectory DOS Information (0x2222 87 07)


Revoke File Handle Rights 0x2222 87 43

v2.xv3.xv4.xv5.x



Request

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (43) byte 8 Reserved[3] byte 11 QueryFlag byte 12 FileHandle long (Hi-Lo) 16 RemoveOpenRights long (Lo-Hi)

Reply

Offset Content Type (reply header) 8 FileHandle long (Hi-Lo) 12 ResultantRights long (Lo-Hi)

Completion Code

	0	0x00	Successful
	115	0x73	Revoke Handle Rights Not Found
	136	0x88	Invalid File Handle
	253	0xFD	Bad Station Number; File Is Not Opened Multiple Times By Same Station & Task

Remarks

NetWare has always assumed that a client would open a file only once when using the same connection number (Station) and task number. If a client wanted to open the same file again, it was assumed it would use a different task number. With Win95 and WinNT clients, they can open the same file, multiple times but use the same connection number and task number, which is different than the original assumption by the NetWare Locks Engine. NetWare currently works (partially) as long as the requested rights (READ, WRITE, DENY_READ, DENY_WRITE) start from more rights to less rights. A problem occurs when the client opens the file with less rights and opens the same file again with more rights. For example, open a file with READ & WRITE rights, then open the file again with READ & WRITE & DENY_READ. After closing the file (the second open occurrence) the rights of the open file are still set to READ & WRITE & DENY_READ. Herein lies the problem. One might expect that the rights should have reverted back to READ & WRITE, but they don't. NCP 87 43 addresses this problem. If a file is opened multiple times by a client using the same connection & task, the client via NCP 87 43, can change the access rights back to what they were before the corresponding open had occurred.

The FileHandle parameter is the file handle of the file being opened or created. The left-most or most significant four bytes must be in Hi-Lo order.

QueryFlag - If this flag is set to 0x1, this will inform the NCP function to query the locks engine, and to return the current effective access rights on the FileHandle.

RemoveOpenRights - The original access rights the file was opened under. This will be accepted only if QueryFlag is equal to 0x0.

ResultantRights - The current effective access rights on the open file specified by FileHandle.

See Also


Update File Handle Rights 0x2222 87 44

v2.xv3.xv4.xv5.x




Request

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (44) byte 8 Reserved[2] byte 10 VolumeNumber byte 11 NameSpace byte 12 DirectoryNumber long (Lo-Hi) 16 OldAccessRights word (Lo-Hi) 18 NewAccessRights word (Lo-Hi) 20 FileHandle long (Hi-Lo)

Reply

Offset Content Type (reply header) 8 FileHandle long (Hi-Lo) 12 ResultantRights long (Lo-Hi)

Completion Code

	0	0x00	Successful
	115	0x73	Revoke Handle Rights Not Found
	136	0x88	Invalid File Handle
	253	0xFD	Bad Station Number; File Is Not Opened Multiple Times By Same Station & Task

Remarks

The VolumeNumber parameter refers to the number of the volume the DirectoryNumber is on.

The NameSpace field is the name space that the DirectoryNumber corresponds with.

The DirectoryNumber is the directory entry number of the file to be updated.

The OldAccessRights parameter is passed in to verify internally that they correspond to existing rights.

The NewAccessRights parameter is the value passed in that you want to update the existing file handle's rights to.

The FileHandle request parameter is the file handle of the file currently open. The left-most or most significant four bytes must be in Hi-Lo order.

The FileHandle reply parameter is returned as the file handle of the file currently open and just updated.

ResultantRights - The current effective access rights on the open file specified by FileHandle, and after applying the NewAccessRights.

See Also


Modify File or Subdirectory DOS Information 0x2222 87 07

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (07) byte 8 NameSpace byte 9 reserved (0) byte 10 SearchAttributes (See Intro) word (Lo-Hi) 12 ModifyDOSInfoMask (See Intro) long (Lo-Hi) 16 ModifyDOSInfoStruct (See Intro) structure 54 NWHandlePathStruct (See Intro) structure

Reply Format

Offset Content Type (reply header)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used for modifying DOS information while in another name space.

The SearchAttributes field, ModifyDosMask field, ModifyDosInfoStruct, and NWHandlePathStruct fields are explained in more detail in the Introduction to File System NCPs. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

NOTE: You cannot change the name with this NCP, so passing in a 0x1 in the ModifyDOSInfoMask has no effect.

See Also

Modify DOS Attributes on a File or Subdirectory (0x2222 87 35)


Modify Maximum Rights Mask 0x2222 22 04

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (5+DirectoryPathLen)word (Hi-Lo) 9 SubFunctionCode (4) byte 10 DirectoryHandle byte 11 RightsGrantMask byte 12 RightsRevokeMask byte 13 DirectoryPathLen byte 14 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call allows a client to modify the maximum access rights mask associated with a directory. The directory's maximum access rights mask is first ANDed with the NOT of the Rights Revoke Mask specified by the client. This operation removes any rights included in the Rights Revoke Mask from the directory's maximum access rights mask. The result of this operation is then ORed with the Rights Grant Mask specified. This operation adds the rights included in the Rights Grant Mask to the directory's maximum access rights mask. The result is the directory's new maximum access rights mask.

This call is successful if the client has access control rights to either the target directory or its parent directory.


Obtain File or SubDirectory Information 0x2222 87 06

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (06) byte 8 NameSpace byte 9 DestNameSpace byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NetWareInfoStruct structure xx NetWareFileNameStruct structure

Completion Code

	0	SUCCESSFUL

Remarks

NOTE: The SearchAttributes request field is currently not used. Regardless of what value is passed in, info on the file or subdirectory will be returned if the file or subdir exists.

The ReturnInfoMask field, NetWareInfoStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

The date values in the NetWareInfoStruct, from the least significant byte to the most significant byte, are:

The time values in the NetWareInfoStruct, from the least significant byte to the most significant byte, are:


Open CallBack Control 0x2222 87 34

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (34) byte 8 CCFileHandle long (Hi-Lo) 12 CCFunction (see below) byte

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful

Remarks

The CCFileHandle parameter is the file handle of the file being opened or created. The left-most or most significant four bytes must be in Hi-Lo order.

There are three actions that can be specified in the CCFunction parameter when calling this NCP:

  1. Clear Callback (0x1)
  2. Acknowledge Callback (0x2)
  3. Decline Callback (0x3)

Open/Create File (old) 0x2222 84 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (84) byte 7 DirectoryHandle byte 8 FileAttributes byte 9 AccessFlags byte 10 ActionCode byte 11 FileNameLen byte 12 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[6] (Hi-Lo) 14 Reserved word (Hi-Lo) 16 FileName byte[14] 30 FileAttributes byte 31 FileExecuteType byte 32 FileLen long (Hi-Lo) 36 CreationDate word (Hi-Lo) 38 LastAccessDate word (Hi-Lo) 40 LastUpdateDate word (Hi-Lo) 42 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	132	0x84	No Create Privileges
	133	0x85	No Create/Delete Privileges
	135	0x87	Create Filename Error
	141	0x8D	Some Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	153	0x99	Directory Full Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This NCP replaces the three earlier NCPs, Open File (0x2222 76 --), Create File (0x2222 67 --), and Create New File (0x2222 77 --).

The Create File NCP (0x2222 67 --) creates and opens a file, automatically replacing an older file by the same name if it exists. Create New File (0x2222 77 --) fails if another file by the same name exists. The Open/Create File NCP (0x2222 84 --) provides the ActionFlag parameter which allows the client to specify the following different actions:

ACTION_OPEN (0x1)
ACTION_REPLACE (0x2)
ACTION_CREATE (0x10)

As with the older calls, this call creates a new file for the calling client in the indicated directory. The client must have at least file creation privileges in the directory or this request will be rejected.

If the client has file deletion privileges in the indicated directory and a file with the same name already exists in the directory, and the client has specified that the existing file is to be replaced, the existing file will be erased before the new file is created.

If the client does not have file deletion privileges in the indicated directory and a file with the same name already exists in the directory, this request will fail.

The newly created file will be stamped with the date and time of its creation. The file attributes byte will be set to the attributes specified by the client. The file will be opened as an exclusive file with both read and write access requested. The actual access rights granted will depend on the client's file access privileges in the specified directory.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

This call is replaced by the NetWare 386 v3.11 call Open Create File or Subdirectory (0x2222 87 01).

See Also

Create File (0x2222 67 --)

Create New File (0x2222 77 --)

Erase File (0x2222 68 --)

Open File (0x2222 76 --)

Open Create File or Subdirectory (0x2222 87 01)


Open/Create File or SubDirectory 0x2222 87 01

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (01) byte 8 NameSpace byte 9 OpenCreateMode (See below) byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 CreateAttributes long (Lo-Hi) 20 DesiredAccessRights (See below) word (Lo-Hi) 22 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 FileHandle long (Hi-Lo) 12 OpenCreateAction (See below) byte 13 Reserved byte 14 NetWareInfoStruct structure xx NetWareFileNameStruct structure

Completion Code

	0	SUCCESSFUL

Remarks

This NCP creates or opens the specified file depending on the OpenCreate Mode field. Note, however, that subdirectories may be created but not opened by the client.

The following request parameters are defined:

The NameSpace parameter contains a value identifying one of the following name spaces:

NameNumeric Value
DOS0
MAC1
NFS2
FTAM3
OS/24

NOTE: In NetWare 4.11 or greater, the OS/2 name space (OS2.NAM) has been replaced with the LONG name space (LONG.NAM).

The OpenCreateMode field as shown below allows you to designate whether you are creating a new file, replacing a current file, or opening a current file.

OpenCreateMode
7654 3210 Definition
0






reserved

0





reserved


x




Action 64 Bit Access Allowed



0



reserved




x


Action Create





0

reserved






x
Action Replace







x Action Open

OpenCreateMode flag bits may have the following values:

0x01 OPEN_FILE
0x02 TRUNCATE_FILE
0x08 CREATE_FILE
0x20 OPEN_64BIT_ACCESS (NOTE: Allows 64 bit access on NSS volumes)

These values are combined to have the following effects:

0x0 Invalid action
0x1 Open existing file (file must exist)
0x2 Open existing file and truncate it, else create a new file (same as 0xB)
0x3 Open existing file and truncate it (file must exist)
0x8 Create new file or subdirectory (file or subdirectory cannot exist)
0x9 Open existing file or create a new file
0xA Open existing file and truncate it, else create a new file (same 0xB)
0xB Open existing file and truncate it, else create a new file

The SearchAttributes field allows you to designate the following create/open options:

The ReturnInfoMask allows you to request from the server specific information about a file/subdirectory. Information such as creation date/time, attributes, inherited rights, name space, etc. is returned in the NetWareInfoStruct structure. The file/subdirectory name and length are returned in the NetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the NetWareFileNameStruct (reply parameter) are given in the Introduction to File System NCPs.

The CreateAttributes field is used to set the attributes in the DOS name space.

The DesiredAccessRights parameter, as shown below, allows you to designate the access rights of the file being created. Beginning with NetWare 4.10, a file can be opened as a temporary file that will be deleted when the file is closed.
IMPORTANT NOTE: If the item being created is a subdirectory, then the DesiredAccessRights parameter is used as an Inherited Rights Filter. See Inherited Rights Mask definition below. Typically you would want all rights in the Inherited Rights Mask Definition and would pass a 0xFF.

To create a temporary file, the caller must set the DELETE_FILE_CLOSE_BIT (0x0400), the DENY_READ_BIT, and the DENY_WRITE_BIT in the desired access rights field. Temporary files by definition do not allow shared I/O access. This file will exist until the caller closes the file, which will cause the file to be deleted.

The OS will create temporary files with the HIDDEN_BIT set, so that they will not be visible. Also the IMMEDIATE_COMPRESS_BIT is masked off from the created attributes supplied by the caller.

DesiredAccessRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





x









Delete File Close






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

Inherited Rights Mask Definition (for subdirs)
15141312111098 76543210 Bit Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







x







Supervisor Privileges Bit








x






Modify Entry Bit









x





See Files Bit










x




Change Access Control Bit











x



Delete Existing Bit












x


Create New Entry Bit













x

Old Open Existing File Bit














x
Write Existing File Bit















x Read Existing File Bit

The NWHandlePathStruct is a structure you use to pass the file/subdirectory handle or path. You can pass a handle or path by using the Volume Number field, the Dirctory Base field, or the Directory Handle field of the structure shown below. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

	BYTE	VolumeNumber;
	LONG	DirectoryBaseOrShortHandle; (Lo-Hi)
	BYTE	HandleFlag;
	BYTE	PathComponentCount; /*Count for each directory and subdirectory. For
	 	   example, SYS:TEST\NLM_TEST would be a path component count of 3.
	STRUCT	Pcomponent [PathComponentCount];

The first part of the Handle\Path structure (everything except the Pcomponent field) is used to pass to the server either a 1-byte Directory Handle (v2.15 Style Short Directory Handle) or a 4-Byte Directory Base (v3.1 Style). The layout of the handle portion of the structure is as follows:

The client can pass a Short Directory Handle (with or without a path) a Directory Base (with or without a path), or a fully qualified path.

The server always checks the Handle Flag field (shown below) to see if the handle is a Short Directory Handle (0), a Directory Base (1), or No Handle Present (FF).

HandleFlag

The server performs the appropriate action based on the Handle Flag. If the client passes a Short Directory Handle (0x00) or a Directory Base (0x01), the server can use the Path Component. If the client passes no handle (0xFF), the server expects the first path component to contain the Volume Name. If there are additional components, the server handles them after generating a Volume Number.

The second portion of the Handle\Path structure is used to pass a qualified NetWare Path (Len, String) in component form (Path Component Count is used for the number of Components). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:

	struct
	{
		BYTE PathNameLen;
		BYTE PathName[];
	} PComponent[];

The following reply parameters are defined:

The FileHandle parameter is the file handle of the file being opened or created. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

The OpenCreateAction parameter, as shown below, indicates the type of action that was taken regarding the file or subdirectory.

OpenCreateAction
7654 3210 Definition
x






File is Read Only NetWare 4.11 or greater

x





reserved


x




reserved



x



reserved




x


File Is Compressed NetWare 4.11 or greater





x

File Replaced






x
File\SubDirectory Created







x File Open

NOTE: If bits 0-2 are set to zero, then no action was taken.

The NetWareInfoStruct parameter is a pointer to a NetWareInformationStructure. This structure encompasses both the way a client requests information from a server and the way a server responds to a client's request. The client-request and server-response process works as follows. When in a client's request packet, a particular bit in the ReturnInfoMask field (long) is set (see ReturnInfoMask parameter above), the server uses the corresponding structure in the NetWareInformationStructure to return the requested information in a reply packet. For example, if the Rights Information bit of the ReturnInfoMask field is set, the server uses the RightsInfoStruct field of the NetWareInformationStructure to return information about a specified file's rights. (For more detailed information, see the Introduction to the File System NCPs.)

The NetWareFileNameStruct is a pointer to the NetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.


Open/Create File or Subdirectory 0x2222 87 30

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (30) byte 8 NameSpace byte 9 DataStream byte 10 OpenCreateMode (See below) byte 11 Reserved byte 12 SearchAttributes word (Lo-Hi) 14 Reserved word (Lo-Hi) 16 ReturnInfoMask long (Lo-Hi) 20 CreateAttributes long (Lo-Hi) 24 DesiredAccessRights (See below) word (Lo-Hi) 26 NWHandlePathStruct (See below) structure

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[4] (Hi-Lo) 12 OpenCreateAction (See below) byte 13 Reserved byte 14 NetWareInfoStruct structure xx NetWareFileNameStruct (See intro)structure

Completion Code

	0	0x00	Successful
	255	0xFF	Failure

Remarks

This NCP replaces Open/Create File or Subdirectory (0x2222 87 01). This NCP will create or open the file depending on the OpenCreate Mode field. Note, however, that subdirectories may be created by the client but not opened by the client. The following request parameters are defined:

The NameSpace parameter contains a value identifying one of the following name spaces:

NameNumeric Value
DOS0
MAC1
NFS2
FTAM3
OS/24

NOTE: In NetWare 4.11 or greater, the OS/2 name space (OS2.NAM) has been replaced with the LONG name space (LONG.NAM).

The DataStream field contains the data stream number if the name space is Macintosh. A value of 0 is the resource fork and a value of 1 is the data fork. If DOS, the value is always 0.

The OpenCreateMode field as shown below allows you to designate whether you are creating a new file, replacing a current file, or opening a current file.

OpenCreateMode
7654 3210 Definition
0






reserved

0





reserved


x




Action 64 Bit Access Allowed



0



reserved




x


Action Create





0

reserved






x
Action Replace







x Action Open

OpenCreateMode flag bits may have the following values:

0x01 OPEN_FILE
0x02 TRUNCATE_FILE
0x08 CREATE_FILE
0x20 OPEN_64BIT_ACCESS (NOTE: Allows 64 bit access on NSS volumes)

These values are combined to have the following effects:

0x0 Invalid action
0x1 Open existing file (file must exist)
0x2 Open existing file and truncate it, else create a new file (same as 0xB)
0x3 Open existing file and truncate it (file must exist)
0x8 Create new file or subdirectory (file or subdirectory cannot exist)
0x9 Open existing file or create a new file
0xA Open existing file and truncate it, else create a new file (same 0xB)
0xB Open existing file and truncate it, else create a new file

The CreateAttributes field is used to set the attributes in the DOS name space. More information on this field in given in the Introduction to File System NCPs.

The SearchAttributes field allows you to designate the following create/open options:

The ReturnInfoMask allows you to request from the server specific information about a file/subdirectory. Information such as creation date/time, attributes, inherited rights, name space, etc. is returned in the NetWareInfoStruct structure. The file/subdirectory name and length are returned in the NetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the NetWareFileNameStruct (reply parameter) are given in the Introduction to File System NCPs.

The CreateAttributes field is used to set the attributes in the DOS name space.

The DesiredAccessRights parameter, as shown below, allows you to designate the access rights of the file being created. Beginning with NetWare 4.10, a file can be opened as a temporary file that will be deleted when the file is closed.
IMPORTANT NOTE: If the item being created is a subdirectory, then the DesiredAccessRights parameter is used as an Inherited Rights Filter. See Inherited Rights Mask definition below. Typically you would want all rights in the Inherited Rights Mask Definition and would pass a 0xFF.

To create a temporary file, the caller must set the DELETE_FILE_CLOSE_BIT (0x0400), the DENY_READ_BIT, and the DENY_WRITE_BIT in the desired access rights field. Temporary files by definition do not allow shared I/O access. This file will exist until the caller closes the file, which will cause the file to be deleted.

The OS will create temporary files with the HIDDEN_BIT set, so that they will not be visible. Also the IMMEDIATE_COMPRESS_BIT is masked off from the created attributes supplied by the caller.

DesiredAccessRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





x









Delete File Close






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

Inherited Rights Mask Definition (for subdirs)
15141312111098 76543210 Bit Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







x







Supervisor Privileges Bit








x






Modify Entry Bit









x





See Files Bit










x




Change Access Control Bit











x



Delete Existing Bit












x


Create New Entry Bit













x

Old Open Existing File Bit














x
Write Existing File Bit















x Read Existing File Bit

The NWHandlePathStruct is a structure you use to pass the file/subdirectory handle or path. You can pass a handle or path by using the Volume Number field, the Dirctory Base field, or the Directory Handle field of the structure shown below. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

	BYTE	VolumeNumber;
	LONG	DirectoryBaseOrShortHandle; (Lo-Hi)
	BYTE	HandleFlag;
	BYTE	PathComponentCount; /*Count for each directory and subdirectory. For
		    example, SYS:TEST\NLM_TEST would be a path component count of 3.
	STRUCT	Pcomponent [PathComponentCount];

The first part of the Handle\Path structure (everything except the Pcomponent field) is used to pass to the server either a 1-byte Directory Handle (v2.15 Style Short Directory Handle) or a 4-Byte Directory Base (v3.1 Style). The layout of the handle portion of the structure is as follows:

The client can pass a Short Directory Handle (with or without a path) a Directory Base (with or without a path), or a fully qualified path.

The server always checks the Handle Flag field (shown below) to see if the handle is a Short Directory Handle (0), a Directory Base (1), or No Handle Present (FF).

HandleFlag

The server performs the appropriate action based on the Handle Flag. If the client passes a Short Directory Handle (0x00) or a Directory Base (0x01), the server can use the Path Component. If the client passes no handle (0xFF), the server expects the first path component to contain the Volume Name. If there are additional components, the server handles them after generating a Volume Number.

The second portion of the Handle\Path structure is used to pass a qualified NetWare Path (Len, String) in component form (Path Component Count is used for the number of Components). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:

	struct
	{
		BYTE PathNameLen;
		BYTE PathName[];
	} PComponent[]

The following reply parameters are defined:

The FileHandle parameter is the file handle of the file being opened or created. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

The OpenCreateAction parameter, as shown below, indicates the type of action that was taken regarding the file or subdirectory.

OpenCreateAction
7654 3210 Definition
x






File is Read Only NetWare 4.11 or greater

x





reserved


x




reserved



x



reserved




x


File Is Compressed NetWare 4.11 or greater





x

File Replaced






x
File\SubDirectory Created







x File Open

NOTE: If bits 0-2 are set to zero, then no action was taken.

The NetWareInfoStruct parameter is a pointer to a NetWareInformationStructure. This structure encompasses both the way a client requests information from a server and the way a server responds to a client's request. The client-request and server-response process works as follows.

When in a client's request packet, a particular bit in the ReturnInfoMask field (long) is set (see ReturnInfoMask parameter above), the server uses the corresponding structure in the NetWareInformationStructure to return the requested information in a reply packet. For example, if the Rights Information bit of the ReturnInfoMask field is set, the server uses the RightsInfoStruct field of the NetWareInformationStructure to return information about a specified file's rights. (For more detailed information, see the Introduction to the File System NCPs.)

The NetWareFileNameStruct is a pointer to the NetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.


Open/Create File or Subdirectory with Callback 0x2222 87 32

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (32) byte 8 NameSpace byte 9 OpenCreateMode (See below) byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 CreateAttributes long (Lo-Hi) 20 DesiredAccessRights (See below) word (Lo-Hi) 22 NWHandlePathStruct (See below) structure

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[4] (Hi-Lo) 12 OpenCreateAction (See below) byte 13 OCRetFlags byte 14 NetWareInfoStruct structure xx NetWareFileNameStruct (See intro)structure

Completion Code

	0	0x00	Successful
	255	0xFF	Failure

Remarks

This NCP is an enhancement of the NCP Open/Create File or Subdirectory (0x2222 87 01). As with the older NCP, this new NCP will create or open the specified file depending on the OpenCreate Mode field. In addition, this NCP allows you to set a CallBack flag; on return the OCRetFlags (OpenCallBackReturnFlags) field in the reply structure notifies you of completion.

As with the older NCP, also note that subdirectories may be created by the client but not opened by the client. The following request parameters are defined:

NameNumeric Value
DOS0
MAC1
NFS2
FTAM3
OS/24

NOTE: In NetWare 4.11 or greater, the OS/2 name space (OS2.NAM) has been replaced with the LONG name space (LONG.NAM).

The OpenCreateMode field as shown below has two additional bit settings: Open CallBack and RO Access OK. The fields in this structure allow you to designate the following:

  1. Opening a current file
  2. Replacing a current file
  3. Creating a new file
  4. Allowing Read Only access
  5. Requesting a Callback.
  6. Requesting 64 bit access on an NSS volume.
OpenCreateMode Bits
7654 3210 Definition
x






Open Callback

x





RO Access OK


x




Action 64 Bit Access Allowed



x



reserved




x


Create





x

reserved






x
Replace







x Open

OpenCreateMode flag bits may have the following values:

0x01 OPEN_FILE
0x02 TRUNCATE_FILE
0x08 CREATE_FILE
0x20 OPEN_64BIT_ACCESS (NOTE: Allows 64 bit access on NSS volumes)
0x40 RO_ACCESS_OK
0x80 OPEN_CALLBACK

These values are combined to have the following effects:

0x0 Invalid action
0x1 Open existing file (file must exist)
0x2 Open existing file and truncate it, else create a new file (same as 0xB)
0x3 Open existing file and truncate it (file must exist)
0x8 Create new file or subdirectory (file or subdirectory cannot exist)
0x9 Open existing file or create a new file
0xA Open existing file and truncate it, else create a new file (same 0xB)
0xB Open existing file and truncate it, else create a new file

The SearchAttributes field allows you to designate the following create/open options:

The ReturnInfoMask allows you to request from the server specific information about a file/subdirectory. Information such as creation date/time, attributes, inherited rights, name space, etc. is returned in the NetWareInfoStruct structure. The file/subdirectory name and length are returned in the NetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the NetWareFileNameStruct (reply parameter) are given in the Introduction to File System NCPs.

The CreateAttributes field is used to set the attributes in the DOS name space.

The DesiredAccessRights parameter, as shown below, allows you to designate the access rights of the file being created.
IMPORTANT NOTE: If the item being created is a subdirectory, then the DesiredAccessRights parameter is used as an Inherited Rights Filter. See Inherited Rights Mask definition below. Typically you would want all rights in the Inherited Rights Mask Definition and would pass a 0xFF.

DesiredAccessRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





x









Delete File Close






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

Inherited Rights Mask Definition (for subdirs)
15141312111098 76543210 Bit Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







x







Supervisor Privileges Bit








x






Modify Entry Bit









x





See Files Bit










x




Change Access Control Bit











x



Delete Existing Bit












x


Create New Entry Bit













x

Old Open Existing File Bit














x
Write Existing File Bit















x Read Existing File Bit

The NWHandlePathStruct is a structure you use to pass the file/subdirectory handle or path. You can pass a handle or path by using the Volume Number field, the Dirctory Base field, or the Directory Handle field of the structure shown below. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

	BYTE	VolumeNumber;
	LONG	DirectoryBaseOrShortHandle; (Lo-Hi)
	BYTE	HandleFlag;
	BYTE	PathComponentCount; /*Count for each directory and subdirectory. For
		 	   example, SYS:TEST\NLM_TEST would be a path component count of 3.
	STRUCT	Pcomponent [PathComponentCount];

The first part of the Handle\Path structure (everything except the Pcomponent field) is used to pass to the server either a 1-byte Directory Handle (v2.15 Style Short Directory Handle) or a 4-Byte Directory Base (v3.1 Style). The layout of the handle portion of the structure follows:

The client can pass a Short Directory Handle (with or without a path) a Directory Base (with or without a path), or a fully qualified path.

The server always checks the Handle Flag field (shown below) to see if the handle is a Short Directory Handle (0), a Directory Base (1), or No Handle Present (FF).

HandleFlag

The server performs the appropriate action based on the Handle Flag. If the client passes a Short Directory Handle (0x00) or a Directory Base (0x01), the server can use the Path Component. If the client passes no handle (0xFF), the server expects the first path component to contain the Volume Name. If there are additional components, the server handles them after generating a Volume Number.

The second portion of the Handle\Path structure is used to pass a qualified NetWare Path (Len, String) in component form (Path Component Count is used for the number of Components). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:

	struct
	{
		BYTE PathNameLen;
		BYTE PathName[];
	} PComponent[];

The following reply parameters are defined:

The FileHandle parameter is the file handle of the file being opened or created. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

The OpenCreateAction parameter, as shown below, indicates the type of action that was taken regarding the file or subdirectory.

DesiredAccessRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





x









Delete File Close






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

The OCRetFlags field is a call back field. This field can contain 2 values. A value of 1 indicates that this request has been registered for callback if someone else tries to open the file. A value of 0 indicates that no callback has been registered.

The NetWareInfoStruct parameter is a pointer to a NetWareInformationStructure. This structure encompasses both the way a client requests information from a server and the way a server responds to a client's request. The client-request and server-response process works as follows. When in a client's request packet, a particular bit in the ReturnInfoMask field (long) is set (see ReturnInfoMask parameter above), the server uses the corresponding structure in the NetWareInformationStructure to return the requested information in a reply packet. For example, if the Rights Information bit of the ReturnInfoMask field is set, the server uses the RightsInfoStruct field of the NetWareInformationStructure to return information about a specified file's rights. (For more detailed information, see the Introduction to the File System NCPs.)

The NetWareFileNameStruct is a pointer to the NetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.

See Also

Open/Create File or Subdirectory (0x2222 87 01)


Open/Create File or Subdirectory II with Callback 0x2222 87 33

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (33) byte 8 NameSpace byte 9 DataStream byte 10 OpenCreateMode (See below) byte 11 Reserved byte 12 SearchAttributes word (Lo-Hi) 14 Reserved word (Lo-Hi) 16 ReturnInfoMask long (Lo-Hi) 20 CreateAttributes long (Lo-Hi) 24 DesiredAccessRights (See below) word (Lo-Hi) 26 NWHandlePathStruct (See below) structure

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[4] (Hi-Lo) 12 OpenCreateAction (See below) byte 13 OCRetFlags byte 14 NetWareInfoStruct structure xx NetWareFileNameStruct (See intro) structure

Completion Code

	0	0x00	Successful
	255	0xFF	Failure

Remarks

This NCP is an enhancement of the NCP Open/Create File or Subdirectory (0x2222 87 30). As with the older NCP, this new NCP will create or open the file depending on the OpenCreate Mode field. In addition, this NCP allows you to set a CallBack flag; on return the OCRetFlags (OpenCallBackReturnFlags) field in the reply structure notifies you of completion.

As with the older NCP, also note that subdirectories may be created by the client but not opened by the client. The following request parameters are defined:

The NameSpace parameter contains a value identifying one of the following name spaces:

NameNumeric Value
DOS0
MAC1
NFS2
FTAM3
OS/24

NOTE: In NetWare 4.11 or greater, the OS/2 name space (OS2.NAM) has been replaced with the LONG name space (LONG.NAM).

The DataStream field contains the data stream number if the name space is Macintosh. A value of 0 is the resource fork and a value of 1 is the data fork. If DOS, the value is always 0.

The OpenCreateMode field as shown below has two additional bit settings: Open CallBack and RO Access OK. The fields in this structure allow you to designate the following:

  1. Opening a current file
  2. Replacing a current file
  3. Creating a new file
  4. Allowing Read Only access
  5. Requesting a Callback.
  6. Requesting 64 bit access on an NSS volume.
OpenCreateMode Bits
7654 3210 Definition
x






Open Callback

x





RO Access OK


x




Action 64 Bit Access Allowed



x



reserved




x


Create





x

reserved






x
Replace







x Open

OpenCreateMode flag bits may have the following values:

0x01 OPEN_FILE
0x02 TRUNCATE_FILE
0x08 CREATE_FILE
0x20 OPEN_64BIT_ACCESS (NOTE: Allows 64 bit access on NSS volumes)
0x40 RO_ACCESS_OK
0x80 OPEN_CALLBACK

These values are combined to have the following effects:

0x0 Invalid action
0x1 Open existing file (file must exist)
0x2 Open existing file and truncate it, else create a new file (same as 0xB)
0x3 Open existing file and truncate it (file must exist)
0x8 Create new file or subdirectory (file or subdirectory cannot exist)
0x9 Open existing file or create a new file
0xA Open existing file and truncate it, else create a new file (same 0xB)
0xB Open existing file and truncate it, else create a new file

The CreateAttributes field is used to set the attributes in the DOS name space. More information on this field in given in the Introduction to File System NCPs.

The SearchAttributes field allows you to designate the following create/open options:

The ReturnInfoMask allows you to request from the server specific information about a file/subdirectory. Information such as creation date/time, attributes, inherited rights, name space, etc. is returned in the NetWareInfoStruct structure. The file/subdirectory name and length are returned in the NetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the NetWareFileNameStruct (reply parameter) are given in the Introduction to File System NCPs.

The CreateAttributes field is used to set the attributes in the DOS name space.

The DesiredAccessRights parameter, as shown below, allows you to designate the access rights of the file being created.
IMPORTANT NOTE: If the item being created is a subdirectory, then the DesiredAccessRights parameter is used as an Inherited Rights Filter. See Inherited Rights Mask definition below. Typically you would want all rights in the Inherited Rights Mask Definition and would pass a 0xFF.

DesiredAccessRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





x









Delete File Close






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

Inherited Rights Mask Definition (for subdirs)
15141312111098 76543210 Bit Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







x







Supervisor Privileges Bit








x






Modify Entry Bit









x





See Files Bit










x




Change Access Control Bit











x



Delete Existing Bit












x


Create New Entry Bit













x

Old Open Existing File Bit














x
Write Existing File Bit















x Read Existing File Bit

The NWHandlePathStruct is a structure you use to pass the file/subdirectory handle or path. You can pass a handle or path by using the Volume Number field, the Dirctory Base field, or the Directory Handle field of the structure shown below. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

	BYTE	VolumeNumber;
	LONG	DirectoryBaseOrShortHandle; (Lo-Hi)
	BYTE	HandleFlag;
	BYTE	PathComponentCount; /*Count for each directory and subdirectory. For
		 	   example, SYS:TEST\NLM_TEST would be a path component count of 3.
	STRUCT	Pcomponent [PathComponentCount];

The first part of the Handle\Path structure (everything except the Pcomponent field) is used to pass to the server either a 1-byte Directory Handle (v2.15 Style Short Directory Handle) or a 4-Byte Directory Base (v3.1 Style). The layout of the handle portion of the structure is as follows:

The client can pass a Short Directory Handle (with or without a path) a Directory Base (with or without a path), or a fully qualified path.

The server always checks the Handle Flag field (shown below) to see if the handle is a Short Directory Handle (0), a Directory Base (1), or No Handle Present (FF).

HandleFlag

The server performs the appropriate action based on the Handle Flag. If the client passes a Short Directory Handle (0x00) or a Directory Base (0x01), the server can use the Path Component. If the client passes no handle (0xFF), the server expects the first path component to contain the Volume Name. If there are additional components, the server handles them after generating a Volume Number.

The second portion of the Handle\Path structure is used to pass a qualified NetWare Path (Len, String) in component form (Path Component Count is used for the number of Components). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:

	struct
	{
		BYTE PathNameLen;
		BYTE PathName[];
	} PComponent[];

The following reply parameters are defined:

The FileHandle parameter is the file handle of the file being opened or created. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

The OpenCreateAction parameter, as shown below, indicates the type of action that was taken regarding the file or subdirectory.

OpenCreateAction
7654 3210 Definition
x






File is Read Only NetWare 4.11 or greater

x





reserved


x




reserved



x



reserved




x


File Is Compressed NetWare 4.11 or greater





x

File Replaced






x
File\SubDirectory Created







x File Open

NOTE: If bits 0-2 are set to zero, then no action was taken.

The OCRetFlags field is a call back field. This field can contain 2 values. A value of 1 indicates that this request has been registered for callback if someone else tries to open the file. A value of 0 indicates that no callback has been registered.

The NetWareInfoStruct parameter is a pointer to a NetWareInformationStructure. This structure encompasses both the way a client requests information from a server and the way a server responds to a client's request. The client-request and server-response process works as follows.

When in a client's request packet, a particular bit in the ReturnInfoMask field (long) is set (see ReturnInfoMask parameter above), the server uses the corresponding structure in the NetWareInformationStructure to return the requested information in a reply packet. For example, if the Rights Information bit of the ReturnInfoMask field is set, the server uses the RightsInfoStruct field of the NetWareInformationStructure to return information about a specified file's rights. (For more information, see the Introduction to the File System NCPs.)

The NetWareFileNameStruct is a pointer to the NetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.

See Also

Open/Create File or Subdirectory (0x2222 87 30)


Open Data Stream 0x2222 22 49

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (5+FileNameLen) word (Hi-Lo) 9 SubFunctionCode (49) byte 10 DataStream byte 11 DirHandle byte 12 FileAttributes byte 13 OpenRights (requested rights) byte 14 FileNameLen byte 15 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[4] (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Failure
	130	0x82	No Open Privileges
	144	0x90	Read-only Access To Volume
	190	0xBE	Invalid Data Stream
	255	0xFF	No Files Found

Remarks

This function opens a data stream associated with any supported name space on the server. It also returns a NetWare file handle.

The following request parameters are defined:

The DataStream contains the data stream number if the name space is Macintosh. A value of 0 is the resource fork and a value of 1 is the data fork. If DOS, the value is always 0.

The DirHandle is the directory handle of the directory in which the file is located.

The one-byte FileAttributes parameter control access to the file as shown and explained below:

Byte 0 Bit Definition
7654 3210 Definition
x






Shareable Bit

x





Execute Confirm Bit


x




Archive Bit



x



Subdirectory Bit




x


Excute Only Bit





x

System Bit






x
Hidden Bit







x Read Only Bit

BitNameBit Description
0 Read Only File can be read but not written to.
1 Hidden File will not be shown in a normal directory listing.
2 System File will not be shown in a normal directory listing.
3 Execute Only File can be loaded for execution only; once this Bit has been set, it cannot be cleared.
4 Subdirectory Entry is a subdirectory, not a file.
5 Archive Bit is set if the file has been changed since it was last backed up.
6 Execute Confirm
7 Shareable Bit is set if file can be simultaneously accessed by more than one user.

The one-byte OpenRights parameter, as shown below, is the lower eight bits that specify requested access rights to the file.

OpenRights Bits
15141312111098 76543210 Definition
0














reserved

0













reserved


0












reserved



0











reserved




0










reserved





0









reserved






0








reserved







0







reserved








0






reserved









x





File Write Through Mode










0




reserved











x



Compatibility Mode












x


Deny Write Mode













x

Deny Read Mode














x
Write Access Mode















x Read Access Mode

The FileNameLen is the length of the file name.

The FileName is the name of the file for which a data stream is opened.

The following reply parameters are defined:

The FileHandle is the file handle returned by this NCP. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.


Open File (old) 0x2222 65 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (65) byte 7 DirectoryHandle byte 8 SearchAttributes byte 9 FileNameLen byte 10 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[6] (Hi-Lo) 14 Reserved word (Hi-Lo) 16 FileName byte[14] 30 FileAttributes byte 31 FileExecuteType byte 32 FileLen long (Hi-Lo) 36 CreationDate word (Hi-Lo) 38 LastAccessDate word (Hi-Lo) 40 LastUpdateDate word (Hi-Lo) 42 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	130	0x82	No Open Privileges
	148	0x94	No Write Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Lock Error, Failure, No Files Found

Remarks

This call is the pre-NetWare v2.0a form of Open File (0x2222 76 --). It is equivalent to function 76, except that the Desired Access Rights cannot be specified with this call. Using this call is the same as using function 76 with Desired Access Rights set to Exclusive, Read, and Write (0x13).

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

See Also

Open File (0x2222 76 --)

Close File (0x2222 66 --)

Open/Create File (0x2222 84 --)

Open Create File or Subdirectory (0x2222 87 01)


Open File (old) 0x2222 76 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (76) byte 7 DirectoryHandle byte 8 SearchAttributes byte 9 DesiredAccessRights byte 10 FileNameLen byte 11 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 FileHandle byte[6] (Hi-Lo) 14 Reserved word (Hi-Lo) 16 FileName byte[14] 30 FileAttributes byte 31 FileExecuteType byte 32 FileLen long (Hi-Lo) 36 CreationDate word (Hi-Lo) 38 LastAccessDate word (Hi-Lo) 40 LastUpdateDate word (Hi-Lo) 42 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	128	0x80	Lock Fail
	129	0x81	Out Of Handles
	130	0x82	No Open Privileges
	148	0x94	No Write Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Lock Error, Failure, No Files Found

Remarks

This call allows a client to open an existing file. The "system" and "hidden" bits in the client's Search Attributes flag are used to discover or ignore system and hidden files as described in the introduction. File Name is a valid file path and is used with the Directory Handle to indicate which file should be opened.

If the client lacks file open privileges in the target directory, the request will fail.

The Desired Access Rights flag is a bit field with the following bits defined:

BitDefinition
0Open the file forreading (read).
1Open the file for writing (write).
2Do not allow other clients to open this file for writing (deny write).
3Do not allow other clients to open this file for reading (deny read).
4This client assumes a single-user environment (exclusive).
5-7Not defined.

The Desired Access Rights flag designates which access rights a client wants in a specified file. The client's initial Desired Access Rights are modified to reflect the actual access rights the client is allowed to the specified directory and file. Modifications are determined as follows:

If the client lacks file Read privileges in the specified directory, the read bit of the Desired Access Rights flag is cleared.
If the client lacks file Write privileges in the specified directory, the write bit of the Desired Access Rights flag is cleared.
If the specified file is marked Read Only, the write bit of the Desired Access Rights flag is cleared.

If the "exclusive" bit is cleared in the Desired Access Rights flag, the access flag is in its final state and the server processes the open request.

If the "exclusive" bit is set in the Desired Access Rights flag, the client normally expects exclusive access to files. This is roughly equivalent to the "compatibility" bit defined in MS-DOS 3.X. When the "exclusive" bit is set, the file's attribute flags are examined and the "shareable" bit tested. The shareable attribute on a file controls the final access rights granted to a client when the client is opening files in an exclusive-access mode.

If the file's "shareable" bit is set, the "deny read" and "deny write" bits are cleared in the Access Rights flag. (All clients with appropriate directory access rights can read from and write to shareable files.)

If the file's "shareable" bit is cleared and the Desired Access Rights flag's "write" bit is cleared, the "deny read" bit is cleared and the "deny write" bit is set. This allows multiple clients to read from the file with no one writing to it.

If the file's "shareable" bit is cleared and the Desired Access Rights flag's "write" bit is set, the "deny read" bit is set and the "deny write" bit is set. This ensures that the file is kept for the exclusive use of the requesting client.

After the Desired Access Rights flag has been modified, the result is compared with the access rights of other clients currently using the same file. If the Desired Access Rights are not compatible with the access rights of other clients, the open request is refused.

The FileHandle returned by this call must be used by the client for all subsequent file access requests. The client must not modify any information within the file handle. The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.

The FileName field contains the name of the file opened; if File Name is shorter than 14 characters, this field will be null-padded.

The FileAttribute field contains the attributes of the opened file.

The FileLength field indicates the file's length at the instant it was opened. If multiple clients are using a file, they must coordinate the extending of the shared file among themselves. For a discussion of extending shared files, see Get Current Size of File (function 71).

Dates and Times are in MS-DOS format except that they are stored in high-low order.

Clients can open a single file more than once. However, the file must be closed as many times as it is opened before the server will release the file to other clients.

This call is replaced by the NetWare 386 v3.11 call Open Create File or Subdirectory (0x2222 87 01).

See Also

Open File (old) (0x2222 65 --)

Close File (0x2222 66 --)

Open/Create File (0x2222 84 --)

Open Create File or Subdirectory (0x2222 87 01)


Parse Tree 0x2222 90 00

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (90) byte 7 SubFuncStrucLen (17+limbStruct) word (Hi-Lo) 9 SubFuncCode (00) byte 10 InformationMask (see below) long (Lo-Hi) 14 InformationMask2 (see below) long (Lo-Hi) 18 reserved (0) long (Lo-Hi) 22 limbCount (see below) long (Lo-Hi) 26+ limbStruct (see below) structure[]

ReplyFormat

Offset Content Type (reply header) 8 limbCompletedCnt long (Lo-Hi) 12 ItemsCount long (Lo-Hi) 16 nextLimbScanNum long (Lo-Hi) 20+ InfoBlock structure

CompletionCode

	0	0x00	Successful
	126	0x7E	Invalid Length
	255	0xFF	Failure

Remarks

This NCP will parse a tree by directory base. It allows a caller to query for various pieces of information about files, directories, or the root. Note also that multiple requests may be placed in the request packet to reduce the wire traffic.

The InformationMask parameter has the following values and information:

ValueInformation
0x00000001DOS Time Information (structure)
0x00000002Reference Count (long)
0x00000004DOS Attributes (long)
0x00000008IDs (structure)
0x00000010Date Stream Sizes (structure)
0x00000020Name Space Attribute (long)
0x00000040EA Present Flag (long)
0x00000080All Attributes (long[NumberOfNameSpacesOnVolume])
0x00000100All Directory Base Numbers [long[NumberOfNameSpacesOnVolume])
0x00000200Maximum Access Mask (long)
0x00000400Flush Time (long)
0x00000800Parent Base ID (long)
0x00001000MAC Finder Info (structure)
0x00002000Sibling Count (long)
0x00004000Effective Rights (long)
0x00008000MAC Time (structure)
0x00008000Last Accessed Time (uint16)
0x20000000DOS Name (structure)
0x40000000Creator Name Space & Name (structure)
0x80000000Name (structure)

The InformationMask2 parameter is reserved for future use.

The limbCount parameter contains the count of limb structures that are present in the request packet.

The limbStructure parameter contains information about an area to scan or get information on, depending on whether the ScanFolder bit is set. The structure is defined below:

typedef struct {
	long limbFlags; (Lo-Hi)
	long limbVolumeNumber; (Lo-Hi)
	long limbDirectoryBase; (Lo-Hi)
	long limbScanNumber; (Lo-Hi) /* only used if ScanEntireFolder bit is set */
	long limbNameSpace; (Lo-Hi)
} limb;

The limbFlags field in the limb structure is described below:

ValueActionDescription
0x00000002Scan Entire Folder (wild search)
0x00000004Scan Files Only (valid only if Scan Entire Folder bit set)
0x00000008Scan Folders Only (valid only if Scan Entire Folder bit set)
0x00000010Allow System Files/Folders
0x00000020Allow Hidden Files/Folders

The limbCompletedCnt parameter contains the number of limb structures that were processed and completed from the request packet.

The ItemsCount parameter contains the number of InfoBlock structures in the packet.

The nextLimbScanNum parameter is valid only if the ScanEntireFolder bit was set. It will contain a -1 if scan has completed, or the next scan value for the limb structure being scanned.

The InfoBlock parameter is a structure that contains the information requested for each item scanned. It is defined as follows:

	typedef struct
	{
		InfoCCode ccode; /* if ccode.completionCode==0, information requested follows */
	} InfoBlock;
	typedef struct
	{
		LONG completionCode; /* completion code for the item scanned */
		LONG FolderFlag; /* Item is a Folder */
		LONG DirectoryBaseNumber; /* Name Space */
	} InfoCCode;

Information Structures

If DOS Time Information is requested, then the following will be returned:

	typedef struct 
	{
		LONG CreateDateAndTime; (Lo-Hi)
		LONG LastArchiveDateAndTime; (Lo-Hi)
		LONG LastUpdatedDateAndTime; (Lo-Hi)
		LONG LastAccessedDate; (Lo-Hi)
		LONG LastModifiedInSeconds; (Lo-Hi) /* seconds relative to the year 2000 */
	} DOSTimeInformationBlock;

If the Reference Count is requested, then the following will be returned:

	typedef struct 
	{
		LONG ReferenceCount;
	} ReferenceCountStruc;

If DOS Attributes are requested, then the following will be returned:

	LONG DOSAttributes;

If ID Information is requested, then the following will be returned:

	typedef struct
	{
		LONG OwnerID;
		LONG LastArchivedID;
		LONG LastUpdatedID; /* field is valid only if file */
	} IDStruc;

If Data Stream Sizes Information is requested and the item is a file, then the following will be returned:

	typedef struct 
	{
		LONG NumberOfSizes;
		LONG Sizes[NumberOfSizes]; /* dependent on Name Space */
	} DataStreamSizesStruc;

If Data Stream Sizes Information is requested and the item is a folder, then the following will be returned:

	typedef struct 
	{
		LONG NumberOfSizes = 1;
		LONG MaximumSpaceRestriction;
	} MaxSpaceStruc;

If Name Space Attribute is requested, then the following will be returned:

	LONG Attributes;

If EA Present is requested, then the following will be returned:

	LONG EAPresentFlag;

If All the Attributes are requested, then the following will be returned:

	typedef struct 
	{
		LONG NumberOfAttributes; /* depends on the number of Name Spaces loaded on
						the requested volume */
		LONG Attributes[NumberOfAttributes];
	} AllAttrStruc;

	typedef struct 
	{
		LONG NumberOfDirBaseNumbers;/* depends on the number of Name Spaces
					loaded on the requested volume */
		LONG DirectoryBaseNumbers[NumberOfDirBaseNumbers];
	} AllDirBaseNumStruc;

If Maximum Access Mask value is requested, then the following will be returned:

	LONG MaximumAccessMask;

If Flush Time is requested, then the following will be returned:

	typedef struct 
	{
		LONG FlushTime;
	} FlushTimeStruct;

If Parent Base ID is requested, then the following will be returned:

	LONG ParentDirectoryBaseID;

If MAC Finder Info is requested, then the following will be returned:

	typedef struct
	{
		BYTE MacFinderInfo[32];
	} MacFinderInfoStruct;

If Sibling Count is requested, then the following will be returned:

	LONG NumberOfSiblings;

If Effective Rights is requested, then the following will be returned:

	LONG EffectiveRights;

If MAC Time is requested, then the following will be returned:

	typedef struct
	{
		LONG MacCreateTime;
		LONG MacBackupTime;		
	} MacTimeStruct;

If Last Accessed Time is requested, then the following will be returned:

	WORD LastAccessedTime;

If DOS Name is requested, then the following will be returned:

	typedef struct 
	{
		BYTE DOSNameLength;
		BYTE DOSName[DOSNameLength];
	} DOSNameStruc;

If Creator Information is requested, then the following will be returned:

	typedef struct 
	{
		LONG CreatorNameSpace;
		BYTE CreatorNameLen;
		BYTE CreatorName[CreatorNameLen];
	} CreatorStruc;

If Name Information is requested, then the following will be returned:

	typedef struct 
	{
		BYTE NameLen;
		BYTE Name[NameLen];
	} NameStruc;

Purge Erased Files (old) 0x2222 22 16

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (1) word (Hi-Lo) 9 SubFunctionCode (16) byte

Reply Format

Offset Content Type (reply header)

Completion Code

  0		0x00		Successful
129	0x81		Out Of Handles
150	0x96		Server Out Of Memory
152	0x98		Disk Map Error
161	0xA1		Directory I/O Error
255	0xFF		Failure

Remarks

This is an old NetWare 286 call that is supported in NetWare v2.1 or previous. It is replaced by the NetWare 386 v3.0 call, Purge Salvageable File (0x2222 22 29).

When files are deleted by a client, they are moved to a holding area on the volume until they are either purged (using this call), restored (using Restore Erased File (0x2222 22 17), or replaced by other files deleted by the client.

This call purges, or permanantly deletes all files that the file server is holding for the client on all of the server's volumes. The space relinquished by purged files can now be used by the file server. Files deleted when this call is made cannot be recovered using Restore Erased File. Files that are deleted by the client after this call is made will again be placed in the holding area.

See Also

Recover Erased File (old) (0x2222 22 17)

Purge Salvageable File (0x2222 22 29)

Recover Salvageable File (0x2222 22 28)

Purge All Erased Files (0x2222 23 206)


Purge Salvageable File 0x2222 87 18

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (18) byte 8 NameSpace byte 9 reserved (0) byte 10 ScanSequence (See below) long (Lo-Hi) 14 ScanVolume long (Lo-Hi) 18 ScanDirectoryBase long (Lo-Hi)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used by the client to purge entries found through the ScanSalvageableFiles function. Note that the NWHandlePathStruct must point to a SubDirectory path. No file names or wild cards are allowed when using this call to search for salvageable files or subdirectories. The ScanSequence field is the value that was used in the Scan Salvageable Files request.

See Also

Purge All Erased Files (0x2222 23 206)

Purge Salvageable File (0x2222 22 29)

Recover Salvageable File (0x2222 22 28)

Scan Salvageable Files (0x2222 22 27)


Purge Salvageable File (old) 0x2222 22 29

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (29) byte 10 DirectoryHandle byte 11 Sequence long (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	133	0x85	No Delete Privileges
	156	0x9C	Invalid Path

Remarks

This function purges the specified salvageable file from the server.

This call is replaced by the NetWare 386 v3.11 call Purge Salvageable File

(0x2222 87 18).

See Also

Recover Salvageable File (0x2222 22 28)

Scan Salvageable Files (0x2222 22 27)

Purge Salvageable File (0x2222 87 18)

Purge All Erased Files (0x2222 23 206)


Query NS Information Format 0x2222 87 23

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (23) byte 8 NameSpace byte 9 VolumeNumber byte

Reply Format

Offset Content Type (reply header) 8 FixedBitMask long (Lo-Hi) 12 VariableBitMask long (Lo-Hi) 16 HugeBitMask long (Lo-Hi) 20 FixedBitsDefined word (Lo-Hi) 22 VariableBitsDefined word (Lo-Hi) 24 HugeBitsDefined word (Lo-Hi) 26 FieldsLenTable[32] long (Lo-Hi)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used to query for the format of NS information.

The following request format parameters are defined:

The NameSpace parameter contains a value identifying one of the following name spaces:

NameNumeric Value
DOS0
MAC1
NFS2
FTAM3
OS/24

NOTE: In NetWare 4.11 or greater, the OS/2 name space (OS2.NAM) has been replaced with the LONG name space (LONG.NAM).

The Volume parameter is the volume for which name space information is requested.

The following reply format parameters are defined and explained in the Introduction to File System NCPs:

See Also

Get NS Info (0x2222 87 19)

Set NS Info (0x2222 87 25)


Recover Erased File (old) 0x2222 22 17

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (3+PathNameLen) word (Hi-Lo) 9 SubFunctionCode (17) byte 10 DirectoryHandle byte

Reply Format

Offset Content Type (reply header) 8 OldFileName byte [15] 23 NewFileName byte [15]

Completion Code

  0 	0x00	Successful
150	0x96	Server Out Of Memory
152	0x98	Disk Map Error
155	0x9B	Bad Directory Handle
156	0x9C	Invalid Path
161	0xA1	Directory I/O Error
253	0xFD	Bad Station Number
255	0xFF	Failure

Remarks

This is an old NetWare 286 call that is supported in NetWare v2.1 or previous. It is replaced by the NetWare 386 v3.0 call, Recover Salvageable File (0x2222 22 28).

This call allows a client to recover one file on the volume as specified by Directory Handle and Path Name. When a client requests that a file be erased, the file is marked for deletion and moved to a special holding area in the volume's directory structure. Deleted files placed in the holding area can be recovered only until the client attempts another file erase or file create request; the server holds only the most recently "deleted" files for each client and purges the older files so that their disk and directory space can be reclaimed.

Old File Name must contain the file's original name, null-padded. If a file having the same name already exists in the target directory, the server will assign a new filename. This filename will be recorded in New File Name and will also be null-padded as required.

See Also

Purge Erased Files (old) (0x2222 22 17)

Recover Salvageable File (0x2222 22 28)

Purge Salvageable File (0x2222 22 29)


Read from a File 0x2222 72 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (72) byte 7 Reserved byte 8 FileHandle byte[6] (Hi-Lo) 14 StartingByteOffset long (Hi-Lo) 18 BytesToRead word (Hi-Lo)

Reply Format

Offset Content Type (reply header) 8 BytesActuallyRead word (Hi-Lo) 10 Data byte[BytesActuallyRead]

Completion Code

  0	0x00	Successful
131	0x83	Hard I/O Error	
136	0x88	Invalid File Handle
147	0x93	No Read Privileges
255	0xFF	I/O Bound Error

Remarks

This function reads a block of bytes from a file starting at a specified file offset. If the end-of-file is encountered before the read request is satisfied, the server returns a Successful Completion Code, but Bytes Actually Read (returned by the server) will contain a count less than Bytes To Read (specified by the client).

This function will fail if the calling client does not have read access privileges to the indicated file, or if a portion of the targeted byte block is locked for use by some other client.

Clients using this function are constrained by the current negotiated file buffer size (see Negotiate Buffer Size (function 33). A client cannot request more bytes of data than will fit in the currently negotiated buffer size. (IMPORTANT NOTE: In NetWare 5.x and above, the following description does not apply) Furthermore, the client cannot request a data block that straddles a buffer-size boundary in the file. Thus, if the current buffer size were 512 bytes and the client wished to read 1000 bytes starting at file offset 500, the client must issue three read requests. The first request would read 12 bytes starting at offset 500. The second request would read 512 bytes starting at offset 512. The third request would read 476 bytes starting at offset 1024.

If a client requests a block of data that starts on an odd-byte boundary within the file, the first byte of the data field returned by the server will contain garbage; the actual data from the file will start in the second byte of the data block.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.


Recover Salvageable File 0x2222 87 17

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (17) byte 8 NameSpace byte 9 reserved (0) byte 10 ScanSequence (See below) long (Lo-Hi) 14 ScanVolume long (Lo-Hi) 18 ScanDirectoryBase long (Lo-Hi) 22 NewFileNameLen byte 23 NewFileName byte[NewFileNameLen]

Reply Format

Offset Content Type

	(reply header)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used by the client to recover a file or subdirectory entry found through the ScanSalvageableFiles function. Note that the NWHandlePathStruct must point to a SubDirectory path. (See NetWareHandlePathStruct in Introduction to File Systems NCPs.) No file names or wild cards are allowed when using this call to search for salvageable files or subdirectories. The ScanSequence field is the value that was used in the Scan Salvageable Files request.


Recover Salvageable File (old) 0x2222 22 28

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen * word (Lo-Hi) 9 SubFunctionCode (28) byte 10 DirectoryHandle byte 11 Sequence long (Hi-Lo) 15 FileNameLen byte 16 FileName byte[FileNameLen] 16+FileNameLen newFileNameLen byte 17+FileNameLen newFileName byte[newFileNameLen]

* SubFuncStrucLen = 8 + FileNameLen + newFileNameLen

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	132	0x84	No Create Privileges
	156	0x9C	Invalid Path
	254	0xFE	File Name Already Exists In This Directory

Remarks

This NCP will recover the specified salvageable file into the same directory. This call is replaced by the NetWare 386 v3.11 call Recover Salvageable File (0x2222 87 17).

See Also

Purge Salvageable File (0x2222 22 29)

Scan Salvageable Files (0x2222 22 27)

Recover Salvageable File (0x2222 87 17)


Remove Extended Trustee from Dir or File 0x2222 22 43

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (5+PathLen) word (Hi-Lo) 9 SubFunctionCode (43) byte 10 DirHandle byte 11 ObjectID long (Hi-Lo) 15 Unused byte 16 PathLen byte 17 Path byte[PathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	144	0x90	Read-only Access To Volume
	156	0x9C	Invalid Path
	254	0xFE	Trustee Not Found
	255	0xFF	No Trustee Change Privileges

Remarks

This function removes a trustee from a file or directory.

See Also

Add Extended Trustee to Directory or File (0x2222 22 39)


Remove User Disk Space Restriction 0x2222 22 34

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (34) byte 10 VolumeNumber byte 11 ObjectID long (Lo-Hi) *Unverified changed from (Hi-Lo) on 07/29/2014

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	254	0xFE	User Not Found

Remarks

This function removes a user's disk space restriction from the specified volume.

See Also

Get Directory Disk Space Restrictions (0x2222 22 35)

Add User Disk Space Restriction (0x2222 22 33)

Get Object Disk Usage and Restrictions (0x2222 22 41)

Scan Volume's User Disk Restrictions (0x2222 22 32)

Set Directory Disk Space Restriction (0x2222 22 36)

Scan Directory Disk Space (0x2222 22 40)


Rename Directory 0x2222 22 15

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen * word (Hi-Lo) 9 SubFunctionCode (15) byte 10 DirectoryHandle byte 11 DirectoryPathLen byte 12 DirectoryPath byte[DirectorythLen] 12+DirectoryPathLen NewDirectoryPathLen byte 13+DirectoryPathLen NewDirectoryPath byte[NewDirectoryPathLen]

* SubFuncStrucLen = 4 + DirectoryPathLen + NewDirectoryPathLen

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	139	0x8B	No Rename Privileges
	146	0x92	All Names Exist
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	158	0x9E	Bad File Name
	161	0xA1	Directory I/O Error
	239	0xEF	Illegal Name
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call allows a client to rename a directory. New Directory Path must contain only the new name of the target directory; this new name must not be preceded by a path specification. Current implementations limit directory names to the DOS "8.3" naming conventions. Longer paths will be truncated.

For this call to be successful, the calling client must have access control and modify rights in the directory.

See Also

Rename or Move (old) (0x2222 22 46)

Rename or Move a File or Subdirectory (0x2222 87 04)


Rename File 0x2222 69 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (69) byte 7 DirectoryHandle byte 8 SearchAttributes byte 9 FileNameLen byte 10 FileName byte[FileNameLen] 10+FileNameLen TargetDirectoryHandle byte 11+FileNameLen NewFileNameLen byte 12+FileNameLen NewFileName byte[NewFileNameLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	135	0x87	Create Filename Error
	139	0x8B	No Rename Privileges
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Read Only
	144	0x90	All Read Only
	145	0x91	Some Names Exist
	146	0x92	All Names Exist
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	154	0x9A	Rename Across Volume
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to rename a file. The source directory (where the file resides) and the target directory (where the renamed file will be deposited) do not need to be the same directory. This call can be used to move a file from one directory to another. However, the two directories must reside on the same server volume. This call will not move a file from one volume to another.

The client must have file modification privileges in both the source and the target directories. The rename attempt will fail if the file is being used by other clients or if the target name already exists in the target directory. Wildcard renaming is supported.

This call is replaced by the NetWare 386 v3.11 call Rename or Move a File or Subdirectory (0x2222 87 04).

See Also

Rename or Move A File or SubDirectory (0x2222 87 04)


Rename Or Move (old) 0x2222 22 46

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen * word (Hi-Lo) 9 SubFunctionCode (46) byte 10 SourceDirHandle byte 11 SearchAttribute byte 12 SourcePathComponentCount byte 13 SourcePath byte[SourcePathLen] 13+SourcePathLen DestDirHandle byte 14+SourcePathLen DestPathComponentCount byte 15+SourcePathLen DestPath byte[DestPathLen]

* SubFuncStrucLen = 6 + SourcePathLen + DestPathLen

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	1	0x01	Insufficient Disk Space
	135	0x87	Create File Invalid File Name
	139	0x8B	No Rename Privileges
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	143	0x8F	Some Files Read Only
	144	0x90	Read-only Access To Volume
	145	0x91	Some Files Already Exist
	146	0x92	All Files Already Exist
	154	0x9A	Rename Across Volumes
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	164	0xA4	Invalid Directory Rename Attempted
	255	0xFF	No Files Found

Remarks

This NCP renames a file or directory using the long names. It will support wild cards. It takes in a full path, and it may be used to move files and directories by changing the target path.

The paths used by this NCP are of a special format. Unlike most strings, which are preceded by their lengths, the source and destination paths are preceded by the number of components in the path strings. For example, the path "TEST\TESTDIR" consists of two components. In addition, each entry in the path is preceded by its length. For example: "TEST\TESTDIR" would become "\X004TEST\X007TESTDIR".

This NCP will only move entries within a volume.

See Also

Rename Directory (0x2222 22 15)

Rename or Move a File or Subdirectory (0x2222 87 04)


Rename or Move a File or SubDirectory 0x2222 87 04

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (04) byte 8 NameSpace byte 9 RenameFlag (See below) byte 10 SearchAttributes word (Lo-Hi) 12 SrcNWHandlePathS1 (See below) structure 19 DstNWHandlePathS2 (See below) structure 26 SrcDstPathStrings[] (See below) byte

Reply Format

Offset Content Type

	(reply header)

Completion Code

	0	SUCCESSFUL

Remarks

The SearchAttributes field is explained in more detail in the Introduction to File System NCPs.

The SrcNWHandlePathS1 and DstNWHandlePathS2 structures are the same as the NWHandlePathStructure (See NetWareHandlePathStruct in Introduction to File System NCPs) except that the PathInfo array is not contained in these structures. This difference is because of space limitations.

The SrcDstPathStrings array contains the source component path if present, and then the destination component path if present. The component count in the SrcNWHandlePathS1 & DstNWHandlePathS2 is used to tell how many components for each respectively.

The RenameFlag values follow:

	0x01	RRenameToMyself allows files to be renamed to themselves. If this bit is not set and an
		attempt is made to rename a file to its identical original name, 0x8992 is returned.

	0x02	RCompatabilityFlag allows files that are marked read only to be opened with a read/write
		access call. Some applications required this parameter to be set. This bit is also used to
		determine whether a file is currently locked or in use.

	0x04	RNameOnlyFlag renames only the name space entry name (of the name space passed into this NCP)
		and ignores other name entries in other name spaces.


Restore an Extracted Base Handle 0x2222 22 24

v2.xv3.xv4.xv5.x




Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 8 SubFuncStrucLen (15 + DirectoryPathLen) word (Hi-Lo) 9 SubFunctionCode (24) byte 10 ServerNetworkAddress byte[10] 20 HandleID byte[4]

Reply Format

Offset Content Type (reply header) 8 NewDirectoryHandle byte 9 AccessRightsMask byte

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	157	0x9D	No Directory Handles
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This NCP obtains a directory handle from the NetWare internal identifier for the specified directory Handle ID. Handle ID must be obtained using the NCP, Extract a Base Handle (0x2222 22 23).

See Also

Restore an Extracted Base Handle (0x2222 22 24)


Scan a Directory 0x2222 22 30

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 Function Code (22) byte 7 SubFuncStrucLen (8+SearchPatternLen) word (Hi-Lo) 9 SubFunctionCode (30) byte 10 DirectoryHandle byte 11 SearchAttributes (DOS file attributes) byte 12 Sequence long (Lo-Hi) 16 SearchPatternLen byte 17 SearchPattern byte[SearchPatternLen]

Reply Format

Offset Content Type (reply header) 8 Sequence long (Lo-Hi) (DOS File Entry) 12 Subdirectory long (Lo-Hi) 16 Attributes long (Lo-Hi) 20 UniqueID byte 21 Flags byte 22 NameSpace byte 23 NameLen byte 24 Name byte[12] 36 CreationDateAndTime long (Lo-Hi) 40 OwnerID long (Hi-Lo) 44 LastArchivedDateAndTime long (Lo-Hi) 48 LastArchivedID long (Hi-Lo) 52 LastUpdatedDateAndTime long (Lo-Hi) 56 LastUpdatedID long (Hi-Lo) 60 FileSize long (Hi-Lo) 64 Reserved byte[44] 108 InheritedRightsMask word (Lo-Hi) 110 LastAccessedDate word (Lo-Hi) 112 Reserved byte[28] (DOS Subdirectory Entry) 12 Subdirectory long (Lo-Hi) 16 Attributes long (Lo-Hi) 20 UniqueID byte 21 Flags byte 22 NameSpace byte 23 DirectoryNameLen byte 24 DirectoryName byte[12] 36 CreationDateAndTime long (Lo-Hi) 40 OwnerID long (Hi-Lo) 44 LastArchivedDateAndTime long (Lo-Hi) 48 LastArchivedID long (Hi-Lo) 52 LastModifiedDateAndTime long (Lo-Hi) 56 NextTrusteeEntry long (Hi-Lo) 60 Reserved byte[48] 108 MaximumSpace long (Lo-Hi) 112 InheritedRightsMask word (Lo-Hi) 114 Undefined byte[26]

Completion Code

	0	0x00	Successful
	251	0xFB	386 File Structure Not Supported On Server
	255	0xFF	No More Matches In Directory

Remarks

This function scans a directory using an 8.3 wild card (server wild card format). It will return information about the file or directory. To initialize a scan, set the sequence number to FFFFFFFFh. The DirectoryHandle field must include a directory handle (a nonzero value). The SearchPattern field must include a file name or a wildcard. It cannot include a path name. To continue scanning, pass the previously returned sequence number.

See Also

Scan Directory Disk Space (0x2222 22 40)


Scan Directory Disk Space 0x2222 22 40

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (8+SearchPatternLen) word (Hi-Lo) 9 SubFunctionCode (40) byte 10 DirectoryHandle byte 11 SearchAttributes byte 12 Sequence long (Lo-Hi) 16 SearchPatternLen byte 17 SearchPattern byte[SearchPatternLen]

Reply Format

Offset Content Type (reply header) 8 Sequence long (Lo-Hi) 12 Subdirectory long (Lo-Hi) 16 Attributes long (Lo-Hi) 20 UniqueID byte 21 Flags byte 22 NameSpace byte 23 NameLen byte 24 Name byte[12] 36 CreationDateAndTime long (Lo-Hi) 40 OwnerID long (Hi-Lo) 44 LastArchivedDateAndTime long (Lo-Hi) 48 LastArchivedID long (Hi-Lo) 52 LastUpdatedDateAndTime long (Lo-Hi) 56 LastUpdatedID long (Hi-Lo) 60 DataForkSize long (Hi-Lo) 64 DataForkFirstFAT long (Hi-Lo) 68 NextTrusteeEntry long (Hi-Lo) 72 Reserved byte[36] 108 InheritedRightsMask word (Lo-Hi) 110 LastAccessedDate word (Lo-Hi) 112 DeletedFileTime long (Lo-Hi) 116 DeletedDateAndTime long (Lo-Hi) 120 DeletedID long (Hi-Lo) 124 Undefined byte[8] 132 PrimaryEntry long (Lo-Hi) 136 NameList long (Lo-Hi) 140 OtherFileForkSize long[2] (Hi-Lo)

Completion Code

	0	0x00	Successful
	137	0x89	No Search Privileges
	156	0x9C	Invalid Path
	251	0xFB	386 File Structure Not Supported On Server
	255	0xFF	No More Matches In Directory

Remarks

This function scans a directory using the wild card format. To intialize a directory search, set the sequence number to -1 (0xFFFFFFFF). This routine is the same as 0x2222 22 30 except that it also returns the data fork and resource fork size. The file size is the actual file size rather than the logical file size (sparse files can be logically much larger than they actually are).

DataForkFirstFAT (Reply) - Specifies the first file allocation table (FAT) entry for the indicated file.

OtherFileForkSize (Reply) - Specifies two longs, which specify the file size for the data stream that is supported by the given name space and the first FAT entry for the name space-specific data stream respectively.

See Also


Scan Directory for Trustees 0x2222 22 12

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen) word (Hi-Lo) 9 SubFunctionCode (12) byte 10 DirectoryHandle byte 11 TrusteeSetNumber byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 DirectoryPath byte[16] 24 CreationDate word (Hi-Lo) 26 CreationTime word (Hi-Lo) 28 DirectoryOwnerID long (Hi-Lo) 32 TrusteeIDSet long[5] (Hi-Lo) 52 TrusteeAccessMasks byte[5]

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call allows a client to determine the objects that are trustees of the specified directory.

This call must be used iteratively to retrieve all trustees of a given directory. The first time this call is used, the Trustee Set Number must be set to 1; otherwise, unexpected results occur. On successive requests, the client must increment the Trustee Set Number by 1. The server will return a Failure error when the client requests a Trustee Set Number that has no trustees.

Directory Path will be null-padded.

Creation Date and Creation Time are in DOS format, except that the values are stored in high-low order.

A directory can have an arbitrary number of objects (usually users or user groups) listed as trustees. Each trustee has a corresponding Trustee Access Mask.

If a trustee is deleted, the deleted trustee ID number is replaced with a long zero, indicating that the trustee slot is unused. (Zero is not a valid trustee ID number.) Within each set of five trustee ID numbers, all zero entries are collected at the end of the trustee ID vector. Therefore, a client algorithm scanning a directory's trustees will stop scanning the current set of 5 trustees when it encounters a trustee ID of zero. The algorithm must then retrieve the next trustee set from the server and scan it. This process is repeated until the client receives a completion code other than the Successful code.

Clients making this call must have access control rights to the target directory or to its parent directory.

See Also

Scan File or Directory for Extended Trustees (0x2222 22 38)

Scan File or Subdirectory for Trustees (0x2222 87 05)


Scan Directory Information 0x2222 22 02

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (5+DirectoryPathLen) word (Hi-Lo) 9 SubFunctionCode (2) byte 10 DirectoryHandle byte 11 StartingSearchNumber word (Hi-Lo) 13 DirectoryPathLen byte 14 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header) 8 Directory Path byte[16] 24 CreationDate word (Hi-Lo) 26 CreationTime word (Hi-Lo) 28 OwnerTrusteeID long (Hi-Lo) 32 AccessRightsMask byte 33 Reserved byte 34 NextSearchNumber word (Hi-Lo)

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call returns information about a file server directory. The Directory Path supplied by the client can contain wildcard characters in the last name of the path; the last name of the Directory Path is used as a pattern against which directory names are matched. When this call is used iteratively to search for wildcard patterns, the client should set the Starting Search Number to 1 on the first call. On subsequent calls, the client should set the Starting Search Number to 1 plus the Next Search Number returned on the previous call. The Starting Search Number and the Next Search Number are stored in high-low order.

Directory Path will be null-padded.

Creation Date and Time are in DOS format, except that the bytes are in Hi-Lo rather than Lo-Hi order.

Owner Trustee ID contains the trustee ID of the object (user) that originally created the directory.

The Access Rights Mask is a bit field containing maximum access privileges (See Introduction to File System NCPs.)

This NCP does not have to be used for iterative searches. A full or partial directory path can be specified, and the directory information for only that directory will be returned. If the request message's Directory Path Length field is set to zero (0), the Directory Path can be omitted, and the directory information for the directory specified by Directory Handle will be returned.

File Search Initialize (0x2222 62 --) (See File Services Section)

File Search Continue (0x2222 63 --) (See File Services Section)


Scan File or Directory for Extended Trustees 0x2222 22 38

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+PathLen) word (Hi-Lo) 9 SubFunctionCode (38) byte 10 DirHandle byte 11 Sequence byte 12 PathLen byte 13 Path byte[PathLen]

Reply Format

Offset Content Type (reply header) 8 NumberOfEntries byte 9 ObjectID long[20] (Hi-Lo) 89 TrusteeRights word[20]

Completion Code

	0	0x00	Successful
	152	0x98	Bad Volume Name
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path

Remarks

This function returns the extended trustee information for a file or directory (up to 20 entries per call).

The following request parameters are defined:

The DirHandle is the directory handle for the file or directory being scanned.

The Sequence is the sequence of number of the call. Initially, this should be set to one (1), and it should be incremented by 1 on each successive call.

The PathLen is the path length of the file or directory being scanned.

The Path is the path of the file or directory being scanned.

The following reply parameters are defined:

The NumberOfEntries indicates how many ObjectIDs and TrusteeRights are actually returned.

The ObjectID is the ID number of the file/directory object being scanned.

The TrusteeRights are the trustee rights for the file or directory

Note that regardless of how many extended trustee rights entries are returned by this call, TrusteeRights values are returned starting at offset 89 in the reply buffer.

See Also

Scan Directory for Trustees (0x2222 22 12)


Scan File Information 0x2222 23 15

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (23) byte 7 SubFuncStrucLen (6+FileNameLen) word (Hi-Lo) 9 SubFunctionCode (15) byte 10 LastSearchIndex word (Lo-Hi) 12 DirectoryHandle byte 13 SearchAttributes byte 14 FileNameLen byte 15 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 NextSearchIndex word (Lo-Hi) 10 FileName byte[14] 24 FileAttributes byte 25 ExtendedFileAttributes byte 26 FileSize long (Hi-Lo) 30 FileCreationDate word (Hi-Lo) 32 LastAccessDate word (Hi-Lo) 34 LastUpdateDate word (Hi-Lo) 36 LastUpdateTime word (Hi-Lo) 38 FileOwnerID long (Hi-Lo) 42 LastArchiveDate word (Hi-Lo) 44 LastArchiveTime word (Hi-Lo) 46 Reserved byte[56]

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	137	0x89	No Search Privileges
	147	0x93	No Read Privileges
	148	0x94	No Write Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	No Files Found

Remarks

This call allows a client to retrieve a file's extended status information. This information includes the trustee ID of the owner who created the file. The calling client must have directory search privileges in the target directory.

This call is used the same way that Search for A File (0x2222 64 --) is used. A client should initially set the Last Search Index field to 0xFFFF (-1). If this call is used iteratively to scan entries in a directory, each subsequent call should set the Last Search Index to the Next Search Index returned by the server on the previous call.

Directory Handle is an index number (1 to 255). A file server maintains a directory handle table for each logged in workstation. A directory handle points to a volume or a directory on the file server.

A client must specify the Search Attributes for the type(s) of files to be scanned. (See the introduction for an explanation of the Search Attributes byte.)

File Name Length is the length of the File Name that follows.

The File Name can be up to 255 bytes long. File Name is a valid file path relative to the Directory Handle. A full file path appears in the following format:

volume:directory/.../directory/filename

A partial file path includes a filename and (optionally) one or more antecedent directory names. A filename can be 1 to 8 characters long and can also include an extension of 1 to 3 characters. All letters must appear in upper case.

A partial file path can be combined with a directory handle to identify a file. When a client passes a full file path, the client should also pass a value of 0x00 in the Directory Handle field.

This call returns the file attributes of the specified file in the File Attributes field. (See the introduction for an explanation of File Attributes.)

This call returns the extended attributes of the specified file in the Extended File Attributes field. (See the introduction for an explanation of File Attributes.)

The File Size field indicates the size of the specified file in bytes.

The Creation Date and Last Access Date fields indicate the creation date and last access date of the specified file (bytes 1 and 2 below). The Last Update Date And Time and the Last Archive Date And Time fields indicate the last time the file was updated or archived (bytes 1, 2, 3, and 4 on the next page). All dates are returned as illustrated in bytes 1 and 2. Times are returned as illustrated in bytes 3 and 4.

Data Format
Byte 1Byte 2
15141312111098 76543210
yyyyyyym mmmddddd
yearmonthday
(0 to 119)
(1980-2099)
(1 to 12)(1 to 31)

Time Format
Byte 3Byte 4
15141312111098 76543210
hhhhhmmm mmmsssss
hourminutesecond
(0 to 23)(0 to 59)(0 to 29)
(2 sec. units)

Owner Object ID is the bindery object ID of the user who created the file.

See Also

Search for A File (0x2222 64 --)

Set File Attributes (0x2222 70 --)


Scan File or SubDirectory for Trustees 0x2222 87 05

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (05) byte 8 NameSpace byte 9 reserved (0) byte 10 SearchAttribute word (Lo-Hi) 12 SearchSequence (See below) long (Lo-Hi) 16 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NextSearchSequence long (Lo-Hi) 12 ObjectIDCount word (Lo-Hi) 14 TrusteeStruct[] structure

CompletionCode

	0	SUCCESSFUL

Remarks

The ScanSequence field is set to 0 on the first call. On each subsequent call it is replaced by the NextScanSequence value. When NextScanSequence number is equal to -1, all the trustees have been received by the client.

Note also that the server will send the maximum trustee structures (maximum of 20) until the last call. The last call contains a partial packet of trustee structures.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.


Scan Salvageable Files 0x2222 87 16

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (16) byte 8 NameSpace byte 9 DataStream byte 10 ReturnInfoMask long (Lo-Hi) 14 ScanSequence long (Lo-Hi) 18 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NextScanSequence long (Lo-Hi) 12 DeleteTime word (Lo-Hi) 14 DeleteDate word (Lo-Hi) 16 DeletorID long (Hi-Lo) 20 ScanVolume long (Lo-Hi) 24 ScanDirectoryBase long (Lo-Hi) 28 NetWareInfoStruct structure xx NetWareFileNameStruct structure

Completion Code

	0	SUCCESSFUL

Remarks

This NCP allows the client to scan a subdirectory for any files that have been deleted but not yet purged. The NWHandlePathStruct must point to a SubDirectory path. No file names or wild cards are allowed when using this call to search for salvageable files or subdirectories.

The ReturnInforMask field, NetWareInforStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs. Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

The ScanSequence field is set to -1 on the first call. On each subsequent call it is replaced by the NextScanSequence value.


Scan Salvageable Files (old) 0x2222 22 27

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (27) byte 10 DirectoryHandle byte 11 Sequence long (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 Sequence long (Lo-Hi) 12 Subdirectory word (Lo-Hi) 14 Attributes long (Lo-Hi) 18 UniqueID byte 19 Flags byte 20 NameSpace byte 21 FileNameLen byte 22 FileName byte[12] 34 CreationDateAndTime long (Lo-Hi) 38 OwnerID long (Hi-Lo) 42 LastArchivedDateAndTime long (Lo-Hi) 46 LastArchivedID long (Hi-Lo) 50 LastUpdatedDateAndTime long (Lo-Hi) 54 LastUpdatedID long (Hi-Lo) 58 FileSize =long (Hi-Lo) 62 Reserved byte[44] 106 InheritedRightsMask word (Lo-Hi) 108 LastAccessedDate word (Lo-Hi) 110 DeletedFileTime long (Lo-Hi) 114 DeletedDateAndTime long (Lo-Hi) 118 DeletedID long (Hi-Lo) 122 Reserved byte[16]

Completion Code

	0	0x00	Successful
	251	0xFB	Server Does Not Support 386 Salvage Functions
	255	0xFF	No More Salvageable Files In Directory

Remarks

This function gets the salvageable file information for a file in the current directory. If Sequence has been set to FFFFFFFFh, it will start with a new search, otherwise it will return the next file.

See Also

Purge Salvageable File (0x2222 22 29)

Recover Salvageable File (0x2222 22 38)


Scan Volume's User Disk Restrictions

0x2222 22 32

NetWare Linux
v2.x v3.x v4.x v5.x v6.x OES 1 OES 2 OES 11 OES 2015
 

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (6) word (Hi-Lo) 9 SubFunctionCode (32) byte 11 VolumeNumber byte 12 Sequence long (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 NumberOfEntries byte (for each entry) 9 ObjectID long (Lo-Hi) 14 Restriction long (Lo-Hi)

Completion Code

	0	0x00	Successful
	152	0x98	Invalid Volume

Remarks

This NCP returns a list of the object restrictions for a specified volume. All restrictions are in 4K blocks. A restriction may be zero (0). If a restriction is greater than 0x40000000, then that entry has no restriction. The maximum number of entries that can be returned is sixteen (16). The Sequence starts at zero (0) and increments by the value of NumberOfEntries. If the NumberOfEntries comes back as 16, then it may be assumed that there may be additional entries that can be returned. In this case, the NCP would need to be reissued with the sequence input parameter set to whatever it was just issued with in the previous NCP request + 16.

See Also
0x2222 22 56Scan Volume User Disk Restrictions (64Bit Aware)
Get Directory Disk Space Restrictions (0x2222 22 35)

Set Directory Disk Space Restrictions (0x2222 22 36)

Add User Disk Space Restriction (0x2222 22 33)

Remove User Disk Space Restriction (0x2222 22 34)

Get Object Disk Usage and Restrictions (0x2222 22 41)


Search for a File 0x2222 64 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (64) byte 7 LastSearchIndex word (Hi-Lo) 9 DirectoryHandle byte 10 SearchAttributes byte 11 FileNameLen byte 12 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header) 8 NextSearchIndex word (Hi-Lo) 10 Reserved word (Hi-Lo) 12 FileName byte[14] 26 FileAttributes byte 27 FileExecuteType byte 28 FileLen long (Hi-Lo) 32 CreationDate word (Hi-Lo) 34 LastAccessDate word (Hi-Lo) 36 LastUpdateDate word (Hi-Lo) 38 LastUpdateTime word (Hi-Lo)

Completion Code

	0	0x00	Successful
	137	0x89	No Search Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to search the specified server's directory. If the client does not have directory search privileges to the target directory, this call will fail. The client controls whether this request finds "system" and "hidden" files by setting the appropriate bits in the Search Attributes flag discussed in the introduction to this section.

This call can be used iteratively by a client. The first time this call is made, the client should set Last Search Index to 0xFFFF. On subsequent calls, the client should set the Last Search Index to the Next Search Index returned by the server on the previous call. This will allow a client to scan for all files that match the specified search pattern. Wildcard searches are supported.

See Also

Scan File Information (0x2222 23 15)


Search for File or SubDirectory 0x2222 87 03

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (03) byte 8 NameSpace byte 9 DataStream byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 SearchSequence[9] byte 25 SearchPatternLen byte 26 SearchPattern byte[SearchPatternLen]

Reply Format

Offset Content Type (reply header) 8 NextSearchSequence[9] byte 17 Reserved (0) byte 18 NetWareInfoStruct structure xx NetWareFileNameStruct structure

Completion Code

	0	SUCCESSFUL

Remarks

The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs.

This function will search for a file or subdirectory starting with the Search Sequence number returned by the Initialize Search request.

See Also

Initialize Search (0x2222 87 02)


Search for File or SubDirectory Set 0x2222 87 20

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (20) byte 8 NameSpace byte 9 DataStream byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 ReturnInfoCount word (Lo-Hi) 18 SearchSequence[9] byte 25 SearchPatternLen byte 26 SearchPattern byte[SearchPatternLen]

Reply Format

Offset Content Type (reply header) 8 NextSearchSequence[9] byte 17 MoreEntriesFlag (See below) byte 18 InfoCount (See below) word (Lo-Hi) 20 NetWareInfoStruct structure xx NetWareFileNameStruct structure yy (See below) .....

Completion Code

	0	SUCCESSFUL

Remarks

This NCP searches for a file or subdirectory starting with the Search Sequence number returned by the Initialize Search request. It returns as many NetWareInfoStructs as requested by ReturnInfoCount, or that will fit into a packet.

The InfoCount field is the count of NetWareInfoStructs returned to the client.

The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs.

The MoreEntriesFlag field is set to -1 (0xff) when more entries are available, or set to 0 when there are not more entries available.

As already mentioned, this call will return as many NetWareInfoStructs and NetWareFileNameStructs as possible.

Note: The NetWareFileNameStruct field is always returned when this call is made. With all other function 87 calls, however, this field is not returned unless the Include File Name Structure bit in the ReturnInfoMask structure is set.

To get the NetWareFileNameStruct, the bit IncludeFileNameStruct must be set in the ReturnInfoMask. The field InfoCount indicates how many structures were returned. The following is an example of a return:

	Info Count = 2  IncludeFileNameStruct = TRUE

	0	NetWareInfoStruct
	+	NetWareFileNameStruct
	+	NetWareInfoStruct
	+	NetWareFileNameStruct

Set Compressed File Size 0x2222 90 12

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (90) byte 7 SubFuncStrucLen (11) word (Hi-Lo) 9 SubFunction (12) byte 10 NetWareFileHandle byte[6] 16 SuggestedFileSize long

Reply Format

Offset Content Type (reply header) 8 OldFileSize long 12 NewFileSize long

Completion Code

	0	SUCCESSFUL

Remarks

This NCP sets the size on a compressed file to the size designated by the caller.


Set Directory Disk Space Restriction

0x2222 22 36

NetWare Linux
v2.x v3.x v4.x v5.x v6.x OES 1 OES 2 OES 11 OES 2015
 

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (5) word (Hi-Lo) 9 SubFunctionCode (36) byte 10 DirHandle byte 11 DiskSpaceLimit long (Lo-Hi)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	1	0x01	Invalid Space Limit
	140	0x8C	No Set Privileges
	191	0xBF	Invalid Name Space

Remarks

This function sets a disk restriction for a specific directory. If the restriction is 0, the restriction for the directory is cleared. If the restriction is a negative number, the disk space assigned will be 0. All restrictions are in 4K blocks.

See Also
0x2222 22 57Set Directory Disk Space Restriction (64Bit Aware)

Get Directory Disk Space Restrictions (0x2222 22 35)

Add User Disk Space Restriction (0x2222 22 33)

Remove User Disk Space Restriction (0x2222 22 34)

Get Object Disk Usage and Restrictions (0x2222 22 41)

Scan Volume's User Disk Restrictions (0x2222 22 32)


Set Directory Entry Information 0x2222 22 37

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (148) word (Hi-Lo) 9 SubFunctionCode (37) byte 10 DirHandle byte 11 SearchAttributes byte 12 Sequence long (Lo-Hi) 16 ChangeBits long (DOS File Entry) 20 Subdirectory long (Lo-Hi) 24 Attributes long (Lo-Hi) 28 UniqueID byte 29 Flags byte 30 NameSpace byte 31 NameLen byte 32 Name byte[12] 44 CreationDateAndTime long (Lo-Hi) 48 OwnerID long (Hi-Lo) 52 LastArchivedDateAndTime long (Lo-Hi) 56 LastArchivedID long (Hi-Lo) 60 LastUpdatedDateAndTime long (Lo-Hi) 64 LastUpdatedID long (Hi-Lo) 68 FileSize long (Hi-Lo) 72 DataForkFirstFAT long (Hi-Lo) 76 NextTrusteeEntry long (Hi-Lo) 80 Reserved byte[36] 116 InheritedRightsMask word (Lo-Hi) 118 LastAccessedDate word (Lo-Hi) 120 Reserved byte[20] 140 PrimaryEntry long (Lo-Hi) 144 NameList long (Lo-Hi) (DOS Subdirectory Entry) 20 Subdirectory long (Lo-Hi) 24 Attributes long (Lo-Hi) 28 UniqueID byte 29 Flags byte 30 NameSpace byte 31 DirectoryNameLen byte 32 DirectoryName byte[12] 44 CreationDateAndTime long (Lo-Hi) 48 OwnerID long (Hi-Lo) 52 LastArchivedDateAndTime long (Lo-Hi) 56 LastArchivedID long (Hi-Lo) 60 LastModifiedDateAndTime long (Lo-Hi) 64 NextTrusteeEntry long (Hi-Lo) 68 Reserved byte[48] 116 Maximum Space long (Lo-Hi) 120 InheritedRightsMask word (Lo-Hi) 122 Undefined byte[26] (Macintosh Name Space Entry) 20 Subdirectory long 24 MACFileAttributes long 28 MACUniqueID byte 29 MACFlags byte 30 MACMyNameSpace byte 31 MACFileNameLen byte 32 MACFileName byte[32] 64 ResourceFork long 68 ResourceForkSize long 72 FinderInfo byte[32] 104 ProDosInfo byte[6] 110 Reserved byte[38]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	1	0x01	Invalid Parameter
	140	0x8C	No Set Privileges
	191	0xBF	Invalid Name Space

Remarks

This function sets or changes the file or directory entry information to the values entered in the ChangeBits field. The DOS ChangeBits field is defined as follows:

ModifyNameBit0x0001
FileAttributesBit0x0002
CreateDateBit0x0004
CreateTimeBit0x0008
OwnerIDBit0x0010
LastArchivedDateBit0x0020
LastArchivedTimeBit0x0040
LastArchivedIDBit0x0080
LastUpdatedDateBit0x0100
LastUpdatedTimeBit0x0200
LastUpdatedIDBit0x0400
LastAccessedDateBit0x0800
MaxAccessMaskBit0x1000
MaximumSpaceBit0x2000

(This call also works for Macintosh name space directory entries.) The MAC change bits are as follows:

MacModifyNameBit0x0001
MacFinderInfoBit0x0002

Set Directory Handle 0x2222 22 00

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (4+DirectoryPathLen) word (Hi-Lo) 9 SubFunctionCode (0) byte 10 TargetDirectoryHandle byte 11 SourceDirectoryHandle byte 12 DirectoryPathLen byte 13 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	250	0xFA	Temporary Remap Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure

Remarks

This call changes the directory pointed to by Target Directory Handle to the directory pointed to by Source Directory Handle and Directory Path. The Target Directory Handle must already exist. To create a new directory handle, a client must use one of the functions to create a permanent or temporary directory handle (function 22, subfunctions 18, 19, or 22).

The client can specify the complete Directory Path and can use a Source Directory Handle of zero, if desired.

The Directory Handle returned by the server will be the same handle as the Target Directory Handle in the request message.

The Access Rights Mask returned by the server contains the client's effective access privileges in the indicated directory.

See Also

Alloc Permanent Directory Handle (0x2222 22 18)

Alloc Temporary Directory Handle (0x2222 22 19)

Deallocate Directory Handle (0x2222 22 20)

Alloc Special Temporary Directory Handle (0x2222 22 22)


Set Directory Information 0x2222 22 25

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (22) byte 7 SubFuncStrucLen (12+DirectoryPathLen) word (Hi-Lo) 9 SubFunctionCode (25) byte 10 DirectoryHandle byte 11 CreationDate word (Lo-Hi) 13 CreationTime word (Lo-Hi) 15 OwnerID long (Hi-Lo) 19 MaximumAccessRightsMask byte 20 DirectoryPathLen byte 21 DirectoryPath byte[DirectoryPathLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to modify information about a directory. Clients can use this call to restore a directory that has been destroyed and is being regenerated from some backup medium.

The directory's Creation Date, Creation Time, and Maximum Access Rights can be set by any client that has access control and modify rights in the directory's parent directory.

The Owner ID number can be changed only by a client that is a supervisor of the object.

See Also

Get Directory Information (0x2222 22 45)


Set File Attributes 0x2222 70 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (70) byte 7 NewFileAttributes byte 8 DirectoryHandle byte 9 SearchAttributes byte 10 FileNameLen byte 11 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to modify a file's attributes. The client must have file modification privileges in the target directory. The target file must not be in use by other clients. The target file's attributes are set to the attribute value specified by the client.

Once set, the "execute-only" attribute on a file cannot be reset.

This call supports wildcard attribute setting.

Note: For NetWare v3.0, this call can also be used to modify directory attributes.

See Also

Scan File Information (0x2222 23 15)


Set File Extended Attribute 0x2222 79 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (79) byte 7 NewFileAttributes byte 8 DirectoryHandle byte 9 SearchAttributes byte 10 FileNameLen byte 11 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	140	0x8C	No Set Privileges
	141	0x8D	Some Files In Use
	142	0x8E	All Files In Use
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	253	0xFD	Bad Station Number
	255	0xFF	Failure, No Files Found

Remarks

This call is equivalent to Set File Attributes (0x2222 70 --), except that it sets the NetWare extended attributes byte. The bits of the extended attribute byte are defined as follows:

BitBit Field Description<
0-3Search mode (see below)
4Transaction Bit
5Index Bit
6Read Audit Bit (not currently implemented)
7Write Audit Bit (not currently implemented)

The Search Mode, which is comprised of the first three bits, is only valid with NetWare v2.0a and above. The possible values of the Search Mode are

BitsDecimalMode
2 1 0

0 0 00Shell Default Search Mode
0 0 11Search On All Opens With No Path
0 1 02Do Not Search
0 1 13Search On Read Only Opens With No Path
1 0 04Reserved--Do Not Use
1 0 15Search On All Opens
1 1 06Reserved--Do Not Use
1 1 17Search On All Read Only Opens

The Transaction bit, if set, prompts NetWare's Transaction Tracking System (TTS) to track all writes to the file during a transaction. A transaction file cannot be deleted or renamed.

The Index bit, if set, prompts NetWare to index the file's File Allocation Tables (FATs) thereby reducing the time it takes to access the file.

The Read Audit and Write Audit bits (flags) can only be set by a user with security equivalence to the supervisor.

See Also

Scan File Information (0x2222 23 15)

Set File Attributes (0x2222 70 --)


Set File Information 0x2222 23 16

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (23) byte 7 SubFunctionStructureLen (82+FileNameLen) word (Hi-Lo) 9 SubFunctionCode (16) byte 10 FileAttributes byte 11 Extended File Attributes byte 12 FileSize long (Hi-Lo) 16 FileCreationDate word (Hi-Lo) 18 LastAccessDate word (Hi-Lo) 20 LastUpdateDate word (Hi-Lo) 22 LastUpdateTime word (Hi-Lo) 24 UniqueOwnerID long (Hi-Lo) 28 LastArchiveDate word (Hi-Lo) 30 LastArchiveTime word (Hi-Lo) 32 Reserved byte[56] 88 DirectoryHandle byte 89 SearchAttributes byte 90 FileNameLen byte 91 FileName byte[FileNameLen]

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	140	0x8C	No Set Privileges
	142	0x8E	All Files In Use
	148	0x94	No Write Privileges
	150	0x96	Server Out Of Memory
	152	0x98	Disk Map Error
	155	0x9B	Bad Directory Handle
	156	0x9C	Invalid Path
	161	0xA1	Directory I/O Error
	162	0xA2	IO Lock Error
	252	0xFC	No Such Object
	253	0xFD	Bad Station Number
	254	0xFE	Directory Locked
	255	0xFF	Failure, No Files Found

Remarks

This call allows a client to set a file's status information. Any client with file modification privileges in the target directory can set a file's attributes, execute type, file creation date, last access date, last update date and time, and last archive date and time. The File Size field is always ignored. Only a client that is an object supervisor of the file is allowed to set a file's owner ID, the Last Archive Date and Time, or the 56 bytes of currently undefined information.

This call is used primarily by archive programs that need to restore a file's complete profile to some earlier state.

See Also

Set File Extended Attributes (0x2222 79 --)

Scan File Information (0x2222 23 15)

Set File Attributes (0x2222 70 --)

Set File Time Date Stamp (0x2222 75 --)


Set File Time Date Stamp 0x2222 75 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (75) byte 7 Reserved byte 8 FileHandle byte[6] (Hi-Lo) 14 ForgedTime word (Hi-Lo) 16 ForgedDate word (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	150	0x96	Server Out Of Memory

Remarks

This NCP allows a client to change the time date stamp on the file identified by File Handle.

The FileHandle parameter requires the left-most or most significant 4 bytes in Hi-Lo order.


Set Huge NS Information 0x2222 87 27

Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (27) byte 8 NameSpace byte 9 VolumeNumber byte 10 DirectoryBase long (Lo-Hi) 14 HugeMask long (Lo-Hi) 18 HugeStateInfo byte[16] 34 HugeDataLen long (Lo-Hi) 38 HugeData[] byte

Reply Format

Offset Content Type (reply header) 8 NextHugeStateInfo byte[16] 24 HugeDataUsed (See below) long (Lo-Hi)

CompletionCode

	0	SUCCESSFUL

Remarks

This NCP is used to set huge NS information; however, it is used only when the NS has indicated that there is huge information available via the Query NS Information Format NCP (0x2222 87 23).

The HugeMask field, the HugeStateInfo field, and the NextHugeStateInfo field are explained in more detail in the Introduction to File System NCPs.

The HugeStateInfo parameter is used only by the NFS name space.

The HugeDataLen field specifies the length of the data that will be returned in the reply buffer.

The HugeDataUsed field contains the number of bytes consumed by the name space out of the total data bytes that were sent to the name space.

See Also

Get Huge NS Information (0x2222 87 26)

Query NS Information Format (0x2222 87 23)


Set NS Information 0x2222 87 25

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (25) byte 8 SrcNameSpace byte 9 DstNameSpace byte 10 VolumeNumber byte 11 DirectoryBase long (Lo-Hi) 15 NSInfoBitMask (See Intro) long (Lo-Hi) 19 NSSpecificInfo[512] (See Intro) byte

Reply Format

Offset Content Type (reply header)

CompletionCode

	0	0x0000	SUCCESSFUL
	139	0x898b	No Rename Privileges

Remarks

This NCP sets specific name space information. Note also that 1) this call is passed to the name space NLM and 2) this call is an expensive time user on the server.

The specific information in the NSSpecificInfo field that you set/send with this call depends on the corresponding bit you set with the NSInfoBitMask. Both the NSInfoBitMask and NSSpecificInfo fields are explained in more detail in the Introduction to File System NCPs.

See Also

Get NS Information (0x2222 87 19)

Query NS Information Format (0x2222 87 23)


Set Short Directory Handle 0x2222 87 09

v2.xv3.xv4.xv5.x


Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (09) byte 8 NameSpace byte 9 DataStream byte 10 DstDirHandle byte 11 Flags byte 12 NWHandlePathStruct structure

ReplyFormat

Flags ValueReply Format Syntax
0

Offset Content Type (reply header)

0x40

Offset Content Type (reply header) 8 Volume long (Lo-Hi) 12 DirectoryBase long (Lo-Hi) 16 DOSDirectoryBase long (Lo-Hi) 20 NameSpace long (Lo-Hi)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP sets a short directory handle.

Note that if the input Flags field is set to 0x40, then the reply will contain 4 items as noted above. If the input Flags field is zero, then no data will be returned.

Note that the NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

See Also

Allocate Short Directory Handle (0x2222 87 12)


Write to a File 0x2222 73 --

v2.xv3.xv4.xv5.x

Request Format

Offset Content Type (request header) 6 FunctionCode (73) byte 7 Reserved byte 8 FileHandle byte[6] (Hi-Lo) 14 StartingByteOffset long (Hi-Lo) 18 BytesToWrite word (Hi-Lo) 20 Data byte[BytesToWrite]

Reply Format

										

Offset Content Type (reply header)

Completion Code

  0	0x00	Successful
131	0x83	Hard I/O Error
136	0x88	Invalid File Handle
148	0x94	No Write Privileges
149	0x95	File Detached
162	0xA2	IO Lock Error
255	0xFF	I/O Bound Error

Remarks

This NCP writes a block of data to a file. This request will fail if the client does not have Write access to the indicated file, or if some portion of the targeted byte block is locked for use by a different client.

Clients using this call are constrained by the current negotiated file buffer size (see Negotiate Buffer Size, 0x2222 33 --). A client cannot write more bytes of data than will fit in the currently negotiated buffer size. In addition, the client cannot write a data block that straddles a buffer-size 4K boundary in the file. Thus if the current buffer size were 4,096 bytes and the client wished to write 4200 bytes starting at file offset 4000, the client must issue three write requests. The first request would write 96 bytes starting at offset 4,000. The second request would write 4,096 bytes starting at offset 4,096. The third request would write 8 bytes starting at offset 8,192.

It is important to note also that if the client writes no bytes at position 0, the file will be truncated

See Also

Negotiate Buffer Size (0x2222 33 --)


Search for File or SubDirectory Set (Extended Errors) 0x2222 87 40

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (40) byte 8 NameSpace byte 9 DataStream byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 ReturnInfoCount word (Lo-Hi) 18 SearchSequence[9] byte 25 SearchPatternLen byte 26 SearchPattern byte[SearchPatternLen]

Reply Format

Offset Content Type (reply header) 8 NextSearchSequence[9] byte 17 MoreEntriesFlag (See below) byte 18 InfoCount (See below) word (Lo-Hi) 20 NetWareInfoStruct structure xx NetWareFileNameStruct structure yy (See below) .....

Completion Code

	0	SUCCESSFUL

Remarks

IMPORTANT NOTE: This NCP is identical with NCP 87 20 (Search for File or SubDirectory Set) with one exception. It will return extended error codes. The 2 conditions which return extended error codes are: 1) If the path ends with a subdirectory and the subdirectory doesn't exist, the NCP will return ERR_INVALID_PATH (0x899C) rather than 0x89FF. 2) If a file exists but you have insufficient rights to see it, the NCP will return ERR_ACCESS_DENIED (0x89A8) instead of 0x89FF. To access these extended error codes, the OS ORs in 0x80000000 to the search attributes so that the extended error codes can be returned. The user DOES NOT have to pass this bit in.

This NCP searches for a file or subdirectory starting with the Search Sequence number returned by the Initialize Search request. It returns as many NetWareInfoStructs as requested by ReturnInfoCount, or that will fit into a packet.

The InfoCount field is the count of NetWareInfoStructs returned to the client.

The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and NetWareFileNameStruct field are explained in more detail in the Introduction to File System NCPs.

The MoreEntriesFlag field is set to -1 (0xff) when more entries are available, or set to 0 when there are not more entries available.

As already mentioned, this call will return as many NetWareInfoStructs and NetWareFileNameStructs as possible.

To get the NetWareFileNameStruct, the bit IncludeFileNameStruct must be set in the ReturnInfoMask. The field InfoCount indicates how many structures were returned. The following is an example of a return:

	Info Count = 2  IncludeFileNameStruct = TRUE

	0	NetWareInfoStruct
	+	NetWareFileNameStruct
	+	NetWareInfoStruct
	+	NetWareFileNameStruct

Scan Salvageable File List 0x2222 87 41

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (41) byte 8 NameSpace byte 9 reserved byte 10 ControlFlags WORD (Lo-Hi) 12 ScanSequence LONG (Lo-Hi) 16 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NextScanSequence LONG (Lo-Hi) 12 PurgeBase LONG (Lo-Hi) 16 ScanItems LONG (Lo-Hi) 20 ScanInfo structure

Completion Code

	0	SUCCESSFUL

Remarks

This NCP allows the client to generate from a path, a list of salvageable files (files that have been deleted but not yet purged) for that path. The NWHandlePathStruct must point to a SubDirectory path. No file names or wild cards are allowed when using this call to search for salvageable files or subdirectories.

The Control Flags parameter has the following control bits defined:
		#define		ReturnFileName		0x00000001

The ScanSequence field is set to -1 on the first call. On each subsequent call it is replaced by the NextScanSequence value.

The NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

The NextScanSequence reply field will contain the next ScanSequence number if more items are present in the subdir (that wouldn't fit into the reply buffer), or will contain -1 if no more items are present.

The PurgeBase reply field contains the NetWare Directory Base of the path.

The ScanItems reply field contains the Number of valid ScanInfo structures returned.

The ScanInfo reply field structure returns info depending on the Control Flag passed in.
If the ReturnFileName bit in the ControlFlag field is cleared, then the structure is defined
as:
	typedef struct ScanInfoNoFileName
	{
		LONG SalvageableFileEntryNumber;
	};
If the ReturnFileName bit in the ControlFlag field is set, then the structure is defined
as:
	typedef struct ScanInfoFileName
	{
		LONG SalvageableFileEntryNumber;
		BYTE FileNameLength;
		BYTE FileName[FileNameLength];
	};

NOTE: If you intend to use this NCP to get a list of salvageable files which will be passed to NCP 87 42 (Purge Salvageable File List), then you must not pass in the ReturnFileName bit set in the ControlFlag field. NCP 87 42 requires the list to contain back to back salvageableFileEntryNumbers.

See Also

Purge All Erased Files (0x2222 23 206)

Purge Salvageable File (0x2222 22 29)

Recover Salvageable File (0x2222 22 28)

Scan Salvageable Files (0x2222 22 27)

Purge Salvageable File List (0x2222 87 42)


Purge Salvageable File List 0x2222 87 42

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (42) byte 8 NameSpace byte 9 reserved byte 10 ControlFlags WORD (Lo-Hi) 12 Volume LONG (Lo-Hi) 16 PurgeBase LONG (Lo-Hi) 20 PurgeCount LONG (Lo-Hi) 24 PurgeList LONG[] (Lo-Hi)

Reply Format

Offset Content Type (reply header) 8 PurgeCount LONG (Lo-Hi) 12 PurgeListCcode LONG[] (Lo-Hi)

Completion Code

	0	SUCCESSFUL

Remarks

This NCP is used by the client to purge all entries in a subdir, or those found through the Scan Salvageable File List NCP (87 41).

The Control Flags parameter has the following control bits defined:
		#define		PurgeAll		0x00000001

The Volume field should contain the number of the volume on which items to be purged, reside.

The PurgeBase field should contain the NetWare Directory Base of the path intended to be purged. This can be obtained from a call to NCP 87 41 (Scan Salvageable File List).

The PurgeCount request field contains the number of items in the PurgeList to be purged (If the PurgeAll bit is not set). If the PurgeAll bit in the ControlFlags was set, this field is ignored and no items need to be placed in the PurgeList. All salvageable files in the subdirectory specified by the PurgeBase will be purged.

The PurgeList is a LONG array containing a list of SalvageableFileEntryNumbers obtained from a call to NCP 87 41 (Scan Salvageable File List). As mentioned above, this list will be used only if the PurgeAll bit in the ControlFlags is not set.

The PurgeCount reply field contains the number of PurgeListCcodes returned in the PurgeListCcode list (if the PurgeAll bit in the ControlFlags was not set). If the PurgeAll bit in the ControlFlags was set, then this field will contain a 1 indicating that there is only 1 field valid in the PurgeListCcode list.

The PurgeListCcode reply field contains a corresponding ccode for each item in the PurgeList request packet (if the PurgeAll bit in the ControlFlags was not set). If the PurgeAll bit in the ControlFlags was set, then this list will contain only one entry indicating the total number of salvageable files purged in the subdirectory specified by the PurgeBase in the request packet.

NOTE: If you obtained a list of salvageable files which will be from NCP 87 41 (Scan Salvageable File List), then this list must contain only salvageableFileEntryNumbers and no file names.

See Also

Purge All Erased Files (0x2222 23 206)

Purge Salvageable File (0x2222 22 29)

Recover Salvageable File (0x2222 22 28)

Scan Salvageable Files (0x2222 22 27)

Scan Salvageable File List (0x2222 87 41)


Get Directory Disk Space Restrictions 0x2222 87 39

v2.xv3.xv4.xv5.x



Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunction (39) byte 8 NameSpace byte 9 reserved byte[2] 11 NWHandlePathStruct structure

Reply Format

Offset Content Type (reply header) 8 NumberOfEntries byte (for each entry) 9 DirDiskSpaceRestList structure

Completion Code

	0	0x00	Successful

Remarks

This NCP scans for the amount of disk space assigned to all directories between the current directory and the root directory. The return buffer contains information about the restrictions along the directory path.

The NWHandlePathStruct parameter is of type NetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to File System NCPs, you must search for the NetWareHandlePathStruct.

NOTE: The target must be a subdirectory or an error will be returned.

The NumberOfEntries reply field contains the number of DirDiskSpaceRestList structures that follow. There will be one of these structures for each entry back to the root from the current entry.

The DirDiskSpaceRestList structure (Directory Disk Space Restriction List) contains the following:

	typedef struct DirDiskSpaceResList
	{
		BYTE LevelNumber;
		LONG MaximumAmount;
		LONG CurrentAmount;
	};

LevelNumber refers to the distance from the directory to the root.

MaximumAmount refers to the maximum amount of space assigned to a directory.

CurrentAmount refers to the amount of space assigned to a directory minus the amount of space used by a directory and its subdirectories.

To find the actual amount of space available to a directory, scan all the current entries and use the smallest one. Directories which have no restrictions will not return any information. If no entries are returned, no space restrictions exist for the specified directory. All restrictions are in 4K blocks.

When the MAX field is 0x7fffffff, there is no restriction on the entry; however, you can still calculate the space in use by subtracting the CURRENT from the MAX entry. When the MAX field is negative, the limit is zero. When the CURRENT field is negative, CURRENT is really zero. These are allowed to go negative so you can still generate a valid "IN USE" value.

See Also

Add User Disk Space Restriction (0x2222 22 33)

Remove User Disk Space Restriction (0x2222 22 34)

Get Object Disk Usage and Restrictions (0x2222 22 41)

Scan Volume's User Disk Restrictions (0x2222 22 32)

Get Directory Disk Space Restriction (0x2222 22 35)

Set Directory Disk Space Restriction (0x2222 22 36)

Scan Directory Disk Space (0x2222 22 40)


Read File (64 Bit offset capable) 0x2222 87 64

v2.xv3.xv4.xv5.xv6.x





Request

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (64) byte 8 FileHandle long (Hi-Lo) 12 StartingByteOffset UINT64 (Hi-Lo) 20 BytesToRead word (Hi-Lo)

Reply Format

Offset Content Type (reply header) 8 BytesActuallyRead word (Hi-Lo) 10 Data byte[BytesActuallyRead]

Completion Code

  0	0x00	Successful
131	0x83	Hard I/O Error	
136	0x88	Invalid File Handle
147	0x93	No Read Privileges
253	0xFD	Bad Station Number
255	0xFF	I/O Bound Error

Remarks

Note that the StartingByteOffset parameter in the request can be 64 bits. Requests made to NSS volumes will support reading at true 64 bit offsets. Requests made to traditional volumes will support reading at 32 bit offsets. Reading at offsets greater than 32 bits, will result in an error on a traditional volume.

This function reads a block of bytes from a file starting at a specified file offset. If the end-of-file is encountered before the read request is satisfied, the server returns a Successful Completion Code, but Bytes Actually Read (returned by the server) will contain a count less than Bytes To Read (specified by the client).

This function will fail if the calling client does not have read access privileges to the indicated file, or if a portion of the targeted byte block is locked for use by some other client.

Clients using this function are constrained by the current negotiated file buffer size (see Negotiate Buffer Size (function 33). A client cannot request more bytes of data than will fit in the currently negotiated buffer size. (IMPORTANT NOTE: In NetWare 5.x and above, the following description does not apply) Furthermore, the client cannot request a data block that straddles a buffer-size boundary in the file. Thus, if the current buffer size were 512 bytes and the client wished to read 1000 bytes starting at file offset 500, the client must issue three read requests. The first request would read 12 bytes starting at offset 500. The second request would read 512 bytes starting at offset 512. The third request would read 476 bytes starting at offset 1024.

If a client requests a block of data that starts on an odd-byte boundary within the file, the first byte of the data field returned by the server will contain garbage; the actual data from the file will start in the second byte of the data block.

The FileHandle, StartingByteOffset, and BytesToRead parameters require the input to be in Hi-Lo order. The reply parameter BytesActuallyRead is returned in Hi-Lo order.


Write to a File (64 Bit offset capable) 0x2222 87 65

v2.xv3.xv4.xv5.xv6.x





Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (65) byte 8 FileHandle long (Hi-Lo) 12 StartingByteOffset UINT64 (Hi- Lo) 20 BytesToWrite word (Hi-Lo) 22 Data byte[BytesToWrite]

Reply Format

										

Offset Content Type (reply header)

Completion Code

  0	0x00	Successful
131	0x83	Hard I/O Error
136	0x88	Invalid File Handle
148	0x94	No Write Privileges
149	0x95	File Detached
162	0xA2	IO Lock Error
253	0xFD	Bad Station Number
255	0xFF	I/O Bound Error

Remarks

Note that the StartingByteOffset parameter in the request can be 64 bits. Requests made to NSS volumes will support writing at true 64 bit offsets. Requests made to traditional volumes will support writing at 32 bit offsets. Writing at offsets greater than 32 bits, will result in an error on a traditional volume.

This NCP writes a block of data to a file. This request will fail if the client does not have Write access to the indicated file, or if some portion of the targeted byte block is locked for use by a different client.

Clients using this call are constrained by the current negotiated file buffer size (see Negotiate Buffer Size, 0x2222 33 --). A client cannot write more bytes of data than will fit in the currently negotiated buffer size. In addition, the client cannot write a data block that straddles a buffer-size 4K boundary in the file. Thus if the current buffer size were 4,096 bytes and the client wished to write 4200 bytes starting at file offset 4000, the client must issue three write requests. The first request would write 96 bytes starting at offset 4,000. The second request would write 4,096 bytes starting at offset 4,096. The third request would write 8 bytes starting at offset 8,192.

It is important to note also that if the client writes no bytes at position 0, the file will be truncated

The FileHandle, StartingByteOffset, and BytesToWrite parameters require the input to be in Hi-Lo order.

See Also

Negotiate Buffer Size (0x2222 33 --)

Read File (64 Bit offset capable) (0x2222 87 64)


Get Current Size of File (64 Bit size capable) 0x2222 87 66

v2.xv3.xv4.xv5.xv6.x





Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (66) byte 8 FileHandle long (Hi-Lo)

Reply Format

Offset Content Type (reply header) 8 CurrentFileSize UINT64 (Lo -Hi)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	253	0xFD	Bad Station Number

Remarks

Note that the CurrentFileSize parameter in the reply can be 64 bits. Requests made to NSS volumes will support returning true 64 bit file sizes. Requests made to traditional volumes will support returning 32 bit file sizes.

Also note that 64 bit file sizes can be obtained from NSS volumes by using the following NCPs: NCP 87 1 (Open Create a File) NCP 87 30 (Open Create a File or Subdir) NCP 87 32 (Open Create a File with callback) NCP 87 33 (Open Create a File or Subdir with callback) NCP 87 3 (Continue a File Search) NCP 87 6 (Get File/Subdirectory Information) NCP 87 20 (Search for set of Files/Subdirectories) NCP 87 16 (Scan Salvageable Files) NCP 87 29 (Get Effective Directory Rights) In each case, the caller should pass in a ReturnInfoMask that includes at least the following: RNewStyle 0x80000000 R64BitFileSize 0x04000000 For a full description go to New Style NetWare info Structure Information.

This NCP allows a client to determine the current length of a file that the client has open. It can be used by clients cooperatively sharing a file that might need to be extended.

When a shared file needs to be extended, the client extending the file needs to lock the area of the file that will be affected for its exclusive use. This can be done by locking the entire file or by locking the section of the file that is beyond the current known end-of-file.

After locking the file, the client extending the file must make this call to determine the current file length. If the file has already been extended by some other client, this call will reveal the length of the extension to the current client so that the file can be extended further, if needed. The file can then be unlocked.

The FileHandle parameter requires the input to be in Hi-Lo order.

Only by using this method of extending a shared file can a client properly lock the current end of a file for exclusive access; otherwise, another client could extend the file at any time.

See Also

Locking calls in Synchronization Section

Log Physical Record (64 bit offset capable) (0x2222 87 67)

Release Physical Record (64 bit offset capable) (0x2222 87 68)

Clear Physical Record (64 bit offset capable) (0x2222 87 69)


Log Physical Record (64 Bit offset capable) 0x2222 87 67

v2.xv3.xv4.xv5.xv6.x





Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (67) byte 8 LockFlag long (Lo-Hi) 12 FileHandle long (Hi-Lo) 16 LockAreaStartOffset UINT64 (Hi-Lo) 24 LockAreaLength UINT64 (Hi-Lo) 32 LockTimeout long (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	136	0x88	Invalid File Handle
	150	0x96	Server Out Of Memory
	253	0xFD	Lock Collision
	127	0x7F	ERR_LOCK_WAITING
	253	0xFD	Bad Station Number
	255	0xFF	Lock Error

Remarks

Note that the LockAreaStartOffset and LockAreaLength parameters in the request can be 64 bits. Requests made to NSS volumes will support locking at true 64 bit offsets. Requests made to traditional volumes will support locking at 32 bit offsets. Locking at offsets greater than 32 bits, will result in an error on a traditional volume.

The FileHandle, LockAreaStartOffset, LockAreaLength and LockTimeout parameters require the input to be in Hi-Lo order. The LockFlag parameter requires input to be in Lo-Hi order.

This NCP locks a byte range within a file for the calling client's use. The following table describes the Lock Flag field:

Lock FlagResult
00hThe byte range is not locked, but is logged for future locking.
01hThe byte range is locked with "exclusive" (read/write) access.
03hThe byte range is locked with "shareable" (read-only) access.

The Lock Timeout value specifies how long the file server will attempt to lock the byte range before returning a Failure Completion Code. The Lock Timeout is only valid if the Lock flag is 01h or 3h.

Locked byte ranges can be used only by the task making the lock request. Overlapping lock ranges are allowed.

See Also

Lock Physical Record Set (0x2222 110 --)

Log Physical Record (0x2222 109 --)

Release Physical Record (0x2222 28 --)

Release Physical Record Set (0x2222 29 --)

Clear Physical Record (0x2222 30 --)

Clear Physical Record Set (0x2222 31 --)

Release Physical Record (64 bit offset capable) (0x2222 87 68)

Clear Physical Record (64 bit offset capable) (0x2222 87 69)


Release Physical Record (64 Bit offset capable) 0x2222 87 68

v2.xv3.xv4.xv5.xv6.x





Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (68) byte 8 FileHandle long (Hi-Lo) 12 LockAreaStartOffset UINT64 (Hi-Lo) 20 LockAreaLength UINT64 (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	253	0xFD	Bad Station Number
	255	0xFF	Unlock Error

Remarks

Note that the LockAreaStartOffset and LockAreaLength parameters in the request can be 64 bits. Requests made to NSS volumes will support locking at true 64 bit offsets. Requests made to traditional volumes will support locking at 32 bit offsets. Locking at offsets greater than 32 bits, will result in an error on a traditional volume.

The FileHandle, LockAreaStartOffset, LockAreaLength parameters require the input to be in Hi-Lo order.

This NCP releases a byte range previously locked by the calling client. The released byte range will remain in the client's logged data block table and will be relocked by subsequent calls to Lock Physical Record Set (0x2222 27 --). Released byte ranges must match locked byte ranges. Releasing only a portion of a previously locked byte range is not allowed. If the byte range being released overlaps any other byte range lock(s) still in effect, all but the overlapped bytes will be released.

See Also

Log Physical Record (0x2222 109 --)

Lock Physical Record Set (0x2222 110 --)

Release Physical Record Set (0x2222 29 --)

Clear Physical Record (0x2222 30 --)

Clear Physical Record Set (0x2222 31 --)

Log Physical Record (64 bit offset capable) (0x2222 87 67)

Clear Physical Record (64 bit offset capable) (0x2222 87 69)


Clear Physical Record Set (64 Bit offset capable) 0x2222 87 69

v2.xv3.xv4.xv5.xv6.x





Request Format

Offset Content Type (request header) 6 FunctionCode (87) byte 7 SubFunctionCode (68) byte 8 FileHandle long (Hi-Lo) 12 LockAreaStartOffset UINT64 (Hi-Lo) 20 LockAreaLength UINT64 (Hi-Lo)

Reply Format

Offset Content Type (reply header)

Completion Code

	0	0x00	Successful
	253	0xFD	Bad Station Number
	255	0xFF	Unlock Error

Remarks

Note that the LockAreaStartOffset and LockAreaLength parameters in the request can be 64 bits. Requests made to NSS volumes will support locking at true 64 bit offsets. Requests made to traditional volumes will support locking at 32 bit offsets. Locking at offsets greater than 32 bits, will result in an error on a traditional volume.

The FileHandle, LockAreaStartOffset, LockAreaLength parameters require the input to be in Hi-Lo order.

This NCP removes the specified byte range from the client's data byte range table. If the byte range is locked, then it is cleared. The client can't use the specified byte range until that range is again logged and locked.

The byte range specified must match a byte range previously logged. Clearing only a portion of a previously logged byte range is not allowed.

See Also

Log Physical Record (0x2222 109 --)

Log Physical Record (64 bit offset capable) (0x2222 87 67)

Release Physical Record (64 bit offset capable) (0x2222 87 68)

Lock Physical Record Set (0x2222 110 --)

Release Physical Record (0x2222 28 --)

Release Physical Record Set (0x2222 29 --)

Clear Physical Record Set (0x2222 31 --)