Prototype: DWORD GetASPI32SupportInfo(VOID)
The GetASPI32SupportInfo function returns the number of host adapters installed and ensures that the ASPI manager is initialized properly. This function must be called once at initialization time, before SendASPI32Command is accessed. The number of host adapters returned represents the logical bus count, not the true physical adapter count. For host adapters with a single bus, the host adapter count and logical bus count are identical.
This function has no parameters.
The DWORD return value specifies the result of the ASPI request. The DWORD is encoded as follows:
Table 4-1. Return Values from GetASPI32SupportInfo Function
Length | Bit |
---|---|
Meaning | |
WORD | 31-16 |
Reserved = 0 | |
BYTE | 15-8 |
Status |
SS_COMP | ASPI request completed without error |
SS_FAILED_INIT | ASPI manager unable to initialize; ASPI services not available |
BYTE | 7-0 |
If Status = SS_COMP | |
Number of host adapters |
Example
This example returns the current status of ASPI for Win32.
DWORD ASPIStatus;
BYTE NumAdapters;
HWND hwnd;
.
.
ASPIStatus = GetASPI32SupportInfo();
switch ( HIBYTE(LOWORD(ASPIStatus)) )
{
case SS_COMP:
/*
* ASPI for Win32 is properly initialized
*/
NumAdapters = LOBYTE(LOWORD(ASPIStatus));
break;
default:
MessageBox( hwnd,
"ASPI for Win32 is not initialized!!",
NULL,
MB_ICONSTOP );
return FALSE;
}
.
.