dmi_registry_status

Synopsis

#include <opendmi/registry.h>

enum dmi_registry_status {
    DMI_REGISTRY_STATUS_SCANNED   = (1 << 0),
    DMI_REGISTRY_STATUS_TRUNCATED = (1 << 1),
    DMI_REGISTRY_STATUS_DECODED   = (1 << 2),
    DMI_REGISTRY_STATUS_LINKED    = (1 << 3),
    DMI_REGISTRY_STATUS_OVERLAID  = (1 << 4)
};

unsigned dmi_registry_status(const dmi_registry_t *registry);

Description

The dmi_registry_status function returns the status flags of a registry, which tell how far the structures of the table have got as the context is opened:

DMI_REGISTRY_STATUS_SCANNED

The table has been scanned, and an entity has been created for every structure found.

DMI_REGISTRY_STATUS_TRUNCATED

The table area ends before the end-of-table structure, or a structure runs past its end, so the structures which follow are missing. Unless the context has DMI_CONTEXT_FLAG_STRICT, a structure whose length is shorter than its header is taken the same way, since the structures which follow it cannot be found.

DMI_REGISTRY_STATUS_DECODED

The structures have been decoded. Unless the context has DMI_CONTEXT_FLAG_STRICT, the structures which cannot be decoded are left undecoded, and the flag is set all the same.

DMI_REGISTRY_STATUS_LINKED

The references between the structures have been resolved, which happens if the context has DMI_CONTEXT_FLAG_LINK, see dmi_create. Unless the context has DMI_CONTEXT_FLAG_STRICT, the broken references are left unresolved, and the flag is set all the same.

DMI_REGISTRY_STATUS_OVERLAID

At least one structure carries additional information entries, which happens if the context has DMI_CONTEXT_FLAG_OVERLAY and the table has entries referring to structures of it. Such structures are decoded from copies with the entries applied, which the table does not hold.

Parameters

registry

Registry to query, see dmi_get_registry.

Return value

Returns the status flags of the registry, a combination of the values above, or zero if registry is nullptr.

Errors

DMI_ERROR_ARGUMENT_NULL

Raised if registry is nullptr, in which case it is not reported, since there is no context to hold it.

Example

if (dmi_registry_status(dmi_get_registry(context)) & DMI_REGISTRY_STATUS_TRUNCATED)
    fprintf(stderr, "SMBIOS table is truncated\n");