PROCEDURE (HIDDEN) rap$check_rhfam_for_namve (
  status)

*IF $variable(rav$proc_doc,declared)<>'UNKNOWN'

" PURPOSE:
"   This procedure checks the state of RHFAM and returns bad status if RHFAM has ever been activated
"   on the running system.
"
" DESIGN:
"   One of the restrictions placed on NAM/VE activation is that it cannot occur after the activation of
"   RHFAM because of shared buffer problems.  The status condition OSF$SYSTEM_TASK_NOT_DEFINED must be
"   returned by DISPLAY_SYSTEM_TASK_DATA before we can be sure RHFAM has not been activate at any time
"   since the last deadstart.
*IFEND


  "$FORMAT=OFF
  VAR
    local_status: status
    rav$event_message: (XREF) status
  VAREND
  "$FORMAT=ON"


  rav$event_message=$status(false, 'RA', rae$testing_error, 'for RHFAM')

  display_system_task_data task_name=rhfam o=$null status=local_status

  IF local_status.normal THEN
    local_status=$status(false, 'RA', rae$no_namve_due_to_rhfam)
  ELSEIF $condition(local_status.condition) = 'OSE$SYSTEM_TASK_NOT_DEFINED' THEN
    local_status.normal=true
  IFEND

  IF local_status.normal THEN
    rav$event_message.normal=true
  ELSE
    EXIT procedure WITH local_status
  IFEND

PROCEND rap$check_rhfam_for_namve
