The structure that DosProtectEnumAttribute returns is used to calculate the size of the buffer needed to hold the full extended attribute (FEA2) information for a DosQueryPathInfo or DosProtectQueryFileInfo call that actually gets the FEA2. The buffer size is calculated as follows:

Each entry must start on a doubleword boundary.

A process can continue through a file's EA list by reissuing DosProtectEnumAttribute with ulEntry set to the value specified in the previous call, plus the value returned in pulCount.

DosProtectEnumAttribute does not control the specific ordering of EAs; it merely identifies them. Extended attributes can have multiple readers and writers, just as the files they are associated with can. If a file is open in a sharing mode that allows other processes to modify the file's EA list, repetitively calling DosProtectEnumAttribute to back up to an EA's position may return inconsistent results. For example with DosProtectSetFileInfo or DosSetPathInfo, another process can edit the EA list between calls by your process to DosProtectEnumAttribute. Therefore, the EA returned when ulEntry is 11 for the first call might not be the same EA returned when ulEntry is 11 for the next call.

To prevent EAs from being modified between calls to DosProtectEnumAttribute for a specified file handle or file name, the calling function must open the file in deny-write sharing mode before it calls DosProtectEnumAttribute. If a subdirectory name is specified, modification by other processes is not a concern, because no sharing is possible.

When ENUEMEA_REFTYPE_PATH is specified for ulRefType, the EAs returned are current only when the call was made, and may have been changed by another thread or process since then.


[Back] [Next]