// read the ActivePath key set by the NDIS loader driver
NdisReadConfiguration(&status,
&pConfigParm,
configHandle,
&activePathKey,
NdisParameterString);
if (!NDIS_SUCCESS(status))
{
if(NDIS_STATUS_RESOURCES == status)
{
RETAILMSG(1, (L"***!!!!!!!!!!!!!!!NdisReadConfiguration NDIS_STATUS_RESOURCES\r\n"));
}
DBGPRINT(DBG_LOAD | DBG_ERROR,
(L"SDNdis: Failed to get active path key (0x%08X)\n",
status));
// close our registry configuration
NdisCloseConfiguration(configHandle);
return status;
}
if (NdisParameterString != pConfigParm->ParameterType) {
DBGPRINT(DBG_LOAD | DBG_ERROR,
(L"SDNdis: PARAMETER TYPE NOT STRING!!!\n"));
// close our registry configuration
NdisCloseConfiguration(configHandle);
return status;
}
if (pConfigParm->ParameterData.StringData.Length > sizeof(pAdapter->ActivePath)) {
DBGPRINT(DBG_LOAD | DBG_ERROR,
(L"SDNdis: Active path too long!\n"));
NdisCloseConfiguration(configHandle);
return NDIS_STATUS_FAILURE;
}
// copy the counted string over
memcpy(pAdapter->ActivePath,
pConfigParm->ParameterData.StringData.Buffer,
pConfigParm->ParameterData.StringData.Length);
if ( pConfigParm->ParameterData.StringData.Length == 0 )
{
DBGPRINT(DBG_LOAD | DBG_WARNING,
(L"SDNdis: Active path str length is 0, perhaps no card!\n"));
NdisCloseConfiguration(configHandle);
return NDIS_STATUS_FAILURE;
}else{
DBGPRINT(DBG_LOAD | DBG_WARNING,
(L"SDNdis: Active path str == %s\n",pConfigParm->ParameterData.StringData.Buffer));
}
NdisCloseConfiguration(configHandle);
DBGPRINT(DBG_LOAD | DBG_LOAD,
(L"SDNdis: Active Path Retrieved: %s \n",pAdapter->ActivePath));
// now get the device handle
pAdapter->hDevice = SDGetDeviceHandle((DWORD)pAdapter->ActivePath, NULL);
return NDIS_STATUS_SUCCESS;
}