Download Programmer`s Guide

Transcript
VIM Interface Calls
79
To use this call, perform these steps in the following order to avoid kernel terminates with an access violation.
1 Call VIMgetHardwareListSize to determine the size of this
packet.
2 Allocate the DeviceStatusSize of memory indicated.
3 Call VIM_get_hardware_list, passing the buffer of size DeviceSta-
tusSize.
Example
APIRET rc;
rc = (APIRET) VIMgetHardwareListSize
(&DeviceStatusSize);
BaseAddressDSP = malloc(DeviceStatusSize);
if (BaseAddressDSP)
{
dsp = (DEVICE_STATUS_PACKET *) BaseAddressDSP;
dsp->DeviceStatusSize = DeviceStatusSize;
rc = (APIRET) VIM_get_hardware_list (dsp);
}
For more information, see “VIM Programming Examples” on
page 110. Fully functional source code and header files are found in
PDT/VIM directory after you’ve installed InveStore.
Syntax
int ENTRY VIM_get_hardware_list
(DEVICE_STATUS_PACKET PTR ListBuffer)
Output
ListBuffer is the address of buffer that receives the returned information. If successful, the following DEVICE_STATUS_PACKET is
returned.
/* operation request packet for data transfer element status */
typedef struct tagTRANSFER_STATUS_PACKET
{
ULONG DeviceStatusSize;
/* total size of status structure
USHORT MajorStatus;
/* major status of operation
USHORT MinorStatus;
/* minor status of operation
USHORT NumLibraries;
/* number of libraries container
LIBRARY_STATUS LibraryStatus;
/* library container array
*/
*/
*/
*/
*/