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:
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:
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 | |||||||
| Bit | Name | Bit 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 | $td> |
| 7 | Shareable | Bit is set if file can be simultaneously accessed by more than one user. |
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 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 | |||||||
| Bit | Name | Bit 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 Offset | Decimal Equivalent | Search Mode | ||
|---|---|---|---|---|
| 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 Bit | System Bit | Files 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
| 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 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
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 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 | |||||||
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.
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:
| Bit | Function |
|---|---|
| 0 | Set if trustee can read from files in this directory. |
| 1 | Set if trustee can write to files in this directory. |
| 2 | Set if trustee can open existing files in this directory. |
| 3 | Set if trustee can create files in this directory. |
| 4 | Set if trustee can delete files in this directory. |
| 5 | Set 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). |
| 6 | Set if trustee can search this directory. |
| 7 | Set 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).
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.
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:
| 0x00 | The drive is unallocated. |
|---|---|
| 0x01 | The drive is a permanent network drive. |
| 0x02 | The drive is a temporary network drive. |
| 0x80 | The drive is a local drive. |
| 0x81 | The drive is a local drive allocated as a permanent network drive. |
| 0x82 | The 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.
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.
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 (NCP 87 2) and File Search Continue (NCP 87 3). These calls are found in the Enhanced File Services section.
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:
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:
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 EnhNetWareFileNameStruct structure. Since this structure is not a field of the NetWareInformationStructure, it is discussed under the heading "EnhNetWareFileNameStruct 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 | |||||||||||||||
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 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:
NOTE: Depending on which data type is specified in the request, one of the following data structures will be used:
(ASCII data type)
typedef struct
{
BYTE DOSNameLength;
BYTE DOSName[DOSNameLength];
} DOSNameStruct;
(UTF8 data type)
typedef struct
{
WORD DOSNameLength; (Lo-Hi)
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;
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.
| Offset | Content | Type |
| 0 | DSSpaceAllocateStruct (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)
The EnhNetWareFileNameStruct structure is used to pass a filename back to the client. It consists of a length field and a filename field. The filename is limited to a maximum of 768 bytes in UTF8 format and 255 bytes in ASCII format. These maximums are provided so that a UTF8 string can be represented given a worst case scenario where a character's UTF8 representation takes 3 bytes.
Note: The server always returns the EnhNetWareFileNameStruct for the following NCP: Search For File or Subdirectory (0x2222 89 03). For all other NCPs, the EnhNetWareFileNameStruct is returned to the client only when the IncludeFileNameStructure bit is set in the ReturnInfoMask field.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
Enhanced File Name Information Structure (ASCII data type)
Offset Content Type 0 FileNameLength (variable) BYTE 1 FileName[] (variable) BYTE
Enhanced File Name Information Structure (UTF8 data type)
Offset Content Type 0 FileNameLength (variable) WORD (Lo-Hi) 1 FileName[] (variable) BYTE
NetWare Handle and Path Structure Definition
The EnhNetWareHandlePathStruct 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:
LONG Directory Base or Short Directory Handle; (Lo-Hi) BYTE Volume Number; BYTE Handle Flag; BYTE Data Type Flag; BYTE Reserved[5]; 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 Data Type Flag indicates what format the path string will be in. There are currently 2 supported formats. Ascii and UTF8.
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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). Note: The length field is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:
(ASCII data type)
struct
{
BYTE PathNameLen;
BYTE PathName[];
} Pcomponent[];
(UTF8 data type)
struct
{
WORD PathNameLen; (Lo-Hi)
BYTE PathName[];
} Pcomponent[];
The following structure is a complete definition of the Handle/Path structure. Following it is a pseudo code definition:
LONG DirectoryBaseOrShortHandle; (Lo-Hi) BYTE VolumeNumber; BYTE HandleFlag; BYTE Data Type Flag; BYTE Reserved[5]; BYTE PathComponentCount; STRUCT Pcomponent [PathComponentCount];
The Handle/Path structure can total as much as 913 bytes.
HandleFlag
#define ShortDirectoryHandle 0x00 #define DirectoryBase 0x01 #define NoHandlePresent 0xFF
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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 EnhNetWareHandlePathStruct.
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)
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 |
| 0 | 1 1 1 1 1 1 1 1 1 1 1 1 1 | 0 |
| Variable Bit Mask | ||
|---|---|---|
| Bit 31 | . . . | Bit 0 |
| 0 | 0 0 0 0 0 0 ... 0 0 0 0 0 0 | 1 |
| Huge Bit Mask | ||
|---|---|---|
| Bit 31 | . . . | Bit 0 |
| 0 | 0 0 0 0 0 0 ... 0 0 0 0 0 0 | 0 |
| 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 .. 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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)
| 15 | 14 - 5 | 4 | 3 | 2 | 1 | 0 | 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 - 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 | |||||||||||||||
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 - 16 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 | |||||||||||||||
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.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 TrusteeStruct[] structure (see definition below) xx EnhNWHandlePathStruct 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 Enhanced 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.
The TrusteeStruct structure is a variable length structure whose entries are 6 bytes each. The number of TrusteeStruct entries is input in the ObjectIDCount field. The EnhNWHandlePathStruct structure will begin directly after the last entry in the TrusteeStruct. This can be determined by multiplying the number in the ObjectIDCount field by the sizeof TrusteeStruct (6 bytes). Care should be taken to balance the number of input TrusteeStruct entries with the length of the path components in the EnhNWHandlePathStruct. If the path components don't take up much space, more TrusteeStruct entries can be passed. If the length of the path components take up a large amount of buffer space, then the number of TrusteeStruct entries should be reduced. The TrusteeStruct structure is as follows:
typedef struct { LONG ObjectID; (Hi-Lo) WORD TrusteeRights; (Lo-Hi) }TrusteeStruct;
Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct. See the "NetWare Handle and Path Structure Definition" explanation in the Enhanced File System NCPs" section.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (12) byte 8 NameSpace byte 9 DstNameSpace byte 10 AllocateMode word (Lo-Hi) 12 EnhNWHandlePathStruct 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) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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:
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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
See Also
Set Short Directory Handle (0x2222 89 09)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (08) byte 8 NameSpace byte 9 reserved (0) byte 10 SearchAttributes word (Lo-Hi) 12 EnhNWHandlePathStruct 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 Enhanced File System NCPs.
Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (11) byte 8 NameSpace byte 9 reserved (0) byte 10 ObjectIDCount word (Lo-Hi) 12 TrusteeStruct structure (see definition below) xx EnhNWHandlePathStruct 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.
The TrusteeStruct structure is a variable length structure whose entries are 6 bytes each. The number of TrusteeStruct entries is input in the ObjectIDCount field. The EnhNWHandlePathStruct structure will begin directly after the last entry in the TrusteeStruct. This can be determined by multiplying the number in the ObjectIDCount field by the sizeof TrusteeStruct (6 bytes). Care should be taken to balance the number of input TrusteeStruct entries with the length of the path components in the EnhNWHandlePathStruct. If the path components don't take up much space, more TrusteeStruct entries can be passed. If the length of the path components take up a large amount of buffer space, then the number of TrusteeStruct entries should be reduced. The TrusteeStruct structure is as follows:
typedef struct { LONG ObjectID; (Hi-Lo) WORD TrusteeRights; (Lo-Hi) }TrusteeStruct;
Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct. See the "NetWare Handle and Path Structure Definition" explanation in the Enhanced File System NCPs" section.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (22) byte 8 srcNameSpace byte 9 dstNameSpace (0) byte 10 dstNSIndicator word 12 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (29) byte 8 NameSpace byte 9 DestNameSpace byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 EnhNWHandlePathStruct structure
Reply Format
Offset Content Type (reply header) 8 MyEffectiveRights word (Lo-Hi) 10 NetWareInfoStruct structure xx EnhNetWareFileNameStruct structure
Completion Code
0 SUCCESSFUL
Remarks
The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs. Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (28) byte 8 SrcNameSpace byte 9 DstNameSpace byte 10 PathCookie (See below) structure 20 EnhNWHandlePathStruct 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.
Note: The length field in the PathComponent Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The PathComponent Structure is defined as follows:
(ASCII data type)
struct PathComponent
{
BYTE pathLength;
byte string[];
};
(UTF8 data type)
struct PathComponent
{
WORD 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (19) byte 8 SrcNameSpace byte 9 DstNameSpace byte 10 DataTypeFlag 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[1024] (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 DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order. Otherwise, the length preceeding field will be a byte.
The NSInfoBitMask and the NSSpecificInfo structure are explained in more detail in the Introduction to Enhanced File System NCPs.
See Also
Set NS Information (0x2222 89 25)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (02) byte 8 NameSpace byte 9 reserved (0) byte 10 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct 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 89 07), but with the additional capability to modify files with a wild card.
Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
Flags
If the following bit is set, then Wild Cards in the EnhNWHandlePathStruct 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 89 07)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct (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 EnhNWHandlePathStruct fields are explained in more detail in the Introduction to Enhanced File System NCPs. Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
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 89 35)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (06) byte 8 NameSpace byte 9 DestNameSpace byte 10 SearchAttributes word (Lo-Hi) 12 ReturnInfoMask long (Lo-Hi) 16 EnhNWHandlePathStruct structure
Reply Format
Offset Content Type (reply header) 8 NetWareInfoStruct structure xx EnhNetWareFileNameStruct 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 EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs. Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
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:
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct 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 EnhNetWareFileNameStruct 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:
| Name | Numeric Value |
|---|---|
| DOS | 0 |
| MAC | 1 |
| NFS | 2 |
| FTAM | 3 |
| OS/2 | 4 |
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.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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:
These values are combined to have the following effects:
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 EnhNetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the EnhNetWareFileNameStruct (reply parameter) are given in the Introduction to Enhanced 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
LONG DirectoryBaseOrShortHandle; (Lo-Hi) BYTE VolumeNumber; BYTE HandleFlag; BYTE Data Type Flag; BYTE Reserved[5]; 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 DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). The default length preceeding field is a byte. If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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). Note: The length field is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:
(ASCII data type)
struct
{
BYTE PathNameLen;
BYTE PathName[];
} Pcomponent[];
(UTF8 data type)
struct
{
WORD PathNameLen; (Lo-Hi)
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.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 Enhanced File System NCPs.)
The EnhNetWareFileNameStruct is a pointer to the EnhNetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct (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 EnhNetWareFileNameStruct (See intro)structure
Completion Code
0 0x00 Successful 255 0xFF Failure
Remarks
This NCP replaces Open/Create File or Subdirectory (0x2222 89 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:
| Name | Numeric Value |
|---|---|
| DOS | 0 |
| MAC | 1 |
| NFS | 2 |
| FTAM | 3 |
| OS/2 | 4 |
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.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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:
These values are combined to have the following effects:
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 Enhanced 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 EnhNetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the EnhNetWareFileNameStruct (reply parameter) are given in the Introduction to Enhanced 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
LONG DirectoryBaseOrShortHandle; (Lo-Hi) BYTE VolumeNumber; BYTE HandleFlag; BYTE Data Type Flag; BYTE Reserved[5]; 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 DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). The default length preceeding field is a byte. If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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). Note: The length field is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:
(ASCII data type)
struct
{
BYTE PathNameLen;
BYTE PathName[];
} Pcomponent[];
(UTF8 data type)
struct
{
WORD PathNameLen; (Lo-Hi)
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.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 Enhanced File System NCPs.)
The EnhNetWareFileNameStruct is a pointer to the EnhNetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct (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 EnhNetWareFileNameStruct (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 89 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:
| Name | Numeric Value |
|---|---|
| DOS | 0 |
| MAC | 1 |
| NFS | 2 |
| FTAM | 3 |
| OS/2 | 4 |
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:
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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:
These values are combined to have the following effects:
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 EnhNetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the EnhNetWareFileNameStruct (reply parameter) are given in the Introduction to Enhanced 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
LONG DirectoryBaseOrShortHandle; (Lo-Hi) BYTE VolumeNumber; BYTE HandleFlag; BYTE Data Type Flag; BYTE Reserved[5]; 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 DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). The default length preceeding field is a byte. If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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). Note: The length field is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:
(ASCII data type)
struct
{
BYTE PathNameLen;
BYTE PathName[];
} Pcomponent[];
(UTF8 data type)
struct
{
WORD PathNameLen; (Lo-Hi)
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 Enhanced File System NCPs.)
The EnhNetWareFileNameStruct is a pointer to the EnhNetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
See Also
Open/Create File or Subdirectory (0x2222 89 01)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 EnhNWHandlePathStruct (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 EnhNetWareFileNameStruct (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 89 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:
| Name | Numeric Value |
|---|---|
| DOS | 0 |
| MAC | 1 |
| NFS | 2 |
| FTAM | 3 |
| OS/2 | 4 |
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:
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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:
These values are combined to have the following effects:
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 Enhanced 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 EnhNetWareFileNameStruct structure. More information on the ReturnInfoMask (request parameter), NetWareInfoStruct (reply parameter), and the EnhNetWareFileNameStruct (reply parameter) are given in the Introduction to Enhanced 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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) | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
LONG DirectoryBaseOrShortHandle; (Lo-Hi) BYTE VolumeNumber; BYTE HandleFlag; BYTE Data Type Flag; BYTE Reserved[5]; 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 DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). The default length preceeding field is a byte. If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
DataTypeFlag
#define ASCII_DATA_TYPE 0x00 #define UTF8_DATA_TYPE 0x01
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). Note: The length field is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). The layout of the path portion of the structure (one structure for each directory on the tree) is as follows:
(ASCII data type)
struct
{
BYTE PathNameLen;
BYTE PathName[];
} Pcomponent[];
(UTF8 data type)
struct
{
WORD PathNameLen; (Lo-Hi)
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.
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | 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 Enhanced File System NCPs.)
The EnhNetWareFileNameStruct is a pointer to the EnhNetWareFileNameStruct structure. The file/subdirectory name and length are returned in this structure.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
See Also
Open/Create File or Subdirectory (0x2222 89 30)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 DataTypeFlag byte 23 NewFileNameLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 24/25 NewFileName byte[NewFileNameLen]
Reply Format
Offset Content Type
(reply header)Completion Code
0 SUCCESSFULRemarks
This NCP is used by the client to recover a file or subdirectory entry found through the ScanSalvageableFiles function. The ScanSequence field is the value that was used in the Scan Salvageable Files request.
The DataTypeFlag indicates what format the file name in the NewFileName field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
Rename or Move a File or SubDirectory 0x2222 89 04
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (04) byte 8 NameSpace byte 9 RenameFlag (See below) byte 10 SearchAttributes word (Lo-Hi) 12 SrcEnhNWHandlePathS1 (See below) structure 25 DstEnhNWHandlePathS2 (See below) structure 38 SrcDstPathStrings[] (See below) byte
Reply Format
Offset Content Type
(reply header)Completion Code
0 SUCCESSFULRemarks
The SearchAttributes field is explained in more detail in the Introduction to Enhanced File System NCPs.
The SrcEnhNWHandlePathS1 and DstEnhNWHandlePathS2 structures are the same as the EnhNWHandlePathStructure (See EnhNetWareHandlePathStruct in Introduction to Enhanced File System NCPs) except that the PathInfo array is not contained in these structures (each structure is 13 bytes in length). 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.
Scan File or SubDirectory for Trustees 0x2222 89 05
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (05) byte 8 NameSpace byte 9 MaxReplyObjectIDCount byte 10 SearchAttribute word (Lo-Hi) 12 SearchSequence (See below) long (Lo-Hi) 16 EnhNWHandlePathStruct 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 that the server will return as many trustee structures as indicated in the request parameter MaxReplyObjectIDCount, or as many as will fit into the reply buffer. Additional requests may be necessary to retrieve all trustees. Once NextScanSequence number is -1, all trustees have been returned by the server.
The TrusteeStruct structure is a 6 byte structure. The number of TrusteeStruct entries is contained in the ObjectIDCount field. The TrusteeStruct structure is as follows:
typedef struct { LONG ObjectID; (Hi-Lo) WORD TrusteeRights; (Lo-Hi) }TrusteeStruct;
Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (16) byte 8 NameSpace byte 9 DataStream byte 10 ReturnInfoMask long (Lo-Hi) 14 ScanSequence long (Lo-Hi) 18 EnhNWHandlePathStruct 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 EnhNetWareFileNameStruct 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 EnhNWHandlePathStruct 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, NetWareInfoStruct field, and EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs. Note that the EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
The ScanSequence field is set to -1 on the first call. On each subsequent call it is replaced by the NextScanSequence value.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 DataTypeFlag byte 26 SearchPatternLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 27/28 SearchPattern byte[SearchPatternLen]
Reply Format
Offset Content Type (reply header) 8 NextSearchSequence[9] byte 17 Reserved (0) byte 18 NetWareInfoStruct structure xx EnhNetWareFileNameStruct structure
Completion Code
0 SUCCESSFUL
Remarks
The SearchAttributes field, ReturnInfoMask field, NetWareInfoStruct field, and EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
The DataTypeFlag indicates what format the file name in the SearchPattern field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
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 89 02)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 DataTypeFlag byte 26 SearchPatternLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 27/28 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 EnhNetWareFileNameStruct 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 EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
The DataTypeFlag indicates what format the file name in the SearchPattern field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
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 EnhNetWareFileNameStructs as possible.
Note: The EnhNetWareFileNameStruct field is always returned when this call is made. With all other function 89 calls, however, this field is not returned unless the Include File Name Structure bit in the ReturnInfoMask structure is set.
To get the EnhNetWareFileNameStruct, 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 + EnhNetWareFileNameStruct + NetWareInfoStruct + EnhNetWareFileNameStruct
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 DataTypeFlag byte 26 SearchPatternLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 27/28 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 EnhNetWareFileNameStruct 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 EnhNetWareFileNameStruct field are explained in more detail in the Introduction to Enhanced File System NCPs.
Note: The length field in the Enhanced File Name Information Structure is determined by the data type flag that is passed in in the NCP request. If the data type flag in the request indicates ASCII, then the length field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the length field will be 2 bytes (WORD). Refer to the Data Type Flag definitions below.
The DataTypeFlag indicates what format the file name in the SearchPattern field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
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 EnhNetWareFileNameStructs as possible.
To get the EnhNetWareFileNameStruct, 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 + EnhNetWareFileNameStruct + NetWareInfoStruct + EnhNetWareFileNameStruct
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (50) byte 8 NameSpace byte 9 ObjectID long (Hi-Lo) 13 EnhNWHandlePathStruct structure
Reply Format
Offset Content Type (reply header) 8 MyEffectiveRights word (Lo-Hi)
Completion Code
0 SUCCESSFUL
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 89 29); however, this call allows you to specify an object (ObjectID parameter) for which rights are returned.
Note: This NCP is based on old NCP 22 50 (Get Object Effective Rights for Directory Entry).
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (71) byte 8 Volume long (Lo-Hi) 12 ObjectID long (Hi-Lo) 16 SequenceNumber word (Lo-Hi) 18 DataTypeFlag byte
Reply Format
Offset Content Type (reply header) 8 NextSequenceNumber word (Lo-Hi) 10 ObjectID long (Hi-Lo) 14 TrusteeAccessMask byte 15 DirectoryPathLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 16/17 DirectoryPath byte[DirectoryPathLen]
Completion Code
0 0x00 Successful 147 0x93 No Read Privileges 150 0x96 Server Out Of Memory 161 0xA1 Directory I/O Error 240 0xF0 Illegal Wildcard 241 0xF1 Bindery Security 242 0xF2 No Object Read 252 0xFC No Such Object 254 0xFE Directory Locked 255 0xFF Hard Failure
Remarks
This call returns a path on the specified volume (Volume Number) where the specified Object ID is a trustee. The path returned is also known as the trustee path. This call can be used iteratively to determine all paths on a specified volume where the Object ID number appears in a directory's trustee list.
NOTE:The DataTypeFlag input parameter indicates what format the file name in the DirectoryPath reply field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
The client's Sequence Number in the request message should initially be set to -1L (word -1); in successive requests, the Sequence Number should be set to the value returned in Next Sequence Number of the previous reply message.
The Object ID field must contain the number of the object (user) whose trustee directory paths are being sought.
The file server returns the Directory Path in the following format:
volume:directory/subdirectory/subdirectory/. . .
Directory paths are not returned in any special order. The server will return a Directory Path Length of 0 if all directory paths where the object is listed as a trustee have been returned.
A client who is a supervisor (or equivalent) can use this call to investigate the trustee directory rights of any object in the bindery. Any client can use this call to determine its own trustee paths, or the trustee paths of any object to which the client is security equivalent.
Note: This NCP is based on old NCP 23 71 (Scan Bindery Object Trustee Paths).
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (09) byte 8 NameSpace byte 9 DataStream byte 10 DstDirHandle byte 11 Flags byte 12 EnhNWHandlePathStruct structure
ReplyFormat
| Flags Value | Reply Format Syntax |
|---|---|
| 0 |
|
| 0x40 |
|
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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
See Also
Allocate Short Directory Handle (0x2222 89 12)
Get Directory Disk Space Restrictions |
0x2222 89 39 |
| NetWare | Linux | ||||||||
| v2.x | v3.x | v4.x | v5.x | v6.x | v6.5sp2 | OES 1 | OES 2 | OES 11 | OES 2015 |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (39) byte 8 NameSpace byte 9 reserved byte[2] 11 EnhNWHandlePathStruct 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 EnhNWHandlePathStruct parameter is of type EnhNetWareHandlePathStruct; therefore, when you search for information on this parameter in the Introduction to Enhanced File System NCPs, you must search for the EnhNetWareHandlePathStruct.
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
0x2222 89 41 | Get Directory Disk Space Restrictions (64Bit Aware) |
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)
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (54) byte 8 Flags (See Intro) word (Lo-Hi) 10 EAHandleStruct structure 18 InspectSize long (Lo-Hi) 22 EnumerateSequence word (Lo-Hi) 24 DataTypeFlag byte 25 KeyLength word (Lo-Hi) 27 Key[] byte
Reply Format (Information Level = 0)
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 TtlEAs long (Lo-Hi) 16 TtlEAsDataSize long (Lo-Hi) 20 TtlEAsKeySize long (Lo-Hi) 24 NewEAHandle (See Intro) long (Lo-Hi) 28 reserved (0) word (Lo-Hi) 30 reserved (0) word (Lo-Hi)
Reply Format (Information Level = 1)
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 TtlEAs (See Intro) long (Lo-Hi) 16 TtlEAsDataSize (See Intro) long (Lo-Hi) 20 TtlEAsKeySize (See Intro) long (Lo-Hi) 24 NewEAHandle (See Intro) long (Lo-Hi) 28 NextEnumerateSequence word (Lo-Hi) 30 EnumEAStructCount (See Intro) word (Lo-Hi) 32 EnumEAStruct_Lvl1[] (See Intro) structures
Reply Format (Information Level = 6)
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 TtlEAs (See Intro) long (Lo-Hi) 16 TtlEAsDataSize (See Intro) long (Lo-Hi) 20 TtlEAsKeySize (See Intro) long (Lo-Hi) 24 NewEAHandle (See Intro) long (Lo-Hi) 28 reserved (0) word (Lo-Hi) 30 reserved (0) word (Lo-Hi) 32 EnumEAStruct_Lvl6[] (See Intro) structure
Reply Format (Information Level = 7)
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 TtlEAs long (Lo-Hi) 16 TtlEAsDataSize long (Lo-Hi) 20 TtlEAsKeySize long (Lo-Hi) 24 NewEAHandle (See Intro) long (Lo-Hi) 28 NextEnumerateSequence word (Lo-Hi) 30 EnumEAStructCount word (Lo-Hi) 32 EnumEAStruct_Lvl7[] (See Intro) structure
Completion Codes
SUCCESSFUL ERR_INTERNAL_FAILURE ERR_INVALID_EA_HANDLE ERR_EA_NOT_FOUND ERR_UNKNOWN_REQUEST ERR_NO_ALLOC_SPACE ERR_EA_ACCESS_DENIED
Remarks
Note: This NCP is based on NCP 86 4 (Enumerate Extended Attribute). For specific information on the different information levels, refer to the NCP case 86 NCP documentation. NCP 86 (Extended Attribute NCPs)
Note that when using a level 6 enumerate request, the fields TtlEAsDataSize and TtlEAsKeySize will contain the size of the value and key specified only. Also the field TtlEAs will contain a 1. The fields (KeyPages & Value Pages) in the Level 6 enumerate structure contain the number of pages of Extended Directory space was used.
The DataTypeFlag indicates what format the Key name will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). NOTE: The KeyLength input field is always a WORD (2 bytes) regardless of whether the DataTypeFlag is 0 or 1.
If the Key Length equals 0, then a list of all EA's including information about each EA, will be passed back. If a key is used, then only information level 6 my be used. On the first Enumerate call, EnumerateSequence must be set to 0, with subsequent calls, using the NextEnumerateSequence from the reply to set EnumerateSequence with.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (53) byte 8 Flags (See Intro) word (Lo-Hi) 10 EAHandleStruct structure 18 ReadPosition (See Intro) long (Lo-Hi) 22 InspectSize long (Lo-Hi) 26 DataTypeFlag byte 27 MaxReadDataReplySize word (Lo-Hi) 29 KeyLength word (Lo-Hi) 31 Key[] byte
Reply Format
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 TtlValuesLength long (Lo-Hi) 16 NewEAHandle (See Intro) long (Lo-Hi) 20 AccessFlag long (Lo-Hi) 24 ValueLength word (Lo-Hi) 26 Value[] byte
Completion Codes
SUCCESSFUL ERR_EA_NOT_FOUND ERR_EA_INTERNAL_FAILURE ERR_EA_BAD_DIR_NUM ERR_INVALID_EA_HANDLE ERR_EA_ACCESS_DENIED ERR_EA_VOLUME_NOT_MOUNTED ERR_EA_INSPECT_FAILURE ERR_NO_ALLOC_SPACE ERR_INVALID_FILE_HANDLE ERR_INVALID_PATH ERR_NO_SET_PRIVILEGES
Remarks
Note: This NCP is based on NCP 86 3 (Read Extended Attribute). For additional information on request and reply fields, refer to the NCP case 86 NCP documentation. NCP 86 (Extended Attribute NCPs)
NOTE: The readData in the reply field is always returned in 128 byte chunks.
The DataTypeFlag indicates what format the Key name will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). NOTE: The KeyLength field is always a WORD (2 bytes) regardless of whether the DataTypeFlag is 0 or 1.
The MaxReadDataReplySize input request parameter allows the caller of this NCP to specify how big the reply buffer is that he is sending in to the reply. In the case 86 3 NCP, the readData reply size was always a maximum size of 512 bytes (4 - 128 byte chunks). With this case 89 53 NCP, the readData reply size can be a maximum of 1408 bytes if the connection is an IP connection, and 512 bytes if the connection is IPX. Because over IP the readData reply can be much bigger, the caller needs to explictly input how big his reply buffer is. If the caller's reply buffer is bigger than what the NCP supports, the reply size will be set to the largest size that the NCP will support. Currently, the largest size is 1408 (readData) + 18 (rest of reply packet) = 1426 bytes.
The key is only sent on the first read, subsequent reads should not contain the key. Set Key Length to zero after first read.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (52) byte 8 Flags (See Intro) word (Lo-Hi) 10 EAHandleStruct (See Intro) structure 18 TtlWriteDataSize long (Lo-Hi) 22 WritePosition (See Intro) long (Lo-Hi) 26 AccessFlag long (Lo-Hi) 30 DataTypeFlag byte 31 ValueLength word (Lo-Hi) 33 KeyLength word (Lo-Hi) 35 Key[] byte xx Value[] byte
Reply Format
Offset Content Type (reply header) 8 ErrorCode (See Intro) long (Lo-Hi) 12 BytesWritten long (Lo-Hi) 16 NewEAHandle (See Intro) long (Lo-Hi)
Completion Codes
SUCCESSFUL ERR_MISSING_EA_KEY ERR_EA_NOT_FOUND ERR_NO_KEY_NO_DATA ERR_EA_INTERNAL_FAILURE ERR_EA_BAD_DIR_NUM ERR_INVALID_EA_HANDLE ERR_EA_WRITE_OUT_OF_RANGE ERR_EA_ACCESS_DENIED ERR_DATA_PAGE_ODD_SIZE ERR_EA_VOLUME_NOT_MOUNTED ERR_BAD_PAGE_BOUNDARY ERR_NO_SET_PRIVILEGES ERR_INSUFFICIENT_SPACE ERR_HARD_FAILURE ERR_INVALID_PATH
Remarks
Note: This NCP is based on NCP 86 2 (Write Extended Attribute). For additional information on request and reply fields, refer to the NCP case 86 NCP documentation. NCP 86 (Extended Attribute NCPs)
The DataTypeFlag indicates what format the Key name will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). NOTE: The KeyLength field is always a WORD (2 bytes) regardless of whether the DataTypeFlag is 0 or 1.
The key is only be sent on the first write, subsequent writes should not contain the key. Set Key Length to zero after first write.
| v2.x | v3.x | v4.x | v5.x | v65.sp2 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) 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 DataTypeFlag byte 20 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 DataTypeFlag indicates what format the file name in the NSSpecificInfo buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). If the DataTypeFlag is UTF8, and the mask indicates that the name is being set, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order. Otherwise, the length preceeding field will be a byte.
The DataTypeFlag indicates what format the file name in the reply buffer will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). If the DataTypeFlag is UTF8, and the mask indicates that the name will be returned, then the length preceeding field is a WORD (2 bytes) in Lo-Hi order.
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
Enhanced Get NS Information (0x2222 89 19)
Query NS Information Format (0x2222 87 23)
| v2.x | v3.x | v4.x | v5.x | v65.sp4 and newer |
Request Format
Offset Content Type (request header) 6 FunctionCode (89) byte 7 SubFunction (21) byte 8 NameSpace byte 9 ShortDirectoryHandle byte 10 DataTypeFlag byte
Reply Format
Offset Content Type (reply header) 8 PathLen byte (Ascii) or WORD (Lo-Hi) (UTF8) 9 Path[] byte
Completion Code
0 SUCCESSFUL
Remarks
This NCP gets a path string from a short directory handle.
NOTE:The DataTypeFlag input parameter indicates what format the Path in the Path reply field will be in. Currently there are 2 formats supported. Ascii (0) and UTF8 (1). By default, the length preceeding field is a byte. If the DataTypeFlag is UTF8, the length preceeding field is a WORD (2 bytes) in Lo-Hi order.