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

Extended Attribute NCPs


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 7Definition
0

1
Immediate Close Handle

Bit 6Bit 5Bit 4Information Level
000Level 0
001Level 1
010Level 2
011Level 3
100Level 4
101Level 5
110Level 6
111Level 7

Bit 2Definition
0

1
Close Handle on Error (Bit 7 = NZ)

Bit 1Bit 0EA Handle Structure
00LONG Volume;
LONG DirectoryNumber;
01BYTE NetWareHandle[4];
LONG reserved;
10LONG EAHandle;
LONG reserved
11reserved

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

Enumerate EA Structure Definitions

Enumerate EA Structure (Information Level = 1)
OffsetContentType
0ValueLength (variable)LONG (Lo-Hi)
4KeyLength (variable)WORD (Lo-Hi)
6AccessFlag (variable)LONG (Lo-Hi)
10Key[] (variable)BYTE

Enumerate EA Structure (Information Level = 6)
OffsetContentType
0ValueLength (variable)LONG (Lo-Hi)
4KeyLength (variable)WORD (Lo-Hi)
6AccessFlag (variable)LONG (Lo-Hi)
10KeyExtants (variable)LONG (Lo-Hi)
14ValueExtants (variable)LONG (Lo-Hi)
18Key[] (variable)BYTE

Enumerate EA Structure (Information Level = 7)
OffsetContentType
0KeyLength (variable)BYTE / WORD
1 / 2Key[] (variable)BYTE
xNullByte (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
3130292827262524 2322212019181716 Definition
x















Enumerate Failed

x














Read Failed


x













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)
ErrorValue
SUCCESSFUL0 [0x0000]
ERR_MISSING_EA_KEY200 [0x00C8]
ERR_EA_NOT_FOUND201 [0x00C9]
ERR_INVALID_EA_HANDLE_TYPE202 [0x00CA]
ERR_EA_NO_KEY_NO_DATA203 [0x00CB]
ERR_EA_NUMBER_MISMATCH204 [0x00CC]
ERR_EXTENT_NUMBER_OUT_OF_RANGE205 [0x00CD]
ERR_EA_BAD_DIR_NUM206 [0x00CE]
ERR_INVALID_EA_HANDLE207 [0x00CF]
ERR_EA_POSITION_OUT_OF_RANGE208 [0x00D0]
ERR_EA_ACCESS_DENIED209 [0x00D1]
ERR_DATA_PAGE_ODD_SIZE210 [0x00D2]
ERR_EA_VOLUME_NOT_MOUNTED211 [0x00D3]
ERR_BAD_PAGE_BOUNDARY212 [0x00D4]
ERR_INSPECT_FAILURE213 [0x00D5]
ERR_EA_ALREADY_CLAIMED214 [0x00D6]
ERR_ODD_BUFFER_SIZE215 [0x00D7]
ERR_NO_SCORECARDS216 [0x00D8]
ERR_BAD_EDS_SIGNATURE217 [0x00D9]
ERR_EA_SPACE_LIMIT218 [0x00DA]
ERR_EA_KEY_CORRUPT219 [0x00DB]
ERR_EA_KEY_LIMIT220 [0x00DC]
ERR_TALLY_CORRUPT221 [0x00DD]


Close Extended Attribute Handle 0x2222 86 01

v2.xv3.xv4.xv5.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.


Duplicate Extended Attributes 0x2222 86 05

v2.xv3.xv4.xv5.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

Enumerate Extended Attribute 0x2222 86 04

v2.xv3.xv4.xv5.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.


Read Extended Attribute 0x2222 86 03

v2.xv3.xv4.xv5.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.


Write Extended Attribute 0x2222 86 02

v2.xv3.xv4.xv5.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.