This call identifies extended attributes for a specific file or subdirectory.
DosEnumAttribute
RefType (USHORT) - input
Value
Reserved (UCHAR)
On output, the actual number of EAs for which information is returned. When this value is greater than 1, enumerated information is returned in a packed list. That is, information for the next EA will be stored adjacent to the previous one.
The structure returned by DosEnumAttribute is used to calculate the size of the buffer required to hold the full extended attribute (FEA) information for a DosQPathInfo or DosQFileInfo call that actually gets the FEA. The size of buffer required to hold the FEA information is calculated as follows:
One byte (for fea_Reserved) +
One byte (for fea_cbName) +
Two bytes (for fea_cbValue) +
Value of cbName (for the name of the EA) +
One byte (for terminating NULL in fea_cbName) +
Value of cbValue (for the value of the EA)
A process can continue through a file's EA list by reissuing DosEnumAttribute with EntryNum set to the value specified in the previous call plus the value returned in EnumCnt.
DosEnumAttribute does not control the specific ordering of EAs; it merely identifies them. Like the files they are associated with, extended attributes can have multiple readers and writers. If a file is open in a sharing mode that allows other processes to modify the file's EA list, calling DosEnumAttribute repetitively to back up to an EA's position may return inconsistent results. For example, it is possible for another process to edit the EA list with DosSetFileInfo or DosSetPathInfo between calls by your process to DosEnumAttribute. Thus, the EA returned when EntryNum is 11 for the first call may not be the same EA returned when EntryNum is 11 for the next call.
To prevent the modification of EAs between calls to DosEnumAttribute for a specified file handle or file name, the caller must open the file in deny-write sharing mode before it calls DosEnumAttribute. If a subdirectory name is specified, modification by other processes is not a concern , because no sharing is possible.
For RefType = 1, the EAs returned are current only when the call was made, and they may have been changed by another thread or process in the meantime.