This introduction includes detailed information about and illustrations of flags and structures used by the NetWare 386 v3.11 extended attribute NCP calls.
Flags Definition
| Bit 7 | Definition |
| Immediate Close Handle |
| Bit 6 | Bit 5 | Bit 4 | Information Level |
| 0 | 0 | 0 | Level 0 |
| 0 | 0 | 1 | Level 1 |
| 0 | 1 | 0 | Level 2 |
| 0 | 1 | 1 | Level 3 |
| 1 | 0 | 0 | Level 4 |
| 1 | 0 | 1 | Level 5 |
| 1 | 1 | 0 | Level 6 |
| 1 | 1 | 1 | Level 7 |
| Bit 2 | Definition |
| Close Handle on Error (Bit 7 = NZ) |
| Bit 1 | Bit 0 | EA Handle Structure |
| 0 | 0 | LONG Volume; LONG DirectoryNumber; |
| 0 | 1 | BYTE NetWareHandle[4]; LONG reserved; |
| 1 | 0 | LONG EAHandle; LONG reserved |
| 1 | 1 | reserved |
Exceptions
When using the Duplicate EA function, you cannot use the EA Handle setting in the Flags, or Immediate Close Handle setting.
Information Level only applies to the Enumerate EA function. At this time, only levels 0, 1, 6, and 7 are defined.
Access Flag Definition
| Bit Numbers | Definition |
| 0 - 6 | reserved |
| 7 | EA Need Bit Flag |
| 8 - 15 | reserved |
Enumerate EA Structure Definitions
| Enumerate EA Structure (Information Level = 1) | ||
|---|---|---|
| Offset | Content | Type |
| 0 | ValueLength (variable) | LONG (Lo-Hi) |
| 4 | KeyLength (variable) | WORD (Lo-Hi) |
| 6 | AccessFlag (variable) | LONG (Lo-Hi) |
| 10 | Key[] (variable) | BYTE |
| Enumerate EA Structure (Information Level = 6) | ||
|---|---|---|
| Offset | Content | Type |
| 0 | ValueLength (variable) | LONG (Lo-Hi) |
| 4 | KeyLength (variable) | WORD (Lo-Hi) |
| 6 | AccessFlag (variable) | LONG (Lo-Hi) |
| 10 | KeyExtants (variable) | LONG (Lo-Hi) |
| 14 | ValueExtants (variable) | LONG (Lo-Hi) |
| 18 | Key[] (variable) | BYTE |
| Enumerate EA Structure (Information Level = 7) | ||
|---|---|---|
| Offset | Content | Type |
| 0 | KeyLength (variable) | BYTE / WORD |
| 1 / 2 | Key[] (variable) | BYTE |
| x | NullByte (0) | BYTE |
NOTE: If the NCP request is a case 89 request, the KeyLength field in the Enumerate EA Structure (Information Level 7) 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 KeyLength field will be 1 byte (as it has previously been). If the data type flag in the request indicates UTF8, then the KeyLength field will be 2 bytes (WORD). Refer to the enhanced case 89 NCP doc for additional information. NCP 89 (Enhanced File System NCPs)
Multiple Functions Description
The functions Enumerate EA, Read EA, and Write EA can do multiple actions, such as open a EA handle, then do the appropriate function, then close the EA handle. The Error Code field is define as 32 bits, with the low order 16 bits containing the error code from the Server. In addtion to the error code returned back by the server, the upper bits indicate which multiple action failed, show below.
| Bit Number | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | Definition |
| Enumerate Failed | ||||||||||||||||
| Read Failed | ||||||||||||||||
| Write Failed |
Read and Write Position Definitions
All read and write positions are based on a 128 byte page in the file server, therefore read and write positions always start on a mod(128) byte boundary. All data is passed between the server and client in 512 byte data chunks except for the last transfer which can be less.
Also note that Extended Attributes values are always read or written completely, no partial read or writes allowed, the Extended Attributes are not treated like files when transferring.
The starting value of read or write position is 0, the following calls to the server will return the next read or write position to use.
Extended Attributes Error Codes (Values)
| Error | Value |
|---|---|
| SUCCESSFUL | 0 [0x0000] |
| ERR_MISSING_EA_KEY | 200 [0x00C8] |
| ERR_EA_NOT_FOUND | 201 [0x00C9] |
| ERR_INVALID_EA_HANDLE_TYPE | 202 [0x00CA] |
| ERR_EA_NO_KEY_NO_DATA | 203 [0x00CB] |
| ERR_EA_NUMBER_MISMATCH | 204 [0x00CC] |
| ERR_EXTENT_NUMBER_OUT_OF_RANGE | 205 [0x00CD] |
| ERR_EA_BAD_DIR_NUM | 206 [0x00CE] |
| ERR_INVALID_EA_HANDLE | 207 [0x00CF] |
| ERR_EA_POSITION_OUT_OF_RANGE | 208 [0x00D0] |
| ERR_EA_ACCESS_DENIED | 209 [0x00D1] |
| ERR_DATA_PAGE_ODD_SIZE | 210 [0x00D2] |
| ERR_EA_VOLUME_NOT_MOUNTED | 211 [0x00D3] |
| ERR_BAD_PAGE_BOUNDARY | 212 [0x00D4] |
| ERR_INSPECT_FAILURE | 213 [0x00D5] |
| ERR_EA_ALREADY_CLAIMED | 214 [0x00D6] |
| ERR_ODD_BUFFER_SIZE | 215 [0x00D7] |
| ERR_NO_SCORECARDS | 216 [0x00D8] |
| ERR_BAD_EDS_SIGNATURE | 217 [0x00D9] |
| ERR_EA_SPACE_LIMIT | 218 [0x00DA] |
| ERR_EA_KEY_CORRUPT | 219 [0x00DB] |
| ERR_EA_KEY_LIMIT | 220 [0x00DC] |
| ERR_TALLY_CORRUPT | 221 [0x00DD] |
| v2.x | v3.x | v4.x | v5.x |
Request Format
Offset Content Type (request header) 6 FunctionCode (86) byte 7 SubFunction (01) byte 8 reserved (0) word (Lo-Hi) 10 EAHandle long (Lo-Hi)
Reply Format
Offset Content Type (reply header)
Completion Codes
SUCCESSFUL ERR_INVALID_EA_HANDLE ERR_EA_VOLUME_NOT_MOUNTED
Remarks
This NCP closes an extended attribute handle.
| v2.x | v3.x | v4.x | v5.x |
Request Format
Offset Content Type (request header) 6 FunctionCode (86) byte 7 SubFunction (05) byte 8 SrcFlags (See Intro) word (Lo-Hi) 10 DstFlags (See Intro) word (Lo-Hi) 12 SrcEAHandleStruct (see Intro) structure 20 DstEAHandleStruct (see Intro) structure
Reply Format
Offset Content Type (reply header) 8 DuplicatedCount long (Lo-Hi) 12 DataSizeDuplicated long (Lo-Hi) 16 KeySizeDuplicated long (Lo-Hi)
Completion Codes
SUCCESSFUL ERR_NO_SET_PRIVILEGES ERR_NO_ALLOC_SPACE ERR_EA_ACCESS_DENIED ERR_EA_INTERNAL_FAILURE
| v2.x | v3.x | v4.x | v5.x |
Request Format
Offset Content Type (request header) 6 FunctionCode (86) byte 7 SubFunction (04) byte 8 Flags (See Intro) word (Lo-Hi) 10 EAHandleStruct structure 18 InspectSize long (Lo-Hi) 22 EnumerateSequence word (Lo-Hi) 24 KeyLength word (Lo-Hi) 26 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 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.
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 |
Request Format
Offset Content Type (request header) 6 FunctionCode (86) byte 7 SubFunction (03) byte 8 Flags (See Intro) word (Lo-Hi) 10 EAHandleStruct structure 18 ReadPosition (See Intro) long (Lo-Hi) 22 InspectSize long (Lo-Hi) 26 KeyLength word (Lo-Hi) 28 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
The key is only be 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 |
Request Format
Offset Content Type (request header) 6 FunctionCode (86) byte 7 SubFunction (02) 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 ValueLength word (Lo-Hi) 32 KeyLength word (Lo-Hi) 34 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
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.