Error Handling in the DLL
Use event logging to record errors that occur during any of the functions in the performance DLL. Logging error events aids in troubleshooting applications providing performance data during development and after installation. Be careful not to log error events on every Collect call, however, because data collection can be frequent.
The following errors are logged to the event log by the performance library if it has problems with the Open procedure. If one of the errors listed below occurs, then the performance library makes no further calls to this performance DLL. Instead, the DLL is unloaded and data for the object provided by the performance DLL is not returned with the performance data.
-
PERFLIB_OPEN_PROC_NOT_FOUND – Logged when the procedure name defined in the registry could not be found in the DLL as an exported function. This usually occurs when the performance counter DLL or the service is not installed correctly or the function name has been renamed without updating the installation procedure.
-
PERFLIB_OPEN_PROC_FAILURE – Logged when the open procedure returned an error status other than ERROR_SUCCESS. This usually occurs when an expected error condition has occurred in the open procedure. Should this happen, the Counter DLL should have also entered an event log entry describing the conditions that caused the failure.
-
PERFLIB_OPEN_PROC_EXCEPTION – Logged when the open procedure encounters an unhandled exception. This is usually due to an unexpected error condition encountered by the open procedure.