ERR("Could not set value HKEY_DYN_DATA\\%s\\%s\n",KEYNAME_SCSI,KEYNAME_SCSI_CONTROLLERMAP);
}
RegCloseKey(hkeyControllerMap);
RegCloseKey(hkeyScsi);
return;
}
staticintSCSI_Linux_CheckDevices(void)
staticvoidSCSI_Linux_CheckDevices(void)
{
DIR*devdir;
structdirent*dent=NULL;
...
...
@@ -578,100 +337,14 @@ static int SCSI_Linux_CheckDevices(void)
if(dent==NULL)
{
TRACE("WARNING: You don't have any /dev/sgX generic scsi devices ! \"man MAKEDEV\" !\n");
return0;
return;
}
return1;
}
#endif
staticvoid
SCSI_GetProcinfo()
/* I'll admit, this function is somewhat of a mess... it was originally
* designed to make some sort of linked list then I realized that
* HKEY_DYN_DATA would be a lot less messy
*/
voidSCSI_Init(void)
{
#ifdef linux
staticconstcharprocname[]="/proc/scsi/scsi";
FILE*procfile=NULL;
charread_line[40],read1[10]="\0",read2[10]="\0";
intresult=0;
structLinuxProcScsiDevicedev;
charidstr[20];
chardevstr[20];
intdevnum=0;
intnum_ha=0;
HKEYhkeyScsi;
DWORDdisposition;
/* Check whether user has generic scsi devices at all */
if(!(SCSI_Linux_CheckDevices()))
return;
procfile=fopen(procname,"r");
if(!procfile)
{
ERR("Could not open %s\n",procname);
return;
}
fgets(read_line,40,procfile);
sscanf(read_line,"Attached %9s %9s",read1,read2);
if(strcmp(read1,"devices:"))
{
ERR("Incorrect %s format\n",procname);
return;
}
if(!(strcmp(read2,"none")))
{
ERR("No devices found in %s. Make sure you loaded your SCSI driver or set up ide-scsi emulation for your IDE device if this app needs it !\n",procname);