The AttachPropertyInstanceEx function attaches a property to a frame, thus creating a PROPERTYINST and a PROPERTYINSTEX structure for that frame in the PROPERTYINSTTABLE for the frame.
DWORD AttachPropertyInstanceEx(
HFRAME hFrame,
HPROPERTY hProperty,
DWORD Length,
LPVOID lpData,
DWORD LengthEx,
LPVOID lpDataEx,
DWORD HelpID,
DWORD IndentLevel,
DWORD IFlags
);
1 | IFLAG_ERROR |
2 | IFLAG_SWAPPED (WORD or DWORD byte is non-Intel format at attach time) |
4 | IFLAG_UNICODE (STRING is UNICODE at attach time) |
Note that earlier parsers set the fError DWORD to 0 or 1, which will map to IFLAG_ERROR.
The return value is the error code.
Error code | Meaning |
---|---|
BHERR_SUCCESS | No problems were encountered. |
BHERR_INVALID_HPROPERTY | The hProperty was invalid. |
BHERR_INVALID_HFRAME | The hFrame was invalid. |
This function is used to attach a property to a frame, thus creating a PROPERTYINST and a PROPERTYINSTEX structure for that frame in the PROPERTYINSTTABLE for the frame. This function will add the information to the Frame as a PROPERTYINST structure.
The AttachPropertyInstanceEx function is used when data needs to be generated external to the frame data in order to more clearly describe the protocol. For example, the Ethernet parser generated a property that describes the length of the frame. Another example would be where the SMB parser converts the time to a SYSTEMTIME format and attaches the converted time with AttachPropertyInstanceEx so that the Generic Formatter will format it.
Note A copy of the lpDataEx structure is made (of LengthEx length) so that it can be in a temporary variable when calling this function. If the lpDataEx pointer is NULL, or the LengthEx parameter is zero, then the "ex" parameters will be ignored and AttachPropertyInstance will be called.