Home > Back-end >  Windows 7 32-bit operating system applied Adaptec ASPI tape machine programming problem
Windows 7 32-bit operating system applied Adaptec ASPI tape machine programming problem

Time:11-12

I under Windows 7 32 bit operating system application Adaptec ASPI tape machine programming, when asked whether the tape machine ready, the program does not response, has been waiting for, namely ss_penging, and the same other commercial software, is to use bcb6, application of Adaptec ASPI writing can be normal use, shows that fiber card driver and the ASPI itself should be no problem, I of the program in some Windows 7 32-bit operating system of the machine can be normal use, under some machines here no, don't know what's wrong, the code is as follows:

Is_ready (int iunit, int scsi_id, int haidt)
{

Int srb_len=sizeof (SRB_ex);

SRB_ex. SRB_HaId=haidt;
SRB_ex. SRB_SenseLen=44;
SRB_ex. SRB_CDBLen=6;

SRB_ex. SRB_Cmd=SC_EXEC_SCSI_CMD;
SRB_ex. SRB_Flags=SRB_DIR_IN;
SRB_ex. SRB_Target=scsi_id;

SRB_ex. CDBByte [0]=0;
SRB_ex. CDBByte [1]=scsi_id & lt; <5;

DWORD ASPIStatus;
ASPIStatus=SendEx ((LPSRBEX) & amp; SRB_ex);

While (SRB_ex. SRB_Status==0)
{
}

If (SRB_ex SRB_Status!=1) return SRB_ex. SRB_Status;
return 0;
}

Program has been the local loop
While (SRB_ex. SRB_Status==0)
{
}

Please experts to give directions, thank you!

CodePudding user response:

Add a sleep a few milliseconds have no?

CodePudding user response:

reference 1st floor ooolinux response:
add a sleep a few milliseconds have no?

No, or has been a deadlock normal running SendEx ((LPSRBEX) & amp; SRB_ex); Immediately after have returned,

CodePudding user response:

May be you sent the wrong parameter

CodePudding user response:

reference 3 floor early play play nuclear response:
may be you sent the wrong parameter
not sure ah, the program in some machine can run normally, on some machines can't use, don't know what problem,

CodePudding user response:

Do {

SendEx ((LPSRBEX) & amp; SRB_ex);
} while (SRB_ex. SRB_Status==0);

CodePudding user response:

Don't understand the Adaptec ASPI
A shot in the dark

CodePudding user response:

Jinwz
reference 4 floor response:
Quote: refer to 3rd floor early play big play nuclear war reply:

May be you sent the wrong parameter
not sure ah, the program in some machine can run normally, on some machines can't use, don't know what problem,


May in some machines on its return is zero, so your code an infinite loop, you shouldn't judge first
ASPIStatus=SendEx ((LPSRBEX) & amp; SRB_ex);
The ASPIStatus
?

CodePudding user response:

refer to 7th floor early play big play nuclear response:
Quote: refer to 4th floor jinwz response:

Quote: refer to the third floor early play big play nuclear war reply:

May be you sent the wrong parameter
not sure ah, the program in some machine can run normally, on some machines can't use, don't know what problem,


May in some machines on its return is zero, so your code an infinite loop, you shouldn't judge first
ASPIStatus=SendEx ((LPSRBEX) & amp; SRB_ex);
The ASPIStatus
?
the return value is zero, is waiting for, this is not normal, should not like that,
  • Related