Microsoft KB Archive/62360

INF: Interpreting OS/2 Extended Attribute FEA Information PSS ID Number: Q62360 Article last modified on 09-20-1991 PSS database name: O_Os2SDK

1.21 1.30 1.30.1

OS/2

Summary:

Listed below is information about the format of the variable length data of the FEA structure, and also described is a sample program that extracts the data portion of an extended attribute and writes this information out to a separate file.

The format of the variable length portion of the extended attribute after the FEA structure is pretty much left up to the application. However, storing the extended attribute name, data type, and length (if required) as the first part of the extended attribute is a convention used to let other applications know what type of extended attribute data is attached to a particular file and, with the extended attribute data length, allows other applications to navigate through the extended attribute data.

Listed below is a description of the “typical” contents of a variable length portion of an extended attribute (for example, an ICON.) Suppose an FEA structure is declared with the name of myFea. For example:

FEA myFea;

Offsets from myFea will be used to show where these “fields” occur in the variable length portion following the FEA structure for an ICON extended attribute.

Field Location —– ——–

.ICON At &myFea + sizeof(FEA). The name of the extended attribute; this is a string. By looking at the cbName value of the FEA structure, it is possible to know how long this string is.

NULL (hex value 0). At &myFea + sizeof(FEA) + myFea.cbValue. Size: 1 byte. A NULL always follows the extended attribute name.

EAT_ICON (hex value FFF9). At &myFea + sizeof(FEA) + myFea.cbValue + 1. Size: 2 bytes. This is the “type” of the actual extended attribute data. Values 0000 through 7fff are available for user-definable types. A list of the standard types can be found in Section 2.3.2.2 of the “Microsoft Operating System/2 Programmer’s Reference Volume 4” for version 1.2.

4082 at &myFea + sizeof(FEA) + myFea.cbValue + 1 + 2. Size: 2 bytes. This is the size of the actual extended attribute data, which directly follows these 2 bytes. Some standard extended attributes differ from this format from this point onward; namely, the multivalue/multitype types.

… at &myFea + sizeof(FEA) + myFea.cbValue + 1 + 2 + 2. This is the actual extended attribute data, of length 4082, in this example, as specified by the previous 2 bytes.

In the Software/Data Library is a sample program named GETICON that extracts the data portion of an extended attribute and writes it out to a separate file. It is currently configured to extract ICON data and write it out to a file that can be edited with ICONEDIT.EXE. The code can be examined to determine how to access the variable length portion of the extended attribute.

In GETICON, a simple technique is used to declare a pointer and point it to the data type bytes, which begin immediately after the terminating null of the extended attribute name string, and advance the pointer by appropriate amounts to read the rest of the “fields” in the variable portion.

GETICON can be found in the Software/Data Library by searching on the word GETICON, the Q number of this article, or S12592. GETICON was archived using the PKware file-compression utility.

There is also an article in the April 24, 1990 issue of “PC Magazine” (Vol. 9, No. 8) on using extended attributes. This article is helpful in understanding how extended attributes are used.

Copyright Microsoft Corporation 1991.