NWReadEAExt

Reads the next block of data from the specified Extended Attribute, using UFT-8 path and filenames

Local Servers:blocking
Remote Servers:blocking
NetWare Server:6.5 SP2 or later
Platform:NLM, Windows 2000, Windows XP
Client:4.90 SP2 or later
Library:Cross-Platform NetWare Calls (CAL*.*)
Service:Extended Attribute

Syntax

  #include <nwnamspc.h> 
  #include <nwea.h> 
  or 
  #include <nwcalls.h> 
   
  N_EXTERN_LIBRARY(NWCCODE) NWReadEAExt  ( 
     NW_EA_HANDLE_EXT  N_FAR  *EAHandle,  
     nuint32                   bufferSize,  
     pnuint8                   buffer,  
     pnuint32                  totalEASize,  
     pnuint32                  amountRead);
  

Parameters

EAHandle
(IN/OUT) Points to the NW_EA_HANDLE_EXT structure, obtained by calling either the NWGetHandleStructExt, NWFindFirstEAExt, NWFindNextEAExt, or NWOpenEAExt function.
bufferSize
(IN) Specifies the size of the buffer.
buffer
(OUT) Points to a data buffer.
totalEASize
(OUT) Points to the size of the Extended Attribute.
amountRead
(OUT) Points to the total amount of data read with the call (not cumulative across multiple calls).

Return Values

These are common return values; see Return Values (Return Values for C) for more information.

0x0000

SUCCESSFUL

0x0001

EA-EOF (SUCCESSFUL EOF READ)

0x8833

INVALID_BUFFER_LENGTH

0x88F0

UTF8_CONVERSION_FAILED

0x8988

INVALID_FILE_HANDLE

0x898C

NO_MODIFY_PRIVILEGES

0x8996

SERVER_OUT_OF_MEMORY

0x899C

INVALID_PATH

0x89C9

EA_NOT_FOUND

0x89CE

EA_BAD_DIR_NUM

0x89CF

INVALID_EA_HANDLE

0x89D1

EA_ACCESS_DENIED

0x89D3

EA_VOLUME_NOT_MOUNTED

0x89D5

INSPECT_FAILURE

Remarks

The data block to be read is determined from the state information identified by the EAHandle parameter.

NWReadEAExt and the NWWriteEAExt function can perform multiple actions, such as opening or creating an Extended Attribute and then calling the appropriate function. To properly end NWReadEAExt, call the NWCloseEAExt function after the last Read or Write.

Extended Attribute values should always be read or written completely. Extended Attributes are not treated like files when transferring. Therefore, partial Reads or Writes are not allowed.

If 0x0000 is returned, more data can be read from the Extended Attribute by calling NWReadEAExt again. In this case, EAHandle is already positioned correctly for the next subsequent call. If 0x0001 is returned, no more data can be read and the data in the buffer was read successfully. If other error values are returned, the data in the buffer is not considered valid.

IMPORTANT:If an Extended Attribute is not read or written completely, data past the end of the last Read or Write may be lost!

The NW_EA_HANDLE_EXT structure is referenced in all Extended Attribute functions. NWReadEAExt and the NWWriteEAExt function use the NW_EA_HANDLE_EXT structure to maintain state information. The state information is required to access the Extended Attribute database. The NW_EA_HANDLE_EXT structure is for internal use only; do not manipulate it in any way.

Before calling NWReadEAExt initially, you must obtain the EAHandle parameter to access the Extended Attribute database. An application can obtain an Extended Attribute handle by calling one of the following functions:

NWReadEAExt can be called multiple times until the bytes of data read is equal to the value identified by the totalEASize parameter.

NOTE:The value referenced by the amountRead parameter does not reflect the total number of bytes in the Extended Attribute.

For Reads, the bufferSize parameter must be at least 512 bytes; it can be greater than 512 bytes—but must be in multiples of 512. If the bufferSize parameter is less than 512 bytes, NWReadEAExt returns INVALID_BUFFER_LENGTH.

The NWEAReadExt function reads up to the number of bytes specified by the bufferSize parameter or until the end of the Extended Attribute data, whichever comes first.

NCP Calls

See Also

NWFindNextEAExt, NWFindFirstEAExt, NWOpenEAExt, NWWriteEAExt, NWCloseEAExt