(Page 11 of 14 in this chapter)
agmLoadDriver
Description
- Initializes and starts the AG device drivers.
Prototype
- DWORD agmLoadDriver ( AGMHD agmhd)
- agmhd Handle returned by agmOpen.
Return Values
Details
- This function uses the configuration information in the specified context to initialize and start the AG device drivers. Specifically, the board address and interrupt numbers are used for the initialization and starting of the drivers. The AG configuration file is read by the agmOpen library call.
- Under Windows NT, agmLoadDriver should be called after agmOpen and before any other AGM library functions that access the AG boards. The AG device drivers need only be installed and started once per hardware and/or AG configuration file change. agmLoadDriver always stops the AG device drivers, consults the AG configuration information in the context, and restarts the AG device drivers. If another process is using the AG device drivers when agmLoadDriver is called, agmLoadDriver will fail to stop them, and will return AGMERR_FAILURE.
- The AG device driver is a system-wide resource. It should not be loaded by multiple processes.
See Also
- agmOpen
Example
if (agmOpen (ConfigFile, ReportFile, NULL, ErrorHandler, &agmhd)
!= SUCCESS)
{
printf ("agmOpen failed.");
exit (-1);
}
if (agmLoadDriver (agmhd) != SUCCESS)
{
printf ("agmLoadDriver failed.");
exit (-1);
}
if (agmOpenDriver (agmhd, &muxhd, &majorrev, &minorrev)
!= SUCCESS)
{
printf ("agmOpenDriver failed.");
exit (-1);
}
(Page 11 of 14 in this chapter)
tech_support@nmss.com
Copyright © 1998, Natural MicroSystems, Inc. All rights
reserved.