#include <nwnamspc.h> #include <nwea.h> or #include <nwcalls.h>NWCCODE N_API NWReadEA (NW_EA_HANDLE N_FAR EAHandle, nuint32 bufferSize, pnuint8 buffer, pnuint32 totalEASize, pnuint32 amountRead);
NWReadEA and NWWriteEA can perform multiple actions, such as opening or creating an EA and then performing the appropriate function. To properly end NWReadEA, call NWCloseEA 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 written to the EA. If 0x0001 is returned, the data in the buffer was written successfully; however, no more data can be written to the EA. If other errors are returned, the data in the buffer was not written to the EA.
NW_EA_HANDLE is referenced in all EA functions. NWReadEA and NWWriteEA use NW_EA_HANDLE to maintain state information. The state information is required to access the EA database. NW_EA_HANDLE is for internal use only; applications must not manipulate it in any way.
Before calling NWReadEA initially, an application must obtain an EAHandle in order to access the EA database. An application can obtain an EA handle by calling one of the following:
For Reads, bufferSize must be at least 512 bytes. bufferSize can be greater than 512 bytes, but must be in multiples of 512. If bufferSize is less than 512, NWReadEA returns INVALID_BUFFER_LENGTH.
NWEARead reads up to the bufferSize number of EA information bytes or until the end of the EA data, whichever comes first.
0x2222 | 86 | 03 | Read Extended Attribute |
-------------------------------------------- | 0x2222| 86| 03| Read Extended Attribute| |-------|----|----|-------------------------|