- This function retrieves an event from the AG driver and processes it. While processing, AG Access may generate an event for the application.
- The application must supply a pointer to an ADI_EVENT structure in the event argument. AG Access assigns the structure before returning to the application.
Note: If the returned ADI_EVENT ID field is zero (0), this does not indicate an error condition. The event has been consumed by the AG Access library, and there is no event for the application to process.
- To determine if an event is pending in the driver queue, use one of the following OS-specific mechanisms:
- OS/2 - use DosWaitEventSem with the muxhandle returned
from adiOpenDriver as the event semaphore.
- NT - use any Win32 event-object wait function with the
muxhandle returned from adiOpenDriver as the event-
object. Examples include WaitForSingleObject, and
WaitForMultipleObjects.
- When the application is notified that an AG event is available, adiFetchAndProcess must be called to read and process the event. The event structure, shown below, is included in adi.h:
typedef struct
{
DWORD id; /* event id */
CTAHD ctahd; /* context handle */
DWORD timestamp; /* timestamp */
DWORD userid; /* user id */
DWORD size; /* buffer size */
void *buffer; /* buffer pointer */
DWORD value; /* Event-specific data */
DWORD reserved ;
} ADI_EVENT;
- The ADI_EVENT structure contains the following fields:
-
Note: If no data is contained in an event, buffer is NULL and size may contain a second event-specific DWORD value.