SEGINFO

3.1

typedef struct tagSEGINFO {
    UINT    offSegment;
    UINT    cbSegment;
    UINT    flags;
    UINT    cbAlloc;
    HGLOBAL h;
    UINT    alignShift;
    UINT    reserved[2];
} SEGINFO;

The SEGINFO structure contains information about a data or code segment. This structure is filled in by the GetCodeInfo function.

Members

offSegment

Specifies the offset, in sectors, to the contents of the segment data, relative to the beginning of the file. (Zero means no file data is available.) The size of the sector is determined by shifting left by 1 the value given in the alignShift member.

cbSegment

Specifies the length of the segment in the file, in bytes. Zero means 64K.

flags

Contains flags which specify attributes of the segment. The following list describes these flags:

Bit Meaning

0–2 Specifies the segment type. If bit 0 is set to 1, the segment is a data segment. Otherwise, the segment is a code segment.
3 Specifies whether segment data is iterated. When this bit is set to 1, the segment data is iterated.
4 Specifies whether the segment is movable or fixed. When this bit is set to 1, the segment is movable. Otherwise, it is fixed.
5–6 Reserved.
7 Specifies whether the segment is a read-only data segment or an execute-only code segment. If this bit is set to 1 and the segment is a code segment, the segment is an execute-only segment. If this bit is set to zero and the segment is a data segment, it is a read-only segment.
8 Specifies whether the segment has associated relocation information. If this bit is set to 1, the segment has relocation information. Otherwise, the segment does not have relocation information.
9 Specifies whether the segment has debugging information. If this bit is set to 1, the segment has debugging information. Otherwise, the segment does not have debugging information.
10–15 Reserved.

cbAlloc

Specifies the total amount of memory allocated for the segment. This amount may exceed the actual size of the segment. Zero means 64K.

h

Identifies the global memory for the segment.

alignShift

Specifies the size of the addressable sector as an exponent of 2. An executable file pads the application's code, data, and resource segments with zero bytes so that the segments are always a multiple of the file-segment size. Windows discards the extra bytes when it loads the segments from the file.

reserved

Specifies two reserved UINT values.

See Also

GetCodeInfo