NPA_System_Alert

Allows a CDM or HAM to display hardware or software alert messages to the console screen and/or the system error log from the current thread (or a separate thread) without providing the console's screen handle.

Thread Context:Non-Blocking

Syntax

    LONG NPA_System_Alert (
       LONG   npaHandle,
       BYTE  *controlString,
       LONG   alertMask,
       LONG   targetNotifyMask,
       LONG   alertID,
       LONG   alertClass,
       LONG   alertSeverity,
       LONG   parameterCount,
              args...
    );
    

Parameters

npaHandle
(IN) The CDMs or HAMs handle for using the NPA APIs, assigned during NPA_Register_CDM_Module or NPA_Register_HAM_Module, respectively.
controlString
(IN) Points to a NULL-terminated control string similar to that used in the C sprintf function, including embedded returns, line-feeds, tabs, bells, and % specifiers. Floating-point specifiers are not permitted.
alertMask
(IN) A bit mask indicating how the alert gets posted. Valid values are:

Value

Description

0x00000001

QUEUE_THIS_ALERT_MASK: Causes the alert message to occur on a separate thread. If this bit is not set, the alert message occurs on the same thread that called NPA_System_Alert.

0x00000002

ALERT_ID_VALID_MASK

0x00000008

ALERT_EVENT_NOTIFY_ONLY_MASK

0x00000010

ALERT_NO_EVENT_NOTIFY_MASK

targetNotifyMask
(IN) A bit mask identifying the destination of the notification:

Value

Description

0x00000002

NOTIFY_EVERYONE_BIT

0x00000004

NOTIFY_ERROR_LOG_BIT

0x00000008

NOTIFY_CONSOLE_BIT

This field is usually set to NOTIFY_CONSOLE_BIT.

alertID
Optional. Set to 0 if not used.

(IN) Alert number where the upper word equals the Novell assigned module ID and the lower word equals a driver-defined unique alert number.

IMPORTANT:If a valid unique number is passed in, the ALERT_ID_VALID_MASK bit must be set in the alertMask field.

alertClass
Indicates the class of the error:

Value

Description

0x00000000

ALERT_CLASS_UNKNOWN

0x00000001

ALERT_CLASS_OUT_OF_RESOURCE

0x00000002

ALERT_CLASS_TEMP_SITUATION

0x00000005

ALERT_CLASS_HARDWARE_ERROR

0x00000009

ALERT_CLASS_BAD_FORMAT

0x00000011

ALERT_CLASS_MEDIA_FAILURE

0x00000015

ALERT_CLASS_CONFIGURATION_ERROR

0x00000018

ALERT_CLASS_DISK_INFORMATION

alertSeverity
Indicates the severity of the error:

Value

Description

0x00000000

ALERT_SEVERITY_INFORMATIONAL

0x00000001

ALERT_SEVERITY_WARNING

0x00000002

ALERT_SEVERITY_RECOVERABLE

0x00000003

ALERT_SEVERITY_CRITICAL

0x00000004

ALERT_SEVERITY_FATAL

0x00000005

ALERT_SEVERITY_OPERATION_ABORTED

parameterCount
The number of additional arguments being passed in the args input parameter. If no arguments are to be passed, set this parameter to zero.

This function accepts up to four additional arguments.

args
Additional arguments corresponding to the % specifiers contained in the controlString input parameter. If no % specifiers are contained in controlString, this parameter does not need to be used.

Return Values

The following table lists return values and descriptions.

zero

Successful

-1

NWPA object for the calling HAM cannot be found.

-2

parameterCount is out of range (exceeds 4).

Remarks

One purpose of NPA_System_Alert is to provide CDMs and HAMs with a method of displaying alert messages on the server console screen or directing those messages to the system error log (or both). In NetWare 6.x, the console screen is the screen from which the driver was loaded, not the Logger screen.

Another purpose of NPA_System_Alert is to provide a mechanism to display alerts on the console screen without the need for a specific screen handle. The only time that a CDM or HAM has access to a valid console screen handle is during a call to HAM_Load, the load-time initialization function, or during a call to HAM_Unload_Check, the unload check function. The handles passed to these two functions should not be saved. They are only valid during the context of the respective functions.

Because displaying strings requires a significant amount of time, it might be necessary during time-critical areas to have NPA_System_Alert display the alert on a separate thread (other than the thread that called the function) by queuing the alert message.