Writing Monitors for the Event Monitoring Service (December 1999)
Chapter 3 113
Creating a Resource Monitor
Processing a Resource Update Event
If the RmResourceType is RM_ENUMERATED_TYPE, rm_get_next_event()
does not create a Resource State object automatically. The resource
monitor must call rm_create() or rm_copy() to create the Resource
State object. Then the resource monitor must set the RmStateValue and
RmStateName fields of the Resource State object. The Resource State
object contains the fields listed in Table 3-8:
RmResource
Value
rm_value_
type *
A pointer to the current value of the
resource. If the RmResourceType is
RM_ERROR_TYPE, this field is not
meaningful.
This field can be the address of a
character string, the address of a
signed 32-bit integer, the address of an
unsigned 32-bit integer, the address of
a double-precision floating point
value, or an rm_object_addr (the
address of an object) as listed by the
RmResourceType field above.
EMS provides a data structure called
an rm_value_type union, which
can be used to store any resource
value or address. When calling
rm_set() to store the value in the
Resource Update object, the resource
monitor simply passes the address of
the rm_value_type variable.
Table 3-7 Resource Update Object Fields
Field Name Type Description
Table 3-8 Resource State Object Fields
Field Name Type Description
RmObjectType rm_object
_type
The object type. For a Resource State
object, the value is
RM_RESOURCE_STATE_OBJECT. This
value is set by rm_create() and
should not be modified.