HBA_RegisterForAdapterEvents routine
The HBA_RegisterForAdapterEvents routine registers the indicated user callback routine to call when an adapter event occurs.
Syntax
HBA_STATUS HBA_API HBA_RegisterForAdapterEvents(
HBA_ADAPTER_CALLBACK callback,
void *userData,
HBA_HANDLE handle,
HBA_CALLBACKHANDLE *callbackHandle
);
Parameters
callback
Pointer to a callback routine of type HBA_ADAPTER_CALLBACK that is called when an adapter is added to the system.userData
Pointer to a buffer that is passed to the callback routine with each event. This data correlates the event with the source of the event registration.handle
Contains a value returned by the routine HBA_OpenAdapter that identifies the HBA for which the adapter events are generated.callbackHandle
Contains an opaque identifier that the user must pass to HBA_RemoveCallback to de-register the callback routine.
Return value
The HBA_RegisterForAdapterEvents routine returns a value of type HBA_STATUS that indicates the status of the HBA. In particular, this member should have one of the following values.
| Return code | Description |
|---|---|
| HBA_STATUS_OK | Returned if the callback routine was successfully registered. |
| HBA_STATUS_ERROR | Returned if an unspecified error occurred that prevented the registration of the callback routine. |
Remarks
If the HBA referenced by handle is removed from the system, the callback function is called with event type of HBA_EVENT_ADAPTER_REMOVE.
If the configuration of the HBA referenced by handle is changed, the callback function is called with event type of HBA_EVENT_ADAPTER_CHANGE.
Requirements
Target platform |
Desktop |
Header |
Hbaapi.h (include Hbaapi.h) |
Library |
Hbaapi.lib |
DLL |
Hbaapi.dll |
See also