DwtDrmHGetIndexedLiteral(3Dwt)
Name
DwtDrmHGetIndexedLiteral − Fetches indexed literals from a DRM hierarchy.
Syntax
Cardinal DwtDrmHGetIndexedLiteral(hierarchy_id, index, context_id)
DRMHierarchy hierarchy_id;
String index;
DRMResourceContextPtr context_id;
Arguments
hierarchy_idSpecifies the hierarchy to be searched.
indexSpecifies the case-sensitive index of the desired literal.
context_idSpecifies the resource context into which the literal is read.
Description
The DwtDrmHGetIndexedLiteral function searches a DRM search hierarchy for a literal, given the literal’s index. That is, it gets a public literal from a DRM search hierarchy. This function returns the literal as the contents of the context buffer. The group that is fetched is always DRMgLiteral. The literal type filter is taken from the context. If unmodified in the context obtained from DwtDrmGetResourceContext, there is no filtering (type = RGMtNul). In general, you do not need to set any of the fields in the context, except possibly type. The following buffer contents are for some common literal types obtained from a UID file. Note that in some cases the caller must cause offsets to be memory pointers.
DwtDrmRCType(context_id) == RGMrTypeChar8:
DwtDrmRCBuffer(context_id) contains a null-terminated ASCII string
DwtDrmRCType(context_id) == RGMrTypeCString:
DwtDrmRCBuffer(context_id) contains a compound-string (DwtCompString)
DwtDrmRCType(context_id) == RGMrTypeChar8Vector:
DwtDrmRCType(context_id) == RGMrTypeCStringVector:
DwtDrmRCBuffer(context_id) contains an RGM text vector
or stringtable (RGMTextVector). The items in the
text vector contain offsets into the buffer that
locate either null-terminated ASCII strings or
compound-strings. You can relocate these to memory
pointers by adding the buffer address to the offset:
item[n].textitem.pointer = item[n].textitem.offset+bufadr
Return Values
This function returns one of these status return constants:
| DRMSuccess | The function executed successfully. |
| DRMNotFound | Literal not found. |
| DRMFailure | The function failed. Invalid resource context. |